From e021254b649e47370933d3344e6ef8439d1b8316 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 16 Feb 2009 21:09:34 +0000 Subject: [PATCH] introduce msgb_l2len() function --- include/openbsc/msgb.h | 5 +++++ 1 file changed, 5 insertions(+) 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);