\doxysection{GSMTAP}
\label{group__gsmtap}\index{GSMTAP@{GSMTAP}}


GSMTAP utility routines.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ gsmtap\+\_\+util.\+h}
\item 
file \textbf{ gsmtap\+\_\+util.\+c}
\begin{DoxyCompactList}\small\item\em GSMTAP support code in libosmocore. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gsmtap\+\_\+inst}
\begin{DoxyCompactList}\small\item\em one gsmtap instance \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \textbf{ chantype\+\_\+rsl2gsmtap2} (uint8\+\_\+t rsl\+\_\+chantype, uint8\+\_\+t \textbf{ link\+\_\+id}, bool user\+\_\+plane)
\begin{DoxyCompactList}\small\item\em convert RSL channel number to GSMTAP channel type \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ chantype\+\_\+rsl2gsmtap} (uint8\+\_\+t rsl\+\_\+chantype, uint8\+\_\+t \textbf{ link\+\_\+id})
\begin{DoxyCompactList}\small\item\em convert RSL channel number to GSMTAP channel type \end{DoxyCompactList}\item 
void \textbf{ chantype\+\_\+gsmtap2rsl} (uint8\+\_\+t gsmtap\+\_\+chantype, uint8\+\_\+t $\ast$rsl\+\_\+chantype, uint8\+\_\+t $\ast$\textbf{ link\+\_\+id})
\begin{DoxyCompactList}\small\item\em convert GSMTAP channel type to RSL channel number + Link ID \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ gsmtap\+\_\+makemsg\+\_\+ex} (uint8\+\_\+t \textbf{ type}, uint16\+\_\+t \textbf{ arfcn}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t chan\+\_\+type, uint8\+\_\+t ss, uint32\+\_\+t fn, int8\+\_\+t \textbf{ signal\+\_\+dbm}, int8\+\_\+t snr, const uint8\+\_\+t $\ast$\textbf{ data}, unsigned int \textbf{ len})
\begin{DoxyCompactList}\small\item\em create an arbitrary type GSMTAP message \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ gsmtap\+\_\+makemsg} (uint16\+\_\+t \textbf{ arfcn}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t chan\+\_\+type, uint8\+\_\+t ss, uint32\+\_\+t fn, int8\+\_\+t \textbf{ signal\+\_\+dbm}, int8\+\_\+t snr, const uint8\+\_\+t $\ast$\textbf{ data}, unsigned int \textbf{ len})
\begin{DoxyCompactList}\small\item\em create L1/\+L2 data and put it into GSMTAP \end{DoxyCompactList}\item 
int \textbf{ gsmtap\+\_\+inst\+\_\+fd} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti)
\begin{DoxyCompactList}\small\item\em Deprecated, use \doxyref{gsmtap\+\_\+inst\+\_\+fd2()}{p.}{group__gsmtap_gade1327e89e4b4fe0e08bf9947ec99a04} instead. \end{DoxyCompactList}\item 
int \textbf{ gsmtap\+\_\+inst\+\_\+fd2} (const struct \textbf{ gsmtap\+\_\+inst} $\ast$gti)
\begin{DoxyCompactList}\small\item\em obtain the file descriptor associated with a gsmtap instance \end{DoxyCompactList}\item 
int \textbf{ gsmtap\+\_\+source\+\_\+init\+\_\+fd} (const char $\ast$\textbf{ host}, uint16\+\_\+t port)
\item 
int \textbf{ gsmtap\+\_\+source\+\_\+init\+\_\+fd2} (const char $\ast$local\+\_\+host, uint16\+\_\+t local\+\_\+port, const char $\ast$rem\+\_\+host, uint16\+\_\+t rem\+\_\+port)
\item 
int \textbf{ gsmtap\+\_\+source\+\_\+add\+\_\+sink\+\_\+fd} (int gsmtap\+\_\+fd)
\item 
struct \textbf{ gsmtap\+\_\+inst} $\ast$ \textbf{ gsmtap\+\_\+source\+\_\+init} (const char $\ast$\textbf{ host}, uint16\+\_\+t port, int ofd\+\_\+wq\+\_\+mode)
\item 
struct \textbf{ gsmtap\+\_\+inst} $\ast$ \textbf{ gsmtap\+\_\+source\+\_\+init2} (const char $\ast$local\+\_\+host, uint16\+\_\+t local\+\_\+port, const char $\ast$rem\+\_\+host, uint16\+\_\+t rem\+\_\+port, int ofd\+\_\+wq\+\_\+mode)
\item 
void \textbf{ gsmtap\+\_\+source\+\_\+free} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti)
\item 
int \textbf{ gsmtap\+\_\+source\+\_\+set\+\_\+nonblock} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti, int on)
\item 
int \textbf{ gsmtap\+\_\+source\+\_\+add\+\_\+sink} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti)
\item 
bool \textbf{ gsmtap\+\_\+source\+\_\+using\+\_\+wq} (const struct \textbf{ gsmtap\+\_\+inst} $\ast$gti)
\item 
int \textbf{ gsmtap\+\_\+sendmsg} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti, struct \textbf{ msgb} $\ast$\textbf{ msg})
\item 
int \textbf{ gsmtap\+\_\+sendmsg\+\_\+free} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti, struct \textbf{ msgb} $\ast$\textbf{ msg})
\item 
int \textbf{ gsmtap\+\_\+send\+\_\+ex} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti, uint8\+\_\+t \textbf{ type}, uint16\+\_\+t \textbf{ arfcn}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t chan\+\_\+type, uint8\+\_\+t ss, uint32\+\_\+t fn, int8\+\_\+t \textbf{ signal\+\_\+dbm}, int8\+\_\+t snr, const uint8\+\_\+t $\ast$\textbf{ data}, unsigned int \textbf{ len})
\item 
int \textbf{ gsmtap\+\_\+send} (struct \textbf{ gsmtap\+\_\+inst} $\ast$gti, uint16\+\_\+t \textbf{ arfcn}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t chan\+\_\+type, uint8\+\_\+t ss, uint32\+\_\+t fn, int8\+\_\+t \textbf{ signal\+\_\+dbm}, int8\+\_\+t snr, const uint8\+\_\+t $\ast$\textbf{ data}, unsigned int \textbf{ len})
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gsmtap\+\_\+gsm\+\_\+channel\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gsmtap\+\_\+type\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gsmtap\+\_\+gsm\+\_\+channel\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gsmtap\+\_\+type\+\_\+names} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
GSMTAP utility routines. 

