diff --git a/include/osmocore/msgb.h b/include/osmocore/msgb.h index 354c5d88a..395c7c2ca 100644 --- a/include/osmocore/msgb.h +++ b/include/osmocore/msgb.h @@ -187,4 +187,9 @@ static inline struct msgb *msgb_alloc_headroom(int size, int headroom, return msg; } +/* non inline functions to ease binding */ +uint8_t *msgb_data(const struct msgb *msg); +uint16_t msgb_length(const struct msgb *msg); + + #endif /* _MSGB_H */ diff --git a/src/msgb.c b/src/msgb.c index a60e2ffa5..12a839a93 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -1,4 +1,5 @@ /* (C) 2008 by Harald Welte + * (C) 2010 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -88,3 +89,13 @@ void msgb_reset(struct msgb *msg) memset(&msg->cb, 0, sizeof(msg->cb)); } + +uint8_t *msgb_data(const struct msgb *msg) +{ + return msg->data; +} + +uint16_t msgb_length(const struct msgb *msg) +{ + return msg->len; +}