<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12079">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Update msgb Lx helpers<br><br>* add missing L1 and L4 hexdump<br>* add msgb_l4() for consistency and convert msgb_sms() into simple alias<br><br>Those will be used in follow-up patches for msgb debug/test helpers.<br><br>Change-Id: I8d6dd1b1ff3aa98a452711c692ca7dee0449203b<br>---<br>M include/osmocom/core/msgb.h<br>1 file changed, 17 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h</span><br><span>index 2449151..1bb5fe5 100644</span><br><span>--- a/include/osmocom/core/msgb.h</span><br><span>+++ b/include/osmocom/core/msgb.h</span><br><span>@@ -130,8 +130,10 @@</span><br><span> #define msgb_l2(m) ((void *)(m->l2h))</span><br><span> /*! obtain L3 header of msgb */</span><br><span> #define msgb_l3(m)  ((void *)(m->l3h))</span><br><span style="color: hsl(120, 100%, 40%);">+/*! obtain L4 header of msgb */</span><br><span style="color: hsl(120, 100%, 40%);">+#define msgb_l4(m)      ((void *)(m->l4h))</span><br><span> /*! obtain SMS header of msgb */</span><br><span style="color: hsl(0, 100%, 40%);">-#define msgb_sms(m)    ((void *)(m->l4h))</span><br><span style="color: hsl(120, 100%, 40%);">+#define msgb_sms(m)      msgb_l4(m)</span><br><span> </span><br><span> /*! determine length of L1 message</span><br><span>  *  \param[in] msgb message buffer</span><br><span>@@ -566,6 +568,13 @@</span><br><span> void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead");</span><br><span> int msgb_printf(struct msgb *msgb, const char *format, ...);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static inline const char *msgb_hexdump_l1(const struct msgb *msg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!msgb_l1(msg) || !(msgb_l1len(msg)))</span><br><span style="color: hsl(120, 100%, 40%);">+              return "[]";</span><br><span style="color: hsl(120, 100%, 40%);">+        return osmo_hexdump((const unsigned char *) msgb_l1(msg), msgb_l1len(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static inline const char *msgb_hexdump_l2(const struct msgb *msg)</span><br><span> {</span><br><span>   if (!msgb_l2(msg) || !(msgb_l2len(msg)))</span><br><span>@@ -580,4 +589,11 @@</span><br><span>      return osmo_hexdump((const unsigned char*) msgb_l3(msg), msgb_l3len(msg));</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static inline const char *msgb_hexdump_l4(const struct msgb *msg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!msgb_l4(msg) || !(msgb_l4len(msg)))</span><br><span style="color: hsl(120, 100%, 40%);">+              return "[]";</span><br><span style="color: hsl(120, 100%, 40%);">+        return osmo_hexdump((const unsigned char*) msgb_l4(msg), msgb_l4len(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! @} */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12079">change 12079</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/12079"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I8d6dd1b1ff3aa98a452711c692ca7dee0449203b </div>
<div style="display:none"> Gerrit-Change-Number: 12079 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>