libosmogsm 1.9.0.196-9975
Osmocom GSM library
bssmap_le.c File Reference

Message encoding and decoding for 3GPP TS 49.031 BSSMAP-LE. More...

#include <string.h>
#include <osmocom/core/byteswap.h>
#include <osmocom/core/endian.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/bssmap_le.h>
#include <osmocom/gsm/bsslap.h>
#include <osmocom/gsm/gad.h>
#include <osmocom/gsm/gsm48.h>
#include <osmocom/gsm/gsm0808.h>

Data Structures

struct  osmo_bssap_le_header
 

Macros

#define BSSAP_LE_MSG_SIZE   BSSMAP_MSG_SIZE
 
#define BSSAP_LE_MSG_HEADROOM   BSSMAP_MSG_HEADROOM
 
#define DEC_ERR_NO_RETURN(RC, MSG_TYPE, IEI, CAUSE, fmt, args...)
 
#define DEC_ERR(RC, MSG_TYPE, IEI, CAUSE, fmt, args...)
 
#define DEC_IE_MANDATORY(MSG_TYPE, IEI, DEC_FUN, DEC_FUN_ARG)
 
#define DEC_IE_OPTIONAL_FLAG(MSG_TYPE, IEI, DEC_FUN, DEC_FUN_ARG, PRESENCE_FLAG)
 
#define DEC_IE_OPTIONAL(MSG_TYPE, IEI, DEC_FUN, DEC_FUN_ARG)
 
#define BSSAP_LE_DEC_ERR(RC, fmt, args...)
 

Functions

uint8_t osmo_bssmap_le_ie_enc_location_type (struct msgb *msg, const struct bssmap_le_location_type *location_type)
 Encode full BSSMAP-LE Location Type IE, including IEI tag and length. More...
 
