libosmogsm  1.5.1
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
3GPP TS 48.071 BSS LCS Assistance Protocol (BSSLAP).

Files

file  bsslap.h
 Message encoding and decoding for 3GPP TS 48.071 BSS LCS Assistance Protocol (BSSLAP).
 
file  gsm_48_071.h
 
file  bsslap.c
 Message encoding and decoding for 3GPP TS 48.071 BSSLAP protocol.
 

Data Structures

struct  osmo_bsslap_err
 
struct  bsslap_ta_response
 
struct  bsslap_ta_layer3
 
struct  bsslap_reset
 
struct  bsslap_pdu
 

Macros

#define DEC_ERR(RC, MSG_TYPE, IEI, CAUSE, fmt, args...)
 

Enumerations

enum  bsslap_msgt {
  BSSLAP_MSGT_TA_REQUEST = 0x1,
  BSSLAP_MSGT_TA_RESPONSE = 0x2,
  BSSLAP_MSGT_REJECT = 0xa,
  BSSLAP_MSGT_RESET = 0xb,
  BSSLAP_MSGT_ABORT = 0xc,
  BSSLAP_MSGT_TA_LAYER3 = 0xd,
  BSSLAP_MSGT_MS_POS_CMD = 0xf,
  BSSLAP_MSGT_MS_POS_RESP = 0x10,
  BSSLAP_MSGT_UTDOA_REQ = 0x11,
  BSSLAP_MSGT_UTDOA_RESP = 0x12
}
 
enum  bsslap_cause {
  BSSLAP_CAUSE_CONGESTION = 0x0,
  BSSLAP_CAUSE_CHAN_MODE_NOT_SUPP = 0x1,
  BSSLAP_CAUSE_POS_PROC_NOT_SUPP = 0x2,
  BSSLAP_CAUSE_OTHER_RADIO_EVT_FAIL = 0x3,
  BSSLAP_CAUSE_INTRA_BSS_HO = 0x4,
  BSSLAP_CAUSE_SUPERV_TIMER_EXPIRED = 0x5,
  BSSLAP_CAUSE_INTER_BSS_HO = 0x6,
  BSSLAP_CAUSE_LOSS_SIG_CONN_MS = 0x7,
  BSSLAP_CAUSE_INCORR_SERV_CELL_ID = 0x8,
  BSSLAP_CAUSE_BSSAP_LE_SEGMENT_ERR = 0x9,
  BSSLAP_CAUSE_CONCUR_POS_PROC_NOT_EN = 0xa
}
 
enum  bsslap_iei {
  BSSLAP_IEI_TA = 0x1,
  BSSLAP_IEI_CELL_ID = 0x9,
  BSSLAP_IEI_CHAN_DESC = 0x10,
  BSSLAP_IEI_MEAS_REP = 0x14,
  BSSLAP_IEI_CAUSE = 0x18,
  BSSLAP_IEI_RRLP_FLAG = 0x19,
  BSSLAP_IEI_RRLP = 0x1b,
  BSSLAP_IEI_CELL_ID_LIST = 0x1c,
  BSSLAP_IEI_ENH_MEAS_REP = 0x1d,
  BSSLAP_IEI_LAC = 0x1e,
  BSSLAP_IEI_FREQ_LIST = 0x21,
  BSSLAP_IEI_MS_POWER = 0x22,
  BSSLAP_IEI_DELTA_TIMER = 0x23,
  BSSLAP_IEI_SERVING_CELL_ID = 0x24,
  BSSLAP_IEI_ENCR_KEY = 0x25,
  BSSLAP_IEI_CIPH_MODE_SET = 0x26,
  BSSLAP_IEI_CHAN_MODE = 0x27,
  BSSLAP_IEI_MR_CONFIG = 0x28,
  BSSLAP_IEI_POLLING_REPETITION = 0x29,
  BSSLAP_IEI_PACKET_CHAN_DESC = 0x2a,
  BSSLAP_IEI_TLLI = 0x2b,
  BSSLAP_IEI_TFI = 0x2c,
  BSSLAP_IEI_TBF_START_TIME = 0x2d,
  BSSLAP_IEI_PWRUP_START_TIME = 0x2e,
  BSSLAP_IEI_LONG_ENCR_KEY = 0x2f,
  BSSLAP_IEI_CONCUR_POS_PROC_F = 0x30
}
 

Functions

static const char * osmo_bsslap_msgt_name (enum bsslap_msgt val)
 
static const char * osmo_bsslap_iei_name (enum bsslap_iei val)
 
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...
 
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)
 

