\doxysection{include/osmocom/gsm/gsm\+\_\+utils.h File Reference}
\label{gsm__utils_8h}\index{include/osmocom/gsm/gsm\_utils.h@{include/osmocom/gsm/gsm\_utils.h}}


GSM utility functions, e.\+g.  


{\ttfamily \#include $<$stddef.\+h$>$}\newline
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/defs.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gsm\+\_\+time}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ ADD\+\_\+\+MODULO}(sum,  delta,  modulo)
\item 
\#define \textbf{ GSM\+\_\+\+MAX\+\_\+\+FN}~(26$\ast$51$\ast$2048)
\item 
\#define \textbf{ GSM\+\_\+\+FN\+\_\+\+UNSET}~0x\+FFFFFFFF
\item 
\#define \textbf{ OSMO\+\_\+\+MAX\+\_\+\+RAND\+\_\+\+ID\+\_\+\+LEN}~16
\item 
\#define \textbf{ ARFCN\+\_\+\+PCS}~0x8000
\item 
\#define \textbf{ ARFCN\+\_\+\+UPLINK}~0x4000
\item 
\#define \textbf{ ARFCN\+\_\+\+FLAG\+\_\+\+MASK}~0xf000 /$\ast$ Reserve the upper 5 bits \textbf{ for} \textbf{ flags} $\ast$/
\item 
\#define \textbf{ GSM\+\_\+\+RFN\+\_\+\+MODULUS}~42432
\item 
\#define \textbf{ GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+\+F\+\_\+\+TCH\+\_\+\+H\+\_\+\+PDCH}~\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+OSMO\+\_\+\+DYN}
\item 
\#define \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}~0x10000
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ gsm\+\_\+band} \{ \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+850} = 1
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+900} = 2
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+1800} = 4
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+1900} = 8
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+450} = 0x10
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+480} = 0x20
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+750} = 0x40
, \newline
\textbf{ GSM\+\_\+\+BAND\+\_\+810} = 0x80
 \}
\item 
enum \textbf{ gprs\+\_\+tlli\+\_\+type} \{ \newline
\textbf{ TLLI\+\_\+\+LOCAL}
, \newline
\textbf{ TLLI\+\_\+\+FOREIGN}
, \newline
\textbf{ TLLI\+\_\+\+RANDOM}
, \newline
\textbf{ TLLI\+\_\+\+AUXILIARY}
, \newline
\textbf{ TLLI\+\_\+\+RESERVED}
, \newline
\textbf{ TLLI\+\_\+\+G\+\_\+\+RNTI}
, \newline
\textbf{ TLLI\+\_\+\+RAND\+\_\+\+G\+\_\+\+RNTI}
 \}
\item 
enum \textbf{ gsm\+\_\+phys\+\_\+chan\+\_\+config} \{ \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+NONE}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+CCCH}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+CCCH\+\_\+\+SDCCH4}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+F}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+H}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+SDCCH8\+\_\+\+SACCH8C}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+PDCH}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+\+F\+\_\+\+PDCH}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+UNKNOWN}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+CCCH\+\_\+\+SDCCH4\+\_\+\+CBCH}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+SDCCH8\+\_\+\+SACCH8\+C\+\_\+\+CBCH}
, \newline
\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+OSMO\+\_\+\+DYN}
, \newline
\textbf{ \+\_\+\+GSM\+\_\+\+PCHAN\+\_\+\+MAX}
 \}
\item 
enum \textbf{ gsm\+\_\+chan\+\_\+t} \{ \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+NONE}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+SDCCH}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+TCH\+\_\+F}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+TCH\+\_\+H}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+UNKNOWN}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+CCCH}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+PDTCH}
, \newline
\textbf{ GSM\+\_\+\+LCHAN\+\_\+\+CBCH}
, \newline
\textbf{ \+\_\+\+GSM\+\_\+\+LCHAN\+\_\+\+MAX}
 \}