Encapsulates GSM messages over UDP. 

\doxysubsection{Function Documentation}
\mbox{\label{group__gsmtap_ga3567072c254391b92eabf48ed71f9aac}} 
\index{GSMTAP@{GSMTAP}!chantype\_gsmtap2rsl@{chantype\_gsmtap2rsl}}
\index{chantype\_gsmtap2rsl@{chantype\_gsmtap2rsl}!GSMTAP@{GSMTAP}}
\doxysubsubsection{chantype\_gsmtap2rsl()}
{\footnotesize\ttfamily void chantype\+\_\+gsmtap2rsl (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{gsmtap\+\_\+chantype,  }\item[{uint8\+\_\+t $\ast$}]{rsl\+\_\+chantype,  }\item[{uint8\+\_\+t $\ast$}]{link\+\_\+id }\end{DoxyParamCaption})}



convert GSMTAP channel type to RSL channel number + Link ID 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gsmtap\+\_\+chantype} & GSMTAP channel type \\
\hline
\mbox{\texttt{ out}}  & {\em rsl\+\_\+chantype} & RSL channel mumber \\
\hline
\mbox{\texttt{ out}}  & {\em link\+\_\+id} & RSL link identifier \\
\hline
\end{DoxyParams}


References \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+ACCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+AGCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+BCCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+FACCH\+\_\+F}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+FACCH\+\_\+H}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+PCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+PDCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+RACH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+SDCCH4}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+SDCCH8}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+VOICE\+\_\+F}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+VOICE\+\_\+H}, \textbf{ link\+\_\+id}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+BCCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+Bm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+Lm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+PDCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+PCH\+\_\+\+AGCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+RACH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+SDCCH4\+\_\+\+ACCH}, and \textbf{ RSL\+\_\+\+CHAN\+\_\+\+SDCCH8\+\_\+\+ACCH}.