Variables

const struct value_string osmo_bsslap_msgt_names []
 
const struct value_string osmo_bsslap_iei_names []
 
enum bsslap_msgt __attribute__
 
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

Macro Definition Documentation

#define DEC_ERR (   RC,
  MSG_TYPE,
  IEI,
  CAUSE,
  fmt,
  args... 
)
Value:
do { \
if (err && !*err) { \
*err = talloc_zero(err_ctx, struct osmo_bsslap_err); \
**err = (struct osmo_bsslap_err){ \
.rc = (RC), \
.msg_type = (MSG_TYPE), \
.iei = (IEI), \
.cause = (CAUSE), \
.logmsg = talloc_asprintf(*err, "Error decoding BSSLAP%s%s%s%s%s: " fmt, \
(MSG_TYPE) >= 0 ? " " : "", \
(MSG_TYPE) >= 0 ? osmo_bsslap_msgt_name(MSG_TYPE) : "", \
(IEI) >= 0 ? ": " : "", \
(IEI) >= 0 ? osmo_bsslap_iei_name(IEI) : "", \
(IEI) >= 0 ? " IE" : "", \
##args), \
}; \
} \
return RC; \
} while(0)
enum lcs_cause cause
Definition: bsslap.h:40
if(vty->type==VTY_SHELL_SERV)
static const char * osmo_bsslap_msgt_name(enum bsslap_msgt val)
Definition: bsslap.h:45
static const char * osmo_bsslap_iei_name(enum bsslap_iei val)
Definition: bsslap.h:49
Definition: bsslap.h:36
enum bsslap_msgt msg_type
Definition: bsslap.h:38

Referenced by osmo_bsslap_dec(), osmo_bsslap_ie_dec_cause(), osmo_bsslap_ie_dec_cell_id(), osmo_bsslap_ie_dec_chan_desc(), and osmo_bsslap_ie_dec_ta().

Enumeration Type Documentation

Enumerator
BSSLAP_CAUSE_CONGESTION 
BSSLAP_CAUSE_CHAN_MODE_NOT_SUPP 
BSSLAP_CAUSE_POS_PROC_NOT_SUPP 
BSSLAP_CAUSE_OTHER_RADIO_EVT_FAIL 
BSSLAP_CAUSE_INTRA_BSS_HO 
BSSLAP_CAUSE_SUPERV_TIMER_EXPIRED 
BSSLAP_CAUSE_INTER_BSS_HO 
BSSLAP_CAUSE_LOSS_SIG_CONN_MS 
BSSLAP_CAUSE_INCORR_SERV_CELL_ID 
BSSLAP_CAUSE_BSSAP_LE_SEGMENT_ERR 
BSSLAP_CAUSE_CONCUR_POS_PROC_NOT_EN 
enum bsslap_iei
Enumerator
BSSLAP_IEI_TA 
BSSLAP_IEI_CELL_ID 
BSSLAP_IEI_CHAN_DESC 
BSSLAP_IEI_MEAS_REP 
BSSLAP_IEI_CAUSE 
BSSLAP_IEI_RRLP_FLAG 
BSSLAP_IEI_RRLP 
BSSLAP_IEI_CELL_ID_LIST 
BSSLAP_IEI_ENH_MEAS_REP 
BSSLAP_IEI_LAC 
BSSLAP_IEI_FREQ_LIST 
BSSLAP_IEI_MS_POWER 
BSSLAP_IEI_DELTA_TIMER 
BSSLAP_IEI_SERVING_CELL_ID 
BSSLAP_IEI_ENCR_KEY 
BSSLAP_IEI_CIPH_MODE_SET 
BSSLAP_IEI_CHAN_MODE 
BSSLAP_IEI_MR_CONFIG 
BSSLAP_IEI_POLLING_REPETITION 
BSSLAP_IEI_PACKET_CHAN_DESC 
BSSLAP_IEI_TLLI 
BSSLAP_IEI_TFI 
BSSLAP_IEI_TBF_START_TIME 
BSSLAP_IEI_PWRUP_START_TIME 
BSSLAP_IEI_LONG_ENCR_KEY 
BSSLAP_IEI_CONCUR_POS_PROC_F 
Enumerator
BSSLAP_MSGT_TA_REQUEST 
BSSLAP_MSGT_TA_RESPONSE 
BSSLAP_MSGT_REJECT 
BSSLAP_MSGT_RESET 
BSSLAP_MSGT_ABORT 
BSSLAP_MSGT_TA_LAYER3 
BSSLAP_MSGT_MS_POS_CMD 
BSSLAP_MSGT_MS_POS_RESP 
BSSLAP_MSGT_UTDOA_REQ 
BSSLAP_MSGT_UTDOA_RESP 

Function Documentation

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

Parameters
[out]pduWrite decoded values here.
[out]errReturned pointer to error info, dynamically allocated; NULL to not return any.
[in]err_ctxTalloc context to allocate err from, if required.
[in]dataPointer to BSSLAP PDU raw data.
[in]lenData length to decode.
Returns
0 on success, negative on error.

References BSSLAP_IEI_CAUSE, BSSLAP_IEI_CELL_ID, BSSLAP_IEI_CHAN_DESC, BSSLAP_IEI_TA, BSSLAP_MSGT_ABORT, BSSLAP_MSGT_REJECT, BSSLAP_MSGT_RESET, BSSLAP_MSGT_TA_LAYER3, BSSLAP_MSGT_TA_REQUEST, BSSLAP_MSGT_TA_RESPONSE, DEC_ERR, DEC_IE_MANDATORY, LCS_CAUSE_UNSPECIFIED, osmo_bsslap_ie_dec_cause(), osmo_bsslap_ie_dec_cell_id(), osmo_bsslap_ie_dec_chan_desc(), osmo_bsslap_ie_dec_ta(), and tlv_parse2().

Referenced by osmo_bssmap_le_ie_dec_apdu().

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

References DEC_ERR, and LCS_CAUSE_UNSPECIFIED.

Referenced by osmo_bsslap_dec().

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

References DEC_ERR, and LCS_CAUSE_UNSPECIFIED.

Referenced by osmo_bsslap_dec().

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

References DEC_ERR, and LCS_CAUSE_UNSPECIFIED.

Referenced by osmo_bsslap_dec().

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

References DEC_ERR, and LCS_CAUSE_UNSPECIFIED.

Referenced by osmo_bsslap_dec().

static void osmo_bsslap_ie_enc_cause ( struct msgb msg,
enum bsslap_cause  cause 
)
static

References BSSLAP_IEI_CAUSE, and msgb_put_u8().

Referenced by osmo_bsslap_enc().

static void osmo_bsslap_ie_enc_cell_id ( struct msgb msg,
uint16_t  cell_id 
)
static
static void osmo_bsslap_ie_enc_chan_desc ( struct msgb msg,
const struct gsm48_chan_desc chan_desc 
)
static
static void osmo_bsslap_ie_enc_ta ( struct msgb msg,
uint8_t  ta 
)
static

References BSSLAP_IEI_TA, and msgb_put_u8().

Referenced by osmo_bsslap_enc().

static const char* osmo_bsslap_iei_name ( enum bsslap_iei  val)
inlinestatic
static const char* osmo_bsslap_msgt_name ( enum bsslap_msgt  val)
inlinestatic

Variable Documentation

enum bsslap_msgt __attribute__
const struct value_string osmo_bsslap_iei_names[]

Referenced by osmo_bsslap_iei_name().

const struct value_string osmo_bsslap_iei_names[]
Initial value:
= {
{ BSSLAP_IEI_TA, "Timing Advance" },
{ BSSLAP_IEI_CELL_ID, "Cell Identity" },
{ BSSLAP_IEI_CHAN_DESC, "Channel Description" },
{ BSSLAP_IEI_MEAS_REP, "Measurement Report" },
{ BSSLAP_IEI_CAUSE, "Cause" },
{ BSSLAP_IEI_RRLP_FLAG, "RRLP Flag" },
{ BSSLAP_IEI_RRLP, "RRLP" },
{ BSSLAP_IEI_CELL_ID_LIST, "Cell Identity List" },
{ BSSLAP_IEI_ENH_MEAS_REP, "Enhanced Measurement Report" },
{ BSSLAP_IEI_LAC, "Location Area Code" },
{ BSSLAP_IEI_FREQ_LIST, "Frequency List" },
{ BSSLAP_IEI_MS_POWER, "MS Power" },
{ BSSLAP_IEI_DELTA_TIMER, "Delta Timer" },
{ BSSLAP_IEI_SERVING_CELL_ID, "Serving Cell Identifier" },
{ BSSLAP_IEI_ENCR_KEY, "Encryption Key" },
{ BSSLAP_IEI_CIPH_MODE_SET, "Cipher Mode Setting" },
{ BSSLAP_IEI_CHAN_MODE, "Channel Mode" },
{ BSSLAP_IEI_MR_CONFIG, "MultiRate Configuration" },
{ BSSLAP_IEI_POLLING_REPETITION, "Polling Repetition" },
{ BSSLAP_IEI_PACKET_CHAN_DESC, "Packet Channel Description" },
{ BSSLAP_IEI_TLLI, "TLLI" },
{ BSSLAP_IEI_TFI, "TFI" },
{ BSSLAP_IEI_TBF_START_TIME, "TBF Starting Time" },
{ BSSLAP_IEI_PWRUP_START_TIME, "Powerup Starting Time" },
{ BSSLAP_IEI_LONG_ENCR_KEY, "Long Encryption Key" },
{ BSSLAP_IEI_CONCUR_POS_PROC_F, "Concurrent Positioning Flag" },
{}
}
Definition: gsm_48_071.h:64
Definition: gsm_48_071.h:68
Definition: gsm_48_071.h:84
Definition: gsm_48_071.h:72
Definition: gsm_48_071.h:80
Definition: gsm_48_071.h:71
Definition: gsm_48_071.h:82
Definition: gsm_48_071.h:73
Definition: gsm_48_071.h:65
Definition: gsm_48_071.h:78
Definition: gsm_48_071.h:81
Definition: gsm_48_071.h:63
Definition: gsm_48_071.h:60
Definition: gsm_48_071.h:67
Definition: gsm_48_071.h:75
Definition: gsm_48_071.h:76
Definition: gsm_48_071.h:77
Definition: gsm_48_071.h:79
Definition: gsm_48_071.h:83
Definition: gsm_48_071.h:62
Definition: gsm_48_071.h:61
Definition: gsm_48_071.h:85
Definition: gsm_48_071.h:69
Definition: gsm_48_071.h:66
Definition: gsm_48_071.h:74
Definition: gsm_48_071.h:70

Referenced by osmo_bsslap_iei_name().

const struct value_string osmo_bsslap_msgt_names[]

Referenced by osmo_bsslap_msgt_name().

const struct value_string osmo_bsslap_msgt_names[]
Initial value:
= {
{ BSSLAP_MSGT_TA_REQUEST, "TA Request" },
{ BSSLAP_MSGT_TA_RESPONSE, "TA Response" },
{ BSSLAP_MSGT_REJECT, "Reject" },
{ BSSLAP_MSGT_RESET, "Reset" },
{ BSSLAP_MSGT_ABORT, "Abort" },
{ BSSLAP_MSGT_TA_LAYER3, "TA Layer3" },
{ BSSLAP_MSGT_MS_POS_CMD, "MS Position Command" },
{ BSSLAP_MSGT_MS_POS_RESP, "MS Position Response" },
{ BSSLAP_MSGT_UTDOA_REQ, "U-TDOA Request" },
{ BSSLAP_MSGT_UTDOA_RESP, "U-TDOA Response" },
{}
}
Definition: gsm_48_071.h:39
Definition: gsm_48_071.h:41
Definition: gsm_48_071.h:38
Definition: gsm_48_071.h:37
Definition: gsm_48_071.h:36
Definition: gsm_48_071.h:34
Definition: gsm_48_071.h:42
Definition: gsm_48_071.h:33
Definition: gsm_48_071.h:40
Definition: gsm_48_071.h:35

Referenced by osmo_bsslap_msgt_name().

const struct tlv_definition osmo_bsslap_tlvdef
static
Initial value:
= {
.def = {
},
}
Definition: gsm_48_071.h:64
Definition: gsm_48_071.h:68
Definition: gsm_48_071.h:84
Definition: gsm_48_071.h:72
Definition: gsm_48_071.h:80
Definition: gsm_48_071.h:71
tag-value (8bit)
Definition: tlv.h:502
Definition: gsm_48_071.h:82
Definition: gsm_48_071.h:73
Definition: gsm_48_071.h:65
Definition: gsm_48_071.h:78
Definition: gsm_48_071.h:81
Definition: gsm_48_071.h:63
Definition: gsm_48_071.h:60
tag-length-value
Definition: tlv.h:503
Definition: gsm_48_071.h:67
Definition: gsm_48_071.h:75
Definition: gsm_48_071.h:76
Definition: gsm_48_071.h:77
Definition: gsm_48_071.h:79
Definition: gsm_48_071.h:83
Definition: gsm_48_071.h:62
fixed-length value-only
Definition: tlv.h:500
Definition: gsm_48_071.h:61
Definition: gsm_48_071.h:85
Definition: gsm_48_071.h:69
Definition: gsm_48_071.h:66
Definition: gsm_48_071.h:74
Definition: gsm_48_071.h:70