int osmo_bssmap_le_ie_dec_location_type (struct bssmap_le_location_type *lt, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 Decode BSSMAP-LE Location Type IE value part. More...
 
static uint8_t osmo_bssmap_le_ie_enc_lcs_client_type (struct msgb *msg, enum bssmap_le_lcs_client_type client_type)
 Encode full BSSMAP-LE LCS Client Type IE, including IEI tag and length. More...
 
static int osmo_bssmap_le_ie_dec_lcs_client_type (enum bssmap_le_lcs_client_type *client_type, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
static uint8_t osmo_bssmap_le_ie_enc_lcs_priority (struct msgb *msg, uint8_t priority)
 Encode full BSSMAP-LE LCS Priority IE, including IEI tag and length. More...
 
static int osmo_bssmap_le_ie_dec_lcs_priority (uint8_t *priority, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
static uint8_t osmo_bssmap_le_ie_enc_lcs_qos (struct msgb *msg, const struct osmo_bssmap_le_lcs_qos *qos)
 Encode full BSSMAP-LE LCS QoS IE, including IEI tag and length. More...
 
static int osmo_bssmap_le_ie_dec_lcs_qos (struct osmo_bssmap_le_lcs_qos *qos, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
int osmo_lcs_cause_enc (struct msgb *msg, const struct lcs_cause_ie *lcs_cause)
 Encode the value part of 3GPP TS 49.031 10.13 LCS Cause, without IEI and len. More...
 
int osmo_lcs_cause_dec (struct lcs_cause_ie *lcs_cause, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *data, uint8_t len)
 Decode the value part of 3GPP TS 49.031 10.13 LCS Cause, without IEI and len. More...
 
static int osmo_bssmap_le_ie_enc_apdu (struct msgb *msg, const struct bsslap_pdu *bsslap)
 
static int osmo_bssmap_le_ie_dec_apdu (struct bsslap_pdu *bsslap, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *data, size_t len)
 
static int osmo_bssmap_le_ie_dec_cell_id (struct gsm0808_cell_id *cell_id, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
static int osmo_bssmap_le_ie_dec_imsi (struct osmo_mobile_identity *imsi, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
static int osmo_bssmap_le_ie_dec_imei (struct osmo_mobile_identity *imei, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
static int osmo_bssmap_le_ie_dec_gad (union gad_raw *gad, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
 
struct osmo_bssmap_le_lcs_qos __attribute__ ((packed))
 
enum bssmap_le_msgt osmo_bssmap_le_msgt (const uint8_t *data, uint8_t len)
 Return the BSSMAP-LE msg_type from a BSSAP-LE PDU, e.g. More...
 
static int osmo_bssmap_le_enc_reset (struct msgb *msg, enum gsm0808_cause cause)
 
static int osmo_bssmap_le_dec_reset (enum gsm0808_cause *cause, enum bssmap_le_msgt msgt, struct osmo_bssmap_le_err **err, void *err_ctx, const struct tlv_parsed *tp)
 
static int osmo_bssmap_le_enc_perform_loc_req (struct msgb *msg, const struct bssmap_le_perform_loc_req *params)
 
static int osmo_bssmap_le_dec_perform_loc_req (struct bssmap_le_perform_loc_req *params, enum bssmap_le_msgt msgt, struct osmo_bssmap_le_err **err, void *err_ctx, const struct tlv_parsed *tp)
 
static int osmo_bssmap_le_enc_perform_loc_resp (struct msgb *msg, const struct bssmap_le_perform_loc_resp *params)
 
static int osmo_bssmap_le_dec_perform_loc_resp (struct bssmap_le_perform_loc_resp *params, enum bssmap_le_msgt msgt, struct osmo_bssmap_le_err **err, void *err_ctx, const struct tlv_parsed *tp)
 
static int osmo_bssmap_le_enc_perform_loc_abort (struct msgb *msg, const struct lcs_cause_ie *params)
 
static int osmo_bssmap_le_dec_perform_loc_abort (struct lcs_cause_ie *params, enum bssmap_le_msgt msgt, struct osmo_bssmap_le_err **err, void *err_ctx, const struct tlv_parsed *tp)
 
static int osmo_bssmap_le_enc_conn_oriented_info (struct msgb *msg, const struct bssmap_le_conn_oriented_info *params)
 
static int osmo_bssmap_le_dec_conn_oriented_info (struct bssmap_le_conn_oriented_info *params, enum bssmap_le_msgt msgt, struct osmo_bssmap_le_err **err, void *err_ctx, const struct tlv_parsed *tp)
 
static int osmo_bssmap_le_enc (struct msgb *msg, const struct bssmap_le_pdu *pdu)
 Encode BSSMAP-LE PDU and add to msgb (3GPP TS 49.031). More...
 
static int osmo_bssmap_le_dec (struct bssmap_le_pdu *pdu, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *data, size_t len)
 Decode BSSMAP-LE PDU (3GPP TS 49.031). More...
 
struct msgbosmo_bssap_le_enc (const struct bssap_le_pdu *pdu)
 Encode BSSAP-LE PDU returned in new msgb (3GPP TS 49.031). More...
 
int osmo_bssap_le_dec (struct bssap_le_pdu *pdu, struct osmo_bssap_le_err **err, void *err_ctx, struct msgb *msg)
 Decode BSSAP-LE PDU (3GPP TS 49.031). More...
 
int osmo_bssap_le_pdu_to_str_buf (char *buf, size_t buflen, const struct bssap_le_pdu *bssap_le)
 Return a human readable string describing a BSSAP-LE PDU. More...
 
char * osmo_bssap_le_pdu_to_str_c (void *ctx, const struct bssap_le_pdu *bssap_le)
 Return a human readable string describing a BSSAP-LE PDU. More...
 

Variables

static const struct tlv_definition osmo_bssmap_le_tlvdef
 
uint8_t type
 
uint8_t length
 
uint8_t data [0]
 
const struct value_string osmo_bssmap_le_msgt_names []
 
const struct value_string osmo_bssmap_le_iei_names []
 

Detailed Description

Message encoding and decoding for 3GPP TS 49.031 BSSMAP-LE.

Macro Definition Documentation

◆ BSSAP_LE_DEC_ERR

#define BSSAP_LE_DEC_ERR (   RC,
  fmt,
  args... 
)
Value:
do { \
if (err && !*err) { \
*err = talloc_zero(err_ctx, struct osmo_bssap_le_err); \
**err = (struct osmo_bssap_le_err){ \
.rc = (RC), \
.logmsg = talloc_asprintf(*err, "Error decoding BSSAP-LE: " fmt, ##args), \
}; \
} \
return RC; \
} while(0)
Definition: bssmap_le.h:42
char * logmsg
Definition: bssmap_le.h:46

Variable Documentation

◆ data

◆ length

uint8_t length

◆ type

uint8_t type