libosmocore 1.9.0.196-9975
Osmocom core library
msgb.c File Reference
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdarg.h>
#include <errno.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>

Functions

struct msgbmsgb_alloc_c (const void *ctx, uint16_t size, const char *name)
 Allocate a new message buffer from given talloc context. More...
 
struct msgbmsgb_alloc (uint16_t size, const char *name)
 Allocate a new message buffer from tall_msgb_ctx. More...
 
void msgb_free (struct msgb *m)
 Release given message buffer. More...
 
void msgb_enqueue (struct llist_head *queue, struct msgb *msg)
 Enqueue message buffer to tail of a queue. More...
 
struct msgbmsgb_dequeue (struct llist_head *queue)
 Dequeue message buffer from head of queue. More...
 
void msgb_reset (struct msgb *msg)
 Re-set all message buffer pointers. More...
 
uint8_t * msgb_data (const struct msgb *msg)
 get pointer to data section of message buffer More...
 
bool _msgb_eq (const char *file, size_t line, const char *func, uint8_t level, const struct msgb *msg, const uint8_t *data, size_t len, bool print)
 Compare and print: check data in msgb against given data and print errors if any. More...
 
uint16_t msgb_length (const struct msgb *msg)
 get length of message buffer More...
 
void msgb_set_talloc_ctx (void *ctx)
 Set the talloc context for msgb_alloc Deprecated, use msgb_talloc_ctx_init() instead. More...
 
void * msgb_talloc_ctx_init (void *root_ctx, unsigned int pool_size)
 Initialize a msgb talloc context for msgb_alloc. More...
 
struct msgbmsgb_copy_resize_c (const void *ctx, const struct msgb *msg, uint16_t new_len, const char *name)
 Copy an msgb with memory reallocation. More...
 
struct msgbmsgb_copy_resize (const struct msgb *msg, uint16_t new_len, const char *name)
 Copy an msgb with memory reallocation. More...
 
struct msgbmsgb_copy_c (const void *ctx, const struct msgb *msg, const char *name)
 Copy an msgb. More...
 
struct msgbmsgb_copy (const struct msgb *msg, const char *name)
 Copy an msgb. More...
 
int msgb_resize_area (struct msgb *msg, uint8_t *area, int old_size, int new_size)
 Resize an area within an msgb. More...
 
char * msgb_hexdump_buf (char *buf, size_t buf_len, const struct msgb *msg)
 fill user-provided buffer with hexdump of the msg. More...
 
const char * msgb_hexdump (const struct msgb *msg)
 Return a (static) buffer containing a hexdump of the msg. More...
 
char * msgb_hexdump_c (const void *ctx, const struct msgb *msg)
 Return a dynamically allocated buffer containing a hexdump of the msg. More...
 
int msgb_printf (struct msgb *msgb, const char *format,...)
 Print a string to the end of message buffer. More...
 

Variables

void * tall_msgb_ctx = NULL