libosmogsm 1.9.0.196-9975
Osmocom GSM library
3GPP TS 49.031 BSSMAP-LE.

Files

file  bssmap_le.h
 Message encoding and decoding for 3GPP TS 49.031 BSSMAP-LE.
 
file  gsm_49_031.h
 
file  bssmap_le.c
 Message encoding and decoding for 3GPP TS 49.031 BSSMAP-LE.
 

Data Structures

struct  osmo_bssmap_le_err
 
struct  osmo_bssap_le_err
 
struct  lcs_cause_ie
 3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former. More...
 
struct  osmo_bssmap_le_lcs_qos
 
struct  bssmap_le_location_type
 
struct  bssmap_le_perform_loc_req
 
struct  bssmap_le_perform_loc_resp
 
struct  bssmap_le_conn_oriented_info
 
struct  bssmap_le_pdu
 
struct  bssap_le_pdu
 
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)
 

Enumerations

enum  lcs_cause {
  LCS_CAUSE_UNSPECIFIED = 0 ,
  LCS_CAUSE_SYSTEM_FAILURE = 1 ,
  LCS_CAUSE_PROTOCOL_ERROR = 2 ,
  LCS_CAUSE_DATA_MISSING_IN_REQ = 3 ,
  LCS_CAUSE_UNEXP_DATA_IN_REQ = 4 ,
  LCS_CAUSE_POS_METH_FAILURE = 5 ,
  LCS_CAUSE_TGT_MS_UNREACHABLE = 6 ,
  LCS_CAUSE_REQUEST_ABORTED = 7 ,
  LCS_CAUSE_FACILITY_NOTSUPP = 8 ,
  LCS_CAUSE_INTER_BSC_HO = 9 ,
  LCS_CAUSE_INTRA_BSC_HO = 10 ,
  LCS_CAUSE_CONGESTION = 11 ,
  LCS_CAUSE_INTER_NSE_CHG = 12 ,
  LCS_CAUSE_RA_UPDAT = 13 ,
  LCS_CAUSE_PTMSI_REALLOC = 14 ,
  LCS_CAUSE_GPRS_SUSPENSION = 15
}
 3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former. More...
 
enum  bssap_le_msg_discr { BSSAP_LE_MSG_DISCR_BSSMAP_LE = 0 }
 
enum  bssmap_le_msgt {
  BSSMAP_LE_MSGT_PERFORM_LOC_REQ = 0x2b ,
  BSSMAP_LE_MSGT_PERFORM_LOC_RESP = 0x2d ,
  BSSMAP_LE_MSGT_PERFORM_LOC_ABORT = 0x2e ,
  BSSMAP_LE_MSGT_PERFORM_LOC_INFO = 0x2f ,
  BSSMAP_LE_MSGT_ASSIST_INFO_REQ = 0x20 ,
  BSSMAP_LE_MSGT_ASSIST_INFO_RESP = 0x21 ,
  BSSMAP_LE_MSGT_CONN_ORIENTED_INFO = 0x2a ,
  BSSMAP_LE_MSGT_CONN_LESS_INFO = 0x3a ,
  BSSMAP_LE_MSGT_RESET = 0x30 ,
  BSSMAP_LE_MSGT_RESET_ACK = 0x31
}
 
