Max has uploaded this change for review. ( https://gerrit.osmocom.org/12572


Change subject: Change GSM48_PDISC_* to enum type
......................................................................

Change GSM48_PDISC_* to enum type

Prepare for transaction handling revamp in OsmoMSC: an enum is more
clear than an int and #defines for passing around.

Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 20 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/12572/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 234fa79..9c7663d 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1352,30 +1352,32 @@
 } __attribute__((packed));

 /* Section 10.2 + GSM 04.07 12.2.3.1.1 + 3GPP TS 24.007 11.2.3.1.1 */
-#define GSM48_PDISC_GROUP_CC   0x00
-#define GSM48_PDISC_BCAST_CC   0x01
-#define GSM48_PDISC_PDSS1      0x02    /* 04.07 only */
-#define GSM48_PDISC_CC         0x03
-#define GSM48_PDISC_PDSS2      0x04    /* 04.07 only */
-#define GSM48_PDISC_GTTP       0x04    /* 24.007 only */
-#define GSM48_PDISC_MM         0x05
-#define GSM48_PDISC_RR         0x06
-#define GSM48_PDISC_MM_GPRS    0x08
-#define GSM48_PDISC_SMS                0x09
-#define GSM48_PDISC_SM_GPRS    0x0a
-#define GSM48_PDISC_NC_SS      0x0b
-#define GSM48_PDISC_LOC                0x0c
-#define GSM48_PDISC_EXTEND     0x0e
-#define GSM48_PDISC_TEST       0x0f    /* as per 11.10, 04.14 */
-#define GSM48_PDISC_MASK       0x0f
+enum osmo_pdisc {
+       GSM48_PDISC_GROUP_CC    = 0x00,
+       GSM48_PDISC_BCAST_CC    = 0x01,
+       GSM48_PDISC_PDSS1       = 0x02, /* 04.07 onl= y */
+       GSM48_PDISC_CC          = 0x03,
+       GSM48_PDISC_PDSS2       = 0x04, /* 04.07 onl= y */
+       GSM48_PDISC_GTTP        = 0x04, /* 24.007 onl= y */
+       GSM48_PDISC_MM          = 0x05,
+       GSM48_PDISC_RR          = 0x06,
+       GSM48_PDISC_MM_GPRS     = 0x08,
+       GSM48_PDISC_SMS         = 0x09,
+       GSM48_PDISC_SM_GPRS     = 0x0a,
+       GSM48_PDISC_NC_SS       = 0x0b,
+       GSM48_PDISC_LOC         = 0x0c,
+       GSM48_PDISC_EXTEND      = 0x0e,
+       GSM48_PDISC_TEST        = 0x0f, /* as per 11.10, 04.1= 4 */
+       GSM48_PDISC_MASK        = 0x0f,
+};

 extern const struct value_string gsm48_pdisc_names[];
-static inline const char *gsm48_pdisc_name(uint8_t val)
+static inline const char *gsm48_pdisc_name(enum osmo_pdisc 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)
+static inline enum osmo_pdisc gsm48_hdr_pdisc(const struct gsm48_hdr *hdr)
 {
        /*
         * 3GPP TS 24.007 version 12.0.0 Release 12,

--
To view, visit https://gerrit.osmocom.org/12572
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
Gerrit-Change-Number: 12572
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to