\doxysection{include/osmocom/core/prim.h File Reference}
\label{prim_8h}\index{include/osmocom/core/prim.h@{include/osmocom/core/prim.h}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+prim\+\_\+hdr}
\begin{DoxyCompactList}\small\item\em Osmocom primitive header. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+prim\+\_\+event\+\_\+map}
\begin{DoxyCompactList}\small\item\em single entry in a SAP/\+PRIM/\+OP -\/$>$ EVENT map \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+PRIM}(prim,  op)~((prim $<$$<$ 8) $\vert$ (op \& 0x\+FF))
\item 
\#define \textbf{ OSMO\+\_\+\+PRIM\+\_\+\+HDR}(oph)~\textbf{ OSMO\+\_\+\+PRIM}((oph)-\/$>$primitive, (oph)-\/$>$operation)
\item 
\#define \textbf{ \+\_\+\+SAP\+\_\+\+GSM\+\_\+\+SHIFT}~24
\item 
\#define \textbf{ \+\_\+\+SAP\+\_\+\+GSM\+\_\+\+BASE}~(0x01 $<$$<$ \textbf{ \+\_\+\+SAP\+\_\+\+GSM\+\_\+\+SHIFT})
\item 
\#define \textbf{ \+\_\+\+SAP\+\_\+\+TETRA\+\_\+\+BASE}~(0x02 $<$$<$ \textbf{ \+\_\+\+SAP\+\_\+\+GSM\+\_\+\+SHIFT})
\item 
\#define \textbf{ \+\_\+\+SAP\+\_\+\+SS7\+\_\+\+BASE}~(0x03 $<$$<$ \textbf{ \+\_\+\+SAP\+\_\+\+GSM\+\_\+\+SHIFT})
\item 
\#define \textbf{ OSMO\+\_\+\+NO\+\_\+\+EVENT}~0x\+FFFFFFFF
\begin{DoxyCompactList}\small\item\em magic value to be used as final record of \doxyref{osmo\+\_\+prim\+\_\+event\+\_\+map}{p.}{structosmo__prim__event__map} \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef int($\ast$ \textbf{ osmo\+\_\+prim\+\_\+cb}) (struct \textbf{ osmo\+\_\+prim\+\_\+hdr} $\ast$oph, void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em primitive handler callback type \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ osmo\+\_\+prim\+\_\+operation} \{ \newline
\textbf{ PRIM\+\_\+\+OP\+\_\+\+REQUEST}
, \newline
\textbf{ PRIM\+\_\+\+OP\+\_\+\+RESPONSE}
, \newline
\textbf{ PRIM\+\_\+\+OP\+\_\+\+INDICATION}
, \newline
\textbf{ PRIM\+\_\+\+OP\+\_\+\+CONFIRM}
 \}
\begin{DoxyCompactList}\small\item\em primitive operation \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static const char $\ast$ \textbf{ osmo\+\_\+prim\+\_\+operation\+\_\+name} (enum \textbf{ osmo\+\_\+prim\+\_\+operation} val)
\begin{DoxyCompactList}\small\item\em The upper 8 byte of the technology, the lower 24 bits for the SAP. \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+prim\+\_\+init} (struct \textbf{ osmo\+\_\+prim\+\_\+hdr} $\ast$oph, unsigned int sap, unsigned int primitive, enum \textbf{ osmo\+\_\+prim\+\_\+operation} operation, struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Convenience function to initialize a primitive header. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ osmo\+\_\+event\+\_\+for\+\_\+prim} (const struct \textbf{ osmo\+\_\+prim\+\_\+hdr} $\ast$oph, const struct \textbf{ osmo\+\_\+prim\+\_\+event\+\_\+map} $\ast$maps)
\begin{DoxyCompactList}\small\item\em resolve the (fsm) event for a given primitive using a map \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+prim\+\_\+op\+\_\+names} [$\,$]
\begin{DoxyCompactList}\small\item\em human-\/readable string mapping for \doxyref{osmo\+\_\+prim\+\_\+operation}{p.}{group__prim_ga5bd3196233677c8e9ab66b6fb97060d3} \end{DoxyCompactList}\end{DoxyCompactItemize}
