introduce msgb_l2len() function

diff --git a/include/openbsc/msgb.h b/include/openbsc/msgb.h
index 5ebdf96..2c31d15 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_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);