From 00ab9ed6e26edcc0a6d2088903c626217574c82b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 9 Mar 2017 23:27:56 +0100 Subject: add gsm48_pdisc_msgtype_name() Composing the message type string requires knowing the protocol discriminator. To ease printing the message type, add this function to switch between the defined value_string[]s depending on pdisc. Also publish the message type value_string[]s -- without inline functions to access them because it is anyway more convenient to use gsm48_pdisc_msgtype_name() instead. Since gsm48_pdisc_msgtype_name() is nontrivial, do not add as inline function -- in case the message type is not known, it needs a static string buffer. Change-Id: I0fca8e95ed5c2148b1a7440eff3fc9c7583898df --- include/osmocom/gsm/protocol/gsm_04_08.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 87debba9..3f0ce641 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1180,6 +1180,11 @@ void gsm48_set_dtx(struct gsm48_cell_options *op, enum gsm48_dtx_mode full, #define GSM48_MT_CC_START_DTMF_REJ 0x37 #define GSM48_MT_CC_FACILITY 0x3a +extern const struct value_string gsm48_rr_msgtype_names[]; +extern const struct value_string gsm48_mm_msgtype_names[]; +extern const struct value_string gsm48_cc_msgtype_names[]; +const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type); + /* FIXME: Table 10.4 / 10.4a (GPRS) */ /* Section 10.5.3.3 CM service type */ -- cgit v1.2.3