\item 
enum \textbf{ osmo\+\_\+rat\+\_\+type} \{ \newline
\textbf{ OSMO\+\_\+\+RAT\+\_\+\+UNKNOWN} = 0
, \newline
\textbf{ OSMO\+\_\+\+RAT\+\_\+\+GERAN\+\_\+A}
, \newline
\textbf{ OSMO\+\_\+\+RAT\+\_\+\+UTRAN\+\_\+\+IU}
, \newline
\textbf{ OSMO\+\_\+\+RAT\+\_\+\+EUTRAN\+\_\+\+SGS}
, \newline
\textbf{ OSMO\+\_\+\+RAT\+\_\+\+COUNT}
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ \textbf{ gsm\+\_\+band\+\_\+name} (enum \textbf{ gsm\+\_\+band} band)
\begin{DoxyCompactList}\small\item\em Return string name of a given GSM Band. \end{DoxyCompactList}\item 
enum \textbf{ gsm\+\_\+band} \textbf{ gsm\+\_\+band\+\_\+parse} (const char $\ast$mhz)
\begin{DoxyCompactList}\small\item\em Parse string name of a GSM band. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+get\+\_\+rand\+\_\+id} (uint8\+\_\+t $\ast$out, size\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em Generate random identifier We use /dev/urandom (default when GRND\+\_\+\+RANDOM flag is not set). \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n} (char $\ast$decoded, size\+\_\+t \textbf{ n}, const uint8\+\_\+t $\ast$user\+\_\+data, uint8\+\_\+t \textbf{ length})
\begin{DoxyCompactList}\small\item\em Decode a sequence of GSM 03.\+38 encoded 7 bit characters. \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd} (char $\ast$decoded, size\+\_\+t \textbf{ n}, const uint8\+\_\+t $\ast$user\+\_\+data, uint8\+\_\+t \textbf{ length})
\begin{DoxyCompactList}\small\item\em Decode a sequence of 7 bit characters (USSD encoding). \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n} (uint8\+\_\+t $\ast$result, size\+\_\+t \textbf{ n}, const char $\ast$\textbf{ data}, int $\ast$octets\+\_\+written)
\begin{DoxyCompactList}\small\item\em Encode a text string into GSM 03.\+38 encoded 7 bit characters. \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n\+\_\+ussd} (uint8\+\_\+t $\ast$result, size\+\_\+t \textbf{ n}, const char $\ast$\textbf{ data}, int $\ast$octets\+\_\+written)
\begin{DoxyCompactList}\small\item\em Encode a text string into GSM 03.\+38 encoded 7 bit characters (USSD encoding). \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+septets2octets} (uint8\+\_\+t $\ast$result, const uint8\+\_\+t $\ast$rdata, uint8\+\_\+t septet\+\_\+len, uint8\+\_\+t padding) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}This function is unable to handle more than 255 septets
\item 
int use \textbf{ gsm\+\_\+septet\+\_\+pack} () instead.\char`\"{})
\item 
int \textbf{ gsm\+\_\+septet\+\_\+pack} (uint8\+\_\+t $\ast$result, const uint8\+\_\+t $\ast$rdata, size\+\_\+t septet\+\_\+len, uint8\+\_\+t padding)
\begin{DoxyCompactList}\small\item\em GSM Default Alphabet 7bit to octet packing. \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+septet\+\_\+encode} (uint8\+\_\+t $\ast$result, const char $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Encode a ASCII characterrs as 7-\/bit GSM alphabet (TS 03.\+38) \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ gsm\+\_\+get\+\_\+octet\+\_\+len} (const uint8\+\_\+t sept\+\_\+len)
\begin{DoxyCompactList}\small\item\em Compute number of octets from number of septets. \end{DoxyCompactList}\item 
int \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+hdr} (char $\ast$decoded, size\+\_\+t \textbf{ n}, const uint8\+\_\+t $\ast$user\+\_\+data, uint8\+\_\+t \textbf{ length}, uint8\+\_\+t ud\+\_\+hdr\+\_\+ind)
\begin{DoxyCompactList}\small\item\em TS 03.\+38 7-\/bit Character unpacking (6.\+2.\+1) \end{DoxyCompactList}\item 
int \textbf{ ms\+\_\+class\+\_\+gmsk\+\_\+dbm} (enum \textbf{ gsm\+\_\+band} band, int ms\+\_\+class)
\begin{DoxyCompactList}\small\item\em Convert power class to d\+Bm according to GSM TS 05.\+05. \end{DoxyCompactList}\item 
int \textbf{ ms\+\_\+pwr\+\_\+ctl\+\_\+lvl} (enum \textbf{ gsm\+\_\+band} band, unsigned int dbm)
\begin{DoxyCompactList}\small\item\em determine power control level for given d\+Bm value, as indicated by the tables in chapter 4.\+1.\+1 of GSM TS 05.\+05 \end{DoxyCompactList}\item 
int \textbf{ ms\+\_\+pwr\+\_\+dbm} (enum \textbf{ gsm\+\_\+band} band, uint8\+\_\+t lvl)
\begin{DoxyCompactList}\small\item\em Convert TS 05.\+05 power level to absolute d\+Bm value. \end{DoxyCompactList}\item 
int \textbf{ rxlev2dbm} (uint8\+\_\+t rxlev)
\begin{DoxyCompactList}\small\item\em Convert TS 05.\+08 Rx\+Lev to d\+Bm (TS 05.\+08 Chapter 8.\+1.\+4) \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ dbm2rxlev} (int dbm)
\begin{DoxyCompactList}\small\item\em Convert RF signal level in d\+Bm to TS 05.\+08 Rx\+Lev (TS 05.\+08 Chapter 8.\+1.\+4) \end{DoxyCompactList}\item 
static int \textbf{ ms\+\_\+cm2\+\_\+a5n\+\_\+support} (uint8\+\_\+t $\ast$\textbf{ cm2}, unsigned \textbf{ n})
\item 
static int \textbf{ ms\+\_\+cm3\+\_\+a5n\+\_\+support} (uint8\+\_\+t $\ast$cm3, unsigned \textbf{ n})
\item 
static int \textbf{ rach\+\_\+max\+\_\+trans\+\_\+val2raw} (int val)
\item 
static int \textbf{ rach\+\_\+max\+\_\+trans\+\_\+raw2val} (int raw)
\item 
static uint8\+\_\+t \textbf{ rach\+\_\+tx\+\_\+integer\+\_\+raw2val} (uint8\+\_\+t raw)
\item 
int \textbf{ gsm\+\_\+arfcn2band\+\_\+rc} (uint16\+\_\+t \textbf{ arfcn}, enum \textbf{ gsm\+\_\+band} $\ast$band)
\begin{DoxyCompactList}\small\item\em Resolve GSM band from ARFCN. \end{DoxyCompactList}\item 
enum \textbf{ gsm\+\_\+band} \textbf{ gsm\+\_\+arfcn2band} (uint16\+\_\+t \textbf{ arfcn}) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+arfcn2band\+\_\+rc}() \textbf{ instead}\char`\"{})
\begin{DoxyCompactList}\small\item\em Resolve GSM band from ARFCN, aborts process on invalid ARFCN. \end{DoxyCompactList}\item 
uint16\+\_\+t \textbf{ gsm\+\_\+arfcn2freq10} (uint16\+\_\+t \textbf{ arfcn}, int uplink)
\begin{DoxyCompactList}\small\item\em Convert an ARFCN to the frequency in MHz $\ast$ 10. \end{DoxyCompactList}\item 
uint16\+\_\+t \textbf{ gsm\+\_\+freq102arfcn} (uint16\+\_\+t freq10, int uplink)
\begin{DoxyCompactList}\small\item\em Convert a Frequency in MHz $\ast$ 10 to ARFCN. \end{DoxyCompactList}\item 
void \textbf{ gsm\+\_\+fn2gsmtime} (struct \textbf{ gsm\+\_\+time} $\ast$\textbf{ time}, uint32\+\_\+t fn)
\begin{DoxyCompactList}\small\item\em Parse GSM Frame Number into struct \doxyref{gsm\+\_\+time}{p.}{structgsm__time}. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ gsm\+\_\+fn\+\_\+as\+\_\+gsmtime\+\_\+str} (uint32\+\_\+t fn)
\begin{DoxyCompactList}\small\item\em Parse GSM Frame Number into printable string. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ gsm\+\_\+gsmtime2fn} (const struct \textbf{ gsm\+\_\+time} $\ast$\textbf{ time})
\begin{DoxyCompactList}\small\item\em Encode decoded \doxyref{gsm\+\_\+time}{p.}{structgsm__time} to Frame Number. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ osmo\+\_\+dump\+\_\+gsmtime} (const struct \textbf{ gsm\+\_\+time} $\ast$tm)
\item 
char $\ast$ \textbf{ osmo\+\_\+dump\+\_\+gsmtime\+\_\+buf} (char $\ast$buf, size\+\_\+t buf\+\_\+len, const struct \textbf{ gsm\+\_\+time} $\ast$tm)
\item 
char $\ast$ \textbf{ osmo\+\_\+dump\+\_\+gsmtime\+\_\+c} (const void $\ast$ctx, const struct \textbf{ gsm\+\_\+time} $\ast$tm)
\item 
uint32\+\_\+t \textbf{ gsm\+\_\+rfn2fn} (uint16\+\_\+t rfn, uint32\+\_\+t curr\+\_\+fn)
\item 
static uint16\+\_\+t \textbf{ gsm\+\_\+fn2rfn} (uint32\+\_\+t fn)
\item 
int \textbf{ gprs\+\_\+tlli\+\_\+type} (uint32\+\_\+t \textbf{ tlli})
\begin{DoxyCompactList}\small\item\em Determine GPRS TLLI Type (TS 23.\+003 Chapter 2.\+6) \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ gprs\+\_\+tmsi2tlli} (uint32\+\_\+t p\+\_\+tmsi, enum \textbf{ gprs\+\_\+tlli\+\_\+type} \textbf{ type})
\begin{DoxyCompactList}\small\item\em Determine TLLI from P-\/\+TMSI. \end{DoxyCompactList}\item 
static const char $\ast$ \textbf{ gsm\+\_\+chan\+\_\+t\+\_\+name} (enum \textbf{ gsm\+\_\+chan\+\_\+t} val)
\item 
int \textbf{ gsm\+\_\+7bit\+\_\+decode} (char $\ast$decoded, const uint8\+\_\+t $\ast$user\+\_\+data, uint8\+\_\+t \textbf{ length}) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+ussd} (char $\ast$decoded, const uint8\+\_\+t $\ast$user\+\_\+data, uint8\+\_\+t \textbf{ length}) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ gsm\+\_\+7bit\+\_\+encode} (uint8\+\_\+t $\ast$result, const char $\ast$\textbf{ data}) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+ussd} (uint8\+\_\+t $\ast$result, const char $\ast$\textbf{ data}, int $\ast$octets\+\_\+written) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n\+\_\+ussd}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+oct} (uint8\+\_\+t $\ast$result, const char $\ast$\textbf{ data}, int $\ast$octets\+\_\+written) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}Use \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n}() \textbf{ instead}\char`\"{})
\item 
static const char $\ast$ \textbf{ osmo\+\_\+rat\+\_\+type\+\_\+name} (enum \textbf{ osmo\+\_\+rat\+\_\+type} val)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gsm\+\_\+chan\+\_\+t\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+rat\+\_\+type\+\_\+names} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
GSM utility functions, e.\+g. 

coding and decoding. 

\doxysubsection{Macro Definition Documentation}
\mbox{\label{gsm__utils_8h_ac77f3937a96656b951443bd9fd96ed62}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ADD\_MODULO@{ADD\_MODULO}}
\index{ADD\_MODULO@{ADD\_MODULO}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ADD\_MODULO}
{\footnotesize\ttfamily \#define ADD\+\_\+\+MODULO(\begin{DoxyParamCaption}\item[{}]{sum,  }\item[{}]{delta,  }\item[{}]{modulo }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{do} \{    \(\backslash\)}
\DoxyCodeLine{        if ((sum += delta) >= modulo)           \(\backslash\)}
\DoxyCodeLine{                sum -\/= modulo;                  \(\backslash\)}
\DoxyCodeLine{        \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
\mbox{\label{gsm__utils_8h_ad16e807aceb7cbaec75aead9163d1948}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ARFCN\_FLAG\_MASK@{ARFCN\_FLAG\_MASK}}
\index{ARFCN\_FLAG\_MASK@{ARFCN\_FLAG\_MASK}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ARFCN\_FLAG\_MASK}
{\footnotesize\ttfamily \#define ARFCN\+\_\+\+FLAG\+\_\+\+MASK~0xf000 /$\ast$ Reserve the upper 5 bits \textbf{ for} \textbf{ flags} $\ast$/}

\mbox{\label{gsm__utils_8h_a39e77c43a8ae0b66141fe870fdc5a819}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ARFCN\_PCS@{ARFCN\_PCS}}
\index{ARFCN\_PCS@{ARFCN\_PCS}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ARFCN\_PCS}
{\footnotesize\ttfamily \#define ARFCN\+\_\+\+PCS~0x8000}

\mbox{\label{gsm__utils_8h_a3f0f5a17a8755a58af4b7a541e311b3c}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ARFCN\_UPLINK@{ARFCN\_UPLINK}}
\index{ARFCN\_UPLINK@{ARFCN\_UPLINK}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ARFCN\_UPLINK}
{\footnotesize\ttfamily \#define ARFCN\+\_\+\+UPLINK~0x4000}

\mbox{\label{gsm__utils_8h_a6f63775307b862358e11ff634b3eccb3}} 
\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_7BIT\_LEGACY\_MAX\_BUFFER\_SIZE@{GSM\_7BIT\_LEGACY\_MAX\_BUFFER\_SIZE}}
\index{GSM\_7BIT\_LEGACY\_MAX\_BUFFER\_SIZE@{GSM\_7BIT\_LEGACY\_MAX\_BUFFER\_SIZE}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{GSM\_7BIT\_LEGACY\_MAX\_BUFFER\_SIZE}
{\footnotesize\ttfamily \#define GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE~0x10000}

\mbox{\label{gsm__utils_8h_a81e21766d0a1dd5529e0231bb00ad56a}} 
\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_FN\_UNSET@{GSM\_FN\_UNSET}}
\index{GSM\_FN\_UNSET@{GSM\_FN\_UNSET}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{GSM\_FN\_UNSET}
{\footnotesize\ttfamily \#define GSM\+\_\+\+FN\+\_\+\+UNSET~0x\+FFFFFFFF}

\mbox{\label{gsm__utils_8h_a07058d675ebd8d4cba6d70a31dd04306}} 
\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_MAX\_FN@{GSM\_MAX\_FN}}
\index{GSM\_MAX\_FN@{GSM\_MAX\_FN}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{GSM\_MAX\_FN}
{\footnotesize\ttfamily \#define GSM\+\_\+\+MAX\+\_\+\+FN~(26$\ast$51$\ast$2048)}

\mbox{\label{gsm__utils_8h_ac6cc66de1feb7ac0ea99b4c30cecc496}} 
\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_TCH\_F\_TCH\_H\_PDCH@{GSM\_PCHAN\_TCH\_F\_TCH\_H\_PDCH}}
\index{GSM\_PCHAN\_TCH\_F\_TCH\_H\_PDCH@{GSM\_PCHAN\_TCH\_F\_TCH\_H\_PDCH}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{GSM\_PCHAN\_TCH\_F\_TCH\_H\_PDCH}
{\footnotesize\ttfamily \#define GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+\+F\+\_\+\+TCH\+\_\+\+H\+\_\+\+PDCH~\textbf{ GSM\+\_\+\+PCHAN\+\_\+\+OSMO\+\_\+\+DYN}}

\mbox{\label{gsm__utils_8h_ada36d67b324242ded6cc646aeac2f9ac}} 
\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_RFN\_MODULUS@{GSM\_RFN\_MODULUS}}
\index{GSM\_RFN\_MODULUS@{GSM\_RFN\_MODULUS}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{GSM\_RFN\_MODULUS}
{\footnotesize\ttfamily \#define GSM\+\_\+\+RFN\+\_\+\+MODULUS~42432}

\mbox{\label{gsm__utils_8h_ad699af45c2221292d82fb53ebf05249d}} 
\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_MAX\_RAND\_ID\_LEN@{OSMO\_MAX\_RAND\_ID\_LEN}}
\index{OSMO\_MAX\_RAND\_ID\_LEN@{OSMO\_MAX\_RAND\_ID\_LEN}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{OSMO\_MAX\_RAND\_ID\_LEN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+MAX\+\_\+\+RAND\+\_\+\+ID\+\_\+\+LEN~16}



\doxysubsection{Enumeration Type Documentation}
\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gprs\_tlli\_type@{gprs\_tlli\_type}}
\index{gprs\_tlli\_type@{gprs\_tlli\_type}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gprs\_tlli\_type}
{\footnotesize\ttfamily enum \textbf{ gprs\+\_\+tlli\+\_\+type}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_LOCAL@{TLLI\_LOCAL}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_LOCAL@{TLLI\_LOCAL}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7a8d0757fac7777c0877f1ec891e0f314c}} 
TLLI\+\_\+\+LOCAL&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_FOREIGN@{TLLI\_FOREIGN}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_FOREIGN@{TLLI\_FOREIGN}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7a922f2da4cc689a717f7db76edc9516c5}} 
TLLI\+\_\+\+FOREIGN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_RANDOM@{TLLI\_RANDOM}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_RANDOM@{TLLI\_RANDOM}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7a20ba6d183dfc01fece73ba85dc7abaab}} 
TLLI\+\_\+\+RANDOM&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_AUXILIARY@{TLLI\_AUXILIARY}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_AUXILIARY@{TLLI\_AUXILIARY}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7a2a46896d9fd9ae6f95671003421bbdda}} 
TLLI\+\_\+\+AUXILIARY&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_RESERVED@{TLLI\_RESERVED}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_RESERVED@{TLLI\_RESERVED}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7a912f5ee2ee70c36ad8ac036720bca0f9}} 
TLLI\+\_\+\+RESERVED&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_G\_RNTI@{TLLI\_G\_RNTI}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_G\_RNTI@{TLLI\_G\_RNTI}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7ac2b0c20195f8eef5e0dd015896cab832}} 
TLLI\+\_\+\+G\+\_\+\+RNTI&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TLLI\_RAND\_G\_RNTI@{TLLI\_RAND\_G\_RNTI}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!TLLI\_RAND\_G\_RNTI@{TLLI\_RAND\_G\_RNTI}}}\mbox{\label{gsm__utils_8h_a0bc30f44c6a4ecb73193008fa9ac2ed7ad32af438f289ecdefa8b0b7e21996767}} 
TLLI\+\_\+\+RAND\+\_\+\+G\+\_\+\+RNTI&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709e}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_band@{gsm\_band}}
\index{gsm\_band@{gsm\_band}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_band}
{\footnotesize\ttfamily enum \textbf{ gsm\+\_\+band}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_850@{GSM\_BAND\_850}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_850@{GSM\_BAND\_850}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ea84a03e38cd04c2944b19a03e8af54afc}} 
GSM\+\_\+\+BAND\+\_\+850&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_900@{GSM\_BAND\_900}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_900@{GSM\_BAND\_900}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ea593f6e8c846891de8adb9fb9a76ec719}} 
GSM\+\_\+\+BAND\+\_\+900&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_1800@{GSM\_BAND\_1800}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_1800@{GSM\_BAND\_1800}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ea22ca7b57b4a8a1868116ff212611e101}} 
GSM\+\_\+\+BAND\+\_\+1800&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_1900@{GSM\_BAND\_1900}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_1900@{GSM\_BAND\_1900}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709eabe6c3153803fa3289a296ddea1bb468c}} 
GSM\+\_\+\+BAND\+\_\+1900&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_450@{GSM\_BAND\_450}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_450@{GSM\_BAND\_450}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709eadd2b52248fc722230bbaff237862679c}} 
GSM\+\_\+\+BAND\+\_\+450&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_480@{GSM\_BAND\_480}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_480@{GSM\_BAND\_480}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ea05f6ebd7317292599a3530468c3badea}} 
GSM\+\_\+\+BAND\+\_\+480&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_750@{GSM\_BAND\_750}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_750@{GSM\_BAND\_750}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ea9aace027262e70758f2389ae04c14cfb}} 
GSM\+\_\+\+BAND\+\_\+750&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_BAND\_810@{GSM\_BAND\_810}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_BAND\_810@{GSM\_BAND\_810}}}\mbox{\label{gsm__utils_8h_a6e0968a881716940e48ed4650dd4709ead1dbe595098756b9a65d9defe186fbf0}} 
GSM\+\_\+\+BAND\+\_\+810&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8f}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_chan\_t@{gsm\_chan\_t}}
\index{gsm\_chan\_t@{gsm\_chan\_t}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_chan\_t}
{\footnotesize\ttfamily enum \textbf{ gsm\+\_\+chan\+\_\+t}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_NONE@{GSM\_LCHAN\_NONE}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_NONE@{GSM\_LCHAN\_NONE}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8faae9cdadc9639146425436c868e32bb21}} 
GSM\+\_\+\+LCHAN\+\_\+\+NONE&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_SDCCH@{GSM\_LCHAN\_SDCCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_SDCCH@{GSM\_LCHAN\_SDCCH}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fa4dda68bc91cb9e37d534a9863201bdec}} 
GSM\+\_\+\+LCHAN\+\_\+\+SDCCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_TCH\_F@{GSM\_LCHAN\_TCH\_F}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_TCH\_F@{GSM\_LCHAN\_TCH\_F}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fa52619524b2002c09734fa4f6918fca09}} 
GSM\+\_\+\+LCHAN\+\_\+\+TCH\+\_\+F&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_TCH\_H@{GSM\_LCHAN\_TCH\_H}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_TCH\_H@{GSM\_LCHAN\_TCH\_H}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fa3e1b2064b3bd63aad06b4cb2b8996a92}} 
GSM\+\_\+\+LCHAN\+\_\+\+TCH\+\_\+H&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_UNKNOWN@{GSM\_LCHAN\_UNKNOWN}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_UNKNOWN@{GSM\_LCHAN\_UNKNOWN}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fa8b8c6d75c78dff8ccfa27f1fe24f40de}} 
GSM\+\_\+\+LCHAN\+\_\+\+UNKNOWN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_CCCH@{GSM\_LCHAN\_CCCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_CCCH@{GSM\_LCHAN\_CCCH}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fad1d2c8b36456ad1af51ce3f54b5fe70c}} 
GSM\+\_\+\+LCHAN\+\_\+\+CCCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_PDTCH@{GSM\_LCHAN\_PDTCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_PDTCH@{GSM\_LCHAN\_PDTCH}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8faa0d39c5b8a6aeb4625f59ca294560d5a}} 
GSM\+\_\+\+LCHAN\+\_\+\+PDTCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_LCHAN\_CBCH@{GSM\_LCHAN\_CBCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_LCHAN\_CBCH@{GSM\_LCHAN\_CBCH}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8faa334badd157c8e82d2d8cd5f340b9a12}} 
GSM\+\_\+\+LCHAN\+\_\+\+CBCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{\_GSM\_LCHAN\_MAX@{\_GSM\_LCHAN\_MAX}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!\_GSM\_LCHAN\_MAX@{\_GSM\_LCHAN\_MAX}}}\mbox{\label{gsm__utils_8h_a9f0d3d0f3b5d791f71f3c12d71255b8fab6ee3b4bbbd78dd7b0fdd1e553980ce5}} 
\+\_\+\+GSM\+\_\+\+LCHAN\+\_\+\+MAX&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06a}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_phys\_chan\_config@{gsm\_phys\_chan\_config}}
\index{gsm\_phys\_chan\_config@{gsm\_phys\_chan\_config}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_phys\_chan\_config}
{\footnotesize\ttfamily enum \textbf{ gsm\+\_\+phys\+\_\+chan\+\_\+config}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_NONE@{GSM\_PCHAN\_NONE}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_NONE@{GSM\_PCHAN\_NONE}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aa8a575039897de1aaa08d072937054657}} 
GSM\+\_\+\+PCHAN\+\_\+\+NONE&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_CCCH@{GSM\_PCHAN\_CCCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_CCCH@{GSM\_PCHAN\_CCCH}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aa78ced09ad94d7249cbeae233c91ee396}} 
GSM\+\_\+\+PCHAN\+\_\+\+CCCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_CCCH\_SDCCH4@{GSM\_PCHAN\_CCCH\_SDCCH4}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_CCCH\_SDCCH4@{GSM\_PCHAN\_CCCH\_SDCCH4}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aaf94df040da34115892d7b946ec1550c8}} 
GSM\+\_\+\+PCHAN\+\_\+\+CCCH\+\_\+\+SDCCH4&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_TCH\_F@{GSM\_PCHAN\_TCH\_F}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_TCH\_F@{GSM\_PCHAN\_TCH\_F}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aadb239e7bdff0bf283b042bec73524e03}} 
GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+F&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_TCH\_H@{GSM\_PCHAN\_TCH\_H}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_TCH\_H@{GSM\_PCHAN\_TCH\_H}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aaa7c7d2be4a075bda621fa289989d5977}} 
GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+H&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_SDCCH8\_SACCH8C@{GSM\_PCHAN\_SDCCH8\_SACCH8C}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_SDCCH8\_SACCH8C@{GSM\_PCHAN\_SDCCH8\_SACCH8C}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aaa9b91e3b54d63fe7eebe184deaddc30c}} 
GSM\+\_\+\+PCHAN\+\_\+\+SDCCH8\+\_\+\+SACCH8C&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_PDCH@{GSM\_PCHAN\_PDCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_PDCH@{GSM\_PCHAN\_PDCH}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aae5027d41bfd7197c7d0f2d34dae8ee38}} 
GSM\+\_\+\+PCHAN\+\_\+\+PDCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_TCH\_F\_PDCH@{GSM\_PCHAN\_TCH\_F\_PDCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_TCH\_F\_PDCH@{GSM\_PCHAN\_TCH\_F\_PDCH}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aa6395d57d994cf5f2a4e40f832541eaba}} 
GSM\+\_\+\+PCHAN\+\_\+\+TCH\+\_\+\+F\+\_\+\+PDCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_UNKNOWN@{GSM\_PCHAN\_UNKNOWN}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_UNKNOWN@{GSM\_PCHAN\_UNKNOWN}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aa2bc2a11ee21e24886f58cf79038014c3}} 
GSM\+\_\+\+PCHAN\+\_\+\+UNKNOWN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_CCCH\_SDCCH4\_CBCH@{GSM\_PCHAN\_CCCH\_SDCCH4\_CBCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_CCCH\_SDCCH4\_CBCH@{GSM\_PCHAN\_CCCH\_SDCCH4\_CBCH}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aafc22cd46bace582f1df598dc6540f8e6}} 
GSM\+\_\+\+PCHAN\+\_\+\+CCCH\+\_\+\+SDCCH4\+\_\+\+CBCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_SDCCH8\_SACCH8C\_CBCH@{GSM\_PCHAN\_SDCCH8\_SACCH8C\_CBCH}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_SDCCH8\_SACCH8C\_CBCH@{GSM\_PCHAN\_SDCCH8\_SACCH8C\_CBCH}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aa6d4f67230e9619094b173f85e6d7ed94}} 
GSM\+\_\+\+PCHAN\+\_\+\+SDCCH8\+\_\+\+SACCH8\+C\+\_\+\+CBCH&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GSM\_PCHAN\_OSMO\_DYN@{GSM\_PCHAN\_OSMO\_DYN}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!GSM\_PCHAN\_OSMO\_DYN@{GSM\_PCHAN\_OSMO\_DYN}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aabc2fb07796dcd8f9a0b462589531b257}} 
GSM\+\_\+\+PCHAN\+\_\+\+OSMO\+\_\+\+DYN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{\_GSM\_PCHAN\_MAX@{\_GSM\_PCHAN\_MAX}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!\_GSM\_PCHAN\_MAX@{\_GSM\_PCHAN\_MAX}}}\mbox{\label{gsm__utils_8h_a246fb9f8ec6d45e6360ecbd4e5bfd06aad2eb5831df9c7a2d9855d389629603a8}} 
\+\_\+\+GSM\+\_\+\+PCHAN\+\_\+\+MAX&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_rat\_type@{osmo\_rat\_type}}
\index{osmo\_rat\_type@{osmo\_rat\_type}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_rat\_type}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+rat\+\_\+type}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_RAT\_UNKNOWN@{OSMO\_RAT\_UNKNOWN}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_RAT\_UNKNOWN@{OSMO\_RAT\_UNKNOWN}}}\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860a9f4492958e07e7fd5b8819d9e7d1fa0d}} 
OSMO\+\_\+\+RAT\+\_\+\+UNKNOWN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_RAT\_GERAN\_A@{OSMO\_RAT\_GERAN\_A}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_RAT\_GERAN\_A@{OSMO\_RAT\_GERAN\_A}}}\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860ab8f0bfa6cdf8153ee7dacf24ff6fb43f}} 
OSMO\+\_\+\+RAT\+\_\+\+GERAN\+\_\+A&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_RAT\_UTRAN\_IU@{OSMO\_RAT\_UTRAN\_IU}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_RAT\_UTRAN\_IU@{OSMO\_RAT\_UTRAN\_IU}}}\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860a30ab3f8a4d52de8b50f63d54601cc679}} 
OSMO\+\_\+\+RAT\+\_\+\+UTRAN\+\_\+\+IU&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_RAT\_EUTRAN\_SGS@{OSMO\_RAT\_EUTRAN\_SGS}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_RAT\_EUTRAN\_SGS@{OSMO\_RAT\_EUTRAN\_SGS}}}\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860a92cf1aeac8bde6d2ef3795591a05bb0f}} 
OSMO\+\_\+\+RAT\+\_\+\+EUTRAN\+\_\+\+SGS&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_RAT\_COUNT@{OSMO\_RAT\_COUNT}!gsm\_utils.h@{gsm\_utils.h}}\index{gsm\_utils.h@{gsm\_utils.h}!OSMO\_RAT\_COUNT@{OSMO\_RAT\_COUNT}}}\mbox{\label{gsm__utils_8h_aaee7afd3e92fae36c8aca14126c28860a84a1f1116ac6af5de4eb18048856a23c}} 
OSMO\+\_\+\+RAT\+\_\+\+COUNT&\\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{gsm__utils_8h_a40d332ca08e3dddf3dfbd77e3e9f3b85}} 
\index{gsm\_utils.h@{gsm\_utils.h}!dbm2rxlev@{dbm2rxlev}}
\index{dbm2rxlev@{dbm2rxlev}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{dbm2rxlev()}
{\footnotesize\ttfamily uint8\+\_\+t dbm2rxlev (\begin{DoxyParamCaption}\item[{int}]{dbm }\end{DoxyParamCaption})}



Convert RF signal level in d\+Bm to TS 05.\+08 Rx\+Lev (TS 05.\+08 Chapter 8.\+1.\+4) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em dbm} & RF signal level in d\+Bm \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
TS 05.\+08 Rx\+Lev value 
\end{DoxyReturn}
\mbox{\label{gsm__utils_8h_a54938c22c71cc3d62ebad1de580764f6}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gprs\_tlli\_type@{gprs\_tlli\_type}}
\index{gprs\_tlli\_type@{gprs\_tlli\_type}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gprs\_tlli\_type()}
{\footnotesize\ttfamily int \textbf{ gprs\+\_\+tlli\+\_\+type} (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{tlli }\end{DoxyParamCaption})}



Determine GPRS TLLI Type (TS 23.\+003 Chapter 2.\+6) 



References \textbf{ tlli}, \textbf{ TLLI\+\_\+\+AUXILIARY}, \textbf{ TLLI\+\_\+\+FOREIGN}, \textbf{ TLLI\+\_\+\+G\+\_\+\+RNTI}, \textbf{ TLLI\+\_\+\+LOCAL}, \textbf{ TLLI\+\_\+\+RAND\+\_\+\+G\+\_\+\+RNTI}, \textbf{ TLLI\+\_\+\+RANDOM}, and \textbf{ TLLI\+\_\+\+RESERVED}.

\mbox{\label{gsm__utils_8h_a81645092c5373185e9b87c81a64eafcd}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gprs\_tmsi2tlli@{gprs\_tmsi2tlli}}
\index{gprs\_tmsi2tlli@{gprs\_tmsi2tlli}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gprs\_tmsi2tlli()}
{\footnotesize\ttfamily uint32\+\_\+t gprs\+\_\+tmsi2tlli (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{p\+\_\+tmsi,  }\item[{enum \textbf{ gprs\+\_\+tlli\+\_\+type}}]{type }\end{DoxyParamCaption})}



Determine TLLI from P-\/\+TMSI. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p\+\_\+tmsi} & P-\/\+TMSI \\
\hline
\mbox{\texttt{ in}}  & {\em type} & TLLI Type we want to derive from {\itshape p\+\_\+tmsi} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
TLLI of given type 
\end{DoxyReturn}


References \textbf{ tlli}, \textbf{ TLLI\+\_\+\+FOREIGN}, \textbf{ TLLI\+\_\+\+LOCAL}, and \textbf{ type}.

\mbox{\label{gsm__utils_8h_a809699177aa165d56d76655e51f67065}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_decode@{gsm\_7bit\_decode}}
\index{gsm\_7bit\_decode@{gsm\_7bit\_decode}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_decode()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+decode (\begin{DoxyParamCaption}\item[{char $\ast$}]{decoded,  }\item[{const uint8\+\_\+t $\ast$}]{user\+\_\+data,  }\item[{uint8\+\_\+t}]{length }\end{DoxyParamCaption})}



References \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n()}, and \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}.

\mbox{\label{gsm__utils_8h_a03c0ce5109203002f372d2c023062e47}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_decode\_n@{gsm\_7bit\_decode\_n}}
\index{gsm\_7bit\_decode\_n@{gsm\_7bit\_decode\_n}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_decode\_n()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+decode\+\_\+n (\begin{DoxyParamCaption}\item[{char $\ast$}]{text,  }\item[{size\+\_\+t}]{n,  }\item[{const uint8\+\_\+t $\ast$}]{user\+\_\+data,  }\item[{uint8\+\_\+t}]{septet\+\_\+l }\end{DoxyParamCaption})}



Decode a sequence of GSM 03.\+38 encoded 7 bit characters. 


\begin{DoxyParams}{Parameters}
{\em decoded} & The destination buffer for the decoded characters. \\
\hline
{\em n} & A maximum of n chars is written (incl. terminating \textbackslash{}0). Requires n $>$= 1. \\
\hline
{\em user\+\_\+data} & A pointer to the start of the packed 7bit character sequence. \\
\hline
{\em length} & The length of the input sequence in septets, for example pass octet\+\_\+length$\ast$8/7.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the number of (8 bit) chars written excluding the terminating \textbackslash{}0. This is the same like strlen(decoded).
\end{DoxyReturn}
Decode a sequence of GSM 03.\+38 encoded 7 bit characters. 

References \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+hdr()}, and \textbf{ n}.



Referenced by \textbf{ gsm\+\_\+7bit\+\_\+decode()}.

\mbox{\label{gsm__utils_8h_acc316e782432e05d65b194d94cfc3f89}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_decode\_n\_hdr@{gsm\_7bit\_decode\_n\_hdr}}
\index{gsm\_7bit\_decode\_n\_hdr@{gsm\_7bit\_decode\_n\_hdr}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_decode\_n\_hdr()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+hdr (\begin{DoxyParamCaption}\item[{char $\ast$}]{text,  }\item[{size\+\_\+t}]{n,  }\item[{const uint8\+\_\+t $\ast$}]{user\+\_\+data,  }\item[{uint8\+\_\+t}]{septet\+\_\+l,  }\item[{uint8\+\_\+t}]{ud\+\_\+hdr\+\_\+ind }\end{DoxyParamCaption})}



TS 03.\+38 7-\/bit Character unpacking (6.\+2.\+1) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em text} & Caller-\/provided output text buffer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Length of {\itshape text} \\
\hline
\mbox{\texttt{ in}}  & {\em user\+\_\+data} & Input Data (septets) \\
\hline
\mbox{\texttt{ in}}  & {\em septet\+\_\+l} & Number of septets in {\itshape user\+\_\+data} \\
\hline
\mbox{\texttt{ in}}  & {\em ud\+\_\+hdr\+\_\+ind} & User Data Header present in data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes written to {\itshape text} 
\end{DoxyReturn}


References \textbf{ gsm\+\_\+7bit\+\_\+alphabet}, \textbf{ gsm\+\_\+get\+\_\+octet\+\_\+len()}, \textbf{ gsm\+\_\+septet\+\_\+lookup()}, \textbf{ l}, \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



Referenced by \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n()}, and \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd()}.

\mbox{\label{gsm__utils_8h_a8804da8fdc238cfc22985e568433d29f}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_decode\_n\_ussd@{gsm\_7bit\_decode\_n\_ussd}}
\index{gsm\_7bit\_decode\_n\_ussd@{gsm\_7bit\_decode\_n\_ussd}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_decode\_n\_ussd()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd (\begin{DoxyParamCaption}\item[{char $\ast$}]{text,  }\item[{size\+\_\+t}]{n,  }\item[{const uint8\+\_\+t $\ast$}]{user\+\_\+data,  }\item[{uint8\+\_\+t}]{length }\end{DoxyParamCaption})}



Decode a sequence of 7 bit characters (USSD encoding). 

\begin{DoxySeeAlso}{See also}
\doxyref{gsm\+\_\+7bit\+\_\+encode\+\_\+n()}{p.}{gsm__utils_8h_a8ece1eed9b296f7f2486db361701acdd}
\end{DoxySeeAlso}
Decode a sequence of 7 bit characters (USSD encoding). 

References \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+hdr()}, \textbf{ gsm\+\_\+get\+\_\+octet\+\_\+len()}, \textbf{ length}, and \textbf{ n}.



Referenced by \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+ussd()}, and \textbf{ parse\+\_\+process\+\_\+uss\+\_\+req()}.

\mbox{\label{gsm__utils_8h_a2190e95d787876502a77b0e5c9dee61c}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_decode\_ussd@{gsm\_7bit\_decode\_ussd}}
\index{gsm\_7bit\_decode\_ussd@{gsm\_7bit\_decode\_ussd}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_decode\_ussd()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+decode\+\_\+ussd (\begin{DoxyParamCaption}\item[{char $\ast$}]{decoded,  }\item[{const uint8\+\_\+t $\ast$}]{user\+\_\+data,  }\item[{uint8\+\_\+t}]{length }\end{DoxyParamCaption})}



References \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd()}, \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}, and \textbf{ length}.

\mbox{\label{gsm__utils_8h_a63ba84d1168cd0661b0d3c84fae89e75}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_encode@{gsm\_7bit\_encode}}
\index{gsm\_7bit\_encode@{gsm\_7bit\_encode}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_encode()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+encode (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const char $\ast$}]{data }\end{DoxyParamCaption})}



References \textbf{ data}, \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n()}, and \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}.

\mbox{\label{gsm__utils_8h_a8ece1eed9b296f7f2486db361701acdd}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_encode\_n@{gsm\_7bit\_encode\_n}}
\index{gsm\_7bit\_encode\_n@{gsm\_7bit\_encode\_n}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_encode\_n()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+encode\+\_\+n (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{size\+\_\+t}]{n,  }\item[{const char $\ast$}]{data,  }\item[{int $\ast$}]{octets }\end{DoxyParamCaption})}



Encode a text string into GSM 03.\+38 encoded 7 bit characters. 


\begin{DoxyParams}{Parameters}
{\em result} & The destination buffer for the packed 7 bit sequence. \\
\hline
{\em n} & A maximum of n octets is written. \\
\hline
{\em data} & A pointer to the start of the \textbackslash{}0 terminated 8 bit character string. \\
\hline
{\em octets\+\_\+written} & Iff not NULL, $\ast$octets\+\_\+written will be set to the number of octets written to the result buffer.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the number of septets that have been created.
\end{DoxyReturn}
Encode a text string into GSM 03.\+38 encoded 7 bit characters.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em result} & Caller-\/provided output buffer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Maximum length of {\itshape result} in bytes \\
\hline
\mbox{\texttt{ in}}  & {\em data} & octet-\/aligned string \\
\hline
\mbox{\texttt{ out}}  & {\em octets} & Number of octets encoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of septets encoded 
\end{DoxyReturn}


References \textbf{ data}, \textbf{ gsm\+\_\+septet\+\_\+encode()}, \textbf{ gsm\+\_\+septet\+\_\+pack()}, and \textbf{ n}.



Referenced by \textbf{ gsm340\+\_\+gen\+\_\+oa()}, \textbf{ gsm\+\_\+7bit\+\_\+encode()}, \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n\+\_\+ussd()}, and \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+oct()}.

\mbox{\label{gsm__utils_8h_aa501440ce3facba2fac7acd656a1112d}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_encode\_n\_ussd@{gsm\_7bit\_encode\_n\_ussd}}
\index{gsm\_7bit\_encode\_n\_ussd@{gsm\_7bit\_encode\_n\_ussd}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_encode\_n\_ussd()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+encode\+\_\+n\+\_\+ussd (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{size\+\_\+t}]{n,  }\item[{const char $\ast$}]{data,  }\item[{int $\ast$}]{octets }\end{DoxyParamCaption})}



Encode a text string into GSM 03.\+38 encoded 7 bit characters (USSD encoding). 

\begin{DoxySeeAlso}{See also}
\doxyref{gsm\+\_\+7bit\+\_\+decode\+\_\+n()}{p.}{gsm__utils_8h_a03c0ce5109203002f372d2c023062e47}
\end{DoxySeeAlso}
Encode a text string into GSM 03.\+38 encoded 7 bit characters (USSD encoding).


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em result} & Caller-\/provided output buffer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Maximum length of {\itshape result} in bytes \\
\hline
\mbox{\texttt{ in}}  & {\em data} & octet-\/aligned string \\
\hline
\mbox{\texttt{ out}}  & {\em octets} & Number of octets encoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of septets encoded 
\end{DoxyReturn}


References \textbf{ data}, \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n()}, and \textbf{ n}.



Referenced by \textbf{ gsm0480\+\_\+create\+\_\+notify\+SS()}, \textbf{ gsm0480\+\_\+create\+\_\+unstructured\+SS\+\_\+\+Notify()}, \textbf{ gsm0480\+\_\+gen\+\_\+ussd\+\_\+resp\+\_\+7bit()}, and \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+ussd()}.

\mbox{\label{gsm__utils_8h_aa4b00c9071e7e099657463d4276042d3}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_encode\_oct@{gsm\_7bit\_encode\_oct}}
\index{gsm\_7bit\_encode\_oct@{gsm\_7bit\_encode\_oct}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_encode\_oct()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+encode\+\_\+oct (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const char $\ast$}]{data,  }\item[{int $\ast$}]{octets\+\_\+written }\end{DoxyParamCaption})}



References \textbf{ data}, \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n()}, and \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}.

\mbox{\label{gsm__utils_8h_a4aee424b89b759536ce4791617287584}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_7bit\_encode\_ussd@{gsm\_7bit\_encode\_ussd}}
\index{gsm\_7bit\_encode\_ussd@{gsm\_7bit\_encode\_ussd}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_7bit\_encode\_ussd()}
{\footnotesize\ttfamily int gsm\+\_\+7bit\+\_\+encode\+\_\+ussd (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const char $\ast$}]{data,  }\item[{int $\ast$}]{octets\+\_\+written }\end{DoxyParamCaption})}



References \textbf{ data}, \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n\+\_\+ussd()}, and \textbf{ GSM\+\_\+7\+BIT\+\_\+\+LEGACY\+\_\+\+MAX\+\_\+\+BUFFER\+\_\+\+SIZE}.

\mbox{\label{gsm__utils_8h_aa9bc78088295f253cbd538a4914b5bf5}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_arfcn2band@{gsm\_arfcn2band}}
\index{gsm\_arfcn2band@{gsm\_arfcn2band}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_arfcn2band()}
{\footnotesize\ttfamily enum \textbf{ gsm\+\_\+band} gsm\+\_\+arfcn2band (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{arfcn }\end{DoxyParamCaption})}



Resolve GSM band from ARFCN, aborts process on invalid ARFCN. 

In Osmocom, we use the highest bit of the {\itshape arfcn} to indicate PCS. DEPRECATED\+: Use gsm\+\_\+arfcn2band\+\_\+rc instead. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em arfcn} & Osmocom ARFCN, highest bit determines PCS mode \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
GSM Band if ARFCN is valid (part of any valid band), aborts otherwise 
\end{DoxyReturn}


References \textbf{ arfcn}, \textbf{ gsm\+\_\+arfcn2band\+\_\+rc()}, and \textbf{ osmo\+\_\+panic()}.

\mbox{\label{gsm__utils_8h_a2526084c5f9fe9df8b7567f3c4f00d2a}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_arfcn2band\_rc@{gsm\_arfcn2band\_rc}}
\index{gsm\_arfcn2band\_rc@{gsm\_arfcn2band\_rc}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_arfcn2band\_rc()}
{\footnotesize\ttfamily int gsm\+\_\+arfcn2band\+\_\+rc (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{arfcn,  }\item[{enum \textbf{ gsm\+\_\+band} $\ast$}]{band }\end{DoxyParamCaption})}



Resolve GSM band from ARFCN. 

In Osmocom, we use the highest bit of the {\itshape arfcn} to indicate PCS 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em arfcn} & Osmocom ARFCN, highest bit determines PCS mode \\
\hline
\mbox{\texttt{ out}}  & {\em band} & GSM Band containing \textbackslash{}arfcn if arfcn is valid, undetermined otherwise \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if arfcn is valid and {\itshape band} was set, negative on error 
\end{DoxyReturn}


References \textbf{ arfcn}, \textbf{ ARFCN\+\_\+\+PCS}, \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.



Referenced by \textbf{ gsm\+\_\+arfcn2band()}.

\mbox{\label{gsm__utils_8h_abfa6d93d10c7204e6b19aab256abb1c2}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_arfcn2freq10@{gsm\_arfcn2freq10}}
\index{gsm\_arfcn2freq10@{gsm\_arfcn2freq10}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_arfcn2freq10()}
{\footnotesize\ttfamily uint16\+\_\+t gsm\+\_\+arfcn2freq10 (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{arfcn,  }\item[{int}]{uplink }\end{DoxyParamCaption})}



Convert an ARFCN to the frequency in MHz $\ast$ 10. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em arfcn} & GSM ARFCN to convert \\
\hline
\mbox{\texttt{ in}}  & {\em uplink} & Uplink (1) or Downlink (0) frequency \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Frequency in units of 1/10ths of MHz (100k\+Hz) 
\end{DoxyReturn}


References \textbf{ arfcn}, \textbf{ gsm\+\_\+freq\+\_\+range\+::arfcn\+\_\+first}, \textbf{ ARFCN\+\_\+\+FLAG\+\_\+\+MASK}, \textbf{ gsm\+\_\+freq\+\_\+range\+::arfcn\+\_\+last}, \textbf{ gsm\+\_\+freq\+\_\+range\+::flags}, \textbf{ gsm\+\_\+freq\+\_\+range\+::freq\+\_\+dl\+\_\+offset}, \textbf{ gsm\+\_\+freq\+\_\+range\+::freq\+\_\+ul\+\_\+first}, and \textbf{ gsm\+\_\+ranges}.

\mbox{\label{gsm__utils_8h_a650c05a3987ed76bed5913fcb6ab8000}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_band\_name@{gsm\_band\_name}}
\index{gsm\_band\_name@{gsm\_band\_name}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_band\_name()}
{\footnotesize\ttfamily const char $\ast$ gsm\+\_\+band\+\_\+name (\begin{DoxyParamCaption}\item[{enum \textbf{ gsm\+\_\+band}}]{band }\end{DoxyParamCaption})}



Return string name of a given GSM Band. 



References \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.

\mbox{\label{gsm__utils_8h_a1fa7003e966227107b6d55de5ebd391b}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_band\_parse@{gsm\_band\_parse}}
\index{gsm\_band\_parse@{gsm\_band\_parse}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_band\_parse()}
{\footnotesize\ttfamily enum \textbf{ gsm\+\_\+band} gsm\+\_\+band\+\_\+parse (\begin{DoxyParamCaption}\item[{const char $\ast$}]{mhz }\end{DoxyParamCaption})}



Parse string name of a GSM band. 



References \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.

\mbox{\label{gsm__utils_8h_a480a58d35f4f6cf5888b44fc5d9ab875}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_chan\_t\_name@{gsm\_chan\_t\_name}}
\index{gsm\_chan\_t\_name@{gsm\_chan\_t\_name}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_chan\_t\_name()}
{\footnotesize\ttfamily static const char $\ast$ gsm\+\_\+chan\+\_\+t\+\_\+name (\begin{DoxyParamCaption}\item[{enum \textbf{ gsm\+\_\+chan\+\_\+t}}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ get\+\_\+value\+\_\+string()}, and \textbf{ gsm\+\_\+chan\+\_\+t\+\_\+names}.

\mbox{\label{gsm__utils_8h_a03983eaede8e4c86846319818e178b39}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_fn2gsmtime@{gsm\_fn2gsmtime}}
\index{gsm\_fn2gsmtime@{gsm\_fn2gsmtime}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_fn2gsmtime()}
{\footnotesize\ttfamily void gsm\+\_\+fn2gsmtime (\begin{DoxyParamCaption}\item[{struct \textbf{ gsm\+\_\+time} $\ast$}]{time,  }\item[{uint32\+\_\+t}]{fn }\end{DoxyParamCaption})}



Parse GSM Frame Number into struct \doxyref{gsm\+\_\+time}{p.}{structgsm__time}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em time} & Caller-\/provided memory for \doxyref{gsm\+\_\+time}{p.}{structgsm__time} \\
\hline
\mbox{\texttt{ in}}  & {\em fn} & GSM Frame Number \\
\hline
\end{DoxyParams}


References \textbf{ time}.



Referenced by \textbf{ gsm\+\_\+fn\+\_\+as\+\_\+gsmtime\+\_\+str()}, \textbf{ l2\+\_\+ph\+\_\+chan\+\_\+conf()}, and \textbf{ l2\+\_\+ph\+\_\+rach\+\_\+ind()}.

\mbox{\label{gsm__utils_8h_a13d4285e580bacd3dda8248b5aaa4560}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_fn2rfn@{gsm\_fn2rfn}}
\index{gsm\_fn2rfn@{gsm\_fn2rfn}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_fn2rfn()}
{\footnotesize\ttfamily static uint16\+\_\+t gsm\+\_\+fn2rfn (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{fn }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ GSM\+\_\+\+RFN\+\_\+\+MODULUS}.



Referenced by \textbf{ gsm\+\_\+rfn2fn()}.

\mbox{\label{gsm__utils_8h_a04260546b5802656f5f9e67d3eb15b7a}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_fn\_as\_gsmtime\_str@{gsm\_fn\_as\_gsmtime\_str}}
\index{gsm\_fn\_as\_gsmtime\_str@{gsm\_fn\_as\_gsmtime\_str}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_fn\_as\_gsmtime\_str()}
{\footnotesize\ttfamily char $\ast$ gsm\+\_\+fn\+\_\+as\+\_\+gsmtime\+\_\+str (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{fn }\end{DoxyParamCaption})}



Parse GSM Frame Number into printable string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em fn} & GSM Frame Number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to printable string 
\end{DoxyReturn}


References \textbf{ gsm\+\_\+time\+::fn}, \textbf{ gsm\+\_\+fn2gsmtime()}, \textbf{ osmo\+\_\+dump\+\_\+gsmtime()}, and \textbf{ time}.

\mbox{\label{gsm__utils_8h_a0966dafc049ea830941e4350814da7c1}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_freq102arfcn@{gsm\_freq102arfcn}}
\index{gsm\_freq102arfcn@{gsm\_freq102arfcn}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_freq102arfcn()}
{\footnotesize\ttfamily uint16\+\_\+t gsm\+\_\+freq102arfcn (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{freq10,  }\item[{int}]{uplink }\end{DoxyParamCaption})}



Convert a Frequency in MHz $\ast$ 10 to ARFCN. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em freq10} & Frequency in units of 1/10ths of MHz (100k\+Hz) \\
\hline
\mbox{\texttt{ in}}  & {\em uplink} & Frequency is Uplink (1) or Downlink (0) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
ARFCN in case of success; 0xffff on error 
\end{DoxyReturn}


References \textbf{ arfcn}, \textbf{ gsm\+\_\+freq\+\_\+range\+::arfcn\+\_\+first}, \textbf{ gsm\+\_\+freq\+\_\+range\+::arfcn\+\_\+last}, \textbf{ ARFCN\+\_\+\+UPLINK}, \textbf{ gsm\+\_\+freq\+\_\+range\+::flags}, \textbf{ gsm\+\_\+freq\+\_\+range\+::freq\+\_\+dl\+\_\+offset}, \textbf{ gsm\+\_\+freq\+\_\+range\+::freq\+\_\+ul\+\_\+first}, and \textbf{ gsm\+\_\+ranges}.

\mbox{\label{gsm__utils_8h_ae344c384beeff74e364f3bcbe5630146}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_get\_octet\_len@{gsm\_get\_octet\_len}}
\index{gsm\_get\_octet\_len@{gsm\_get\_octet\_len}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_get\_octet\_len()}
{\footnotesize\ttfamily uint8\+\_\+t gsm\+\_\+get\+\_\+octet\+\_\+len (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t}]{sept\+\_\+len }\end{DoxyParamCaption})}



Compute number of octets from number of septets. 

For instance\+: 47 septets need 41,125 = 42 octets. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em sept\+\_\+len} & Number of septets \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of octets required 
\end{DoxyReturn}


Referenced by \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+hdr()}, and \textbf{ gsm\+\_\+7bit\+\_\+decode\+\_\+n\+\_\+ussd()}.

\mbox{\label{gsm__utils_8h_a4fcb2d00394ab3a9976a2232fa1aec5e}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_gsmtime2fn@{gsm\_gsmtime2fn}}
\index{gsm\_gsmtime2fn@{gsm\_gsmtime2fn}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_gsmtime2fn()}
{\footnotesize\ttfamily uint32\+\_\+t gsm\+\_\+gsmtime2fn (\begin{DoxyParamCaption}\item[{const struct \textbf{ gsm\+\_\+time} $\ast$}]{time }\end{DoxyParamCaption})}



Encode decoded \doxyref{gsm\+\_\+time}{p.}{structgsm__time} to Frame Number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em time} & GSM Time in decoded structure \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
GSM Frame Number 
\end{DoxyReturn}


References \textbf{ gsm\+\_\+time\+::fn}, \textbf{ GSM\+\_\+\+MAX\+\_\+\+FN}, \textbf{ OSMO\+\_\+\+MOD\+\_\+\+FLR}, and \textbf{ time}.

\mbox{\label{gsm__utils_8h_ad6becb4339b7ca4d7f3d00aededa0b70}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_rfn2fn@{gsm\_rfn2fn}}
\index{gsm\_rfn2fn@{gsm\_rfn2fn}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_rfn2fn()}
{\footnotesize\ttfamily uint32\+\_\+t gsm\+\_\+rfn2fn (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{rfn,  }\item[{uint32\+\_\+t}]{curr\+\_\+fn }\end{DoxyParamCaption})}



References \textbf{ gsm\+\_\+fn2rfn()}, \textbf{ GSM\+\_\+\+MAX\+\_\+\+FN}, \textbf{ GSM\+\_\+\+RFN\+\_\+\+MODULUS}, \textbf{ GSM\+\_\+\+RFN\+\_\+\+THRESHOLD}, \textbf{ GSM\+\_\+\+TDMA\+\_\+\+FN\+\_\+\+DIFF}, \textbf{ GSM\+\_\+\+TDMA\+\_\+\+FN\+\_\+\+SUB}, \textbf{ GSM\+\_\+\+TDMA\+\_\+\+FN\+\_\+\+SUM}, and \textbf{ OSMO\+\_\+\+ASSERT}.

\mbox{\label{gsm__utils_8h_a29185670b3aca45651f1d77e1bb7c6b7}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_septet\_encode@{gsm\_septet\_encode}}
\index{gsm\_septet\_encode@{gsm\_septet\_encode}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_septet\_encode()}
{\footnotesize\ttfamily int gsm\+\_\+septet\+\_\+encode (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const char $\ast$}]{data }\end{DoxyParamCaption})}



Encode a ASCII characterrs as 7-\/bit GSM alphabet (TS 03.\+38) 

This function converts a zero-\/terminated input string {\itshape data} from ASCII into octet-\/aligned 7-\/bit GSM characters. No packing is performed.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em result} & caller-\/allocated output buffer \\
\hline
\mbox{\texttt{ in}}  & {\em data} & input data, ASCII \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of octets used in {\itshape result} 
\end{DoxyReturn}


References \textbf{ data}, and \textbf{ gsm\+\_\+7bit\+\_\+alphabet}.



Referenced by \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n()}.

\mbox{\label{gsm__utils_8h_a33b84fc430c967b587fdcaf71c96c26a}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_septet\_pack@{gsm\_septet\_pack}}
\index{gsm\_septet\_pack@{gsm\_septet\_pack}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_septet\_pack()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily int use gsm\+\_\+septet\+\_\+pack (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\mbox{\label{gsm__utils_8h_a0510de16d812e1e028e09764a55c220d}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_septet\_pack@{gsm\_septet\_pack}}
\index{gsm\_septet\_pack@{gsm\_septet\_pack}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_septet\_pack()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily int gsm\+\_\+septet\+\_\+pack (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const uint8\+\_\+t $\ast$}]{rdata,  }\item[{size\+\_\+t}]{septet\+\_\+len,  }\item[{uint8\+\_\+t}]{padding }\end{DoxyParamCaption})}



GSM Default Alphabet 7bit to octet packing. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em result} & Caller-\/provided output buffer \\
\hline
\mbox{\texttt{ in}}  & {\em rdata} & Input data septets \\
\hline
\mbox{\texttt{ in}}  & {\em septet\+\_\+len} & Length of {\itshape rdata} \\
\hline
\mbox{\texttt{ in}}  & {\em padding} & padding bits at start \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes used in {\itshape result} 
\end{DoxyReturn}


References \textbf{ data}.



Referenced by \textbf{ gsm\+\_\+7bit\+\_\+encode\+\_\+n()}, and \textbf{ gsm\+\_\+septets2octets()}.

\mbox{\label{gsm__utils_8h_af39ad3773e2d231295cbf0cd56db3071}} 
\index{gsm\_utils.h@{gsm\_utils.h}!gsm\_septets2octets@{gsm\_septets2octets}}
\index{gsm\_septets2octets@{gsm\_septets2octets}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{gsm\_septets2octets()}
{\footnotesize\ttfamily int gsm\+\_\+septets2octets (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{result,  }\item[{const uint8\+\_\+t $\ast$}]{rdata,  }\item[{uint8\+\_\+t}]{septet\+\_\+len,  }\item[{uint8\+\_\+t}]{padding }\end{DoxyParamCaption})}



References \textbf{ OSMO\+\_\+\+DEPRECATED}.

\mbox{\label{gsm__utils_8h_a8bf84d443245ef71bc0facb8671f647e}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ms\_class\_gmsk\_dbm@{ms\_class\_gmsk\_dbm}}
\index{ms\_class\_gmsk\_dbm@{ms\_class\_gmsk\_dbm}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ms\_class\_gmsk\_dbm()}
{\footnotesize\ttfamily int ms\+\_\+class\+\_\+gmsk\+\_\+dbm (\begin{DoxyParamCaption}\item[{enum \textbf{ gsm\+\_\+band}}]{band,  }\item[{int}]{class }\end{DoxyParamCaption})}



Convert power class to d\+Bm according to GSM TS 05.\+05. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em band} & GSM frequency band \\
\hline
\mbox{\texttt{ in}}  & {\em class} & GSM power class \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
maximum transmit power of power class in d\+Bm, negative on error 
\end{DoxyReturn}


References \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.

\mbox{\label{gsm__utils_8h_abc8428d4b8e66ec9f1dcebc326303ea6}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ms\_cm2\_a5n\_support@{ms\_cm2\_a5n\_support}}
\index{ms\_cm2\_a5n\_support@{ms\_cm2\_a5n\_support}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ms\_cm2\_a5n\_support()}
{\footnotesize\ttfamily static int ms\+\_\+cm2\+\_\+a5n\+\_\+support (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{cm2,  }\item[{unsigned}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ cm2}, and \textbf{ n}.

\mbox{\label{gsm__utils_8h_a29677769ccf6d7282a2e8cf0792c0943}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ms\_cm3\_a5n\_support@{ms\_cm3\_a5n\_support}}
\index{ms\_cm3\_a5n\_support@{ms\_cm3\_a5n\_support}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ms\_cm3\_a5n\_support()}
{\footnotesize\ttfamily static int ms\+\_\+cm3\+\_\+a5n\+\_\+support (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{cm3,  }\item[{unsigned}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ n}.

\mbox{\label{gsm__utils_8h_a480695532e5647f6403768db3842dc02}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ms\_pwr\_ctl\_lvl@{ms\_pwr\_ctl\_lvl}}
\index{ms\_pwr\_ctl\_lvl@{ms\_pwr\_ctl\_lvl}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ms\_pwr\_ctl\_lvl()}
{\footnotesize\ttfamily int ms\+\_\+pwr\+\_\+ctl\+\_\+lvl (\begin{DoxyParamCaption}\item[{enum \textbf{ gsm\+\_\+band}}]{band,  }\item[{unsigned int}]{dbm }\end{DoxyParamCaption})}



determine power control level for given d\+Bm value, as indicated by the tables in chapter 4.\+1.\+1 of GSM TS 05.\+05 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em GSM} & frequency band \\
\hline
\mbox{\texttt{ in}}  & {\em dbm} & RF power value in d\+Bm \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
TS 05.\+05 power control level 
\end{DoxyReturn}


References \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.

\mbox{\label{gsm__utils_8h_af1a932df543020d87413668cbba66b9f}} 
\index{gsm\_utils.h@{gsm\_utils.h}!ms\_pwr\_dbm@{ms\_pwr\_dbm}}
\index{ms\_pwr\_dbm@{ms\_pwr\_dbm}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{ms\_pwr\_dbm()}
{\footnotesize\ttfamily int ms\+\_\+pwr\+\_\+dbm (\begin{DoxyParamCaption}\item[{enum \textbf{ gsm\+\_\+band}}]{band,  }\item[{uint8\+\_\+t}]{lvl }\end{DoxyParamCaption})}



Convert TS 05.\+05 power level to absolute d\+Bm value. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em band} & GSM frequency band \\
\hline
\mbox{\texttt{ in}}  & {\em lvl} & TS 05.\+05 power control level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
RF power level in d\+Bm 
\end{DoxyReturn}


References \textbf{ GSM\+\_\+\+BAND\+\_\+1800}, \textbf{ GSM\+\_\+\+BAND\+\_\+1900}, \textbf{ GSM\+\_\+\+BAND\+\_\+450}, \textbf{ GSM\+\_\+\+BAND\+\_\+480}, \textbf{ GSM\+\_\+\+BAND\+\_\+750}, \textbf{ GSM\+\_\+\+BAND\+\_\+810}, \textbf{ GSM\+\_\+\+BAND\+\_\+850}, and \textbf{ GSM\+\_\+\+BAND\+\_\+900}.

\mbox{\label{gsm__utils_8h_acc0292d87248739afc7eb2afbe458f80}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_dump\_gsmtime@{osmo\_dump\_gsmtime}}
\index{osmo\_dump\_gsmtime@{osmo\_dump\_gsmtime}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_dump\_gsmtime()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+dump\+\_\+gsmtime (\begin{DoxyParamCaption}\item[{const struct \textbf{ gsm\+\_\+time} $\ast$}]{tm }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+dump\+\_\+gsmtime\+\_\+buf()}.



Referenced by \textbf{ gsm\+\_\+fn\+\_\+as\+\_\+gsmtime\+\_\+str()}.

\mbox{\label{gsm__utils_8h_add331b4c175d2e82943f7a50d4337cb8}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_dump\_gsmtime\_buf@{osmo\_dump\_gsmtime\_buf}}
\index{osmo\_dump\_gsmtime\_buf@{osmo\_dump\_gsmtime\_buf}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_dump\_gsmtime\_buf()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+dump\+\_\+gsmtime\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buf\+\_\+len,  }\item[{const struct \textbf{ gsm\+\_\+time} $\ast$}]{tm }\end{DoxyParamCaption})}



References \textbf{ gsm\+\_\+time\+::fn}, \textbf{ gsm\+\_\+time\+::t1}, \textbf{ gsm\+\_\+time\+::t2}, and \textbf{ gsm\+\_\+time\+::t3}.



Referenced by \textbf{ osmo\+\_\+dump\+\_\+gsmtime()}, and \textbf{ osmo\+\_\+dump\+\_\+gsmtime\+\_\+c()}.

\mbox{\label{gsm__utils_8h_a116042280c8352d9c7bbaf9bf7ba1909}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_dump\_gsmtime\_c@{osmo\_dump\_gsmtime\_c}}
\index{osmo\_dump\_gsmtime\_c@{osmo\_dump\_gsmtime\_c}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_dump\_gsmtime\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+dump\+\_\+gsmtime\+\_\+c (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{const struct \textbf{ gsm\+\_\+time} $\ast$}]{tm }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+dump\+\_\+gsmtime\+\_\+buf()}.

\mbox{\label{gsm__utils_8h_a5b09d21926d3a35ced829f61dc0bb790}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_get\_rand\_id@{osmo\_get\_rand\_id}}
\index{osmo\_get\_rand\_id@{osmo\_get\_rand\_id}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_get\_rand\_id()}
{\footnotesize\ttfamily int osmo\+\_\+get\+\_\+rand\+\_\+id (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{out,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



Generate random identifier We use /dev/urandom (default when GRND\+\_\+\+RANDOM flag is not set). 

Both /dev/(u)random numbers are coming from the same CSPRNG anyway (at least on GNU/\+Linux $>$= 4.\+8). See also RFC4086. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em out} & Buffer to be filled with random data \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Number of random bytes required \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, or a negative error code on error. 
\end{DoxyReturn}


References \textbf{ ENOTSUP}, \textbf{ len}, and \textbf{ OSMO\+\_\+\+MAX\+\_\+\+RAND\+\_\+\+ID\+\_\+\+LEN}.

\mbox{\label{gsm__utils_8h_ae58afae46f358e59c2146b3cd0284165}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_rat\_type\_name@{osmo\_rat\_type\_name}}
\index{osmo\_rat\_type\_name@{osmo\_rat\_type\_name}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_rat\_type\_name()}
{\footnotesize\ttfamily static const char $\ast$ osmo\+\_\+rat\+\_\+type\+\_\+name (\begin{DoxyParamCaption}\item[{enum \textbf{ osmo\+\_\+rat\+\_\+type}}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ get\+\_\+value\+\_\+string()}, and \textbf{ osmo\+\_\+rat\+\_\+type\+\_\+names}.



Referenced by \textbf{ osmo\+\_\+gsup\+\_\+encode()}.

\mbox{\label{gsm__utils_8h_abc9a983eea548bdece6a38e722d68a2e}} 
\index{gsm\_utils.h@{gsm\_utils.h}!rach\_max\_trans\_raw2val@{rach\_max\_trans\_raw2val}}
\index{rach\_max\_trans\_raw2val@{rach\_max\_trans\_raw2val}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{rach\_max\_trans\_raw2val()}
{\footnotesize\ttfamily static int rach\+\_\+max\+\_\+trans\+\_\+raw2val (\begin{DoxyParamCaption}\item[{int}]{raw }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

\mbox{\label{gsm__utils_8h_a1165d518dee15b65e1afc087d6364fad}} 
\index{gsm\_utils.h@{gsm\_utils.h}!rach\_max\_trans\_val2raw@{rach\_max\_trans\_val2raw}}
\index{rach\_max\_trans\_val2raw@{rach\_max\_trans\_val2raw}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{rach\_max\_trans\_val2raw()}
{\footnotesize\ttfamily static int rach\+\_\+max\+\_\+trans\+\_\+val2raw (\begin{DoxyParamCaption}\item[{int}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

\mbox{\label{gsm__utils_8h_a1db7866722f1a1362059bac2b5fed62e}} 
\index{gsm\_utils.h@{gsm\_utils.h}!rach\_tx\_integer\_raw2val@{rach\_tx\_integer\_raw2val}}
\index{rach\_tx\_integer\_raw2val@{rach\_tx\_integer\_raw2val}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{rach\_tx\_integer\_raw2val()}
{\footnotesize\ttfamily static uint8\+\_\+t rach\+\_\+tx\+\_\+integer\+\_\+raw2val (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{raw }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

\mbox{\label{gsm__utils_8h_a8d7eb8255d6849331f4171b5f7960f83}} 
\index{gsm\_utils.h@{gsm\_utils.h}!rxlev2dbm@{rxlev2dbm}}
\index{rxlev2dbm@{rxlev2dbm}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{rxlev2dbm()}
{\footnotesize\ttfamily int rxlev2dbm (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{rxlev }\end{DoxyParamCaption})}



Convert TS 05.\+08 Rx\+Lev to d\+Bm (TS 05.\+08 Chapter 8.\+1.\+4) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em rxlev} & TS 05.\+08 Rx\+Lev value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Received RF power in d\+Bm 
\end{DoxyReturn}


\doxysubsection{Variable Documentation}
\mbox{\label{gsm__utils_8h_aa1c66d15e1eae4970b3598883ecd3598}} 
\index{gsm\_utils.h@{gsm\_utils.h}!osmo\_rat\_type\_names@{osmo\_rat\_type\_names}}
\index{osmo\_rat\_type\_names@{osmo\_rat\_type\_names}!gsm\_utils.h@{gsm\_utils.h}}
\doxysubsubsection{osmo\_rat\_type\_names}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} osmo\+\_\+rat\+\_\+type\+\_\+names[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ osmo\+\_\+rat\+\_\+type\+\_\+name()}.