enum  bssmap_le_iei {
  BSSMAP_LE_IEI_LCS_QoS = 0x3e ,
  BSSMAP_LE_IEI_LCS_PRIORITY = 0x43 ,
  BSSMAP_LE_IEI_LOCATION_TYPE = 0x44 ,
  BSSMAP_LE_IEI_GANSS_LOCATION_TYPE = 0x82 ,
  BSSMAP_LE_IEI_GEO_LOCATION = 0x45 ,
  BSSMAP_LE_IEI_POSITIONING_DATA = 0x46 ,
  BSSMAP_LE_IEI_GANSS_POS_DATA = 0x83 ,
  BSSMAP_LE_IEI_VELOCITY_DATA = 0x55 ,
  BSSMAP_LE_IEI_LCS_CAUSE = 0x47 ,
  BSSMAP_LE_IEI_LCS_CLIENT_TYPE = 0x48 ,
  BSSMAP_LE_IEI_APDU = 0x49 ,
  BSSMAP_LE_IEI_NET_ELEM_ID = 0x4a ,
  BSSMAP_LE_IEI_REQ_GPS_ASS_D = 0x4b ,
  BSSMAP_LE_IEI_REQ_GANSS_ASS_D = 0x41 ,
  BSSMAP_LE_IEI_DECIPH_KEYS = 0x4c ,
  BSSMAP_LE_IEI_RET_ERR_REQ = 0x4d ,
  BSSMAP_LE_IEI_RET_ERR_CAUSE = 0x4e ,
  BSSMAP_LE_IEI_SEGMENTATION = 0x4f ,
  BSSMAP_LE_IEI_CLASSMARK3_INFO = 0x13 ,
  BSSMAP_LE_IEI_CAUSE = 0x4 ,
  BSSMAP_LE_IEI_CELL_ID = 0x5 ,
  BSSMAP_LE_IEI_CHOSEN_CHAN = 0x21 ,
  BSSMAP_LE_IEI_IMSI = 0x0 ,
  BSSMAP_LE_IEI_LCS_CAPABILITY = 0x50 ,
  BSSMAP_LE_IEI_PKT_MEAS_REP = 0x51 ,
  BSSMAP_LE_IEI_CELL_ID_LIST = 0x52 ,
  BSSMAP_LE_IEI_IMEI = 0x80 ,
  BSSMAP_LE_IEI_BSS_MLAT_CAP = 0x84 ,
  BSSMAP_LE_IEI_CELL_INFO_LIST = 0x85 ,
  BSSMAP_LE_IEI_BTS_RX_ACC_LVL = 0x86 ,
  BSSMAP_LE_IEI_MLAT_METHOD = 0x87 ,
  BSSMAP_LE_IEI_MLAT_TA = 0x88 ,
  BSSMAP_LE_IEI_MS_SYNC_ACC = 0x89 ,
  BSSMAP_LE_IEI_SHORT_ID_SET = 0x8a ,
  BSSMAP_LE_IEI_RANDOM_ID_SET = 0x8b ,
  BSSMAP_LE_IEI_SHORT_BSS_ID = 0x8c ,
  BSSMAP_LE_IEI_RANDOM_ID = 0x8d ,
  BSSMAP_LE_IEI_SHORT_ID = 0x8e ,
  BSSMAP_LE_IEI_COVERAGE_CLASS = 0x8f ,
  BSSMAP_LE_IEI_MTA_ACC_SEC_RQD = 0x90
}
 
enum  bssmap_le_apdu_proto {
  BSSMAP_LE_APDU_PROT_RESERVED = 0 ,
  BSSMAP_LE_APDU_PROT_BSSLAP = 1 ,
  BSSMAP_LE_APDU_PROT_LLP = 2 ,
  BSSMAP_LE_APDU_PROT_SMLCPP = 3
}
 
enum  bssmap_le_location_information {
  BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC = 0x0 ,
  BSSMAP_LE_LOC_INFO_ASSIST_TARGET_MS = 0x1 ,
  BSSMAP_LE_LOC_INFO_BC_DECIPHER_KEYS = 0x2
}
 
enum  bssmap_le_positioning_method {
  BSSMAP_LE_POS_METHOD_OMITTED = 0x0 ,
  BSSMAP_LE_POS_METHOD_MOBILE_ASSISTED_E_OTD = 0x1 ,
  BSSMAP_LE_POS_METHOD_MOBILE_BASED_E_OTD = 0x2 ,
  BSSMAP_LE_POS_METHOD_ASSISTED_GPS = 0x3
}
 
enum  bssmap_le_lcs_client_type {
  BSSMAP_LE_LCS_CTYPE_VALUE_ADDED_UNSPECIFIED = 0x0 ,
  BSSMAP_LE_LCS_CTYPE_PLMN_OPER_UNSPECIFIED = 0x20 ,
  BSSMAP_LE_LCS_CTYPE_PLMN_OPER_BCAST_SERVICE = 0x21 ,
  BSSMAP_LE_LCS_CTYPE_PLMN_OPER_OAM = 0x22 ,
  BSSMAP_LE_LCS_CTYPE_PLMN_OPER_ANON_STATS = 0x23 ,
  BSSMAP_LE_LCS_CTYPE_PLMN_OPER_TGT_MS_SVC = 0x24 ,
  BSSMAP_LE_LCS_CTYPE_EMERG_SVC_UNSPECIFIED = 0x30 ,
  BSSMAP_LE_LCS_CTYPE_LI_UNSPECIFIED = 0x40
}
 