\mbox{\label{group__gsmtap_ga14574d2d831766b848e5ff93b89e8338}} 
\index{GSMTAP@{GSMTAP}!chantype\_rsl2gsmtap@{chantype\_rsl2gsmtap}}
\index{chantype\_rsl2gsmtap@{chantype\_rsl2gsmtap}!GSMTAP@{GSMTAP}}
\doxysubsubsection{chantype\_rsl2gsmtap()}
{\footnotesize\ttfamily uint8\+\_\+t chantype\+\_\+rsl2gsmtap (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{rsl\+\_\+chantype,  }\item[{uint8\+\_\+t}]{link\+\_\+id }\end{DoxyParamCaption})}



convert RSL channel number to GSMTAP channel type 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rsl\+\_\+chantype} & RSL channel type \\
\hline
\mbox{\texttt{ in}}  & {\em link\+\_\+id} & RSL link identifier \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
GSMTAP channel type 
\end{DoxyReturn}


References \textbf{ chantype\+\_\+rsl2gsmtap2()}, and \textbf{ link\+\_\+id}.

\mbox{\label{group__gsmtap_ga2fa99893aabc3b82458803a914fee39a}} 
\index{GSMTAP@{GSMTAP}!chantype\_rsl2gsmtap2@{chantype\_rsl2gsmtap2}}
\index{chantype\_rsl2gsmtap2@{chantype\_rsl2gsmtap2}!GSMTAP@{GSMTAP}}
\doxysubsubsection{chantype\_rsl2gsmtap2()}
{\footnotesize\ttfamily uint8\+\_\+t chantype\+\_\+rsl2gsmtap2 (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{rsl\+\_\+chantype,  }\item[{uint8\+\_\+t}]{link\+\_\+id,  }\item[{bool}]{user\+\_\+plane }\end{DoxyParamCaption})}



convert RSL channel number to GSMTAP channel type 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rsl\+\_\+chantype} & RSL channel type \\
\hline
\mbox{\texttt{ in}}  & {\em link\+\_\+id} & RSL link identifier \\
\hline
\mbox{\texttt{ in}}  & {\em user\+\_\+plane} & Is this voice/csd user plane (1) or signaling (0) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
GSMTAP channel type 
\end{DoxyReturn}


References \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+ACCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+BCCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+CBCH51}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+CBCH52}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+FACCH\+\_\+F}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+FACCH\+\_\+H}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+PCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+PDCH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+RACH}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+SDCCH4}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+SDCCH8}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+UNKNOWN}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+VOICE\+\_\+F}, \textbf{ GSMTAP\+\_\+\+CHANNEL\+\_\+\+VOICE\+\_\+H}, \textbf{ link\+\_\+id}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+BCCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+Bm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+Lm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+CBCH4}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+CBCH8}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+PDCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+VAMOS\+\_\+\+Bm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+OSMO\+\_\+\+VAMOS\+\_\+\+Lm\+\_\+\+ACCHs}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+PCH\+\_\+\+AGCH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+RACH}, \textbf{ RSL\+\_\+\+CHAN\+\_\+\+SDCCH4\+\_\+\+ACCH}, and \textbf{ RSL\+\_\+\+CHAN\+\_\+\+SDCCH8\+\_\+\+ACCH}.



Referenced by \textbf{ chantype\+\_\+rsl2gsmtap()}.

\mbox{\label{group__gsmtap_gad201f805caa17a143201ecce09a21208}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_inst\_fd@{gsmtap\_inst\_fd}}
\index{gsmtap\_inst\_fd@{gsmtap\_inst\_fd}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_inst\_fd()}
{\footnotesize\ttfamily int gsmtap\+\_\+inst\+\_\+fd (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti }\end{DoxyParamCaption})}



