libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Macros | Functions | Variables
bsslap.c File Reference
3GPP TS 48.071 BSS LCS Assistance Protocol (BSSLAP).

Message encoding and decoding for 3GPP TS 48.071 BSSLAP protocol. More...

`#include <errno.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/gsm/bsslap.h>`
`#include <osmocom/gsm/tlv.h>`
`#include <osmocom/core/logging.h>`

## Macros
#define | DEC_ERR(RC, MSG_TYPE, IEI, CAUSE, fmt, args...)
#define | DEC_IE_MANDATORY(IEI, DEC_FUN, DEC_FUN_ARG)

## Functions
static void | osmo_bsslap_ie_enc_cell_id (struct msgb *msg, uint16_t cell_id)
static int | osmo_bsslap_ie_dec_cell_id (uint16_t *cell_id, enum bsslap_msgt msgt, enum bsslap_iei iei, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
static void | osmo_bsslap_ie_enc_ta (struct msgb *msg, uint8_t ta)
static int | osmo_bsslap_ie_dec_ta (uint8_t *ta, enum bsslap_msgt msgt, enum bsslap_iei iei, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
static void | osmo_bsslap_ie_enc_cause (struct msgb *msg, enum bsslap_cause cause)
static int | osmo_bsslap_ie_dec_cause (enum bsslap_cause *cause, enum bsslap_msgt msgt, enum bsslap_iei iei, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
static void | osmo_bsslap_ie_enc_chan_desc (struct msgb *msg, const struct gsm48_chan_desc *chan_desc)
static int | osmo_bsslap_ie_dec_chan_desc (struct gsm48_chan_desc *chan_desc, enum bsslap_msgt msgt, enum bsslap_iei iei, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
int | osmo_bsslap_enc (struct msgb *msg, const struct bsslap_pdu *pdu)
| Encode BSSLAP PDU and append to msgb (3GPP TS 48.071). More...
int | osmo_bsslap_dec (struct bsslap_pdu *pdu, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
| Decode BSSLAP PDU (3GPP TS 48.071). More...

## Variables
static const struct tlv_definition | osmo_bsslap_tlvdef
const struct value_string | osmo_bsslap_msgt_names []
const struct value_string | osmo_bsslap_iei_names []

## Detailed Description

Message encoding and decoding for 3GPP TS 48.071 BSSLAP protocol.

## Macro Definition Documentation

## ◆ DEC_IE_MANDATORY

#define DEC_IE_MANDATORY | ( |  | IEI,
|  |  | DEC_FUN,
|  |  | DEC_FUN_ARG
| ) |  |

Value:
do { \
const struct tlv_p_entry *e; \
int rc; \
if (!(e = TLVP_GET(&tp, IEI))) \
DEC_ERR(-EINVAL, pdu->msg_type, IEI, LCS_CAUSE_DATA_MISSING_IN_REQ, "missing mandatory IE"); \
rc = DEC_FUN(DEC_FUN_ARG, pdu->msg_type, IEI, err, err_ctx, e->val, e->len); \
if (rc) \
DEC_ERR(rc, pdu->msg_type, IEI, LCS_CAUSE_UNSPECIFIED, "cannot parse IE"); \
} while (0)
LCS_CAUSE_DATA_MISSING_IN_REQ
@ LCS_CAUSE_DATA_MISSING_IN_REQ
Definition: gsm_49_031.h:40
LCS_CAUSE_UNSPECIFIED
@ LCS_CAUSE_UNSPECIFIED
Definition: gsm_49_031.h:37
TLVP_GET
#define TLVP_GET(_tp, tag)
Return pointer to a TLV element if it is present.
Definition: tlv.h:573
tlv_p_entry
Entry in a TLV parser array.
Definition: tlv.h:502
tlv_p_entry::len
uint16_t len
length
Definition: tlv.h:503
tlv_p_entry::val
const uint8_t * val
pointer to value
Definition: tlv.h:504