\doxysection{src/gsm/gsm48\+\_\+ie.c File Reference}
\label{gsm48__ie_8c}\index{src/gsm/gsm48\_ie.c@{src/gsm/gsm48\_ie.c}}


GSM Mobile Radio Interface Layer 3 messages.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/tlv.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/mncc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/bitvec.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/protocol/gsm\+\_\+04\+\_\+08.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/gsm48\+\_\+ie.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ gsm48\+\_\+decode\+\_\+bcd\+\_\+number} (char $\ast$output, int output\+\_\+len, const uint8\+\_\+t $\ast$bcd\+\_\+lv, int h\+\_\+len)
\begin{DoxyCompactList}\small\item\em Like \doxyref{gsm48\+\_\+decode\+\_\+bcd\+\_\+number2()}{p.}{group__gsm0408_ga5b3bf7d4c1afaa1fe5705f76bb5a0e07} but with less airtight bounds checking. \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+bcd\+\_\+number2} (char $\ast$output, size\+\_\+t output\+\_\+len, const uint8\+\_\+t $\ast$bcd\+\_\+lv, size\+\_\+t input\+\_\+len, size\+\_\+t h\+\_\+len)
\begin{DoxyCompactList}\small\item\em Decode a \textquotesingle{}called/calling/connect party BCD number\textquotesingle{} as in 10.\+5.\+4.\+7. \end{DoxyCompactList}\item 
static int \textbf{ asc\+\_\+to\+\_\+bcd} (const char asc)
\begin{DoxyCompactList}\small\item\em convert a single ASCII character to call-\/control BCD \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+bcd\+\_\+number} (uint8\+\_\+t $\ast$bcd\+\_\+lv, uint8\+\_\+t max\+\_\+len, int h\+\_\+len, const char $\ast$input)
\begin{DoxyCompactList}\small\item\em convert a ASCII phone number to \textquotesingle{}called/calling/connect party BCD number\textquotesingle{} \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+bearer\+\_\+cap} (struct \textbf{ gsm\+\_\+mncc\+\_\+bearer\+\_\+cap} $\ast$bcap, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Bearer Capability IE (10.\+5.\+4.\+5) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+bearer\+\_\+cap} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int lv\+\_\+only, const struct \textbf{ gsm\+\_\+mncc\+\_\+bearer\+\_\+cap} $\ast$bcap)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Bearer Capability IE (10.\+5.\+4.\+5) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+cccap} (struct \textbf{ gsm\+\_\+mncc\+\_\+cccap} $\ast$ccap, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Call Control Capabilities IE (10.\+5.\+4.\+5a) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+cccap} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+cccap} $\ast$ccap)
\begin{DoxyCompactList}\small\item\em Encodoe TS 04.\+08 Call Control Capabilities (10.\+5.\+4.\+5a) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+called} (struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$called, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Called Party BCD Number IE (10.\+5.\+4.\+7) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+called} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$called)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Called Party IE (10.\+5.\+4.\+7) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+callerid} (struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$callerid, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Caller ID. \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+callerid} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int ie, int max\+\_\+len, const struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$callerid)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Caller ID IE. \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+cause} (struct \textbf{ gsm\+\_\+mncc\+\_\+cause} $\ast$\textbf{ cause}, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Cause IE (10.\+5.\+4.\+11) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+cause} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int lv\+\_\+only, const struct \textbf{ gsm\+\_\+mncc\+\_\+cause} $\ast$\textbf{ cause})
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Cause IE (10.\+5.\+4.\+11) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+calling} (struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$calling, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Calling Number IE (10.\+5.\+4.\+9) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+calling} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$calling)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Calling Number IE (10.\+5.\+4.\+9) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+connected} (struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$connected, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Connected Number IE (10.\+5.\+4.\+13) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+connected} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$connected)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Connected Number IE (10.\+5.\+4.\+13) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+redirecting} (struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$redirecting, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Redirecting Number IE (10.\+5.\+4.\+21b) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+redirecting} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+number} $\ast$redirecting)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Redirecting Number IE (10.\+5.\+4.\+21b) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+facility} (struct \textbf{ gsm\+\_\+mncc\+\_\+facility} $\ast$facility, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Facility IE (10.\+5.\+4.\+15) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+facility} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int lv\+\_\+only, const struct \textbf{ gsm\+\_\+mncc\+\_\+facility} $\ast$facility)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Facility IE (10.\+5.\+4.\+15) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+notify} (int $\ast$notify, const uint8\+\_\+t $\ast$v)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Notify IE (10.\+5.\+4.\+20) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+notify} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int notify)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Notify IE (10.\+5.\+4.\+20) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+signal} (int $\ast$signal, const uint8\+\_\+t $\ast$v)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Signal IE (10.\+5.\+4.\+23) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+signal} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int signal)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Signal IE (10.\+5.\+4.\+23) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+keypad} (int $\ast$keypad, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Keypad IE (10.\+5.\+4.\+17) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+keypad} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int keypad)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Keypad IE (10.\+5.\+4.\+17) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+progress} (struct \textbf{ gsm\+\_\+mncc\+\_\+progress} $\ast$progress, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Progress IE (10.\+5.\+4.\+21) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+progress} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int lv\+\_\+only, const struct \textbf{ gsm\+\_\+mncc\+\_\+progress} $\ast$p)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 Progress IE (10.\+5.\+4.\+21) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+useruser} (struct \textbf{ gsm\+\_\+mncc\+\_\+useruser} $\ast$uu, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 User-\/\+User IE (10.\+5.\+4.\+25) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+useruser} (struct \textbf{ msgb} $\ast$\textbf{ msg}, int lv\+\_\+only, const struct \textbf{ gsm\+\_\+mncc\+\_\+useruser} $\ast$uu)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 User-\/\+User IE (10.\+5.\+4.\+25) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+ssversion} (struct \textbf{ gsm\+\_\+mncc\+\_\+ssversion} $\ast$ssv, const uint8\+\_\+t $\ast$lv)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 SS Version IE (10.\+5.\+4.\+24) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+ssversion} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ gsm\+\_\+mncc\+\_\+ssversion} $\ast$ssv)
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 SS Version IE (10.\+5.\+4.\+24) \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+encode\+\_\+more} (struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Encode TS 04.\+08 More Data IE (10.\+5.\+4.\+19) \end{DoxyCompactList}\item 
static int32\+\_\+t \textbf{ smod} (int32\+\_\+t \textbf{ n}, int32\+\_\+t m)
\item 
int \textbf{ gsm48\+\_\+decode\+\_\+freq\+\_\+list} (struct \textbf{ gsm\+\_\+sysinfo\+\_\+freq} $\ast$f, const uint8\+\_\+t $\ast$cd, uint8\+\_\+t \textbf{ len}, uint8\+\_\+t mask, uint8\+\_\+t frqt)
\begin{DoxyCompactList}\small\item\em Decode TS 04.\+08 Cell Channel Description IE (10.\+5.\+2.\+1b) and other frequency lists. \end{DoxyCompactList}\item 
int \textbf{ gsm48\+\_\+decode\+\_\+classmark3} (struct \textbf{ gsm48\+\_\+classmark3} $\ast$classmark3\+\_\+out, const uint8\+\_\+t $\ast$classmark3, size\+\_\+t classmark3\+\_\+len)
\begin{DoxyCompactList}\small\item\em Decode 3GPP TS 24.\+008 Mobile Station Classmark 3 (10.\+5.\+1.\+7). \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static const char \textbf{ bcd\+\_\+num\+\_\+digits} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
GSM Mobile Radio Interface Layer 3 messages. 

3GPP TS 04.\+08 version 7.\+21.\+0 Release 1998 / ETSI TS 100 940 V7.\+21.\+0. 