\doxysection{include/osmocom/isdn/lapd\+\_\+core.h File Reference}
\label{lapd__core_8h}\index{include/osmocom/isdn/lapd\_core.h@{include/osmocom/isdn/lapd\_core.h}}


primitive related stuff  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/prim.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ mdl\+\_\+error\+\_\+ind\+\_\+param}
\begin{DoxyCompactList}\small\item\em for MDL-\/\+ERROR.\+ind \end{DoxyCompactList}\item 
struct \textbf{ dl\+\_\+rel\+\_\+req\+\_\+param}
\begin{DoxyCompactList}\small\item\em for DL-\/\+REL.\+req \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+dlsap\+\_\+prim}
\begin{DoxyCompactList}\small\item\em primitive header for LAPD DL-\/\+SAP primitives \end{DoxyCompactList}\item 
struct \textbf{ lapd\+\_\+msg\+\_\+ctx}
\begin{DoxyCompactList}\small\item\em LAPD message context. \end{DoxyCompactList}\item 
struct \textbf{ lapd\+\_\+cr\+\_\+ent}
\item 
struct \textbf{ lapd\+\_\+history}
\item 
struct \textbf{ lapd\+\_\+datalink}
\begin{DoxyCompactList}\small\item\em LAPD datalink. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ LOGDL}(dl,  \textbf{ level},  fmt,  args...)~ \textbf{ LOGP}(\textbf{ DLLAPD}, \textbf{ level}, \char`\"{}(\%s) \char`\"{}  fmt, (dl)-\/$>$\textbf{ name}, \#\# args)
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+T200\+\_\+\+EXPIRED}~0x01
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+REEST\+\_\+\+REQ}~0x02
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+UNSOL\+\_\+\+UA\+\_\+\+RESP}~0x03
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+UNSOL\+\_\+\+DM\+\_\+\+RESP}~0x04
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+UNSOL\+\_\+\+DM\+\_\+\+RESP\+\_\+\+MF}~0x05
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+UNSOL\+\_\+\+SPRV\+\_\+\+RESP}~0x06
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+SEQ\+\_\+\+ERR}~0x07
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+UFRM\+\_\+\+INC\+\_\+\+PARAM}~0x08
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+SFRM\+\_\+\+INC\+\_\+\+PARAM}~0x09
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+IFRM\+\_\+\+INC\+\_\+\+MBITS}~0x0a
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+IFRM\+\_\+\+INC\+\_\+\+LEN}~0x0b
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+FRM\+\_\+\+UNIMPL}~0x0c
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+SABM\+\_\+\+MF}~0x0d
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+SABM\+\_\+\+INFO\+\_\+\+NOTALL}~0x0e
\item 
\#define \textbf{ MDL\+\_\+\+CAUSE\+\_\+\+FRMR}~0x0f
\item 
\#define \textbf{ LAPD\+\_\+\+F\+\_\+\+RTS}~0x0001
\begin{DoxyCompactList}\small\item\em lapd\+\_\+flags \end{DoxyCompactList}\item 
\#define \textbf{ LAPD\+\_\+\+F\+\_\+\+DROP\+\_\+2\+ND\+\_\+\+REJ}~0x0002
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ osmo\+\_\+dl\+\_\+prim} \{ \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+UNIT\+\_\+\+DATA}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+DATA}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+EST}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+REL}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+SUSP}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+RES}
, \newline
\textbf{ PRIM\+\_\+\+DL\+\_\+\+RECON}
, \newline
\textbf{ PRIM\+\_\+\+MDL\+\_\+\+ERROR}
 \}
\begin{DoxyCompactList}\small\item\em LAPD related primitives (L2$<$-\/$>$L3 SAP) \end{DoxyCompactList}\item 
enum \textbf{ lapd\+\_\+mode} \{ \newline
\textbf{ LAPD\+\_\+\+MODE\+\_\+\+USER}
, \newline
\textbf{ LAPD\+\_\+\+MODE\+\_\+\+NETWORK}
 \}
