Debian Codegraph @

src/udp-private.h

raw symbols SCIP
1 /* librist. Copyright © 2019-2020 SipRadius LLC. All right reserved.
2 * Author: Kuldeep Singh Dhaka <[email protected]>
3 * Author: Sergio Ammirata, Ph.D. <[email protected]>
4 *
5 * SPDX-License-Identifier: BSD-2-Clause
6 */
7
8 #ifndef RIST_UDP_PRIVATE_H
9 #define RIST_UDP_PRIVATE_H
10
11 #include "common/attributes.h"
12 #include "rist-private.h"
13 #include "proto/gre.h"
14 #include "proto/rtp.h"
15
16 #define RIST_PAYLOAD_TYPE_UNKNOWN 0x0
17 #define RIST_PAYLOAD_TYPE_PING 0x1
18 #define RIST_PAYLOAD_TYPE_PING_RESP 0x2
19 #define RIST_PAYLOAD_TYPE_RTCP 0x3
20 #define RIST_PAYLOAD_TYPE_RTCP_NACK 0x4
21 #define RIST_PAYLOAD_TYPE_DATA_RAW 0x5
22 #define RIST_PAYLOAD_TYPE_DATA_OOB 0x6 // Out-of-band data
23 #define RIST_PAYLOAD_TYPE_DATA_RAW_RTP_EXT 0x7
24 #define RIST_PAYLOAD_TYPE_EAPOL 0x8
25
26 // Maximum offset before the payload that the code can use to put in headers
27 #define RIST_MAX_PAYLOAD_OFFSET (sizeof(struct rist_gre_key_seq) + sizeof(struct rist_protocol_hdr))
28
29 /* shared functions in udp.c */
30 RIST_PRIV void rist_send_nacks(struct rist_flow *f, struct rist_peer *peer);
31 RIST_PRIV int rist_receiver_send_nacks(struct rist_peer *peer, uint32_t seq_array[], size_t array_len);
32 RIST_PRIV int rist_receiver_periodic_rtcp(struct rist_peer *peer);
33 RIST_PRIV void rist_sender_periodic_rtcp(struct rist_peer *peer);
34 RIST_PRIV int rist_respond_echoreq(struct rist_peer *peer, const uint64_t echo_request_time, uint32_t ssrc);
35 RIST_PRIV int rist_request_echo(struct rist_peer *peer);
36 RIST_PRIV int rist_send_common_rtcp(struct rist_peer *p, uint8_t payload_type, uint8_t *payload, size_t payload_len, uint64_t source_time, uint16_t src_port, uint16_t dst_port, uint32_t seq_rtp, uint16_t ts_null_bytes);
37 RIST_PRIV void rist_sender_send_data_balanced(struct rist_sender *ctx, struct rist_buffer *buffer);
38 RIST_PRIV int rist_sender_enqueue(struct rist_sender *ctx, const void *data, size_t len, uint64_t datagram_time, uint16_t src_port, uint16_t dst_port, uint32_t seq_rtp);
39 RIST_PRIV void rist_retry_enqueue(struct rist_sender *ctx, uint32_t seq, struct rist_peer *peer);
40 RIST_PRIV ssize_t rist_retry_dequeue(struct rist_sender *ctx);
41 RIST_PRIV int rist_set_url(struct rist_peer *peer);
42 RIST_PRIV void rist_create_socket(struct rist_peer *peer);
43 RIST_PRIV size_t rist_get_sender_retry_queue_size(struct rist_sender *ctx);
44
45 /* Rate-limited log on send failure. Emits a PMTU-specific hint when errno
46 * is EMSGSIZE/WSAEMSGSIZE, otherwise the generic failure line. attempted
47 * is the size we tried to send; sock_errno is errno (or WSAGetLastError on
48 * Windows) captured immediately after the failing send call. */
49 RIST_PRIV void _librist_log_send_error(struct rist_peer *p, int sock_errno,
50 size_t attempted, const char *origin);
51
52 #endif