mkae the new 'void *dst' member part of a union with the trx pointer
[osmocom-bb.git] / include / osmocom / core / msgb.h
index 57b5d7f..915c4a0 100644 (file)
 struct msgb {
        struct llist_head list;
 
+
        /* Part of which TRX logical channel we were received / transmitted */
        /* FIXME: move them into the control buffer */
-       struct gsm_bts_trx *trx;
+       union {
+               void *dst;
+               struct gsm_bts_trx *trx;
+       };
        struct gsm_lchan *lchan;
 
        /* the Layer1 header (if any) */
@@ -181,7 +185,7 @@ static inline void msgb_reserve(struct msgb *msg, int len)
 static inline struct msgb *msgb_alloc_headroom(int size, int headroom,
                                                const char *name)
 {
-       static_assert(size > headroom, headroom_bigger);
+       osmo_static_assert(size > headroom, headroom_bigger);
 
        struct msgb *msg = msgb_alloc(size, name);
        if (msg)
@@ -193,5 +197,7 @@ static inline struct msgb *msgb_alloc_headroom(int size, int headroom,
 uint8_t *msgb_data(const struct msgb *msg);
 uint16_t msgb_length(const struct msgb *msg);
 
+/* set the talloc context for msgb_alloc[_headroom] */
+void msgb_set_talloc_ctx(void *ctx);
 
 #endif /* _MSGB_H */