diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-16 21:09:34 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-16 21:09:34 +0000 |
commit | e021254b649e47370933d3344e6ef8439d1b8316 (patch) | |
tree | c5220566e7fb66b5c7b20d790414734cda2383ef /include/openbsc | |
parent | 9b177760bbe6195793c9ac06de928890468b9656 (diff) |
introduce msgb_l2len() function
Diffstat (limited to 'include/openbsc')
-rw-r--r-- | include/openbsc/msgb.h | 5 |
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); |