summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/prim.h
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-09-27 12:06:55 +0200
committerHarald Welte <laforge@gnumonks.org>2011-10-10 08:38:58 +0200
commit78122ab56817693feaee3f50307ebae72a2492d0 (patch)
tree62adfcea705b935b382c18292ad50a6b43d80f00 /include/osmocom/core/prim.h
parent742fc79d58c1b19bdb20e763acf401398008c1a0 (diff)
Added defines to use primitive/operation tuples in switch/case statements
Diffstat (limited to 'include/osmocom/core/prim.h')
-rw-r--r--include/osmocom/core/prim.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h
index 2e60c46d..b1026fe3 100644
--- a/include/osmocom/core/prim.h
+++ b/include/osmocom/core/prim.h
@@ -10,6 +10,9 @@
#include <stdint.h>
#include <osmocom/core/msgb.h>
+#define OSMO_PRIM(prim, op) ((prim << 8) | (op & 0xFF))
+#define OSMO_PRIM_HDR(oph) OSMO_PRIM((oph)->primitive, (oph)->operation)
+
/*! \brief primitive operation */
enum osmo_prim_operation {
PRIM_OP_REQUEST, /*!< \brief request */