libosmocore 1.9.0.192-1c24
Osmocom core library
prim.h File Reference
#include <stdint.h>
#include <osmocom/core/msgb.h>

Go to the source code of this file.

Data Structures

struct  osmo_prim_hdr
 Osmocom primitive header. More...
 
struct  osmo_prim_event_map
 single entry in a SAP/PRIM/OP -> EVENT map More...
 

Macros

#define OSMO_PRIM(prim, op)   ((prim << 8) | (op & 0xFF))
 
#define OSMO_PRIM_HDR(oph)   OSMO_PRIM((oph)->primitive, (oph)->operation)
 
#define _SAP_GSM_SHIFT   24
 
#define _SAP_GSM_BASE   (0x01 << _SAP_GSM_SHIFT)
 
#define _SAP_TETRA_BASE   (0x02 << _SAP_GSM_SHIFT)
 
#define _SAP_SS7_BASE   (0x03 << _SAP_GSM_SHIFT)
 
#define OSMO_NO_EVENT   0xFFFFFFFF
 magic value to be used as final record of osmo_prim_event_map More...
 

Typedefs

typedef int(* osmo_prim_cb) (struct osmo_prim_hdr *oph, void *ctx)
 primitive handler callback type More...
 

Enumerations

enum  osmo_prim_operation {
  PRIM_OP_REQUEST ,
  PRIM_OP_RESPONSE ,
  PRIM_OP_INDICATION ,
  PRIM_OP_CONFIRM
}
 primitive operation More...
 

Functions

static const char * osmo_prim_operation_name (enum osmo_prim_operation val)
 The upper 8 byte of the technology, the lower 24 bits for the SAP. More...
 
static void osmo_prim_init (struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
 Convenience function to initialize a primitive header. More...
 
uint32_t osmo_event_for_prim (const struct osmo_prim_hdr *oph, const struct osmo_prim_event_map *maps)
 resolve the (fsm) event for a given primitive using a map More...
 

Variables

const struct value_string osmo_prim_op_names []
 human-readable string mapping for osmo_prim_operation More...