Functions

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 const char * osmo_bssmap_le_msgt_name (enum bssmap_le_msgt val)
 
static const char * osmo_bssmap_le_iei_name (enum bssmap_le_iei val)
 
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...
 
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...
 
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...
 
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...
 
struct osmo_bssmap_le_lcs_qos __attribute__ ((packed))
 
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)
 
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)
 
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...
 

Variables

const struct value_string osmo_bssmap_le_msgt_names []
 
const struct value_string osmo_bssmap_le_iei_names []
 
enum bssap_le_msg_discr __attribute__
 
static const struct tlv_definition osmo_bssmap_le_tlvdef
 
const struct value_string osmo_bssmap_le_msgt_names []
 
const struct value_string osmo_bssmap_le_iei_names []
 

Detailed Description

Macro Definition Documentation

◆ BSSAP_LE_MSG_HEADROOM

#define BSSAP_LE_MSG_HEADROOM   BSSMAP_MSG_HEADROOM

◆ BSSAP_LE_MSG_SIZE

#define BSSAP_LE_MSG_SIZE   BSSMAP_MSG_SIZE

◆ DEC_ERR

#define DEC_ERR (   RC,
  MSG_TYPE,
  IEI,
  CAUSE,
  fmt,
  args... 
)
Value:
do { \
DEC_ERR_NO_RETURN(RC, MSG_TYPE, IEI, CAUSE, fmt, ##args); \
return RC; \
} while(0)

◆ DEC_ERR_NO_RETURN

#define DEC_ERR_NO_RETURN (   RC,
  MSG_TYPE,
  IEI,
  CAUSE,
  fmt,
  args... 
)
Value:
do { \
if (err && !*err) { \
*err = talloc_zero(err_ctx, struct osmo_bssmap_le_err); \
**err = (struct osmo_bssmap_le_err){ \
.rc = (RC), \
.msg_type = (MSG_TYPE), \
.iei = (IEI), \
.cause = (CAUSE), \
}; \
(*err)->logmsg = talloc_asprintf(*err, "Error decoding BSSMAP-LE%s%s%s%s%s: " fmt, \
(MSG_TYPE) >= 0 ? " " : "", \
(MSG_TYPE) >= 0 ? osmo_bssmap_le_msgt_name(MSG_TYPE) : "", \
(IEI) >= 0 ? ": " : "", \
(IEI) >= 0 ? osmo_bssmap_le_iei_name(IEI) : "", \
(IEI) >= 0 ? " IE" : "", \
##args); \
} \
} while(0)
static const char * osmo_bssmap_le_iei_name(enum bssmap_le_iei val)
Definition: bssmap_le.h:56
static const char * osmo_bssmap_le_msgt_name(enum bssmap_le_msgt val)
Definition: bssmap_le.h:52
Definition: bssmap_le.h:32
enum lcs_cause cause
Definition: bssmap_le.h:36
enum bssmap_le_msgt msg_type
Definition: bssmap_le.h:34

◆ DEC_IE_MANDATORY

#define DEC_IE_MANDATORY (   MSG_TYPE,
  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, MSG_TYPE, IEI, LCS_CAUSE_DATA_MISSING_IN_REQ, "missing mandatory IE"); \
rc = DEC_FUN(DEC_FUN_ARG, MSG_TYPE, IEI, err, err_ctx, e->val, e->len); \
if (rc) \
DEC_ERR(rc, MSG_TYPE, IEI, LCS_CAUSE_UNSPECIFIED, "cannot parse IE"); \
} while (0)
@ LCS_CAUSE_DATA_MISSING_IN_REQ
Definition: gsm_49_031.h:40
@ LCS_CAUSE_UNSPECIFIED
Definition: gsm_49_031.h:37
#define TLVP_GET(_tp, tag)
Return pointer to a TLV element if it is present.
Definition: tlv.h:573
Entry in a TLV parser array.
Definition: tlv.h:502
uint16_t len
length
Definition: tlv.h:503
const uint8_t * val
pointer to value
Definition: tlv.h:504

◆ DEC_IE_OPTIONAL

