blob: eddd888f5f24d86abfce557a1230154f6be57b0f [file] [log] [blame]
Harald Welte605ac5d2012-06-16 16:09:52 +08001#ifndef _LIBGB_MSGB_H
2#define _LIBGB_MSGB_H
3
4#include <stdint.h>
5/* the data structure stored in msgb->cb for libgb apps */
6struct libgb_msgb_cb {
7 unsigned char *bssgph;
8 unsigned char *llch;
9
10 /* Cell Identifier */
11 unsigned char *bssgp_cell_id;
12
13 /* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
14 uint16_t nsei;
15 uint16_t bvci;
16
17 /* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
18 uint32_t tlli;
19} __attribute__((packed));
20#define LIBGB_MSGB_CB(__msgb) ((struct libgb_msgb_cb *)&((__msgb)->cb[0]))
21#define msgb_tlli(__x) LIBGB_MSGB_CB(__x)->tlli
22#define msgb_nsei(__x) LIBGB_MSGB_CB(__x)->nsei
23#define msgb_bvci(__x) LIBGB_MSGB_CB(__x)->bvci
24#define msgb_gmmh(__x) (__x)->l3h
25#define msgb_bssgph(__x) LIBGB_MSGB_CB(__x)->bssgph
26#define msgb_bssgp_len(__x) ((__x)->tail - (uint8_t *)msgb_bssgph(__x))
27#define msgb_bcid(__x) LIBGB_MSGB_CB(__x)->bssgp_cell_id
28#define msgb_llch(__x) LIBGB_MSGB_CB(__x)->llch
29
30#endif