libosmocore  0.9.6.194-33e0
Osmocom core library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Osmocom primitives

Files

file  prim.h
 

Data Structures

struct  osmo_prim_hdr
 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
 

Typedefs

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

Enumerations

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

Functions

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 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 [5]
 human-readable string mapping for osmo_prim_operation
 

Detailed Description

Enumeration Type Documentation

primitive operation

Enumerator
PRIM_OP_REQUEST 

request

PRIM_OP_RESPONSE 

response

PRIM_OP_INDICATION 

indication

PRIM_OP_CONFIRM 

confirm

Function Documentation

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

Parameters
[in]ophprimitive header used as key for match
[in]mapslist of mappings from primitive to event
Returns
event determined by map; OSMO_NO_EVENT if no match

References osmo_prim_event_map::event, osmo_prim_event_map::operation, OSMO_NO_EVENT, osmo_prim_hdr::primitive, osmo_prim_event_map::primitive, osmo_prim_hdr::sap, and osmo_prim_event_map::sap.

static void osmo_prim_init ( struct osmo_prim_hdr oph,
unsigned int  sap,
unsigned int  primitive,
enum osmo_prim_operation  operation,
struct msgb msg 
)
inlinestatic

initialize a primitive header

Parameters
[in,out]ophprimitive header
[in]sapService Access Point
[in]primitivePrimitive Number
[in]operationPrimitive Operation (REQ/RESP/IND/CONF)
[in]msgMessage

References osmo_prim_hdr::msg, osmo_prim_hdr::primitive, and osmo_prim_hdr::sap.