aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-02-15 17:18:37 +0000
committerHarald Welte <laforge@gnumonks.org>2009-02-15 17:18:37 +0000
commit0a23990be8444a3c5b7c9cd3f0f391638ef7354e (patch)
tree7d6e334342afffd9a8ace0de71b10d1d74220bc0 /include
parentd4c9bf3c5aab820c8bcbd240ebc0ac9923cb0084 (diff)
introduce msgb_l3len() function
Diffstat (limited to 'include')
-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 db1f8aee2..5ebdf9631 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_l3len(const struct msgb *msgb)
+{
+ return msgb->tail - (u_int8_t *)msgb_l3(msgb);
+}
+
static inline unsigned int msgb_headlen(const struct msgb *msgb)
{
return msgb->len - msgb->data_len;