Deprecated, use \doxyref{gsmtap\+\_\+inst\+\_\+fd2()}{p.}{group__gsmtap_gade1327e89e4b4fe0e08bf9947ec99a04} instead. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gti} & GSMTAP instance \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
file descriptor of GSMTAP instance 
\end{DoxyReturn}


References \textbf{ gsmtap\+\_\+inst\+\_\+fd2()}.

\mbox{\label{group__gsmtap_gade1327e89e4b4fe0e08bf9947ec99a04}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_inst\_fd2@{gsmtap\_inst\_fd2}}
\index{gsmtap\_inst\_fd2@{gsmtap\_inst\_fd2}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_inst\_fd2()}
{\footnotesize\ttfamily int gsmtap\+\_\+inst\+\_\+fd2 (\begin{DoxyParamCaption}\item[{const struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti }\end{DoxyParamCaption})}



obtain the file descriptor associated with a gsmtap instance 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gti} & GSMTAP instance \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
file descriptor of GSMTAP instance 
\end{DoxyReturn}


References \textbf{ gsmtap\+\_\+inst\+::source\+\_\+fd}.



Referenced by \textbf{ gsmtap\+\_\+inst\+\_\+fd()}.

\mbox{\label{group__gsmtap_ga03a4ac0d6f7a80807415476fdc804da6}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_makemsg@{gsmtap\_makemsg}}
\index{gsmtap\_makemsg@{gsmtap\_makemsg}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_makemsg()}
{\footnotesize\ttfamily struct \textbf{ msgb} $\ast$ gsmtap\+\_\+makemsg (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{arfcn,  }\item[{uint8\+\_\+t}]{ts,  }\item[{uint8\+\_\+t}]{chan\+\_\+type,  }\item[{uint8\+\_\+t}]{ss,  }\item[{uint32\+\_\+t}]{fn,  }\item[{int8\+\_\+t}]{signal\+\_\+dbm,  }\item[{int8\+\_\+t}]{snr,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}



create L1/\+L2 data and put it into GSMTAP 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em arfcn} & GSM ARFCN (Channel Number) \\
\hline
\mbox{\texttt{ in}}  & {\em ts} & GSM time slot \\
\hline
\mbox{\texttt{ in}}  & {\em chan\+\_\+type} & Channel Type \\
\hline
\mbox{\texttt{ in}}  & {\em ss} & Sub-\/slot \\
\hline
\mbox{\texttt{ in}}  & {\em fn} & GSM Frame Number \\
\hline
\mbox{\texttt{ in}}  & {\em signal\+\_\+dbm} & Signal Strength (d\+Bm) \\
\hline
\mbox{\texttt{ in}}  & {\em snr} & Signal/\+Noise Ratio (SNR) \\
\hline
\mbox{\texttt{ in}}  & {\em data} & Pointer to data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Length of \textbf{ data} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
message buffer or NULL in case of error
\end{DoxyReturn}
This function will allocate a new msgb and fill it with a GSMTAP header containing the information 

References \textbf{ arfcn}, \textbf{ data}, \textbf{ gsmtap\+\_\+makemsg\+\_\+ex()}, \textbf{ GSMTAP\+\_\+\+TYPE\+\_\+\+UM}, \textbf{ len()}, \textbf{ signal\+\_\+dbm}, and \textbf{ ts}.

\mbox{\label{group__gsmtap_ga4de6489fab3bff7590e53dd9859e3c44}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_makemsg\_ex@{gsmtap\_makemsg\_ex}}
\index{gsmtap\_makemsg\_ex@{gsmtap\_makemsg\_ex}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_makemsg\_ex()}
{\footnotesize\ttfamily struct \textbf{ msgb} $\ast$ gsmtap\+\_\+makemsg\+\_\+ex (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{type,  }\item[{uint16\+\_\+t}]{arfcn,  }\item[{uint8\+\_\+t}]{ts,  }\item[{uint8\+\_\+t}]{chan\+\_\+type,  }\item[{uint8\+\_\+t}]{ss,  }\item[{uint32\+\_\+t}]{fn,  }\item[{int8\+\_\+t}]{signal\+\_\+dbm,  }\item[{int8\+\_\+t}]{snr,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}



create an arbitrary type GSMTAP message 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em type} & The GSMTAP\+\_\+\+TYPE\+\_\+xxx constant of the message to create \\
\hline
\mbox{\texttt{ in}}  & {\em arfcn} & GSM ARFCN (Channel Number) \\
\hline
\mbox{\texttt{ in}}  & {\em ts} & GSM time slot \\
\hline
\mbox{\texttt{ in}}  & {\em chan\+\_\+type} & Channel Type \\
\hline
\mbox{\texttt{ in}}  & {\em ss} & Sub-\/slot \\
\hline
\mbox{\texttt{ in}}  & {\em fn} & GSM Frame Number \\
\hline
\mbox{\texttt{ in}}  & {\em signal\+\_\+dbm} & Signal Strength (d\+Bm) \\
\hline
\mbox{\texttt{ in}}  & {\em snr} & Signal/\+Noise Ratio (SNR) \\
\hline
\mbox{\texttt{ in}}  & {\em data} & Pointer to data buffer \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Length of \textbf{ data} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
dynamically allocated message buffer containing data
\end{DoxyReturn}
This function will allocate a new msgb and fill it with a GSMTAP header containing the information 

References \textbf{ gsmtap\+\_\+hdr\+::antenna\+\_\+nr}, \textbf{ arfcn}, \textbf{ gsmtap\+\_\+hdr\+::arfcn}, \textbf{ data}, \textbf{ gsmtap\+\_\+hdr\+::frame\+\_\+number}, \textbf{ GSMTAP\+\_\+\+VERSION}, \textbf{ gsmtap\+\_\+hdr\+::hdr\+\_\+len}, \textbf{ len()}, \textbf{ msg}, \textbf{ msgb\+\_\+alloc()}, \textbf{ msgb\+\_\+put()}, \textbf{ osmo\+\_\+htonl}, \textbf{ osmo\+\_\+htons}, \textbf{ signal\+\_\+dbm}, \textbf{ gsmtap\+\_\+hdr\+::signal\+\_\+dbm}, \textbf{ gsmtap\+\_\+hdr\+::snr\+\_\+db}, \textbf{ gsmtap\+\_\+hdr\+::sub\+\_\+slot}, \textbf{ gsmtap\+\_\+hdr\+::sub\+\_\+type}, \textbf{ gsmtap\+\_\+hdr\+::timeslot}, \textbf{ ts}, \textbf{ type}, \textbf{ gsmtap\+\_\+hdr\+::type}, and \textbf{ gsmtap\+\_\+hdr\+::version}.



Referenced by \textbf{ gsmtap\+\_\+makemsg()}.

\mbox{\label{group__gsmtap_gae1e4e260037809eb70765c3c6044a2e4}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_send@{gsmtap\_send}}
\index{gsmtap\_send@{gsmtap\_send}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_send()}
{\footnotesize\ttfamily int gsmtap\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti,  }\item[{uint16\+\_\+t}]{arfcn,  }\item[{uint8\+\_\+t}]{ts,  }\item[{uint8\+\_\+t}]{chan\+\_\+type,  }\item[{uint8\+\_\+t}]{ss,  }\item[{uint32\+\_\+t}]{fn,  }\item[{int8\+\_\+t}]{signal\+\_\+dbm,  }\item[{int8\+\_\+t}]{snr,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_gaa998fa989a15883ea67ec5eea58a9283}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_send\_ex@{gsmtap\_send\_ex}}
\index{gsmtap\_send\_ex@{gsmtap\_send\_ex}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_send\_ex()}
{\footnotesize\ttfamily int gsmtap\+\_\+send\+\_\+ex (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti,  }\item[{uint8\+\_\+t}]{type,  }\item[{uint16\+\_\+t}]{arfcn,  }\item[{uint8\+\_\+t}]{ts,  }\item[{uint8\+\_\+t}]{chan\+\_\+type,  }\item[{uint8\+\_\+t}]{ss,  }\item[{uint32\+\_\+t}]{fn,  }\item[{int8\+\_\+t}]{signal\+\_\+dbm,  }\item[{int8\+\_\+t}]{snr,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_ga41ee3b7cd837968637a122aa83ea5af3}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_sendmsg@{gsmtap\_sendmsg}}
\index{gsmtap\_sendmsg@{gsmtap\_sendmsg}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_sendmsg()}
{\footnotesize\ttfamily int gsmtap\+\_\+sendmsg (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti,  }\item[{struct \textbf{ msgb} $\ast$}]{msg }\end{DoxyParamCaption})}