\begin{DoxyCompactList}\small\item\em LAPD mode/role. \end{DoxyCompactList}\item 
enum \textbf{ lapd\+\_\+state} \{ \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+NULL} = 0
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+TEI\+\_\+\+UNASS}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+ASS\+\_\+\+TEI\+\_\+\+WAIT}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+EST\+\_\+\+TEI\+\_\+\+WAIT}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+IDLE}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+SABM\+\_\+\+SENT}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+DISC\+\_\+\+SENT}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+MF\+\_\+\+EST}
, \newline
\textbf{ LAPD\+\_\+\+STATE\+\_\+\+TIMER\+\_\+\+RECOV}
 \}
\begin{DoxyCompactList}\small\item\em LAPD state (Figure B.\+2/Q.921) \end{DoxyCompactList}\item 
enum \textbf{ lapd\+\_\+t200\+\_\+rts} \{ \newline
\textbf{ LAPD\+\_\+\+T200\+\_\+\+RTS\+\_\+\+OFF} = 0
, \newline
\textbf{ LAPD\+\_\+\+T200\+\_\+\+RTS\+\_\+\+PENDING}
, \newline
\textbf{ LAPD\+\_\+\+T200\+\_\+\+RTS\+\_\+\+RUNNING}
 \}
\begin{DoxyCompactList}\small\item\em LAPD T200 state in RTS mode. \end{DoxyCompactList}\item 
enum \textbf{ lapd\+\_\+format} \{ \newline
\textbf{ LAPD\+\_\+\+FORM\+\_\+\+UKN} = 0
, \newline
\textbf{ LAPD\+\_\+\+FORM\+\_\+I}
, \newline
\textbf{ LAPD\+\_\+\+FORM\+\_\+S}
, \newline
\textbf{ LAPD\+\_\+\+FORM\+\_\+U}
 \}
\begin{DoxyCompactList}\small\item\em LAPD message format (I / S / U) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ lapd\+\_\+dl\+\_\+init} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl, uint8\+\_\+t k, uint8\+\_\+t v\+\_\+range, int maxf)
\begin{DoxyCompactList}\small\item\em Initialize LAPD datalink instance and allocate history. \end{DoxyCompactList}\item 
void \textbf{ lapd\+\_\+dl\+\_\+init2} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl, uint8\+\_\+t k, uint8\+\_\+t v\+\_\+range, int maxf, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Initialize LAPD datalink instance and allocate history. \end{DoxyCompactList}\item 
void \textbf{ lapd\+\_\+dl\+\_\+set\+\_\+name} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl, const char $\ast$\textbf{ name})
\item 
void \textbf{ lapd\+\_\+dl\+\_\+exit} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl)
\item 
void \textbf{ lapd\+\_\+dl\+\_\+reset} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl)
\item 
int \textbf{ lapd\+\_\+dl\+\_\+set\+\_\+flags} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl, unsigned int \textbf{ flags})
\begin{DoxyCompactList}\small\item\em Set lapd\+\_\+flags to change behaviour. \end{DoxyCompactList}\item 
int \textbf{ lapd\+\_\+set\+\_\+mode} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl, enum \textbf{ lapd\+\_\+mode} mode)
\begin{DoxyCompactList}\small\item\em Set the lapdm\+\_\+mode of a LAPDm entity. \end{DoxyCompactList}\item 
int \textbf{ lapd\+\_\+ph\+\_\+data\+\_\+ind} (struct \textbf{ msgb} $\ast$msg, struct \textbf{ lapd\+\_\+msg\+\_\+ctx} $\ast$lctx)
\item 
int \textbf{ lapd\+\_\+ph\+\_\+rts\+\_\+ind} (struct \textbf{ lapd\+\_\+msg\+\_\+ctx} $\ast$lctx)
\begin{DoxyCompactList}\small\item\em Enqueue next LAPD frame and run pending T200. \end{DoxyCompactList}\item 
int \textbf{ lapd\+\_\+recv\+\_\+dlsap} (struct \textbf{ osmo\+\_\+dlsap\+\_\+prim} $\ast$dp, struct \textbf{ lapd\+\_\+msg\+\_\+ctx} $\ast$lctx)
\item 
int \textbf{ lapd\+\_\+t200\+\_\+timeout} (struct \textbf{ lapd\+\_\+datalink} $\ast$dl)
\begin{DoxyCompactList}\small\item\em Handle timeout condition of T200 in RTS mode. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
primitive related stuff 

