libosmogsm
1.9.2
Osmocom GSM library
|
|
#define | DEC_ERR(RC, MSG_TYPE, IEI, CAUSE, fmt, args...) |
|
|
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
} |
|
|
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) |
|
◆ DEC_ERR
#define DEC_ERR |
( |
|
RC, |
|
|
|
MSG_TYPE, |
|
|
|
IEI, |
|
|
|
CAUSE, |
|
|
|
fmt, |
|
|
|
args... |
|
) |
| |
Value: do { \
if (err && !*err) { \
.rc = (RC), \
.iei = (IEI), \
.logmsg = talloc_asprintf(*err, "Error decoding BSSLAP%s%s%s%s%s: " fmt, \
(MSG_TYPE) >= 0 ? " " : "", \
(IEI) >= 0 ? ": " : "", \
(IEI) >= 0 ? " IE" : "", \
##args), \
}; \
} \
return RC; \
} while(0)
◆ bsslap_cause
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 | |
◆ 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 | |
◆ bsslap_msgt
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 | |
◆ osmo_bsslap_dec()
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] | pdu | Write decoded values here. |
[out] | err | Returned pointer to error info, dynamically allocated; NULL to not return any. |
[in] | err_ctx | Talloc context to allocate err from, if required. |
[in] | data | Pointer to BSSLAP PDU raw data. |
[in] | len | Data length to decode. |
- Returns
- 0 on success, negative on error.
References bsslap_pdu::abort, 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, bsslap_reset::cause, bsslap_ta_response::cell_id, bsslap_reset::cell_id, bsslap_reset::chan_desc, data, DEC_ERR, DEC_IE_MANDATORY, LCS_CAUSE_UNSPECIFIED, len, bsslap_pdu::msg_type, osmo_bsslap_ie_dec_cause(), osmo_bsslap_ie_dec_cell_id(), osmo_bsslap_ie_dec_chan_desc(), osmo_bsslap_ie_dec_ta(), osmo_bsslap_tlvdef, bsslap_pdu::reject, bsslap_pdu::reset, bsslap_ta_response::ta, bsslap_ta_layer3::ta, bsslap_reset::ta, bsslap_pdu::ta_layer3, bsslap_pdu::ta_response, and tlv_parse2().
Referenced by osmo_bssmap_le_ie_dec_apdu().
◆ osmo_bsslap_enc()
int osmo_bsslap_enc |
( |
struct msgb * |
msg, |
|
|
const struct bsslap_pdu * |
pdu |
|
) |
| |
Encode BSSLAP PDU and append to msgb (3GPP TS 48.071).
- Parameters
-
[out] | msg | msgb to append to. |
[in] | pdu | PDU data to encode. |
- Returns
- number of bytes written, negative on error.
References bsslap_pdu::abort, BSSLAP_MSGT_ABORT, BSSLAP_MSGT_REJECT, BSSLAP_MSGT_RESET, BSSLAP_MSGT_TA_LAYER3, BSSLAP_MSGT_TA_REQUEST, BSSLAP_MSGT_TA_RESPONSE, bsslap_reset::cause, bsslap_ta_response::cell_id, bsslap_reset::cell_id, bsslap_reset::chan_desc, ENOTSUP, msg, bsslap_pdu::msg_type, msgb_put_u8(), osmo_bsslap_ie_enc_cause(), osmo_bsslap_ie_enc_cell_id(), osmo_bsslap_ie_enc_chan_desc(), osmo_bsslap_ie_enc_ta(), bsslap_pdu::reject, bsslap_pdu::reset, bsslap_ta_response::ta, bsslap_ta_layer3::ta, bsslap_reset::ta, bsslap_pdu::ta_layer3, and bsslap_pdu::ta_response.
Referenced by osmo_bssmap_le_ie_enc_apdu().
◆ osmo_bsslap_ie_dec_cause()
◆ osmo_bsslap_ie_dec_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 |
◆ osmo_bsslap_ie_dec_chan_desc()
◆ osmo_bsslap_ie_dec_ta()
◆ osmo_bsslap_ie_enc_cause()
static void osmo_bsslap_ie_enc_cause |
( |
struct msgb * |
msg, |
|
|
enum bsslap_cause |
cause |
|
) |
| |
|
static |
◆ osmo_bsslap_ie_enc_cell_id()
static void osmo_bsslap_ie_enc_cell_id |
( |
struct msgb * |
msg, |
|
|
uint16_t |
cell_id |
|
) |
| |
|
static |
◆ osmo_bsslap_ie_enc_chan_desc()
static void osmo_bsslap_ie_enc_chan_desc |
( |
struct msgb * |
msg, |
|
|
const struct gsm48_chan_desc * |
chan_desc |
|
) |
| |
|
static |
◆ osmo_bsslap_ie_enc_ta()
static void osmo_bsslap_ie_enc_ta |
( |
struct msgb * |
msg, |
|
|
uint8_t |
ta |
|
) |
| |
|
static |
◆ osmo_bsslap_iei_name()
static const char* osmo_bsslap_iei_name |
( |
enum bsslap_iei |
val | ) |
|
|
inlinestatic |
◆ osmo_bsslap_msgt_name()
static const char* osmo_bsslap_msgt_name |
( |
enum bsslap_msgt |
val | ) |
|
|
inlinestatic |
◆ __attribute__
◆ osmo_bsslap_iei_names [1/2]
◆ osmo_bsslap_iei_names [2/2]
◆ osmo_bsslap_msgt_names [1/2]
◆ osmo_bsslap_msgt_names [2/2]
◆ osmo_bsslap_tlvdef
@ BSSLAP_IEI_ENCR_KEY
Definition: gsm_48_071.h:70
@ BSSLAP_IEI_MEAS_REP
Definition: gsm_48_071.h:59
@ BSSLAP_IEI_LAC
Definition: gsm_48_071.h:65
@ BSSLAP_IEI_PACKET_CHAN_DESC
Definition: gsm_48_071.h:75
@ BSSLAP_IEI_RRLP
Definition: gsm_48_071.h:62
@ BSSLAP_IEI_CELL_ID_LIST
Definition: gsm_48_071.h:63
@ BSSLAP_MSGT_UTDOA_RESP
Definition: gsm_48_071.h:38
@ BSSLAP_IEI_ENH_MEAS_REP
Definition: gsm_48_071.h:64
@ BSSLAP_IEI_CHAN_DESC
Definition: gsm_48_071.h:58
@ BSSLAP_MSGT_MS_POS_RESP
Definition: gsm_48_071.h:36
@ TLV_TYPE_FIXED
fixed-length value-only
Definition: tlv.h:510
@ BSSLAP_IEI_CELL_ID
Definition: gsm_48_071.h:57
@ BSSLAP_MSGT_UTDOA_REQ
Definition: gsm_48_071.h:37
@ BSSLAP_IEI_TBF_START_TIME
Definition: gsm_48_071.h:78
@ BSSLAP_IEI_CHAN_MODE
Definition: gsm_48_071.h:72
@ BSSLAP_IEI_MR_CONFIG
Definition: gsm_48_071.h:73
@ BSSLAP_IEI_RRLP_FLAG
Definition: gsm_48_071.h:61
@ TLV_TYPE_TLV
tag-length-value
Definition: tlv.h:513
@ BSSLAP_IEI_PWRUP_START_TIME
Definition: gsm_48_071.h:79
@ BSSLAP_IEI_TLLI
Definition: gsm_48_071.h:76
@ BSSLAP_IEI_SERVING_CELL_ID
Definition: gsm_48_071.h:69
@ BSSLAP_IEI_POLLING_REPETITION
Definition: gsm_48_071.h:74
enum lcs_cause cause
Definition: bsslap.h:36
@ BSSLAP_MSGT_MS_POS_CMD
Definition: gsm_48_071.h:35
@ BSSLAP_MSGT_TA_RESPONSE
Definition: gsm_48_071.h:30
@ BSSLAP_IEI_CIPH_MODE_SET
Definition: gsm_48_071.h:71
static const char * osmo_bsslap_msgt_name(enum bsslap_msgt val)
Definition: bsslap.h:41
static const char * osmo_bsslap_iei_name(enum bsslap_iei val)
Definition: bsslap.h:45
@ BSSLAP_MSGT_TA_REQUEST
Definition: gsm_48_071.h:29
@ BSSLAP_IEI_TFI
Definition: gsm_48_071.h:77
@ BSSLAP_MSGT_RESET
Definition: gsm_48_071.h:32
@ BSSLAP_IEI_LONG_ENCR_KEY
Definition: gsm_48_071.h:80
@ BSSLAP_MSGT_TA_LAYER3
Definition: gsm_48_071.h:34
@ BSSLAP_IEI_CONCUR_POS_PROC_F
Definition: gsm_48_071.h:81
@ BSSLAP_MSGT_REJECT
Definition: gsm_48_071.h:31
@ BSSLAP_IEI_TA
Definition: gsm_48_071.h:56
@ BSSLAP_IEI_DELTA_TIMER
Definition: gsm_48_071.h:68
enum bsslap_msgt msg_type
Definition: bsslap.h:34
@ BSSLAP_IEI_FREQ_LIST
Definition: gsm_48_071.h:66
@ BSSLAP_IEI_CAUSE
Definition: gsm_48_071.h:60
@ BSSLAP_MSGT_ABORT
Definition: gsm_48_071.h:33
@ TLV_TYPE_TV
tag-value (8bit)
Definition: tlv.h:512
@ BSSLAP_IEI_MS_POWER
Definition: gsm_48_071.h:67