Referenced by \textbf{ \+\_\+gsmtap\+\_\+raw\+\_\+output()}.

\mbox{\label{group__gsmtap_gaa05d2bb112ac9d2d80ed7dfe2926c519}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_sendmsg\_free@{gsmtap\_sendmsg\_free}}
\index{gsmtap\_sendmsg\_free@{gsmtap\_sendmsg\_free}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_sendmsg\_free()}
{\footnotesize\ttfamily int gsmtap\+\_\+sendmsg\+\_\+free (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti,  }\item[{struct \textbf{ msgb} $\ast$}]{msg }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_ga08387e8de5e7633d897cd6c2f685a467}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_add\_sink@{gsmtap\_source\_add\_sink}}
\index{gsmtap\_source\_add\_sink@{gsmtap\_source\_add\_sink}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_add\_sink()}
{\footnotesize\ttfamily int gsmtap\+\_\+source\+\_\+add\+\_\+sink (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti }\end{DoxyParamCaption})}



Referenced by \textbf{ log\+\_\+target\+\_\+create\+\_\+gsmtap()}.

\mbox{\label{group__gsmtap_ga0edfda6bec2d5b85a6b97823c806f676}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_add\_sink\_fd@{gsmtap\_source\_add\_sink\_fd}}
\index{gsmtap\_source\_add\_sink\_fd@{gsmtap\_source\_add\_sink\_fd}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_add\_sink\_fd()}
{\footnotesize\ttfamily int gsmtap\+\_\+source\+\_\+add\+\_\+sink\+\_\+fd (\begin{DoxyParamCaption}\item[{int}]{gsmtap\+\_\+fd }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_gac12a6850de80b00a9ce4ab1261a67a55}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_free@{gsmtap\_source\_free}}
\index{gsmtap\_source\_free@{gsmtap\_source\_free}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_free()}
{\footnotesize\ttfamily void gsmtap\+\_\+source\+\_\+free (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti }\end{DoxyParamCaption})}



