libosmocore  UNKNOWN
Osmocom core library
prim.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include <stdint.h>
10 #include <osmocom/core/msgb.h>
11 
12 #define OSMO_PRIM(prim, op) ((prim << 8) | (op & 0xFF))
13 #define OSMO_PRIM_HDR(oph) OSMO_PRIM((oph)->primitive, (oph)->operation)
14 
21 };
22 
23 #define _SAP_GSM_SHIFT 24
24 
25 #define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT)
26 #define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT)
27 
29 struct osmo_prim_hdr {
30  unsigned int sap;
31  unsigned int primitive;
32  enum osmo_prim_operation operation;
33  struct msgb *msg;
34 };
35 
43 static inline void
44 osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap,
45  unsigned int primitive, enum osmo_prim_operation operation,
46  struct msgb *msg)
47 {
48  oph->sap = sap;
49  oph->primitive = primitive;
50  oph->operation = operation;
51  oph->msg = msg;
52 }
53 
55 typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx);
56 
cofirm
Definition: prim.h:20
response
Definition: prim.h:18
Osmocom message buffer.
Definition: msgb.h:42
request
Definition: prim.h:17
indication
Definition: prim.h:19
Osmocom message buffers The Osmocom message buffers are modelled after the &#39;struct skb&#39; inside the Li...
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
initialize a primitive header
Definition: prim.h:44
unsigned int primitive
Primitive number.
Definition: prim.h:31
unsigned int sap
Service Access Point.
Definition: prim.h:30
osmo_prim_operation
primitive operation
Definition: prim.h:16
int(* osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx)
primitive handler callback type
Definition: prim.h:55
primitive header
Definition: prim.h:29
struct msgb * msg
Primitive Operation.
Definition: prim.h:33