aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/osmocom/gprs
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-06-16 16:09:52 +0800
committerHarald Welte <laforge@gnumonks.org>2012-06-16 16:09:52 +0800
commit8645e101da22d539342d2e356bdab6cbf92ed9ef (patch)
treecca8a410060328c0bda20d6c6f8320df51cdbccf /openbsc/include/osmocom/gprs
parentea34a4e3a7741c0b03fc421e2850234b82a0977c (diff)
libgb: move GPRS specific msgb CB definitions to separate header
Diffstat (limited to 'openbsc/include/osmocom/gprs')
-rw-r--r--openbsc/include/osmocom/gprs/Makefile.am2
-rw-r--r--openbsc/include/osmocom/gprs/gprs_bssgp.h1
-rw-r--r--openbsc/include/osmocom/gprs/gprs_msgb.h30
-rw-r--r--openbsc/include/osmocom/gprs/gprs_ns.h1
4 files changed, 33 insertions, 1 deletions
diff --git a/openbsc/include/osmocom/gprs/Makefile.am b/openbsc/include/osmocom/gprs/Makefile.am
index fe5714ea8..66b414f32 100644
--- a/openbsc/include/osmocom/gprs/Makefile.am
+++ b/openbsc/include/osmocom/gprs/Makefile.am
@@ -1,3 +1,3 @@
-libgb_HEADERS = gprs_bssgp.h gprs_ns.h gprs_ns_frgre.h
+libgb_HEADERS = gprs_bssgp.h gprs_ns.h gprs_ns_frgre.h gprs_msgb.h
libgbdir = $(includedir)/osmocom/gprs
diff --git a/openbsc/include/osmocom/gprs/gprs_bssgp.h b/openbsc/include/osmocom/gprs/gprs_bssgp.h
index bfc7d331d..9970a513d 100644
--- a/openbsc/include/osmocom/gprs/gprs_bssgp.h
+++ b/openbsc/include/osmocom/gprs/gprs_bssgp.h
@@ -198,6 +198,7 @@ enum bssgp_ctr {
#include <osmocom/gsm/tlv.h>
+#include <osmocom/gprs/gprs_msgb.h>
/* BSSGP-UL-UNITDATA.ind */
int gprs_bssgp_rcvmsg(struct msgb *msg);
diff --git a/openbsc/include/osmocom/gprs/gprs_msgb.h b/openbsc/include/osmocom/gprs/gprs_msgb.h
new file mode 100644
index 000000000..eddd888f5
--- /dev/null
+++ b/openbsc/include/osmocom/gprs/gprs_msgb.h
@@ -0,0 +1,30 @@
+#ifndef _LIBGB_MSGB_H
+#define _LIBGB_MSGB_H
+
+#include <stdint.h>
+/* the data structure stored in msgb->cb for libgb apps */
+struct libgb_msgb_cb {
+ unsigned char *bssgph;
+ unsigned char *llch;
+
+ /* Cell Identifier */
+ unsigned char *bssgp_cell_id;
+
+ /* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
+ uint16_t nsei;
+ uint16_t bvci;
+
+ /* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
+ uint32_t tlli;
+} __attribute__((packed));
+#define LIBGB_MSGB_CB(__msgb) ((struct libgb_msgb_cb *)&((__msgb)->cb[0]))
+#define msgb_tlli(__x) LIBGB_MSGB_CB(__x)->tlli
+#define msgb_nsei(__x) LIBGB_MSGB_CB(__x)->nsei
+#define msgb_bvci(__x) LIBGB_MSGB_CB(__x)->bvci
+#define msgb_gmmh(__x) (__x)->l3h
+#define msgb_bssgph(__x) LIBGB_MSGB_CB(__x)->bssgph
+#define msgb_bssgp_len(__x) ((__x)->tail - (uint8_t *)msgb_bssgph(__x))
+#define msgb_bcid(__x) LIBGB_MSGB_CB(__x)->bssgp_cell_id
+#define msgb_llch(__x) LIBGB_MSGB_CB(__x)->llch
+
+#endif
diff --git a/openbsc/include/osmocom/gprs/gprs_ns.h b/openbsc/include/osmocom/gprs/gprs_ns.h
index 7045d84d1..cfc2e9050 100644
--- a/openbsc/include/osmocom/gprs/gprs_ns.h
+++ b/openbsc/include/osmocom/gprs/gprs_ns.h
@@ -88,6 +88,7 @@ enum ns_cause {
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
+#include <osmocom/gprs/gprs_msgb.h>
#define NS_TIMERS_COUNT 7
#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)"