commit | 0a23990be8444a3c5b7c9cd3f0f391638ef7354e | [log] [tgz] |
---|---|---|
author | Harald Welte <laforge@gnumonks.org> | Sun Feb 15 17:18:37 2009 +0000 |
committer | Harald Welte <laforge@gnumonks.org> | Sun Feb 15 17:18:37 2009 +0000 |
tree | 7d6e334342afffd9a8ace0de71b10d1d74220bc0 | |
parent | d4c9bf3c5aab820c8bcbd240ebc0ac9923cb0084 [diff] |
introduce msgb_l3len() function
diff --git a/include/openbsc/msgb.h b/include/openbsc/msgb.h index db1f8ae..5ebdf96 100644 --- a/include/openbsc/msgb.h +++ b/include/openbsc/msgb.h
@@ -56,6 +56,11 @@ #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;