This code implements a variety of utility functions related to the OSMUX user-plane multiplexing protocol, an efficient alternative to plain UDP/RTP streams for voice transport in back-haul of cellular networks.
More...
|
#define | OSMUX_DEFAULT_PORT 1984 |
|
#define | OSMUX_FT_SIGNAL 0 |
|
#define | OSMUX_FT_VOICE_AMR 1 |
|
#define | OSMUX_FT_DUMMY 2 |
|
#define | OSMUX_MAX_CONCURRENT_CALLS 8 |
|
#define | OSMUX_BATCH_DEFAULT_MAX 1472 |
|
#define | SNPRINTF_BUFFER_SIZE(ret, remain, offset) |
|
#define | DELTA_RTP_MSG 20000 |
|
#define | DELTA_RTP_TIMESTAMP 160 |
|
#define | LOGMUXLK_(link, lvl, fmt, args ...) |
|
#define | LOGMUXLK(link, lvl, fmt, args ...) LOGMUXLK_(link, lvl, " " fmt, ## args) |
|
#define | LOGMUXCID(link, circuit, lvl, fmt, args ...) |
|
#define | DELTA_RTP_MSG 20000 |
|
#define | DELTA_RTP_TIMESTAMP 160 |
|
|
struct osmux_hdr | __attribute__ ((packed)) |
|
int | osmux_snprintf (char *buf, size_t size, struct msgb *msg) |
| Print osmux header fields and payload from msg into buffer buf. More...
|
|
struct osmux_in_handle * | osmux_xfrm_input_alloc (void *ctx) |
|
void | osmux_xfrm_input_init (struct osmux_in_handle *h) OSMO_DEPRECATED("Use osmux_xfrm_input_alloc() instead") |
|
void | osmux_xfrm_input_fini (struct osmux_in_handle *h) OSMO_DEPRECATED("Use talloc_free() instead") |
|
void | osmux_xfrm_input_set_name (struct osmux_in_handle *h, const char *name) |
|
int | osmux_xfrm_input_set_batch_factor (struct osmux_in_handle *h, uint8_t batch_factor) |
|
void | osmux_xfrm_input_set_batch_size (struct osmux_in_handle *h, uint16_t batch_size) |
|
void | osmux_xfrm_input_set_initial_seqnum (struct osmux_in_handle *h, uint8_t osmux_seqnum) |
|
void | osmux_xfrm_input_set_deliver_cb (struct osmux_in_handle *h, void(*deliver_cb)(struct msgb *msg, void *data), void *data) |
|
void * | osmux_xfrm_input_get_deliver_cb_data (struct osmux_in_handle *h) |
|
int | osmux_xfrm_input_open_circuit (struct osmux_in_handle *h, int ccid, int dummy) |
|
void | osmux_xfrm_input_close_circuit (struct osmux_in_handle *h, int ccid) |
|
int | osmux_xfrm_input (struct osmux_in_handle *h, struct msgb *msg, int ccid) |
| osmux_xfrm_input - add RTP message to OSmux batch More...
|
|
void | osmux_xfrm_input_deliver (struct osmux_in_handle *h) |
|
struct osmux_out_handle * | osmux_xfrm_output_alloc (void *ctx) |
| Allocate a new osmux out handle. More...
|
|
void | osmux_xfrm_output_init (struct osmux_out_handle *h, uint32_t rtp_ssrc) OSMO_DEPRECATED("Use osmux_xfrm_output_alloc() and osmux_xfrm_output_set_rtp_*() instead") |
|
void | osmux_xfrm_output_init2 (struct osmux_out_handle *h, uint32_t rtp_ssrc, uint8_t rtp_payload_type) OSMO_DEPRECATED("Use osmux_xfrm_output_alloc() and osmux_xfrm_output_set_rtp_*() instead") |
|
void | osmux_xfrm_output_set_rtp_ssrc (struct osmux_out_handle *h, uint32_t rtp_ssrc) |
| Set SSRC of generated RTP packets from Osmux frames. More...
|
|
void | osmux_xfrm_output_set_rtp_pl_type (struct osmux_out_handle *h, uint32_t rtp_payload_type) |
| Set Payload Type of generated RTP packets from Osmux frames. More...
|
|
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. More...
|
|
void | osmux_xfrm_output_set_rtp_msgb_alloc_cb (struct osmux_out_handle *h, rtp_msgb_alloc_cb_t cb, void *cb_data) |
| Set callback to call when an RTP packet to be generated is to be allocated. More...
|
|
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 appropriate time. More...
|
|
void | osmux_xfrm_output_flush (struct osmux_out_handle *h) |
| Flush all scheduled RTP packets still pending to be transmitted. More...
|
|
struct osmux_hdr * | osmux_xfrm_output_pull (struct msgb *msg) |
|
This code implements a variety of utility functions related to the OSMUX user-plane multiplexing protocol, an efficient alternative to plain UDP/RTP streams for voice transport in back-haul of cellular networks.
int osmux_xfrm_input |
( |
struct osmux_in_handle * |
h, |
|
|
struct msgb * |
msg, |
|
|
int |
ccid |
|
) |
| |
osmux_xfrm_input - add RTP message to OSmux batch
- Parameters
-
msg | RTP message that you want to batch into one OSmux message |
If 0 is returned, this indicates that the message has been batched and the msgb is now owned by the osmux layer. If negative value is returned, an error occurred and the message has been dropped (and freed). If 1 is returned, you have to invoke osmux_xfrm_input_deliver and try again.
The function takes care of releasing the messages in case of error and when building the batch.