#define DEC_IE_OPTIONAL (   MSG_TYPE,
  IEI,
  DEC_FUN,
  DEC_FUN_ARG 
)
Value:
do { \
const struct tlv_p_entry *e; \
int rc; \
if ((e = TLVP_GET(tp, IEI))) {\
rc = DEC_FUN(DEC_FUN_ARG, MSG_TYPE, IEI, err, err_ctx, e->val, e->len); \
if (rc) \
DEC_ERR(rc, MSG_TYPE, IEI, LCS_CAUSE_UNSPECIFIED, "cannot parse IE"); \
} \
} while (0)

◆ DEC_IE_OPTIONAL_FLAG

#define DEC_IE_OPTIONAL_FLAG (   MSG_TYPE,
  IEI,
  DEC_FUN,
  DEC_FUN_ARG,
  PRESENCE_FLAG 
)
Value:
do { \
const struct tlv_p_entry *e; \
int rc; \
if ((e = TLVP_GET(tp, IEI))) {\
rc = DEC_FUN(DEC_FUN_ARG, MSG_TYPE, IEI, err, err_ctx, e->val, e->len); \
if (rc) \
DEC_ERR(rc, MSG_TYPE, IEI, LCS_CAUSE_UNSPECIFIED, "cannot parse IE"); \
PRESENCE_FLAG = true; \
} \
} while (0)

Enumeration Type Documentation

◆ bssap_le_msg_discr

Enumerator
BSSAP_LE_MSG_DISCR_BSSMAP_LE 

◆ bssmap_le_apdu_proto

Enumerator
BSSMAP_LE_APDU_PROT_RESERVED 
BSSMAP_LE_APDU_PROT_BSSLAP 
BSSMAP_LE_APDU_PROT_LLP 
BSSMAP_LE_APDU_PROT_SMLCPP 

◆ bssmap_le_iei

Enumerator
BSSMAP_LE_IEI_LCS_QoS 
BSSMAP_LE_IEI_LCS_PRIORITY 
BSSMAP_LE_IEI_LOCATION_TYPE 
BSSMAP_LE_IEI_GANSS_LOCATION_TYPE 
BSSMAP_LE_IEI_GEO_LOCATION 
BSSMAP_LE_IEI_POSITIONING_DATA 
BSSMAP_LE_IEI_GANSS_POS_DATA 
BSSMAP_LE_IEI_VELOCITY_DATA 
BSSMAP_LE_IEI_LCS_CAUSE 
BSSMAP_LE_IEI_LCS_CLIENT_TYPE 
BSSMAP_LE_IEI_APDU 
BSSMAP_LE_IEI_NET_ELEM_ID 
BSSMAP_LE_IEI_REQ_GPS_ASS_D 
BSSMAP_LE_IEI_REQ_GANSS_ASS_D 
BSSMAP_LE_IEI_DECIPH_KEYS 
BSSMAP_LE_IEI_RET_ERR_REQ 
BSSMAP_LE_IEI_RET_ERR_CAUSE 
BSSMAP_LE_IEI_SEGMENTATION 
BSSMAP_LE_IEI_CLASSMARK3_INFO 
BSSMAP_LE_IEI_CAUSE 
BSSMAP_LE_IEI_CELL_ID 
BSSMAP_LE_IEI_CHOSEN_CHAN 
BSSMAP_LE_IEI_IMSI 
BSSMAP_LE_IEI_LCS_CAPABILITY 
BSSMAP_LE_IEI_PKT_MEAS_REP 
BSSMAP_LE_IEI_CELL_ID_LIST 
BSSMAP_LE_IEI_IMEI 
BSSMAP_LE_IEI_BSS_MLAT_CAP 
BSSMAP_LE_IEI_CELL_INFO_LIST 
BSSMAP_LE_IEI_BTS_RX_ACC_LVL 
BSSMAP_LE_IEI_MLAT_METHOD 
BSSMAP_LE_IEI_MLAT_TA 
BSSMAP_LE_IEI_MS_SYNC_ACC 
BSSMAP_LE_IEI_SHORT_ID_SET 
BSSMAP_LE_IEI_RANDOM_ID_SET 
BSSMAP_LE_IEI_SHORT_BSS_ID 
BSSMAP_LE_IEI_RANDOM_ID 
BSSMAP_LE_IEI_SHORT_ID 
BSSMAP_LE_IEI_COVERAGE_CLASS 
BSSMAP_LE_IEI_MTA_ACC_SEC_RQD 

