\doxysection{src/gsm/bsslap.c File Reference}
\label{bsslap_8c}\index{src/gsm/bsslap.c@{src/gsm/bsslap.c}}


Message encoding and decoding for 3GPP TS 48.\+071 BSSLAP protocol.  


{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/bsslap.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/tlv.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ DEC\+\_\+\+ERR}(RC,  MSG\+\_\+\+TYPE,  IEI,  CAUSE,  fmt,  args...)
\item 
\#define \textbf{ DEC\+\_\+\+IE\+\_\+\+MANDATORY}(IEI,  DEC\+\_\+\+FUN,  DEC\+\_\+\+FUN\+\_\+\+ARG)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+enc\+\_\+cell\+\_\+id} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint16\+\_\+t cell\+\_\+id)
\item 
static int \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+dec\+\_\+cell\+\_\+id} (uint16\+\_\+t $\ast$cell\+\_\+id, enum \textbf{ bsslap\+\_\+msgt} msgt, enum \textbf{ bsslap\+\_\+iei} \textbf{ iei}, struct \textbf{ osmo\+\_\+bsslap\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len})
\item 
static void \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+enc\+\_\+ta} (struct \textbf{ msgb} $\ast$\textbf{ msg}, uint8\+\_\+t \textbf{ ta})
\item 
static int \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+dec\+\_\+ta} (uint8\+\_\+t $\ast$\textbf{ ta}, enum \textbf{ bsslap\+\_\+msgt} msgt, enum \textbf{ bsslap\+\_\+iei} \textbf{ iei}, struct \textbf{ osmo\+\_\+bsslap\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len})
\item 
static void \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+enc\+\_\+cause} (struct \textbf{ msgb} $\ast$\textbf{ msg}, enum \textbf{ bsslap\+\_\+cause} \textbf{ cause})
\item 
static int \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+dec\+\_\+cause} (enum \textbf{ bsslap\+\_\+cause} $\ast$\textbf{ cause}, enum \textbf{ bsslap\+\_\+msgt} msgt, enum \textbf{ bsslap\+\_\+iei} \textbf{ iei}, struct \textbf{ osmo\+\_\+bsslap\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len})
\item 
static void \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+enc\+\_\+chan\+\_\+desc} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm48\+\_\+chan\+\_\+desc} $\ast$\textbf{ chan\+\_\+desc})
\item 
static int \textbf{ osmo\+\_\+bsslap\+\_\+ie\+\_\+dec\+\_\+chan\+\_\+desc} (struct \textbf{ gsm48\+\_\+chan\+\_\+desc} $\ast$\textbf{ chan\+\_\+desc}, enum \textbf{ bsslap\+\_\+msgt} msgt, enum \textbf{ bsslap\+\_\+iei} \textbf{ iei}, struct \textbf{ osmo\+\_\+bsslap\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len})
\item 
int \textbf{ osmo\+\_\+bsslap\+\_\+enc} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ bsslap\+\_\+pdu} $\ast$pdu)
\begin{DoxyCompactList}\small\item\em Encode BSSLAP PDU and append to msgb (3GPP TS 48.\+071). \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+bsslap\+\_\+dec} (struct \textbf{ bsslap\+\_\+pdu} $\ast$pdu, struct \textbf{ osmo\+\_\+bsslap\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, size\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em Decode BSSLAP PDU (3GPP TS 48.\+071). \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static const struct \textbf{ tlv\+\_\+definition} \textbf{ osmo\+\_\+bsslap\+\_\+tlvdef}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+bsslap\+\_\+msgt\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+bsslap\+\_\+iei\+\_\+names} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Message encoding and decoding for 3GPP TS 48.\+071 BSSLAP protocol. 



\doxysubsection{Macro Definition Documentation}
\mbox{\label{bsslap_8c_ae50a80e14381c6ef749034deccb26be9}} 
\index{bsslap.c@{bsslap.c}!DEC\_IE\_MANDATORY@{DEC\_IE\_MANDATORY}}
\index{DEC\_IE\_MANDATORY@{DEC\_IE\_MANDATORY}!bsslap.c@{bsslap.c}}
\doxysubsubsection{DEC\_IE\_MANDATORY}
{\footnotesize\ttfamily \#define DEC\+\_\+\+IE\+\_\+\+MANDATORY(\begin{DoxyParamCaption}\item[{}]{IEI,  }\item[{}]{DEC\+\_\+\+FUN,  }\item[{}]{DEC\+\_\+\+FUN\+\_\+\+ARG }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{                \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{                const \textcolor{keyword}{struct }tlv\_p\_entry *e; \(\backslash\)}
\DoxyCodeLine{                int rc; \(\backslash\)}
\DoxyCodeLine{                if (!(e = TLVP\_GET(\&tp, IEI))) \(\backslash\)}
\DoxyCodeLine{                        DEC\_ERR(-\/EINVAL, pdu-\/>msg\_type, IEI, LCS\_CAUSE\_DATA\_MISSING\_IN\_REQ, \textcolor{stringliteral}{"{}missing mandatory IE"{}}); \(\backslash\)}
\DoxyCodeLine{                rc = DEC\_FUN(DEC\_FUN\_ARG, pdu-\/>msg\_type, IEI, err, err\_ctx, e-\/>val, e-\/>len); \(\backslash\)}
\DoxyCodeLine{                if (rc) \(\backslash\)}
\DoxyCodeLine{                        DEC\_ERR(rc, pdu-\/>msg\_type, IEI, LCS\_CAUSE\_UNSPECIFIED, \textcolor{stringliteral}{"{}cannot parse IE"{}}); \(\backslash\)}
\DoxyCodeLine{        \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
