aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-01-22 18:24:12 +0100
committerlaforge <laforge@osmocom.org>2021-01-22 19:59:31 +0000
commitcf11411ebb2f0ecb4297b3357c38f34415d6fedc (patch)
treeb21d259861e38be706028077096f6dde030c74f8
parent8b19d0664326290556c19d9985d055f99de12526 (diff)
gprs_bssgp_rim: add value strings for enum bssgp_rim_routing_info_discr
-rw-r--r--include/osmocom/gprs/gprs_bssgp_rim.h6
-rw-r--r--src/gb/gprs_bssgp_rim.c7
-rw-r--r--src/gb/libosmogb.map1
3 files changed, 14 insertions, 0 deletions
diff --git a/include/osmocom/gprs/gprs_bssgp_rim.h b/include/osmocom/gprs/gprs_bssgp_rim.h
index 48bf047c..0810c8ed 100644
--- a/include/osmocom/gprs/gprs_bssgp_rim.h
+++ b/include/osmocom/gprs/gprs_bssgp_rim.h
@@ -33,6 +33,12 @@ enum bssgp_rim_routing_info_discr {
BSSGP_RIM_ROUTING_INFO_EUTRAN,
};
+extern const struct value_string bssgp_rim_routing_info_discr_strs[];
+
+/*! Obtain a human-readable string for NACC Cause code */
+static inline const char *bssgp_rim_routing_info_discr_str(enum bssgp_rim_routing_info_discr val)
+{ return get_value_string(bssgp_rim_routing_info_discr_strs, val); }
+
/*! BSSGP RIM Routing information, see also 3GPP TS 48.018, section 11.3.70 */
struct bssgp_rim_routing_info {
enum bssgp_rim_routing_info_discr discr;
diff --git a/src/gb/gprs_bssgp_rim.c b/src/gb/gprs_bssgp_rim.c
index 5ef83755..844268aa 100644
--- a/src/gb/gprs_bssgp_rim.c
+++ b/src/gb/gprs_bssgp_rim.c
@@ -41,6 +41,13 @@
* (3GPP TS 48.018, sub-clause 11.3.9) but without IE and length octets. */
#define REP_CELL_ID_LEN 8
+const struct value_string bssgp_rim_routing_info_discr_strs[] = {
+ { BSSGP_RIM_ROUTING_INFO_GERAN, "GERAN cell" },
+ { BSSGP_RIM_ROUTING_INFO_UTRAN, "UTRAN RNC" },
+ { BSSGP_RIM_ROUTING_INFO_EUTRAN, "E-UTRAN eNodeB/HeNB" },
+ { 0, NULL }
+};
+
/*! Parse a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).
* \param[out] ri user provided memory to store the parsed results.
* \param[in] buf input buffer of the value part of the IE.
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 23d52a2a..b4d7fdb6 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -34,6 +34,7 @@ bssgp_parse_cell_id;
bssgp_parse_rim_pdu;
bssgp_parse_rim_ri;
bssgp_ran_inf_app_id_strs;
+bssgp_rim_routing_info_discr_strs;
bssgp_set_bssgp_callback;
bssgp_tx_bvc_block;
bssgp_tx_bvc_reset;