libosmo-sigtran 2.0.0.50-b59d
Osmocom SIGTRAN library
xua_msg.c File Reference
#include "xua_msg.h"
#include <osmocom/sigtran/protocol/sua.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/talloc.h>
#include <arpa/inet.h>
#include <string.h>
#include <errno.h>

Functions

void osmo_xua_msg_tall_ctx_init (void *ctx)
 
struct xua_msgxua_msg_alloc (void)
 
void xua_msg_free (struct xua_msg *msg)
 
int xua_msg_add_data (struct xua_msg *msg, uint16_t tag, uint16_t len, const uint8_t *dat)
 
struct xua_msg_partxua_msg_find_tag (const struct xua_msg *xua, uint16_t tag)
 
int xua_msg_free_tag (struct xua_msg *xua, uint16_t tag)
 
int xua_msg_copy_part (struct xua_msg *xua_out, uint16_t tag_out, const struct xua_msg *xua_in, uint16_t tag_in)
 
static int xua_from_msg_common (struct xua_msg *msg, const uint8_t *data, uint16_t pos, uint16_t len)
 
struct xua_msgxua_from_msg (const int version, uint16_t len, uint8_t *data)
 
struct xua_msgxua_from_nested (struct xua_msg_part *outer)
 
struct msgb * xua_to_msg (const int version, struct xua_msg *xua)
 
int msgb_t16l16vp_put (struct msgb *msg, uint16_t tag, uint16_t len, const uint8_t *data)
 
int msgb_t16l16vp_put_u32 (struct msgb *msg, uint16_t tag, uint32_t val)
 
int xua_msg_add_u32 (struct xua_msg *xua, uint16_t iei, uint32_t val)
 
uint32_t xua_msg_part_get_u32 (const struct xua_msg_part *part)
 
uint32_t xua_msg_get_u32 (const struct xua_msg *xua, uint16_t iei)
 
const uint32_t * xua_msg_get_u32p (const struct xua_msg *xua, uint16_t iei, uint32_t *out)
 
const char * xua_msg_part_get_str (const struct xua_msg_part *part)
 
const char * xua_msg_get_str (const struct xua_msg *xua, uint16_t iei)
 
int xua_msg_get_len (const struct xua_msg *xua, uint16_t iei)
 
void xua_part_add_gt (struct msgb *msg, const struct osmo_sccp_gt *gt)
 
int xua_msg_add_sccp_addr (struct xua_msg *xua, uint16_t iei, const struct osmo_sccp_addr *addr)
 
int xua_msg_event_map (const struct xua_msg *xua, const struct xua_msg_event_map *maps, unsigned int num_maps)
 Map from a xua_msg (class+type) to an event. More...
 
const char * xua_class_msg_name (const struct xua_msg_class *xmc, uint16_t msg_type)
 
const char * xua_class_iei_name (const struct xua_msg_class *xmc, uint16_t iei)
 
char * xua_hdr_dump (struct xua_msg *xua, const struct xua_dialect *dialect)
 
int xua_dialect_check_all_mand_ies (const struct xua_dialect *dialect, struct xua_msg *xua)
 
char * xua_msg_dump (struct xua_msg *xua, const struct xua_dialect *dialect)
 

Variables

static void * tall_xua = NULL
 

Function Documentation

◆ msgb_t16l16vp_put()

int msgb_t16l16vp_put ( struct msgb *  msg,
uint16_t  tag,
uint16_t  len,
const uint8_t *  data 
)

References data, len, and tag.

Referenced by msgb_t16l16vp_put_u32(), and xua_msg_add_sccp_addr().

◆ msgb_t16l16vp_put_u32()

int msgb_t16l16vp_put_u32 ( struct msgb *  msg,
uint16_t  tag,
uint32_t  val 
)

◆ osmo_xua_msg_tall_ctx_init()

void osmo_xua_msg_tall_ctx_init ( void *  ctx)

References tall_xua.

◆ xua_class_iei_name()

const char * xua_class_iei_name ( const struct xua_msg_class xmc,
uint16_t  iei 
)

◆ xua_class_msg_name()

const char * xua_class_msg_name ( const struct xua_msg_class xmc,
uint16_t  msg_type 
)

◆ xua_dialect_check_all_mand_ies()

◆ xua_from_msg()

struct xua_msg * xua_from_msg ( const int  version,
uint16_t  len,
uint8_t *  data 
)

◆ xua_from_msg_common()

static int xua_from_msg_common ( struct xua_msg msg,
const uint8_t *  data,
uint16_t  pos,
uint16_t  len 
)
static

◆ xua_from_nested()

◆ xua_hdr_dump()

◆ xua_msg_add_data()

◆ xua_msg_add_sccp_addr()

◆ xua_msg_add_u32()

◆ xua_msg_alloc()

◆ xua_msg_copy_part()

int xua_msg_copy_part ( struct xua_msg xua_out,
uint16_t  tag_out,
const struct xua_msg xua_in,
uint16_t  tag_in 
)

◆ xua_msg_dump()

◆ xua_msg_event_map()

int xua_msg_event_map ( const struct xua_msg xua,
const struct xua_msg_event_map maps,
unsigned int  num_maps 
)

Map from a xua_msg (class+type) to an event.

Parameters
[in]xuaxUA message which is to be mapped
[in]mapsTable containing msg type+class -> event maps [aram[in] num_maps number of entries in maps
Returns
event >= 0; negative on error (no map found)

References xua_msg_event_map::event, xua_msg::hdr, xua_msg_event_map::msg_class, xua_common_hdr::msg_class, xua_msg_event_map::msg_type, and xua_common_hdr::msg_type.

Referenced by m3ua_rx_asp(), sccp_scoc_rx_from_scrc(), and sua_rx_asp().

◆ xua_msg_find_tag()

◆ xua_msg_free()

◆ xua_msg_free_tag()

int xua_msg_free_tag ( struct xua_msg xua,
uint16_t  tag 
)

◆ xua_msg_get_len()

int xua_msg_get_len ( const struct xua_msg xua,
uint16_t  iei 
)

◆ xua_msg_get_str()

const char * xua_msg_get_str ( const struct xua_msg xua,
uint16_t  iei 
)

◆ xua_msg_get_u32()

◆ xua_msg_get_u32p()

const uint32_t * xua_msg_get_u32p ( const struct xua_msg xua,
uint16_t  iei,
uint32_t *  out 
)

◆ xua_msg_part_get_str()

const char * xua_msg_part_get_str ( const struct xua_msg_part part)

References xua_msg_part::dat, and xua_msg_part::len.

Referenced by xua_msg_get_str().

◆ xua_msg_part_get_u32()

◆ xua_part_add_gt()

void xua_part_add_gt ( struct msgb *  msg,
const struct osmo_sccp_gt gt 
)

◆ xua_to_msg()

Variable Documentation

◆ tall_xua

void* tall_xua = NULL
static