summaryrefslogtreecommitdiffstats
path: root/Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h
diff options
context:
space:
mode:
authorTom2011-08-16 13:19:29 +0200
committerTom2011-08-16 13:19:29 +0200
commit7be0213030d2ce50e618e72b5a90e4c5b63c59a4 (patch)
tree98f7f3b0d38c863153f6d95a7129d867c43b652a /Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h
parentremoved whole lib since compiled files were on index (diff)
downloadimsi-catcher-detection-7be0213030d2ce50e618e72b5a90e4c5b63c59a4.tar.gz
imsi-catcher-detection-7be0213030d2ce50e618e72b5a90e4c5b63c59a4.tar.xz
imsi-catcher-detection-7be0213030d2ce50e618e72b5a90e4c5b63c59a4.zip
checked in clean osmocombb lib
Diffstat (limited to 'Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h')
-rw-r--r--Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h b/Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h
new file mode 100644
index 0000000..e892c62
--- /dev/null
+++ b/Src/osmocombb/src/shared/libosmocore/include/osmocom/core/prim.h
@@ -0,0 +1,38 @@
+#ifndef OSMO_PRIMITIVE_H
+#define OSMO_PRIMITIVE_H
+
+#include <stdint.h>
+#include <osmocom/core/msgb.h>
+
+enum osmo_prim_operation {
+ PRIM_OP_REQUEST,
+ PRIM_OP_RESPONSE,
+ PRIM_OP_INDICATION,
+ PRIM_OP_CONFIRM,
+};
+
+#define _SAP_GSM_SHIFT 24
+
+#define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT)
+#define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT)
+
+struct osmo_prim_hdr {
+ unsigned int sap;
+ unsigned int primitive;
+ enum osmo_prim_operation operation;
+ struct msgb *msg; /* message containing associated data */
+};
+
+static inline void
+osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap,
+ unsigned int primitive, enum osmo_prim_operation operation,
+ struct msgb *msg)
+{
+ oph->sap = sap;
+ oph->primitive = primitive;
+ oph->operation = operation;
+ oph->msg = msg;
+}
+
+typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx);
+#endif