aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-06 18:10:38 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-13 17:46:48 +0000
commit0167e3f35535b1b19eab659659180fa549da52b0 (patch)
treebe0971ee854096a57980914ae1c60d56e415d079
parent8d6dcd9bca7ce9b0a29954126c72050f8e2e110c (diff)
add rsl_or_ipac_msg_name() for both standard and ip.access msg types
Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN. Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f Reviewed-on: https://gerrit.osmocom.org/231 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
-rw-r--r--include/osmocom/gsm/rsl.h1
-rw-r--r--src/gsm/libosmogsm.map1
-rw-r--r--src/gsm/rsl.c11
3 files changed, 13 insertions, 0 deletions
diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h
index 418e3f03..b140d48f 100644
--- a/include/osmocom/gsm/rsl.h
+++ b/include/osmocom/gsm/rsl.h
@@ -39,6 +39,7 @@ const char *rsl_err_name(uint8_t err);
const char *rsl_rlm_cause_name(uint8_t err);
const char *rsl_msg_name(uint8_t err);
const char *rsl_ipac_msg_name(uint8_t msg_type);
+const char *rsl_or_ipac_msg_name(uint8_t msg_type);
/* Section 3.3.2.3 TS 05.02. I think this looks like a table */
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 301f5aa1..ea2101c9 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -266,6 +266,7 @@ rsl_init_cchan_hdr;
rsl_init_rll_hdr;
rsl_ipac_msg_name;
rsl_msg_name;
+rsl_or_ipac_msg_name;
rsl_rll_push_hdr;
rsl_rll_push_l3;
rsl_rll_simple;
diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c
index de2e9d76..c3c32a92 100644
--- a/src/gsm/rsl.c
+++ b/src/gsm/rsl.c
@@ -382,6 +382,17 @@ const char *rsl_ipac_msg_name(uint8_t msg_type)
return get_value_string(rsl_ipac_msgt_names, msg_type);
}
+/*! \brief Get human-readable name of standard or ip.access RSL msg type.
+ * If msg_type is a standard RSL message type, return its human-readable name.
+ * Otherwise return rsl_ipac_msg_name(msg_type). */
+const char *rsl_or_ipac_msg_name(uint8_t msg_type)
+{
+ const char *str = get_value_string_or_null(rsl_msgt_names, msg_type);
+ if (str)
+ return str;
+ return rsl_ipac_msg_name(msg_type);
+}
+
static const struct value_string rsl_rlm_cause_strs[] = {
{ RLL_CAUSE_T200_EXPIRED, "Timer T200 expired (N200+1) times" },
{ RLL_CAUSE_REEST_REQ, "Re-establishment request" },