◆ bssmap_le_lcs_client_type

Enumerator
BSSMAP_LE_LCS_CTYPE_VALUE_ADDED_UNSPECIFIED 
BSSMAP_LE_LCS_CTYPE_PLMN_OPER_UNSPECIFIED 
BSSMAP_LE_LCS_CTYPE_PLMN_OPER_BCAST_SERVICE 
BSSMAP_LE_LCS_CTYPE_PLMN_OPER_OAM 
BSSMAP_LE_LCS_CTYPE_PLMN_OPER_ANON_STATS 
BSSMAP_LE_LCS_CTYPE_PLMN_OPER_TGT_MS_SVC 
BSSMAP_LE_LCS_CTYPE_EMERG_SVC_UNSPECIFIED 
BSSMAP_LE_LCS_CTYPE_LI_UNSPECIFIED 

◆ bssmap_le_location_information

Enumerator
BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC 
BSSMAP_LE_LOC_INFO_ASSIST_TARGET_MS 
BSSMAP_LE_LOC_INFO_BC_DECIPHER_KEYS 

◆ bssmap_le_msgt

Enumerator
BSSMAP_LE_MSGT_PERFORM_LOC_REQ 
BSSMAP_LE_MSGT_PERFORM_LOC_RESP 
BSSMAP_LE_MSGT_PERFORM_LOC_ABORT 
BSSMAP_LE_MSGT_PERFORM_LOC_INFO 
BSSMAP_LE_MSGT_ASSIST_INFO_REQ 
BSSMAP_LE_MSGT_ASSIST_INFO_RESP 
BSSMAP_LE_MSGT_CONN_ORIENTED_INFO 
BSSMAP_LE_MSGT_CONN_LESS_INFO 
BSSMAP_LE_MSGT_RESET 
BSSMAP_LE_MSGT_RESET_ACK 

◆ bssmap_le_positioning_method

Enumerator
BSSMAP_LE_POS_METHOD_OMITTED 
BSSMAP_LE_POS_METHOD_MOBILE_ASSISTED_E_OTD 
BSSMAP_LE_POS_METHOD_MOBILE_BASED_E_OTD 
BSSMAP_LE_POS_METHOD_ASSISTED_GPS 

◆ lcs_cause

enum lcs_cause

3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former.

Enumerator
LCS_CAUSE_UNSPECIFIED 
LCS_CAUSE_SYSTEM_FAILURE 
LCS_CAUSE_PROTOCOL_ERROR 
LCS_CAUSE_DATA_MISSING_IN_REQ 
LCS_CAUSE_UNEXP_DATA_IN_REQ 
LCS_CAUSE_POS_METH_FAILURE 
LCS_CAUSE_TGT_MS_UNREACHABLE 
LCS_CAUSE_REQUEST_ABORTED 
LCS_CAUSE_FACILITY_NOTSUPP 
LCS_CAUSE_INTER_BSC_HO 
LCS_CAUSE_INTRA_BSC_HO 
LCS_CAUSE_CONGESTION 
LCS_CAUSE_INTER_NSE_CHG 
LCS_CAUSE_RA_UPDAT 
LCS_CAUSE_PTMSI_REALLOC 
LCS_CAUSE_GPRS_SUSPENSION 

Function Documentation

◆ __attribute__()

struct osmo_bssmap_le_lcs_qos __attribute__ ( (packed)  )

◆ osmo_bssap_le_dec()

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).

Parameters
[out]pduWrite decoded values here.
[in]dataPointer to BSSMAP-LE PDU raw data.
[in]lenData length to decode.
Returns
NULL upon success, a human readable error message on failure.

References BSSAP_LE_DEC_ERR, BSSAP_LE_MSG_DISCR_BSSMAP_LE, bssap_le_pdu::bssmap_le, h, osmo_bssmap_le_err::logmsg, msg, msgb_l2, msgb_l2len(), osmo_bssmap_le_dec(), and osmo_bssmap_le_err::rc.

◆ osmo_bssap_le_enc()

struct msgb * osmo_bssap_le_enc ( const struct bssap_le_pdu pdu)

