23 #include <osmocom/core/linuxlist.h>
50 struct gsm_bts_trx *trx;
78 int old_size,
int new_size);
84 #define MSGB_ABORT(msg, fmt, args ...) do { \
85 osmo_panic("msgb(%p): " fmt, msg, ## args); \
88 #define MSGB_ABORT(msg, fmt, args ...)
92 #define msgb_l1(m) ((void *)(m->l1h))
94 #define msgb_l2(m) ((void *)(m->l2h))
96 #define msgb_l3(m) ((void *)(m->l3h))
98 #define msgb_sms(m) ((void *)(m->l4h))
186 unsigned char *tmp = msgb->
tail;
188 MSGB_ABORT(msgb,
"Not enough tailroom msgb_push (%u < %u)\n",
202 space[0] = word & 0xFF;
212 osmo_store16be(word, space);
222 osmo_store32be(word, space);
231 unsigned char *tmp = msgb->
tail -
len;
233 MSGB_ABORT(msgb,
"msgb too small to get %u (len %u)\n",
257 return osmo_load16be(space);
267 return osmo_load32be(space);
285 MSGB_ABORT(msgb,
"Not enough headroom msgb_push (%u < %u)\n",
318 msg->
l1h = msg->
l2h = NULL;
339 return osmo_load16be(space);
349 return osmo_load32be(space);
377 MSGB_ABORT(msg,
"Negative length is not allowed\n");
410 osmo_static_assert(size > headroom, headroom_bigger);
424 const unsigned char *lbound;
425 if (!msg || !msg->
data || !msg->
tail ||
434 if (msg->
l1h < lbound)
439 if (msg->
l2h < lbound)
444 if (msg->
l3h < lbound)
449 if (msg->
l4h < lbound)