From 0167e3f35535b1b19eab659659180fa549da52b0 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 6 Jun 2016 18:10:38 +0200 Subject: 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 Tested-by: Jenkins Builder --- src/gsm/libosmogsm.map | 1 + src/gsm/rsl.c | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'src') 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" }, -- cgit v1.2.3