diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-01-10 23:33:32 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2019-01-14 17:42:03 +0000 |
commit | f8963f9d4e06a37c96cc0fed91f2b3f731382594 (patch) | |
tree | bbf3777a4b42bbe29d0e086a1e5ea473223bbbf4 /include/osmocom | |
parent | 894be2d9da60a8e0f7ffc0224e3f294ce49b70be (diff) |
change GSM48_CMSERV_* to enum type, add names
Prepare handling multiple CM Service Requests in osmo-msc: an enum is more
clear than an int and #defines for passing around and count CM Service types.
Change-Id: I9c2a7adc45ab7a1a7519168e965e7d805e1481ff
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/gsm/protocol/gsm_04_08.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 791fbd4e..86b5f6f8 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1631,13 +1631,20 @@ 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 */ -#define GSM48_CMSERV_MO_CALL_PACKET 1 -#define GSM48_CMSERV_EMERGENCY 2 -#define GSM48_CMSERV_SMS 4 -#define GSM48_CMSERV_SUP_SERV 8 -#define GSM48_CMSERV_VGCS 9 -#define GSM48_CMSERV_VBS 10 -#define GSM48_CMSERV_LOC_SERV 11 +enum osmo_cm_service_type { + GSM48_CMSERV_MO_CALL_PACKET = 1, + GSM48_CMSERV_EMERGENCY = 2, + GSM48_CMSERV_SMS = 4, + GSM48_CMSERV_SUP_SERV = 8, + GSM48_CMSERV_VGCS = 9, + GSM48_CMSERV_VBS = 10, + GSM48_CMSERV_LOC_SERV = 11, + GSM48_CMSERV_MAX_VAL = GSM48_CMSERV_LOC_SERV +}; + +extern const struct value_string osmo_cm_service_type_names[]; +static inline const char *osmo_cm_service_type_name(enum osmo_cm_service_type val) +{ return get_value_string(osmo_cm_service_type_names, val); } /* Section 10.5.2.26, Table 10.5.64 */ #define GSM48_PM_MASK 0x03 |