diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-09 23:07:02 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-16 12:54:18 +0000 |
commit | dbd994c05ba1f9881f884a7aa1e7d88054b7492e (patch) | |
tree | 7b924e49dff4b6d5c23c6966775a977854a0d8e9 /include/osmocom/gsm/protocol | |
parent | d80a217f7f20c8af38f938a85dd62f1809c09709 (diff) |
add gsm48_pdisc_names and gsm48_pdisc_name()
I often want to log the protocol discriminator in the openbsc debug log. It's
more useful to get the name directly instead of looking it up every time.
Change-Id: I0f053e2a4360b27ffccda7cf82469fb1b1cbb3ae
Diffstat (limited to 'include/osmocom/gsm/protocol')
-rw-r--r-- | include/osmocom/gsm/protocol/gsm_04_08.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 522015ac..87debba9 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -926,6 +926,10 @@ struct gsm48_rr_status { #define GSM48_PDISC_MASK 0x0f #define GSM48_PDISC_USSD 0x11 +extern const struct value_string gsm48_pdisc_names[]; +static inline const char *gsm48_pdisc_name(uint8_t val) +{ return get_value_string(gsm48_pdisc_names, val); } + bool gsm48_hdr_gmm_cipherable(const struct gsm48_hdr *hdr); static inline uint8_t gsm48_hdr_pdisc(const struct gsm48_hdr *hdr) |