Encode BSSAP-LE PDU returned in new msgb (3GPP TS 49.031).

By spec, BSSAP-LE contains either BSSMAP-LE or DTAP.

Parameters
[in]pduPDU data to encode.
Returns
msgb with encoded data and l2h set to the start.

References BSSAP_LE_MSG_DISCR_BSSMAP_LE, BSSAP_LE_MSG_HEADROOM, BSSAP_LE_MSG_SIZE, bssap_le_pdu::bssmap_le, bssap_le_pdu::discr, msg, bssmap_le_pdu::msg_type, msgb_alloc_headroom(), msgb_free(), msgb_length(), msgb_tv_push(), osmo_bssmap_le_enc(), and osmo_bssmap_le_msgt_name().

◆ osmo_bssap_le_pdu_to_str_buf()

int osmo_bssap_le_pdu_to_str_buf ( char *  buf,
size_t  buflen,
const struct bssap_le_pdu bssap_le 
)

◆ osmo_bssap_le_pdu_to_str_c()

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.

Parameters
[in]ctxTalloc context to allocate string buffer from.
[in]bssap_leDecoded BSSAP-LE PDU data.
Returns
string.

References osmo_bssap_le_pdu_to_str_buf(), and OSMO_NAME_C_IMPL.

◆ osmo_bssmap_le_dec()

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 
)
static

◆ osmo_bssmap_le_dec_conn_oriented_info()

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

◆ osmo_bssmap_le_dec_perform_loc_abort()

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

◆ osmo_bssmap_le_dec_perform_loc_req()

◆ osmo_bssmap_le_dec_perform_loc_resp()

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

◆ osmo_bssmap_le_dec_reset()

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

◆ osmo_bssmap_le_enc()

◆ osmo_bssmap_le_enc_conn_oriented_info()

static int osmo_bssmap_le_enc_conn_oriented_info ( struct msgb msg,
const struct bssmap_le_conn_oriented_info params 
)
static

References msg, osmo_bssmap_le_ie_enc_apdu(), and params.

Referenced by osmo_bssmap_le_enc().

◆ osmo_bssmap_le_enc_perform_loc_abort()

static int osmo_bssmap_le_enc_perform_loc_abort ( struct msgb msg,
const struct lcs_cause_ie params 
)
static

◆ osmo_bssmap_le_enc_perform_loc_req()

◆ osmo_bssmap_le_enc_perform_loc_resp()

static int osmo_bssmap_le_enc_perform_loc_resp ( struct msgb msg,
const struct bssmap_le_perform_loc_resp params 
)
static

◆ osmo_bssmap_le_enc_reset()

static int osmo_bssmap_le_enc_reset ( struct msgb msg,
enum gsm0808_cause  cause 
)
static

References cause, gsm0808_enc_cause(), and msg.

Referenced by osmo_bssmap_le_enc().

◆ osmo_bssmap_le_ie_dec_apdu()

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

◆ osmo_bssmap_le_ie_dec_cell_id()

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

◆ osmo_bssmap_le_ie_dec_gad()

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 
)
static

◆ osmo_bssmap_le_ie_dec_imei()

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

◆ osmo_bssmap_le_ie_dec_imsi()

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

◆ osmo_bssmap_le_ie_dec_lcs_client_type()

◆ osmo_bssmap_le_ie_dec_lcs_priority()

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

◆ osmo_bssmap_le_ie_dec_lcs_qos()

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 
)
static

◆ osmo_bssmap_le_ie_dec_location_type()

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.

Parameters
[out]ltBuffer to write decoded values to.
[in]elemPointer to the value part, the V of a TLV.
[in]lenLength, the L of a TLV.
Returns
0 on success, negative on error; lt is always overwritten: cleared on error, populated with values on success.

References BSSMAP_LE_LOC_INFO_ASSIST_TARGET_MS, BSSMAP_LE_LOC_INFO_BC_DECIPHER_KEYS, BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC, BSSMAP_LE_POS_METHOD_ASSISTED_GPS, BSSMAP_LE_POS_METHOD_MOBILE_ASSISTED_E_OTD, BSSMAP_LE_POS_METHOD_MOBILE_BASED_E_OTD, BSSMAP_LE_POS_METHOD_OMITTED, DEC_ERR, iei, LCS_CAUSE_UNSPECIFIED, len, bssmap_le_location_type::location_information, and bssmap_le_location_type::positioning_method.