Referenced by \textbf{ log\+\_\+target\+\_\+destroy()}.

\mbox{\label{group__gsmtap_ga8f0bdeba378d233f34057e63e2d3a6d3}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_init@{gsmtap\_source\_init}}
\index{gsmtap\_source\_init@{gsmtap\_source\_init}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_init()}
{\footnotesize\ttfamily struct \textbf{ gsmtap\+\_\+inst} $\ast$ gsmtap\+\_\+source\+\_\+init (\begin{DoxyParamCaption}\item[{const char $\ast$}]{host,  }\item[{uint16\+\_\+t}]{port,  }\item[{int}]{ofd\+\_\+wq\+\_\+mode }\end{DoxyParamCaption})}



Referenced by \textbf{ log\+\_\+target\+\_\+create\+\_\+gsmtap()}.

\mbox{\label{group__gsmtap_ga3e9f314f1a5098f65770a8616d5cac56}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_init2@{gsmtap\_source\_init2}}
\index{gsmtap\_source\_init2@{gsmtap\_source\_init2}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_init2()}
{\footnotesize\ttfamily struct \textbf{ gsmtap\+\_\+inst} $\ast$ gsmtap\+\_\+source\+\_\+init2 (\begin{DoxyParamCaption}\item[{const char $\ast$}]{local\+\_\+host,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$}]{rem\+\_\+host,  }\item[{uint16\+\_\+t}]{rem\+\_\+port,  }\item[{int}]{ofd\+\_\+wq\+\_\+mode }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_gadd7e1c24b0af2f07c1df3ef12fd2a3b3}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_init\_fd@{gsmtap\_source\_init\_fd}}
\index{gsmtap\_source\_init\_fd@{gsmtap\_source\_init\_fd}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_init\_fd()}
{\footnotesize\ttfamily int gsmtap\+\_\+source\+\_\+init\+\_\+fd (\begin{DoxyParamCaption}\item[{const char $\ast$}]{host,  }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_gaac97f186f5b781a7f15bd9273e2821b0}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_init\_fd2@{gsmtap\_source\_init\_fd2}}
\index{gsmtap\_source\_init\_fd2@{gsmtap\_source\_init\_fd2}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_init\_fd2()}
{\footnotesize\ttfamily int gsmtap\+\_\+source\+\_\+init\+\_\+fd2 (\begin{DoxyParamCaption}\item[{const char $\ast$}]{local\+\_\+host,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$}]{rem\+\_\+host,  }\item[{uint16\+\_\+t}]{rem\+\_\+port }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_gac018ffcd4a62f619259e6c7fceb8d9ba}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_set\_nonblock@{gsmtap\_source\_set\_nonblock}}
\index{gsmtap\_source\_set\_nonblock@{gsmtap\_source\_set\_nonblock}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_set\_nonblock()}
{\footnotesize\ttfamily int gsmtap\+\_\+source\+\_\+set\+\_\+nonblock (\begin{DoxyParamCaption}\item[{struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti,  }\item[{int}]{on }\end{DoxyParamCaption})}

\mbox{\label{group__gsmtap_ga847f5c0c8e5e9e7f9755c0dd573a7dfe}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_source\_using\_wq@{gsmtap\_source\_using\_wq}}
\index{gsmtap\_source\_using\_wq@{gsmtap\_source\_using\_wq}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_source\_using\_wq()}
{\footnotesize\ttfamily bool gsmtap\+\_\+source\+\_\+using\+\_\+wq (\begin{DoxyParamCaption}\item[{const struct \textbf{ gsmtap\+\_\+inst} $\ast$}]{gti }\end{DoxyParamCaption})}



\doxysubsection{Variable Documentation}
\mbox{\label{group__gsmtap_ga4f9601754c2db0434194ebdf0742ccb9}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_gsm\_channel\_names@{gsmtap\_gsm\_channel\_names}}
\index{gsmtap\_gsm\_channel\_names@{gsmtap\_gsm\_channel\_names}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_gsm\_channel\_names\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} gsmtap\+\_\+gsm\+\_\+channel\+\_\+names[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}

\mbox{\label{group__gsmtap_ga4f9601754c2db0434194ebdf0742ccb9}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_gsm\_channel\_names@{gsmtap\_gsm\_channel\_names}}
\index{gsmtap\_gsm\_channel\_names@{gsmtap\_gsm\_channel\_names}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_gsm\_channel\_names\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} gsmtap\+\_\+gsm\+\_\+channel\+\_\+names[$\,$]}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_UNKNOWN, \textcolor{stringliteral}{"{}UNKNOWN"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_BCCH,               \textcolor{stringliteral}{"{}BCCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_CCCH,               \textcolor{stringliteral}{"{}CCCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_RACH,               \textcolor{stringliteral}{"{}RACH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_AGCH,               \textcolor{stringliteral}{"{}AGCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_PCH,         \textcolor{stringliteral}{"{}PCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_SDCCH,             \textcolor{stringliteral}{"{}SDCCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_SDCCH4,   \textcolor{stringliteral}{"{}SDCCH/4"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_SDCCH8,   \textcolor{stringliteral}{"{}SDCCH/8"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_FACCH\_F, \textcolor{stringliteral}{"{}FACCH/F"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_FACCH\_H, \textcolor{stringliteral}{"{}FACCH/H"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_PACCH,             \textcolor{stringliteral}{"{}PACCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_CBCH52,   \textcolor{stringliteral}{"{}CBCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_PDCH,               \textcolor{stringliteral}{"{}PDCH"{}} \} ,}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_PTCCH,             \textcolor{stringliteral}{"{}PTTCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_CBCH51,   \textcolor{stringliteral}{"{}CBCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_ACCH | GSMTAP\_CHANNEL\_SDCCH, \textcolor{stringliteral}{"{}LSACCH"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_ACCH | GSMTAP\_CHANNEL\_SDCCH4, \textcolor{stringliteral}{"{}SACCH/4"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_ACCH | GSMTAP\_CHANNEL\_SDCCH8, \textcolor{stringliteral}{"{}SACCH/8"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_ACCH | GSMTAP\_CHANNEL\_FACCH\_F, \textcolor{stringliteral}{"{}SACCH/F"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_ACCH | GSMTAP\_CHANNEL\_FACCH\_H, \textcolor{stringliteral}{"{}SACCH/H"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_VOICE\_F, \textcolor{stringliteral}{"{}TCH/F"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_CHANNEL\_VOICE\_H, \textcolor{stringliteral}{"{}TCH/H"{}} \},}
\DoxyCodeLine{        \{ 0, NULL \}}
\DoxyCodeLine{\}}

\end{DoxyCode}
\mbox{\label{group__gsmtap_gac6ab8513b1e0e8505b89847a4f9a4a09}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_type\_names@{gsmtap\_type\_names}}
\index{gsmtap\_type\_names@{gsmtap\_type\_names}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_type\_names\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} gsmtap\+\_\+type\+\_\+names[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}

\mbox{\label{group__gsmtap_gac6ab8513b1e0e8505b89847a4f9a4a09}} 
\index{GSMTAP@{GSMTAP}!gsmtap\_type\_names@{gsmtap\_type\_names}}
\index{gsmtap\_type\_names@{gsmtap\_type\_names}!GSMTAP@{GSMTAP}}
\doxysubsubsection{gsmtap\_type\_names\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} gsmtap\+\_\+type\+\_\+names[$\,$]}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_UM,         \textcolor{stringliteral}{"{}GSM Um (MS<-\/>BTS)"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_ABIS,             \textcolor{stringliteral}{"{}GSM Abis (BTS<-\/>BSC)"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_UM\_BURST,             \textcolor{stringliteral}{"{}GSM Um burst (MS<-\/>BTS)"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_SIM,               \textcolor{stringliteral}{"{}SIM Card"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_TETRA\_I1,             \textcolor{stringliteral}{"{}TETRA V+D"{}}  \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_TETRA\_I1\_BURST, \textcolor{stringliteral}{"{}TETRA bursts"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_WMX\_BURST,   \textcolor{stringliteral}{"{}WiMAX burst"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_GB\_LLC,         \textcolor{stringliteral}{"{}GPRS Gb LLC"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_GB\_SNDCP,             \textcolor{stringliteral}{"{}GPRS Gb SNDCP"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_GMR1\_UM,               \textcolor{stringliteral}{"{}GMR-\/1 air interfeace (MES-\/MS<-\/>GTS)"{}}\},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_UMTS\_RLC\_MAC,     \textcolor{stringliteral}{"{}UMTS RLC/MAC"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_UMTS\_RRC,             \textcolor{stringliteral}{"{}UMTS RRC"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_LTE\_RRC,               \textcolor{stringliteral}{"{}LTE RRC"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_LTE\_MAC,               \textcolor{stringliteral}{"{}LTE MAC"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_LTE\_MAC\_FRAMED, \textcolor{stringliteral}{"{}LTE MAC with context hdr"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_OSMOCORE\_LOG,     \textcolor{stringliteral}{"{}libosmocore logging"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_QC\_DIAG,               \textcolor{stringliteral}{"{}Qualcomm DIAG"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_LTE\_NAS,               \textcolor{stringliteral}{"{}LTE Non-\/Access Stratum"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_E1T1,             \textcolor{stringliteral}{"{}E1/T1 lines"{}} \},}
\DoxyCodeLine{        \{ GSMTAP\_TYPE\_GSM\_RLP,               \textcolor{stringliteral}{"{}GSM Radio Link Protocol"{}} \},}
\DoxyCodeLine{        \{ 0, NULL \}}
\DoxyCodeLine{\}}

\end{DoxyCode}
