html/ 0000755 0001750 0001750 00000000000 14752517766 011026 5 ustar build build html/structosmux__in__handle.js 0000644 0001750 0001750 00000000176 14752517766 016307 0 ustar build build var structosmux__in__handle = [ [ "osmux_seq", "structosmux__in__handle.html#a1ba076a41ef9c3413665b7444c6521cc", null ] ]; html/jibuf_8h.html 0000644 0001750 0001750 00000027651 14752517766 013425 0 ustar build build
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
Osmocom Jitter Buffer helpers. More...
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
#include <osmocom/core/timer.h>
Go to the source code of this file.
Data Structures | |
struct | osmo_jibuf |
A structure representing a single instance of a jitter buffer. More... | |
Typedefs | |
typedef void(* | osmo_jibuf_dequeue_cb) (struct msgb *msg, void *data) |
Functions | |
struct osmo_jibuf * | osmo_jibuf_alloc (void *talloc_ctx) |
Allocate a new jitter buffer instance. More... | |
void | osmo_jibuf_delete (struct osmo_jibuf *jb) |
Destroy a previously allocated jitter buffer instance. More... | |
int | osmo_jibuf_enqueue (struct osmo_jibuf *jb, struct msgb *msg) |
Try to enqueue a packet into the jitter buffer. More... | |
bool | osmo_jibuf_empty (struct osmo_jibuf *jb) |
Check whether the jitter buffer instance has packets queued or not. More... | |
void | osmo_jibuf_set_min_delay (struct osmo_jibuf *jb, uint32_t min_delay) |
Set minimum buffer size for the jitter buffer. More... | |
void | osmo_jibuf_set_max_delay (struct osmo_jibuf *jb, uint32_t max_delay) |
Set maximum buffer size for the jitter buffer. More... | |
void | osmo_jibuf_enable_skew_compensation (struct osmo_jibuf *jb, bool enable) |
Toggle use of skew detection and compensation mechanism. More... | |
void | osmo_jibuf_set_dequeue_cb (struct osmo_jibuf *jb, osmo_jibuf_dequeue_cb dequeue_cb, void *cb_data) |
Set dequeue callback for the jitter buffer. More... | |
Osmocom Jitter Buffer helpers.
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
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...
Files | |
file | osmux.h |
Osmocom multiplex protocol helpers. | |
file | osmux.c |
Osmocom multiplex protocol helpers. | |
file | osmux_input.c |
Osmocom multiplex protocol helpers (input) | |
file | osmux_output.c |
Osmocom multiplex protocol helpers (output) | |
Data Structures | |
struct | osmux_hdr |
Osmux protocol header. More... | |
struct | osmux_in_handle |
one to handle all existing RTP flows More... | |
struct | osmux_out_handle |
one per OSmux circuit_id, ie. More... | |
Macros | |
#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 |
Typedefs | |
typedef struct msgb *(* | rtp_msgb_alloc_cb_t) (void *rtp_msgb_alloc_priv_data, unsigned int msg_len) |
Functions | |
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) |
Allocate a new osmux in handle (osmux source, tx side) More... | |
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) |
Variables | |
struct osmux_in_handle | __attribute__ |
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.
For information about the OSMUX protocol design, please see the OSMUX reference manual at http://ftp.osmocom.org/docs/latest/osmux-reference.pdf
int osmux_snprintf | ( | char * | buf, |
size_t | size, | ||
struct msgb * | msg | ||
) |
Print osmux header fields and payload from msg into buffer buf.
[out] | buf | buffer to store the output into |
[in] | len | length of buf in bytes |
[in] | msgb | message buffer containing one or more osmux frames |
If the output was truncated due to this limit, then the return value is the number of characters (excluding the terminating null byte) which would have been written to the final string if enough space had been available.
int osmux_xfrm_input | ( | struct osmux_in_handle * | h, |
struct msgb * | msg, | ||
int | ccid | ||
) |
osmux_xfrm_input - add RTP message to OSmux batch
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.
struct osmux_in_handle * osmux_xfrm_input_alloc | ( | void * | ctx | ) |
Allocate a new osmux in handle (osmux source, tx side)
[in] | ctx | talloc context to use when allocating the returned struct |
This object contains configuration and state to handle a group of circuits (trunk), receiving RTP packets from the upper layer (API user) and sending batched & trunked Osmux messages containing all the data of those circuits down the stack outgoing network Osmux messages. Returned pointer can be freed with regular talloc_free, all pending messages in queue and all internal data will be freed.
void osmux_xfrm_input_fini | ( | struct osmux_in_handle * | h | ) |
void osmux_xfrm_input_init | ( | struct osmux_in_handle * | h | ) |
struct osmux_out_handle * osmux_xfrm_output_alloc | ( | void * | ctx | ) |
Allocate a new osmux out handle.
[in] | ctx | talloc context to use when allocating the returned struct |
This object contains configuration and state to handle a specific CID in incoming network Osmux messages, repackaging the frames for that CID as RTP packets and pushing them up the protocol stack. Returned pointer can be freed with regular talloc_free, queue will be flushed and all internal data will be freed.
void osmux_xfrm_output_flush | ( | struct osmux_out_handle * | h | ) |
Flush all scheduled RTP packets still pending to be transmitted.
[in] | h | the osmux out handle to flush |
This function will immediately call the transmit callback for all queued RTP packets, making sure the list ends up empty. It will also stop all internal timers to make sure the osmux_out_handle can be dropped or re-used by calling osmux_xfrm_output on it.
void osmux_xfrm_output_init | ( | struct osmux_out_handle * | h, |
uint32_t | rtp_ssrc | ||
) |
void osmux_xfrm_output_init2 | ( | struct osmux_out_handle * | h, |
uint32_t | rtp_ssrc, | ||
uint8_t | rtp_payload_type | ||
) |
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.
[in] | h | the osmux out handle handling a specific CID |
[in] | osmuxh | Buffer pointing to osmux frame header structure and AMR payload |
The osmux frame passed to this function must be of the type OSMUX_FT_VOICE_AMR. The generated RTP packets are kept into h's internal list and sent to the callback configured through osmux_xfrm_output_set_tx_cb when are ready to be transmitted according to schedule.
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.
[in] | h | the osmux out handle handling a specific CID |
[in] | cb | User defined msgb alloc function for generated RTP pkts |
[in] | cb_data | Opaque data pointer set by user and passed in cb |
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.
[in] | h | the osmux out handle handling a specific CID |
[in] | rtp_payload_type | the RTP Payload Type to set |
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.
[in] | h | the osmux out handle handling a specific CID |
[in] | rtp_ssrc | the RTP SSRC to set |
void osmux_xfrm_output_set_tx_cb | ( | struct osmux_out_handle * | h, |
void(*)(struct msgb *msg, void *data) | tx_cb, | ||
void * | data | ||
) |
Set transmission callback to call when a generated RTP packet is to be transmitted.
[in] | h | the osmux out handle handling a specific CID |
[in] | osmuxh | Buffer pointing to osmux frame header structure and AMR payload |
This Function sets the callback called by the interal timer set by osmux_xfrm_out_sched function.
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
Osmocom multiplex protocol helpers (input) More...
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/timer_compat.h>
#include <osmocom/core/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/netif/amr.h>
#include <osmocom/netif/rtp.h>
#include <osmocom/netif/osmux.h>
#include <arpa/inet.h>
Macros | |
#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 ...) |
Functions | |
void | osmux_xfrm_input_deliver (struct osmux_in_handle *h) |
int | osmux_xfrm_input (struct osmux_in_handle *h, struct msgb *msg, int ccid) |
osmux_xfrm_input - add RTP message to OSmux batch More... | |
struct osmux_in_handle * | osmux_xfrm_input_alloc (void *ctx) |
Allocate a new osmux in handle (osmux source, tx side) More... | |
void | osmux_xfrm_input_init (struct osmux_in_handle *h) OSMO_DEPRECATED("Use osmux_xfrm_input_alloc() instead") |
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) |
void | osmux_xfrm_input_set_name (struct osmux_in_handle *h, const char *name) |
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) |
void | osmux_xfrm_input_fini (struct osmux_in_handle *h) OSMO_DEPRECATED("Use talloc_free() instead") |
Osmocom multiplex protocol helpers (input)
#define LOGMUXCID | ( | link, | |
circuit, | |||
lvl, | |||
fmt, | |||
args ... | |||
) |
#define LOGMUXLK_ | ( | link, | |
lvl, | |||
fmt, | |||
args ... | |||
) |
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#include <osmocom/core/msgb.h>
Go to the source code of this file.
Typedefs | |
typedef int(* | osmo_stream_srv_link_accept_cb_t) (struct osmo_stream_srv_link *link, int fd) |
typedef int(* | osmo_stream_srv_read_cb_t) (struct osmo_stream_srv *conn) |
typedef int(* | osmo_stream_srv_closed_cb_t) (struct osmo_stream_srv *conn) |
typedef int(* | osmo_stream_srv_read_cb2_t) (struct osmo_stream_srv *conn, int res, struct msgb *msg) |
Completion call-back function when something was read from from the stream client socket. More... | |
typedef int(* | osmo_stream_srv_segmentation_cb_t) (struct msgb *msg) |
typedef int(* | osmo_stream_srv_segmentation_cb2_t) (struct osmo_stream_srv *conn, struct msgb *msg) |
typedef int(* | osmo_stream_cli_connect_cb_t) (struct osmo_stream_cli *cli) |
typedef int(* | osmo_stream_cli_disconnect_cb_t) (struct osmo_stream_cli *cli) |
typedef int(* | osmo_stream_cli_read_cb_t) (struct osmo_stream_cli *cli) |
typedef int(* | osmo_stream_cli_read_cb2_t) (struct osmo_stream_cli *cli, int res, struct msgb *msg) |
Completion call-back function when something was read from from the stream client socket. More... | |
typedef int(* | osmo_stream_cli_segmentation_cb_t) (struct msgb *msg) |
typedef int(* | osmo_stream_cli_segmentation_cb2_t) (struct osmo_stream_cli *cli, struct msgb *msg) |
Functions | |
struct osmo_stream_srv_link * | osmo_stream_srv_link_create (void *ctx) |
Create an Osmocom Stream Server Link. More... | |
void | osmo_stream_srv_link_destroy (struct osmo_stream_srv_link *link) |
Destroy the stream server link. More... | |
void | osmo_stream_srv_link_set_name (struct osmo_stream_srv_link *link, const char *name) |
Set a name on the srv_link object (used during logging). More... | |
const char * | osmo_stream_srv_link_get_name (const struct osmo_stream_srv_link *link) |
Retrieve name previously set on the srv_link object (see osmo_stream_srv_link_set_name()). More... | |
void | osmo_stream_srv_link_set_nodelay (struct osmo_stream_srv_link *link, bool nodelay) |
Set the NODELAY socket option to avoid Nagle-like behavior. More... | |
int | osmo_stream_srv_link_set_priority (struct osmo_stream_srv_link *link, int sk_prio) |
Set the priority value of the stream socket. More... | |
int | osmo_stream_srv_link_set_ip_dscp (struct osmo_stream_srv_link *link, uint8_t ip_dscp) |
Set the DSCP (differentiated services code point) of the stream socket. More... | |
void | osmo_stream_srv_link_set_addr (struct osmo_stream_srv_link *link, const char *addr) |
Set the local address to which we bind. More... | |
int | osmo_stream_srv_link_set_addrs (struct osmo_stream_srv_link *link, const char **addr, size_t addrcnt) |
Set the local address set to which we bind. More... | |
void | osmo_stream_srv_link_set_port (struct osmo_stream_srv_link *link, uint16_t port) |
Set the local port number to which we bind. More... | |
void | osmo_stream_srv_link_set_proto (struct osmo_stream_srv_link *link, uint16_t proto) |
Set the protocol for the stream server link. More... | |
int | osmo_stream_srv_link_set_type (struct osmo_stream_srv_link *link, int type) |
Set the socket type for the stream server link. More... | |
int | osmo_stream_srv_link_set_domain (struct osmo_stream_srv_link *link, int domain) |
Set the socket type for the stream server link. More... | |
void | osmo_stream_srv_link_set_accept_cb (struct osmo_stream_srv_link *link, int(*accept_cb)(struct osmo_stream_srv_link *link, int fd)) |
Set the accept() call-back of the stream server link. More... | |
void | osmo_stream_srv_link_set_data (struct osmo_stream_srv_link *link, void *data) |
Set application private data of the stream server link. More... | |
void * | osmo_stream_srv_link_get_data (struct osmo_stream_srv_link *link) |
Retrieve application private data of the stream server link. More... | |
int | osmo_stream_srv_link_set_tx_queue_max_length (struct osmo_stream_srv_link *link, unsigned int size) |
Set the maximum length queue of the stream servers accepted and allocated from this server link. More... | |
char * | osmo_stream_srv_link_get_sockname (const struct osmo_stream_srv_link *link) |
Retrieve description of the stream server link e. More... | |
struct osmo_fd * | osmo_stream_srv_link_get_ofd (struct osmo_stream_srv_link *link) |
Retrieve Osmocom File Descriptor of the stream server link. More... | |
int | osmo_stream_srv_link_get_fd (const struct osmo_stream_srv_link *link) |
Retrieve File Descriptor of the stream server link. More... | |
int | osmo_stream_srv_link_set_msgb_alloc_info (struct osmo_stream_srv_link *link, unsigned int size, unsigned int headroom) |
Set the msgb allocation parameters on child osmo_stream_srv objects. More... | |
bool | osmo_stream_srv_link_is_opened (const struct osmo_stream_srv_link *link) |
Check whether the stream server link is opened. More... | |
int | osmo_stream_srv_link_open (struct osmo_stream_srv_link *link) |
Open the stream server link. More... | |
void | osmo_stream_srv_link_close (struct osmo_stream_srv_link *link) |
Close the stream server link and unregister from select loop. More... | |
int | osmo_stream_srv_link_set_param (struct osmo_stream_srv_link *link, enum osmo_stream_srv_link_param par, void *val, size_t val_len) |
Set given parameter of stream_srv_link to given value. More... | |
struct osmo_stream_srv * | osmo_stream_srv_create (void *ctx, struct osmo_stream_srv_link *link, int fd, osmo_stream_srv_read_cb_t read_cb, osmo_stream_srv_closed_cb_t closed_cb, void *data) |
Create a legacy osmo_fd mode Stream Server inside the specified link. More... | |
struct osmo_stream_srv * | osmo_stream_srv_create2 (void *ctx, struct osmo_stream_srv_link *link, int fd, void *data) |
Create an osmo_iofd mode Stream Server inside the specified link. More... | |
void | osmo_stream_srv_set_name (struct osmo_stream_srv *conn, const char *name) |
Set a name on the srv object (used during logging). More... | |
const char * | osmo_stream_srv_get_name (const struct osmo_stream_srv *conn) |
Retrieve name previously set on the srv object (see osmo_stream_srv_set_name()). More... | |
void | osmo_stream_srv_set_read_cb (struct osmo_stream_srv *conn, osmo_stream_srv_read_cb2_t read_cb) |
Set the call-back function for incoming data on an osmo_io stream_srv. More... | |
void | osmo_stream_srv_set_closed_cb (struct osmo_stream_srv *conn, osmo_stream_srv_closed_cb_t closed_cb) |
Set the call-back function called when the stream server socket was closed. More... | |
void * | osmo_stream_srv_get_data (struct osmo_stream_srv *conn) |
Retrieve application private data of the stream server. More... | |
struct osmo_stream_srv_link * | osmo_stream_srv_get_master (struct osmo_stream_srv *conn) |
Retrieve the master (Link) from a Stream Server. More... | |
const char * | osmo_stream_srv_get_sockname (const struct osmo_stream_srv *conn) |
Retrieve the stream server socket description. More... | |
struct osmo_fd * | osmo_stream_srv_get_ofd (struct osmo_stream_srv *conn) |
Retrieve Osmocom File Descriptor of a stream server in osmo_fd mode. More... | |
int | osmo_stream_srv_get_fd (const struct osmo_stream_srv *conn) |
Retrieve File Descriptor of the stream server. More... | |
struct osmo_io_fd * | osmo_stream_srv_get_iofd (const struct osmo_stream_srv *srv) |
Retrieve osmo_io descriptor of the stream server socket. More... | |
void | osmo_stream_srv_destroy (struct osmo_stream_srv *conn) |
Destroy given Stream Server. More... | |
void | osmo_stream_srv_set_flush_and_destroy (struct osmo_stream_srv *conn) |
Prepare to send out all pending messages on the connection's Tx queue. More... | |
void | osmo_stream_srv_set_data (struct osmo_stream_srv *conn, void *data) |
Set application private data of the stream server. More... | |
void | osmo_stream_srv_set_segmentation_cb (struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb) |
Set the segmentation callback for target osmo_stream_srv structure. More... | |
void | osmo_stream_srv_set_segmentation_cb2 (struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb2_t segmentation_cb2) |
Set the segmentation callback for target osmo_stream_srv structure. More... | |
void | osmo_stream_srv_send (struct osmo_stream_srv *conn, struct msgb *msg) |
Enqueue data to be sent via an Osmocom stream server. More... | |
int | osmo_stream_srv_recv (struct osmo_stream_srv *conn, struct msgb *msg) |
Receive data via an Osmocom stream server in osmo_fd mode. More... | |
void | osmo_stream_srv_clear_tx_queue (struct osmo_stream_srv *conn) |
void | osmo_stream_cli_set_name (struct osmo_stream_cli *cli, const char *name) |
Set a name on the cli object (used during logging). More... | |
const char * | osmo_stream_cli_get_name (const struct osmo_stream_cli *cli) |
Retrieve name previously set on the cli object (see osmo_stream_cli_set_name()). More... | |
void | osmo_stream_cli_set_nodelay (struct osmo_stream_cli *cli, bool nodelay) |
Set the NODELAY socket option to avoid Nagle-like behavior. More... | |
int | osmo_stream_cli_set_priority (struct osmo_stream_cli *cli, int sk_prio) |
Set the priority value of the stream socket. More... | |
int | osmo_stream_cli_set_ip_dscp (struct osmo_stream_cli *cli, uint8_t ip_dscp) |
Set the DSCP (differentiated services code point) of the stream socket. More... | |
void | osmo_stream_cli_set_addr (struct osmo_stream_cli *cli, const char *addr) |
Set the remote address to which we connect. More... | |
int | osmo_stream_cli_set_addrs (struct osmo_stream_cli *cli, const char **addr, size_t addrcnt) |
Set the remote address set to which we connect. More... | |
void | osmo_stream_cli_set_port (struct osmo_stream_cli *cli, uint16_t port) |
Set the remote port number to which we connect. More... | |
int | osmo_stream_cli_set_type (struct osmo_stream_cli *cli, int type) |
Set the socket type for the stream server link. More... | |
int | osmo_stream_cli_set_domain (struct osmo_stream_cli *cli, int domain) |
Set the socket type for the stream server link. More... | |
void | osmo_stream_cli_set_proto (struct osmo_stream_cli *cli, uint16_t proto) |
Set the protocol for the stream client socket. More... | |
void | osmo_stream_cli_set_local_addr (struct osmo_stream_cli *cli, const char *addr) |
Set the local address for the socket (to be bound to). More... | |
int | osmo_stream_cli_set_local_addrs (struct osmo_stream_cli *cli, const char **addr, size_t addrcnt) |
Set the local address set to which we bind. More... | |
void | osmo_stream_cli_set_local_port (struct osmo_stream_cli *cli, uint16_t port) |
Set the local port number for the socket (to be bound to). More... | |
void | osmo_stream_cli_set_data (struct osmo_stream_cli *cli, void *data) |
Set application private data of the stream client socket. More... | |
void | osmo_stream_cli_set_reconnect_timeout (struct osmo_stream_cli *cli, int timeout) |
Set the reconnect time of the stream client socket. More... | |
void * | osmo_stream_cli_get_data (struct osmo_stream_cli *cli) |
Retrieve application private data of the stream client socket. More... | |
int | osmo_stream_cli_set_tx_queue_max_length (struct osmo_stream_cli *cli, unsigned int size) |
Set the maximum length queue of the stream client. More... | |
char * | osmo_stream_cli_get_sockname (const struct osmo_stream_cli *cli) |
Retrieve the stream client socket description. More... | |
struct osmo_fd * | osmo_stream_cli_get_ofd (struct osmo_stream_cli *cli) |
Retrieve Osmocom File Descriptor of the stream client socket. More... | |
int | osmo_stream_cli_get_fd (const struct osmo_stream_cli *cli) |
Retrieve file descriptor of the stream client socket. More... | |
struct osmo_io_fd * | osmo_stream_cli_get_iofd (const struct osmo_stream_cli *cli) |
Retrieve osmo_io descriptor of the stream client socket. More... | |
void | osmo_stream_cli_set_connect_cb (struct osmo_stream_cli *cli, osmo_stream_cli_connect_cb_t connect_cb) |
Set the call-back function called on connect of the stream client socket. More... | |
void | osmo_stream_cli_set_disconnect_cb (struct osmo_stream_cli *cli, osmo_stream_cli_disconnect_cb_t disconnect_cb) |
Set the call-back function called on disconnect of the stream client socket. More... | |
void | osmo_stream_cli_set_read_cb (struct osmo_stream_cli *cli, osmo_stream_cli_read_cb_t read_cb) |
Set the call-back function called to read from the stream client socket. More... | |
void | osmo_stream_cli_set_read_cb2 (struct osmo_stream_cli *cli, osmo_stream_cli_read_cb2_t read_cb) |
Set the call-back function called to read from the stream client socket. More... | |
void | osmo_stream_cli_set_segmentation_cb (struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) |
Set the segmentation callback for the client. More... | |
void | osmo_stream_cli_set_segmentation_cb2 (struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb2_t segmentation_cb2) |
Set the segmentation callback for the client. More... | |
void | osmo_stream_cli_reconnect (struct osmo_stream_cli *cli) |
Re-connect an Osmocom Stream Client. More... | |
bool | osmo_stream_cli_is_connected (struct osmo_stream_cli *cli) |
Check if Osmocom Stream Client is in connected state. More... | |
struct osmo_stream_cli * | osmo_stream_cli_create (void *ctx) |
Create an Osmocom stream client. More... | |
void | osmo_stream_cli_destroy (struct osmo_stream_cli *cli) |
Destroy a Osmocom stream client (includes close). More... | |
int | osmo_stream_cli_open (struct osmo_stream_cli *cli) |
Open connection of an Osmocom stream client. More... | |
int | osmo_stream_cli_open2 (struct osmo_stream_cli *cli, int reconnect) |
DEPRECATED: use osmo_stream_cli_set_reconnect_timeout() or osmo_stream_cli_reconnect() instead! Open connection of an Osmocom stream client. More... | |
void | osmo_stream_cli_close (struct osmo_stream_cli *cli) |
Close an Osmocom Stream Client. More... | |
void | osmo_stream_cli_send (struct osmo_stream_cli *cli, struct msgb *msg) |
Enqueue data to be sent via an Osmocom stream client. More... | |
int | osmo_stream_cli_recv (struct osmo_stream_cli *cli, struct msgb *msg) |
Receive data via an Osmocom stream client in osmo_fd mode. More... | |
void | osmo_stream_cli_clear_tx_queue (struct osmo_stream_cli *cli) |
Clear the transmit queue of the stream client. More... | |
int | osmo_stream_cli_set_param (struct osmo_stream_cli *cli, enum osmo_stream_cli_param par, void *val, size_t val_len) |
Set given parameter of stream client to given value. More... | |
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
Osmocom Jitter Buffer helpers. More...
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
#include <osmocom/netif/amr.h>
#include <osmocom/netif/rtp.h>
#include <osmocom/netif/jibuf.h>
#include <arpa/inet.h>
Functions | |
struct osmo_jibuf * | osmo_jibuf_alloc (void *talloc_ctx) |
Allocate a new jitter buffer instance. More... | |
void | osmo_jibuf_delete (struct osmo_jibuf *jb) |
Destroy a previously allocated jitter buffer instance. More... | |
int | osmo_jibuf_enqueue (struct osmo_jibuf *jb, struct msgb *msg) |
Try to enqueue a packet into the jitter buffer. More... | |
bool | osmo_jibuf_empty (struct osmo_jibuf *jb) |
Check whether the jitter buffer instance has packets queued or not. More... | |
void | osmo_jibuf_set_min_delay (struct osmo_jibuf *jb, uint32_t min_delay) |
Set minimum buffer size for the jitter buffer. More... | |
void | osmo_jibuf_set_max_delay (struct osmo_jibuf *jb, uint32_t max_delay) |
Set maximum buffer size for the jitter buffer. More... | |
void | osmo_jibuf_enable_skew_compensation (struct osmo_jibuf *jb, bool enable) |
Toggle use of skew detection and compensation mechanism. More... | |
void | osmo_jibuf_set_dequeue_cb (struct osmo_jibuf *jb, osmo_jibuf_dequeue_cb dequeue_cb, void *cb_data) |
Set dequeue callback for the jitter buffer. More... | |
Osmocom Jitter Buffer helpers.
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
Osmocom multiplex protocol helpers. More...
#include <stdio.h>
#include <string.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/timer_compat.h>
#include <osmocom/core/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/netif/amr.h>
#include <osmocom/netif/rtp.h>
#include <osmocom/netif/osmux.h>
#include <arpa/inet.h>
Macros | |
#define | SNPRINTF_BUFFER_SIZE(ret, remain, offset) |
Functions | |
int | osmux_snprintf (char *buf, size_t size, struct msgb *msg) |
Print osmux header fields and payload from msg into buffer buf. More... | |
Osmocom multiplex protocol helpers.
#define SNPRINTF_BUFFER_SIZE | ( | ret, | |
remain, | |||
offset | |||
) |
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/osmo_io.h>
#include <osmocom/core/panic.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/socket.h>
#include <osmocom/netif/stream.h>
#include <osmocom/netif/stream_private.h>
#include "config.h"
#include <osmocom/netif/sctp.h>
Macros | |
#define | LOGSCLI(cli, level, fmt, args...) |
#define | OSMO_STREAM_CLI_F_RECONF (1 << 0) |
#define | OSMO_STREAM_CLI_F_NODELAY (1 << 1) |
#define | IN_CB_MASK_CONNECT_CB (1 << 0) |
#define | IN_CB_MASK_DISCONNECT_CB (1 << 1) |
#define | IN_CB_MASK_READ_CB (1 << 2) |
Enumerations | |
enum | osmo_stream_cli_state { STREAM_CLI_STATE_CLOSED , STREAM_CLI_STATE_WAIT_RECONNECT , STREAM_CLI_STATE_CONNECTING , STREAM_CLI_STATE_CONNECTED , STREAM_CLI_STATE_MAX } |
Functions | |
void | osmo_stream_cli_close (struct osmo_stream_cli *cli) |
Close an Osmocom Stream Client. More... | |
void | osmo_stream_cli_reconnect (struct osmo_stream_cli *cli) |
Re-connect an Osmocom Stream Client. More... | |
bool | osmo_stream_cli_is_connected (struct osmo_stream_cli *cli) |
Check if Osmocom Stream Client is in connected state. More... | |
int | osmo_stream_cli_get_fd (const struct osmo_stream_cli *cli) |
Retrieve file descriptor of the stream client socket. More... | |
struct osmo_io_fd * | osmo_stream_cli_get_iofd (const struct osmo_stream_cli *cli) |
Retrieve osmo_io descriptor of the stream client socket. More... | |
struct osmo_stream_cli * | osmo_stream_cli_create (void *ctx) |
Create an Osmocom stream client. More... | |
void | osmo_stream_cli_set_name (struct osmo_stream_cli *cli, const char *name) |
Set a name on the cli object (used during logging). More... | |
const char * | osmo_stream_cli_get_name (const struct osmo_stream_cli *cli) |
Retrieve name previously set on the cli object (see osmo_stream_cli_set_name()). More... | |
void | osmo_stream_cli_set_addr (struct osmo_stream_cli *cli, const char *addr) |
Set the remote address to which we connect. More... | |
int | osmo_stream_cli_set_addrs (struct osmo_stream_cli *cli, const char **addr, size_t addrcnt) |
Set the remote address set to which we connect. More... | |
void | osmo_stream_cli_set_port (struct osmo_stream_cli *cli, uint16_t port) |
Set the remote port number to which we connect. More... | |
void | osmo_stream_cli_set_local_port (struct osmo_stream_cli *cli, uint16_t port) |
Set the local port number for the socket (to be bound to). More... | |
void | osmo_stream_cli_set_local_addr (struct osmo_stream_cli *cli, const char *addr) |
Set the local address for the socket (to be bound to). More... | |
int | osmo_stream_cli_set_local_addrs (struct osmo_stream_cli *cli, const char **addr, size_t addrcnt) |
Set the local address set to which we bind. More... | |
void | osmo_stream_cli_set_proto (struct osmo_stream_cli *cli, uint16_t proto) |
Set the protocol for the stream client socket. More... | |
void | osmo_stream_cli_set_segmentation_cb (struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) |
Set the segmentation callback for the client. More... | |
void | osmo_stream_cli_set_segmentation_cb2 (struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb2_t segmentation_cb2) |
Set the segmentation callback for the client. More... | |
int | osmo_stream_cli_set_type (struct osmo_stream_cli *cli, int type) |
Set the socket type for the stream server link. More... | |
int | osmo_stream_cli_set_domain (struct osmo_stream_cli *cli, int domain) |
Set the socket type for the stream server link. More... | |
void | osmo_stream_cli_set_reconnect_timeout (struct osmo_stream_cli *cli, int timeout) |
Set the reconnect time of the stream client socket. More... | |
void | osmo_stream_cli_set_data (struct osmo_stream_cli *cli, void *data) |
Set application private data of the stream client socket. More... | |
void * | osmo_stream_cli_get_data (struct osmo_stream_cli *cli) |
Retrieve application private data of the stream client socket. More... | |
int | osmo_stream_cli_set_tx_queue_max_length (struct osmo_stream_cli *cli, unsigned int size) |
Set the maximum length queue of the stream client. More... | |
char * | osmo_stream_cli_get_sockname (const struct osmo_stream_cli *cli) |
Retrieve the stream client socket description. More... | |
struct osmo_fd * | osmo_stream_cli_get_ofd (struct osmo_stream_cli *cli) |
Retrieve Osmocom File Descriptor of the stream client socket. More... | |
void | osmo_stream_cli_set_connect_cb (struct osmo_stream_cli *cli, osmo_stream_cli_connect_cb_t connect_cb) |
Set the call-back function called on connect of the stream client socket. More... | |
void | osmo_stream_cli_set_disconnect_cb (struct osmo_stream_cli *cli, osmo_stream_cli_disconnect_cb_t disconnect_cb) |
Set the call-back function called on disconnect of the stream client socket. More... | |
void | osmo_stream_cli_set_read_cb (struct osmo_stream_cli *cli, osmo_stream_cli_read_cb_t read_cb) |
Set the call-back function called to read from the stream client socket. More... | |
void | osmo_stream_cli_set_read_cb2 (struct osmo_stream_cli *cli, osmo_stream_cli_read_cb2_t read_cb) |
Set the call-back function called to read from the stream client socket. More... | |
void | osmo_stream_cli_destroy (struct osmo_stream_cli *cli) |
Destroy a Osmocom stream client (includes close). More... | |
int | osmo_stream_cli_open2 (struct osmo_stream_cli *cli, int reconnect) |
DEPRECATED: use osmo_stream_cli_set_reconnect_timeout() or osmo_stream_cli_reconnect() instead! Open connection of an Osmocom stream client. More... | |
void | osmo_stream_cli_set_nodelay (struct osmo_stream_cli *cli, bool nodelay) |
Set the NODELAY socket option to avoid Nagle-like behavior. More... | |
int | osmo_stream_cli_set_priority (struct osmo_stream_cli *cli, int sk_prio) |
Set the priority value of the stream socket. More... | |
int | osmo_stream_cli_set_ip_dscp (struct osmo_stream_cli *cli, uint8_t ip_dscp) |
Set the DSCP (differentiated services code point) of the stream socket. More... | |
int | osmo_stream_cli_open (struct osmo_stream_cli *cli) |
Open connection of an Osmocom stream client. More... | |
void | osmo_stream_cli_send (struct osmo_stream_cli *cli, struct msgb *msg) |
Enqueue data to be sent via an Osmocom stream client. More... | |
int | osmo_stream_cli_recv (struct osmo_stream_cli *cli, struct msgb *msg) |
Receive data via an Osmocom stream client in osmo_fd mode. More... | |
void | osmo_stream_cli_clear_tx_queue (struct osmo_stream_cli *cli) |
Clear the transmit queue of the stream client. More... | |
int | osmo_stream_cli_set_param (struct osmo_stream_cli *cli, enum osmo_stream_cli_param par, void *val, size_t val_len) |
Set given parameter of stream client to given value. More... | |
#define LOGSCLI | ( | cli, | |
level, | |||
fmt, | |||
args... | |||
) |
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
libosmo-netif 1.5.1.34-ada6
Osmocom network interface library
|
Data Fields | |
uint16_t | sequence |
uint32_t | timestamp |
uint32_t | ssrc |
uint8_t | data [0] |