blob: 06f5cca26a1482d70d65c08bda1c9e16bc3de3f3 [file] [log] [blame]
Sylvain Munaut12ba7782014-06-16 10:13:40 +02001#pragma once
Harald Welte605ac5d2012-06-16 16:09:52 +08002
3#include <stdint.h>
4/* the data structure stored in msgb->cb for libgb apps */
5struct libgb_msgb_cb {
6 unsigned char *bssgph;
7 unsigned char *llch;
8
9 /* Cell Identifier */
10 unsigned char *bssgp_cell_id;
11
12 /* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
13 uint16_t nsei;
14 uint16_t bvci;
15
16 /* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
17 uint32_t tlli;
Jacob Erlbeck42e0dc02013-10-08 12:04:41 +020018} __attribute__((packed, may_alias));
Harald Welte605ac5d2012-06-16 16:09:52 +080019#define LIBGB_MSGB_CB(__msgb) ((struct libgb_msgb_cb *)&((__msgb)->cb[0]))
20#define msgb_tlli(__x) LIBGB_MSGB_CB(__x)->tlli
21#define msgb_nsei(__x) LIBGB_MSGB_CB(__x)->nsei
22#define msgb_bvci(__x) LIBGB_MSGB_CB(__x)->bvci
23#define msgb_gmmh(__x) (__x)->l3h
24#define msgb_bssgph(__x) LIBGB_MSGB_CB(__x)->bssgph
25#define msgb_bssgp_len(__x) ((__x)->tail - (uint8_t *)msgb_bssgph(__x))
26#define msgb_bcid(__x) LIBGB_MSGB_CB(__x)->bssgp_cell_id
27#define msgb_llch(__x) LIBGB_MSGB_CB(__x)->llch
28
Harald Weltecca49632012-06-16 17:45:59 +080029/* logging contexts */
30#define GPRS_CTX_NSVC 0
31#define GPRS_CTX_BVC 1
32
Harald Welte8eda90d2012-06-17 12:58:46 +080033#include <osmocom/core/logging.h>
34int gprs_log_filter_fn(const struct log_context *ctx,
35 struct log_target *tar);