Referenced by osmo_bssmap_le_dec_perform_loc_req().

◆ osmo_bssmap_le_ie_enc_apdu()

static int osmo_bssmap_le_ie_enc_apdu ( struct msgb msg,
const struct bsslap_pdu bsslap 
)
static

◆ osmo_bssmap_le_ie_enc_lcs_client_type()

static uint8_t osmo_bssmap_le_ie_enc_lcs_client_type ( struct msgb msg,
enum bssmap_le_lcs_client_type  client_type 
)
static

Encode full BSSMAP-LE LCS Client Type IE, including IEI tag and length.

Parameters
[in,out]msgMessage buffer to append to.
[in]client_typeValue to enconde.
Returns
length of bytes written to the msgb.

References BSSMAP_LE_IEI_LCS_CLIENT_TYPE, msg, msgb_put_u8(), and OSMO_ASSERT.

Referenced by osmo_bssmap_le_enc_perform_loc_req().

◆ osmo_bssmap_le_ie_enc_lcs_priority()

static uint8_t osmo_bssmap_le_ie_enc_lcs_priority ( struct msgb msg,
uint8_t  priority 
)
static

Encode full BSSMAP-LE LCS Priority IE, including IEI tag and length.

Parameters
[in,out]msgMessage buffer to append to.
[in]priorityValue to enconde.
Returns
length of bytes written to the msgb.

References BSSMAP_LE_IEI_LCS_PRIORITY, msg, msgb_put_u8(), and OSMO_ASSERT.

Referenced by osmo_bssmap_le_enc_perform_loc_req().

◆ osmo_bssmap_le_ie_enc_lcs_qos()

static uint8_t osmo_bssmap_le_ie_enc_lcs_qos ( struct msgb msg,
const struct osmo_bssmap_le_lcs_qos qos 
)
static

Encode full BSSMAP-LE LCS QoS IE, including IEI tag and length.

Parameters
[in,out]msgMessage buffer to append to.
[in]priorityValue to enconde.
Returns
length of bytes written to the msgb.

References BSSMAP_LE_IEI_LCS_QoS, msg, msgb_tlv_put(), and OSMO_ASSERT.

Referenced by osmo_bssmap_le_enc_perform_loc_req().

◆ osmo_bssmap_le_ie_enc_location_type()

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.

Parameters
[in,out]msgMessage buffer to append to.
[in]location_typeValues to enconde.
Returns
length of bytes written to the msgb.

References BSSMAP_LE_IEI_LOCATION_TYPE, BSSMAP_LE_LOC_INFO_ASSIST_TARGET_MS, BSSMAP_LE_LOC_INFO_BC_DECIPHER_KEYS, bssmap_le_location_type::location_information, msg, msgb_put(), msgb_put_u8(), OSMO_ASSERT, and bssmap_le_location_type::positioning_method.

Referenced by gsm0808_create_perform_location_request(), and osmo_bssmap_le_enc_perform_loc_req().

◆ osmo_bssmap_le_iei_name()

static const char * osmo_bssmap_le_iei_name ( enum bssmap_le_iei  val)
inlinestatic

◆ osmo_bssmap_le_msgt()

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.

from a msgb_l3().

Parameters
[in]dataBSSAP-LE PDU data, starting with BSSAP-LE discriminator.
[in]lenLength of data in bytes.
Returns
bssmap_le_msgt or negative on error or non-BSSMAP-LE discriminator.

References BSSAP_LE_MSG_DISCR_BSSMAP_LE, data, h, and len.

◆ osmo_bssmap_le_msgt_name()

static const char * osmo_bssmap_le_msgt_name ( enum bssmap_le_msgt  val)
inlinestatic

◆ osmo_lcs_cause_dec()

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.

Identically used in 3GPP TS 48.008 3.2.2.66.

Parameters
[out]lcs_causeWrite decoded LCS Cause values here.
[in]dataEncoded cause bytes.
[in]lenLength of data in bytes.
Returns
0 on success, negative on error.

References data, DEC_ERR, iei, LCS_CAUSE_UNSPECIFIED, and len.

