\doxysection{gsm48\+\_\+ie.\+h}
\label{gsm48__ie_8h_source}\index{include/osmocom/gsm/gsm48\_ie.h@{include/osmocom/gsm/gsm48\_ie.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <string.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <errno.h>}}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/defs.h>}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <osmocom/gsm/tlv.h>}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#include <osmocom/gsm/mncc.h>}}
\DoxyCodeLine{13 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08.h>}}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{comment}{/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */}}
\DoxyCodeLine{16 \textcolor{keywordtype}{int} gsm48\_decode\_bcd\_number(\textcolor{keywordtype}{char} *output, \textcolor{keywordtype}{int} output\_len,}
\DoxyCodeLine{17                             \textcolor{keyword}{const} uint8\_t *bcd\_lv, \textcolor{keywordtype}{int} h\_len)}
\DoxyCodeLine{18         OSMO\_DEPRECATED\_OUTSIDE(\textcolor{stringliteral}{"{}Use gsm48\_decode\_bcd\_number2() for improved bounds checking"{}});}
\DoxyCodeLine{19 \textcolor{keywordtype}{int} gsm48\_decode\_bcd\_number2(\textcolor{keywordtype}{char} *output, \textcolor{keywordtype}{size\_t} output\_len,}
\DoxyCodeLine{20                              \textcolor{keyword}{const} uint8\_t *bcd\_lv, \textcolor{keywordtype}{size\_t} input\_len,}
\DoxyCodeLine{21                              \textcolor{keywordtype}{size\_t} h\_len);}
\DoxyCodeLine{22 }
\DoxyCodeLine{23 \textcolor{comment}{/* convert a ASCII phone number to 'called/calling/connect party BCD number' */}}
\DoxyCodeLine{24 \textcolor{keywordtype}{int} gsm48\_encode\_bcd\_number(uint8\_t *bcd\_lv, uint8\_t max\_len,}
\DoxyCodeLine{25                             \textcolor{keywordtype}{int} h\_len, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *input);}
\DoxyCodeLine{26 \textcolor{comment}{/* decode 'bearer capability' */}}
\DoxyCodeLine{27 \textcolor{keywordtype}{int} gsm48\_decode\_bearer\_cap(\textcolor{keyword}{struct} gsm\_mncc\_bearer\_cap *bcap,}
\DoxyCodeLine{28                              \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{29 \textcolor{comment}{/* encode 'bearer capability' */}}
\DoxyCodeLine{30 \textcolor{keywordtype}{int} gsm48\_encode\_bearer\_cap(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} lv\_only,}
\DoxyCodeLine{31                              \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_bearer\_cap *bcap);}
\DoxyCodeLine{32 \textcolor{comment}{/* decode 'call control cap' */}}
\DoxyCodeLine{33 \textcolor{keywordtype}{int} gsm48\_decode\_cccap(\textcolor{keyword}{struct} gsm\_mncc\_cccap *ccap, \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{34 \textcolor{comment}{/* encode 'call control cap' */}}
\DoxyCodeLine{35 \textcolor{keywordtype}{int} gsm48\_encode\_cccap(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{36                         \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_cccap *ccap);}
\DoxyCodeLine{37 \textcolor{comment}{/* decode 'called party BCD number' */}}
\DoxyCodeLine{38 \textcolor{keywordtype}{int} gsm48\_decode\_called(\textcolor{keyword}{struct} gsm\_mncc\_number *called,}
\DoxyCodeLine{39                          \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{40 \textcolor{comment}{/* encode 'called party BCD number' */}}
\DoxyCodeLine{41 \textcolor{keywordtype}{int} gsm48\_encode\_called(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{42                          \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_number *called);}
\DoxyCodeLine{43 \textcolor{comment}{/* decode callerid of various IEs */}}
\DoxyCodeLine{44 \textcolor{keywordtype}{int} gsm48\_decode\_callerid(\textcolor{keyword}{struct} gsm\_mncc\_number *callerid,}
\DoxyCodeLine{45                          \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{46 \textcolor{comment}{/* encode callerid of various IEs */}}
\DoxyCodeLine{47 \textcolor{keywordtype}{int} gsm48\_encode\_callerid(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} ie, \textcolor{keywordtype}{int} max\_len,}
\DoxyCodeLine{48                            \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_number *callerid);}
\DoxyCodeLine{49 \textcolor{comment}{/* decode 'cause' */}}
\DoxyCodeLine{50 \textcolor{keywordtype}{int} gsm48\_decode\_cause(\textcolor{keyword}{struct} gsm\_mncc\_cause *cause,}
\DoxyCodeLine{51                         \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{52 \textcolor{comment}{/* encode 'cause' */}}
\DoxyCodeLine{53 \textcolor{keywordtype}{int} gsm48\_encode\_cause(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} lv\_only,}
\DoxyCodeLine{54                         \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_cause *cause);}
\DoxyCodeLine{55 \textcolor{comment}{/* decode 'calling number' */}}
\DoxyCodeLine{56 \textcolor{keywordtype}{int} gsm48\_decode\_calling(\textcolor{keyword}{struct} gsm\_mncc\_number *calling,}
\DoxyCodeLine{57                          \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{58 \textcolor{comment}{/* encode 'calling number' */}}
\DoxyCodeLine{59 \textcolor{keywordtype}{int} gsm48\_encode\_calling(\textcolor{keyword}{struct} msgb *msg, }
\DoxyCodeLine{60                           \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_number *calling);}
\DoxyCodeLine{61 \textcolor{comment}{/* decode 'connected number' */}}
\DoxyCodeLine{62 \textcolor{keywordtype}{int} gsm48\_decode\_connected(\textcolor{keyword}{struct} gsm\_mncc\_number *connected,}
\DoxyCodeLine{63                          \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{64 \textcolor{comment}{/* encode 'connected number' */}}
\DoxyCodeLine{65 \textcolor{keywordtype}{int} gsm48\_encode\_connected(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{66                             \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_number *connected);}
\DoxyCodeLine{67 \textcolor{comment}{/* decode 'redirecting number' */}}
\DoxyCodeLine{68 \textcolor{keywordtype}{int} gsm48\_decode\_redirecting(\textcolor{keyword}{struct} gsm\_mncc\_number *redirecting,}
\DoxyCodeLine{69                          \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{70 \textcolor{comment}{/* encode 'redirecting number' */}}
\DoxyCodeLine{71 \textcolor{keywordtype}{int} gsm48\_encode\_redirecting(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{72                               \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_number *redirecting);}
\DoxyCodeLine{73 \textcolor{comment}{/* decode 'facility' */}}
\DoxyCodeLine{74 \textcolor{keywordtype}{int} gsm48\_decode\_facility(\textcolor{keyword}{struct} gsm\_mncc\_facility *facility,}
\DoxyCodeLine{75                            \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{76 \textcolor{comment}{/* encode 'facility' */}}
\DoxyCodeLine{77 \textcolor{keywordtype}{int} gsm48\_encode\_facility(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} lv\_only,}
\DoxyCodeLine{78                            \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_facility *facility);}
\DoxyCodeLine{79 \textcolor{comment}{/* decode 'notify' */}}
\DoxyCodeLine{80 \textcolor{keywordtype}{int} gsm48\_decode\_notify(\textcolor{keywordtype}{int} *notify, \textcolor{keyword}{const} uint8\_t *v);}
\DoxyCodeLine{81 \textcolor{comment}{/* encode 'notify' */}}
\DoxyCodeLine{82 \textcolor{keywordtype}{int} gsm48\_encode\_notify(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} notify);}
\DoxyCodeLine{83 \textcolor{comment}{/* decode 'signal' */}}
\DoxyCodeLine{84 \textcolor{keywordtype}{int} gsm48\_decode\_signal(\textcolor{keywordtype}{int} *signal, \textcolor{keyword}{const} uint8\_t *v);}
\DoxyCodeLine{85 \textcolor{comment}{/* encode 'signal' */}}
\DoxyCodeLine{86 \textcolor{keywordtype}{int} gsm48\_encode\_signal(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} signal);}
\DoxyCodeLine{87 \textcolor{comment}{/* decode 'keypad' */}}
\DoxyCodeLine{88 \textcolor{keywordtype}{int} gsm48\_decode\_keypad(\textcolor{keywordtype}{int} *keypad, \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{89 \textcolor{comment}{/* encode 'keypad' */}}
\DoxyCodeLine{90 \textcolor{keywordtype}{int} gsm48\_encode\_keypad(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} keypad);}
\DoxyCodeLine{91 \textcolor{comment}{/* decode 'progress' */}}
\DoxyCodeLine{92 \textcolor{keywordtype}{int} gsm48\_decode\_progress(\textcolor{keyword}{struct} gsm\_mncc\_progress *progress,}
\DoxyCodeLine{93                            \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{94 \textcolor{comment}{/* encode 'progress' */}}
\DoxyCodeLine{95 \textcolor{keywordtype}{int} gsm48\_encode\_progress(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} lv\_only,}
\DoxyCodeLine{96                            \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_progress *p);}
\DoxyCodeLine{97 \textcolor{comment}{/* decode 'user-\/user' */}}
\DoxyCodeLine{98 \textcolor{keywordtype}{int} gsm48\_decode\_useruser(\textcolor{keyword}{struct} gsm\_mncc\_useruser *uu,}
\DoxyCodeLine{99                            \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{100 \textcolor{comment}{/* encode 'useruser' */}}
\DoxyCodeLine{101 \textcolor{keywordtype}{int} gsm48\_encode\_useruser(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} lv\_only,}
\DoxyCodeLine{102                            \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_useruser *uu);}
\DoxyCodeLine{103 \textcolor{comment}{/* decode 'ss version' */}}
\DoxyCodeLine{104 \textcolor{keywordtype}{int} gsm48\_decode\_ssversion(\textcolor{keyword}{struct} gsm\_mncc\_ssversion *ssv,}
\DoxyCodeLine{105                             \textcolor{keyword}{const} uint8\_t *lv);}
\DoxyCodeLine{106 \textcolor{comment}{/* encode 'ss version' */}}
\DoxyCodeLine{107 \textcolor{keywordtype}{int} gsm48\_encode\_ssversion(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{108                            \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm\_mncc\_ssversion *ssv);}
\DoxyCodeLine{109 \textcolor{comment}{/* decode 'more data' does not require a function, because it has no value */}}
\DoxyCodeLine{110 \textcolor{comment}{/* encode 'more data' */}}
\DoxyCodeLine{111 \textcolor{keywordtype}{int} gsm48\_encode\_more(\textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{comment}{/* structure of one frequency */}}
\DoxyCodeLine{114 \textcolor{keyword}{struct }gsm\_sysinfo\_freq \{}
\DoxyCodeLine{115         \textcolor{comment}{/* if the frequency included in the sysinfo */}}
\DoxyCodeLine{116         uint8\_t mask;}
\DoxyCodeLine{117 \};}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 \textcolor{comment}{/* decode "{}Cell Channel Description"{} (10.5.2.1b) and other frequency lists */}}
\DoxyCodeLine{120 \textcolor{keywordtype}{int} gsm48\_decode\_freq\_list(\textcolor{keyword}{struct} gsm\_sysinfo\_freq *f,}
\DoxyCodeLine{121                            \textcolor{keyword}{const} uint8\_t *cd, uint8\_t len,}
\DoxyCodeLine{122                            uint8\_t mask, uint8\_t frqt);}
\DoxyCodeLine{123 }
\DoxyCodeLine{124 \textcolor{comment}{/* decode "{}CSN.1 encoded Classmark 3"{} (10.5.1.7) */}}
\DoxyCodeLine{125 \textcolor{keywordtype}{int} gsm48\_decode\_classmark3(\textcolor{keyword}{struct} gsm48\_classmark3 *classmark3\_out,}
\DoxyCodeLine{126                             \textcolor{keyword}{const} uint8\_t *classmark3, \textcolor{keywordtype}{size\_t} classmark3\_len);}

\end{DoxyCode}
