diff options
Diffstat (limited to 'src/gsm')
-rw-r--r-- | src/gsm/gsm0808.c | 16 | ||||
-rw-r--r-- | src/gsm/gsm0808_utils.c | 16 | ||||
-rw-r--r-- | src/gsm/libosmogsm.map | 1 |
3 files changed, 17 insertions, 16 deletions
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 02288e6c..788f6c3c 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1654,6 +1654,22 @@ const char *gsm0808_cause_name(enum gsm0808_cause cause) return get_value_string(gsm0808_cause_names, cause); } +enum gsm0808_cause gsm0808_get_cause(const struct tlv_parsed *tp) +{ + const uint8_t *buf = TLVP_VAL_MINLEN(tp, GSM0808_IE_CAUSE, 1); + + if (!buf) + return -EBADMSG; + + if (TLVP_LEN(tp, GSM0808_IE_CAUSE) > 1) { + if (!gsm0808_cause_ext(buf[0])) + return -EINVAL; + return buf[1]; + } + + return buf[0]; +} + const struct value_string gsm0808_lcls_config_names[] = { { GSM0808_LCLS_CFG_BOTH_WAY, "Connect both-way" }, { GSM0808_LCLS_CFG_BOTH_WAY_AND_BICAST_UL, diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 7416d8f5..6f3c07a4 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1563,22 +1563,6 @@ int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, return 0; } -int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp) -{ - const uint8_t *buf = TLVP_VAL_MINLEN(tp, GSM0808_IE_CAUSE, 1); - - if (!buf) - return -EBADMSG; - - if (TLVP_LEN(tp, GSM0808_IE_CAUSE) > 1) { - if (!gsm0808_cause_ext(buf[0])) - return -EINVAL; - return buf[1]; - } - - return buf[0]; -} - /*! Print a human readable name of the cell identifier to the char buffer. * This is useful both for struct gsm0808_cell_id and struct gsm0808_cell_id_list2. * See also gsm0808_cell_id_name() and gsm0808_cell_id_list_name(). diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index a518b289..1ff1286c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -157,6 +157,7 @@ gsm0808_bssap_name; gsm0808_bssmap_name; gsm0808_cause_name; gsm0808_cause_class_name; +gsm0808_get_cause; gsm0808_create_ass; gsm0808_create_ass2; gsm0808_create_assignment_completed; |