Referenced by osmo_bssmap_le_dec_perform_loc_abort(), and osmo_bssmap_le_dec_perform_loc_resp().

◆ osmo_lcs_cause_enc()

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.

Identically used in 3GPP TS 48.008 3.2.2.66. Usage example:

uint8_t *l = msgb_tl_put(msg, BSSMAP_LE_IEI_LCS_CAUSE); int rc = osmo_lcs_cause_enc(msg, &lcs_cause); if (rc < 0) goto error; *l = rc;

Parameters
[in,out]msgMessage buffer to append the LCS Cause values to.
[in]lcs_causeLCS Cause values to enconde.
Returns
length of bytes written to the msgb.

References LCS_CAUSE_POS_METH_FAILURE, msg, and msgb_put_u8().

Referenced by gsm0808_create_perform_location_response(), gsm0808_enc_lcs_cause(), osmo_bssmap_le_enc_perform_loc_abort(), and osmo_bssmap_le_enc_perform_loc_resp().

Variable Documentation

◆ __attribute__

enum bssap_le_msg_discr __attribute__

◆ osmo_bssmap_le_iei_names [1/2]

const struct value_string osmo_bssmap_le_iei_names[]
extern

Referenced by osmo_bssmap_le_iei_name().

◆ osmo_bssmap_le_iei_names [2/2]

const struct value_string osmo_bssmap_le_iei_names[]

Referenced by osmo_bssmap_le_iei_name().

◆ osmo_bssmap_le_msgt_names [1/2]

const struct value_string osmo_bssmap_le_msgt_names[]
extern

◆ osmo_bssmap_le_msgt_names [2/2]

const struct value_string osmo_bssmap_le_msgt_names[]
Initial value:
= {
{ BSSMAP_LE_MSGT_PERFORM_LOC_REQ, "PERFORM LOCATION REQUEST" },
{ BSSMAP_LE_MSGT_PERFORM_LOC_RESP, "PERFORM LOCATION RESPONSE" },
{ BSSMAP_LE_MSGT_PERFORM_LOC_ABORT, "PERFORM LOCATION ABORT" },
{ BSSMAP_LE_MSGT_PERFORM_LOC_INFO, "PERFORM LOCATION INFO" },
{ BSSMAP_LE_MSGT_ASSIST_INFO_REQ, "ASSISTANCE INFORMATION REQUEST" },
{ BSSMAP_LE_MSGT_ASSIST_INFO_RESP, "ASSISTANCE INFORMATION RESPONSE" },
{ BSSMAP_LE_MSGT_CONN_ORIENTED_INFO, "CONNECTION ORIENTED INFORMATON" },
{ BSSMAP_LE_MSGT_CONN_LESS_INFO, "CONNECTIONLESS INFORMATION" },
{ BSSMAP_LE_MSGT_RESET, "RESET" },
{ BSSMAP_LE_MSGT_RESET_ACK, "RESET ACKNOWLEDGE" },
{}
}
@ BSSMAP_LE_MSGT_CONN_LESS_INFO
Definition: gsm_49_031.h:91
@ BSSMAP_LE_MSGT_RESET
Definition: gsm_49_031.h:92
@ BSSMAP_LE_MSGT_ASSIST_INFO_REQ
Definition: gsm_49_031.h:88
@ BSSMAP_LE_MSGT_PERFORM_LOC_REQ
Definition: gsm_49_031.h:84
@ BSSMAP_LE_MSGT_PERFORM_LOC_ABORT
Definition: gsm_49_031.h:86
@ BSSMAP_LE_MSGT_RESET_ACK
Definition: gsm_49_031.h:93
@ BSSMAP_LE_MSGT_PERFORM_LOC_INFO
Definition: gsm_49_031.h:87
@ BSSMAP_LE_MSGT_ASSIST_INFO_RESP
Definition: gsm_49_031.h:89
@ BSSMAP_LE_MSGT_PERFORM_LOC_RESP
Definition: gsm_49_031.h:85
@ BSSMAP_LE_MSGT_CONN_ORIENTED_INFO
Definition: gsm_49_031.h:90

Referenced by osmo_bssmap_le_msgt_name().

◆ osmo_bssmap_le_tlvdef

const struct tlv_definition osmo_bssmap_le_tlvdef
static

Referenced by osmo_bssmap_le_dec().