aboutsummaryrefslogtreecommitdiffstats
path: root/include/openbsc/msgb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/openbsc/msgb.h')
-rw-r--r--include/openbsc/msgb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/openbsc/msgb.h b/include/openbsc/msgb.h
index 5ebdf9631..2c31d1587 100644
--- a/include/openbsc/msgb.h
+++ b/include/openbsc/msgb.h
@@ -56,6 +56,11 @@ extern struct msgb *msgb_dequeue(struct llist_head *queue);
#define msgb_l3(m) ((void *)(m->l3h))
#define msgb_sms(m) ((void *)(m->smsh))
+static inline unsigned int msgb_l2len(const struct msgb *msgb)
+{
+ return msgb->tail - (u_int8_t *)msgb_l2(msgb);
+}
+
static inline unsigned int msgb_l3len(const struct msgb *msgb)
{
return msgb->tail - (u_int8_t *)msgb_l3(msgb);