<p>Max has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12572">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Change GSM48_PDISC_* to enum type<br><br>Prepare for transaction handling revamp in OsmoMSC: an enum is more<br>clear than an int and #defines for passing around.<br><br>Change-Id: Icbbe8786a776081d7643193f154e6270224399e6<br>---<br>M include/osmocom/gsm/protocol/gsm_04_08.h<br>1 file changed, 20 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/12572/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>index 234fa79..9c7663d 100644</span><br><span>--- a/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>+++ b/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>@@ -1352,30 +1352,32 @@</span><br><span> } __attribute__((packed));</span><br><span> </span><br><span> /* Section 10.2 + GSM 04.07 12.2.3.1.1 + 3GPP TS 24.007 11.2.3.1.1 */</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_GROUP_CC     0x00</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_BCAST_CC        0x01</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_PDSS1   0x02    /* 04.07 only */</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_CC          0x03</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_PDSS2   0x04    /* 04.07 only */</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_GTTP        0x04    /* 24.007 only */</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_MM         0x05</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_RR              0x06</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_MM_GPRS 0x08</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_SMS             0x09</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_SM_GPRS 0x0a</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_NC_SS   0x0b</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_LOC             0x0c</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_EXTEND  0x0e</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_TEST    0x0f    /* as per 11.10, 04.14 */</span><br><span style="color: hsl(0, 100%, 40%);">-#define GSM48_PDISC_MASK       0x0f</span><br><span style="color: hsl(120, 100%, 40%);">+enum osmo_pdisc {</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_GROUP_CC    = 0x00,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_BCAST_CC    = 0x01,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_PDSS1       = 0x02, /* 04.07 onl= y */</span><br><span style="color: hsl(120, 100%, 40%);">+    GSM48_PDISC_CC          = 0x03,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_PDSS2       = 0x04, /* 04.07 onl= y */</span><br><span style="color: hsl(120, 100%, 40%);">+    GSM48_PDISC_GTTP        = 0x04, /* 24.007 onl= y */</span><br><span style="color: hsl(120, 100%, 40%);">+   GSM48_PDISC_MM          = 0x05,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_RR          = 0x06,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_MM_GPRS     = 0x08,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_SMS         = 0x09,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_SM_GPRS     = 0x0a,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_NC_SS       = 0x0b,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_LOC         = 0x0c,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_EXTEND      = 0x0e,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM48_PDISC_TEST        = 0x0f, /* as per 11.10, 04.1= 4 */</span><br><span style="color: hsl(120, 100%, 40%);">+   GSM48_PDISC_MASK        = 0x0f,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span> </span><br><span> extern const struct value_string gsm48_pdisc_names[];</span><br><span style="color: hsl(0, 100%, 40%);">-static inline const char *gsm48_pdisc_name(uint8_t val)</span><br><span style="color: hsl(120, 100%, 40%);">+static inline const char *gsm48_pdisc_name(enum osmo_pdisc val)</span><br><span> { return get_value_string(gsm48_pdisc_names, val); }</span><br><span> </span><br><span> bool gsm48_hdr_gmm_cipherable(const struct gsm48_hdr *hdr);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static inline uint8_t gsm48_hdr_pdisc(const struct gsm48_hdr *hdr)</span><br><span style="color: hsl(120, 100%, 40%);">+static inline enum osmo_pdisc gsm48_hdr_pdisc(const struct gsm48_hdr *hdr)</span><br><span> {</span><br><span>   /*</span><br><span>    * 3GPP TS 24.007 version 12.0.0 Release 12,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12572">change 12572</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12572"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Icbbe8786a776081d7643193f154e6270224399e6 </div>
<div style="display:none"> Gerrit-Change-Number: 12572 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>