4 #include <osmocom/core/endian.h>
5 #include <osmocom/core/timer.h>
28 #define OSMUX_FT_SIGNAL 0
29 #define OSMUX_FT_VOICE_AMR 1
30 #define OSMUX_FT_DUMMY 2
33 #if OSMO_IS_BIG_ENDIAN
39 #elif OSMO_IS_LITTLE_ENDIAN
47 #define OSMUX_CID_MAX 255
49 #if OSMO_IS_BIG_ENDIAN
52 #elif OSMO_IS_LITTLE_ENDIAN
56 } __attribute__((packed));
65 uint32_t input_rtp_msgs;
66 uint32_t output_osmux_msgs;
67 uint64_t input_rtp_bytes;
68 uint64_t output_osmux_bytes;
71 void (*deliver)(
struct msgb *msg,
void *data);
76 #define OSMUX_MAX_CONCURRENT_CALLS 8
81 uint32_t rtp_timestamp;
83 uint8_t osmux_seq_ack;
84 struct osmo_timer_list timer;
85 struct llist_head list;
86 void (*tx_cb)(
struct msgb *msg,
void *data);
90 static inline uint8_t *osmux_get_payload(
struct osmux_hdr *osmuxh)
92 return (uint8_t *)osmuxh +
sizeof(
struct osmux_hdr);
98 #define OSMUX_BATCH_DEFAULT_MAX 1472
103 int osmux_xfrm_input_open_circuit(
struct osmux_in_handle *h,
int ccid,
int dummy);
104 void osmux_xfrm_input_close_circuit(
struct osmux_in_handle *h,
int ccid);
111 int osmux_xfrm_output(
struct osmux_hdr *osmuxh,
struct osmux_out_handle *h,
struct llist_head *list) OSMO_DEPRECATED(
"Use osmux_xfrm_output_sched() instead");
114 struct osmux_hdr *osmux_xfrm_output_pull(
struct msgb *msg);
116 void osmux_tx_sched(
struct llist_head *list,
void (*tx_cb)(
struct msgb *msg,
void *data),
void *data) OSMO_DEPRECATED(
"Use osmux_xfrm_output_set_tx_cb() instead");
int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg, int ccid)
Definition: osmux.c:805
int osmux_snprintf(char *buf, size_t size, struct msgb *msg)
Definition: osmux.c:1068
void osmux_xfrm_output_set_tx_cb(struct osmux_out_handle *h, void(*tx_cb)(struct msgb *msg, void *data), void *data)
Set transmission callback to call when a generated RTP packet is to be transmitted.
Definition: osmux.c:883
int osmux_xfrm_output_sched(struct osmux_out_handle *h, struct osmux_hdr *osmuxh)
Generate RTP packets from osmux frame AMR payload set and schedule them for transmission at appropiat...
Definition: osmux.c:270
void osmux_xfrm_output_flush(struct osmux_out_handle *h)
Flush all scheduled RTP packets still pending to be transmitted.
Definition: osmux.c:322