\doxysection{gsm0808\+\_\+utils.\+h}
\label{gsm0808__utils_8h_source}\index{include/osmocom/gsm/gsm0808\_utils.h@{include/osmocom/gsm/gsm0808\_utils.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{4 \textcolor{comment}{/*}}
\DoxyCodeLine{5 \textcolor{comment}{ * (C) 2016 by sysmocom -\/ s.f.m.c. GmbH, Author: Philipp Maier}}
\DoxyCodeLine{6 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{7 \textcolor{comment}{ *}}
\DoxyCodeLine{8 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{9 \textcolor{comment}{ *}}
\DoxyCodeLine{10 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{11 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{12 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}}
\DoxyCodeLine{13 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{14 \textcolor{comment}{ *}}
\DoxyCodeLine{15 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{16 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{17 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{18 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{19 \textcolor{comment}{ *}}
\DoxyCodeLine{20 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}}
\DoxyCodeLine{21 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{22 \textcolor{comment}{ *}}
\DoxyCodeLine{23 \textcolor{comment}{ */}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{keyword}{struct }sockaddr\_storage;}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_08\_08.h>}}
\DoxyCodeLine{29 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08.h>}}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm29205.h>}}
\DoxyCodeLine{31 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm23003.h>}}
\DoxyCodeLine{32 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm\_utils.h>}}
\DoxyCodeLine{33 \textcolor{preprocessor}{\#include <osmocom/gsm/tlv.h>}}
\DoxyCodeLine{34 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm48.h>}}
\DoxyCodeLine{35 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{36 }
\DoxyCodeLine{38 \textcolor{preprocessor}{\#define GSM0808\_CELL\_ID\_LIST2\_MAXLEN            127}}
\DoxyCodeLine{39 }
\DoxyCodeLine{43 \textcolor{keyword}{union }gsm0808\_cell\_id\_u \{}
\DoxyCodeLine{44         \textcolor{keyword}{struct }osmo\_cell\_global\_id           global;}
\DoxyCodeLine{45         \textcolor{keyword}{struct }osmo\_lac\_and\_ci\_id             lac\_and\_ci;}
\DoxyCodeLine{46         uint16\_t                                ci;}
\DoxyCodeLine{47         \textcolor{keyword}{struct }osmo\_location\_area\_id               lai\_and\_lac;}
\DoxyCodeLine{48         uint16\_t                                lac;}
\DoxyCodeLine{49         \textcolor{keyword}{struct }osmo\_service\_area\_id         sai;}
\DoxyCodeLine{50         \textcolor{comment}{/* osmocom specific: */}}
\DoxyCodeLine{51         \textcolor{keyword}{struct }osmo\_cell\_global\_id\_ps             global\_ps;}
\DoxyCodeLine{52 \};}
\DoxyCodeLine{53 }
\DoxyCodeLine{55 \textcolor{keyword}{struct }gsm0808\_cell\_id \{}
\DoxyCodeLine{56         \textcolor{keyword}{enum} CELL\_IDENT id\_discr;}
\DoxyCodeLine{57         \textcolor{keyword}{union }gsm0808\_cell\_id\_u id;}
\DoxyCodeLine{58 \};}
\DoxyCodeLine{59 }
\DoxyCodeLine{61 \textcolor{keyword}{struct }gsm0808\_cell\_id\_list2 \{}
\DoxyCodeLine{62         \textcolor{keyword}{enum} CELL\_IDENT id\_discr;}
\DoxyCodeLine{63         \textcolor{keyword}{union }gsm0808\_cell\_id\_u id\_list[GSM0808\_CELL\_ID\_LIST2\_MAXLEN];}
\DoxyCodeLine{64         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} id\_list\_len;}
\DoxyCodeLine{65 \};}
\DoxyCodeLine{66 }
\DoxyCodeLine{68 \textcolor{keyword}{struct }gsm0808\_priority \{}
\DoxyCodeLine{69 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{70         uint8\_t pvi:1,                  \textcolor{comment}{/* Preemption Vulnerability indicator */}}
\DoxyCodeLine{71                 qa:1,                   \textcolor{comment}{/* Queuing allowed indicator */}}
\DoxyCodeLine{72                 priority\_level:4,       \textcolor{comment}{/* Priority level: 1 == hightest, 14 == lowest */}}
\DoxyCodeLine{73                 pci:1,                  \textcolor{comment}{/* Preemption Capability indicator */}}
\DoxyCodeLine{74                 spare:1;}
\DoxyCodeLine{75 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{76 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{77         uint8\_t spare:1, pci:1, priority\_level:4, qa:1, pvi:1;}
\DoxyCodeLine{78 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{79 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{80 }
\DoxyCodeLine{82 \textcolor{keyword}{struct }gsm0808\_vgcs\_feature\_flags \{}
\DoxyCodeLine{83 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{84         uint8\_t tp\_ind:1,               \textcolor{comment}{/* Talker priority supported */}}
\DoxyCodeLine{85                 as\_ind\_circuit:1,       \textcolor{comment}{/* A-\/interface circuit sharing supported */}}
\DoxyCodeLine{86                 as\_ind\_link:1,          \textcolor{comment}{/* A-\/interface link sharing supported */}}
\DoxyCodeLine{87                 bss\_res:1,              \textcolor{comment}{/* BSS supports re-\/establishment */}}
\DoxyCodeLine{88                 tcp:1,                  \textcolor{comment}{/* Talker channel parameter supported */}}
\DoxyCodeLine{89                 spare:3;}
\DoxyCodeLine{90 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{91 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{92         uint8\_t spare:3, tcp:1, bss\_res:1, as\_ind\_link:1, as\_ind\_circuit:1, tp\_ind:1;}
\DoxyCodeLine{93 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{94 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{95 }
\DoxyCodeLine{96 \textcolor{comment}{/* TS 48.008 3.2.2.52 */}}
\DoxyCodeLine{97 \textcolor{keyword}{enum} gsm0808\_assignment\_requirement \{}
\DoxyCodeLine{98         GSM0808\_ASRQ\_DELAY\_ALLOWED            = 0x00,}
\DoxyCodeLine{99         GSM0808\_ASRQ\_IMMEDIATE                    = 0x01,}
\DoxyCodeLine{100         GSM0808\_ASRQ\_IMMEDIATE\_ON\_DEMAND        = 0x02,}
\DoxyCodeLine{101 \};}
\DoxyCodeLine{102 }
\DoxyCodeLine{103 \textcolor{comment}{/* TS 48.008 Table 10.5.8 */}}
\DoxyCodeLine{104 \textcolor{keyword}{enum} gsm0808\_service\_flag \{}
\DoxyCodeLine{105         GSM0808\_SF\_VBS                            = 0,}
\DoxyCodeLine{106         GSM0808\_SF\_VGCS                          = 1,}
\DoxyCodeLine{107 \};}
\DoxyCodeLine{108 }
\DoxyCodeLine{109 \textcolor{keyword}{enum} gsm0808\_call\_priority \{}
\DoxyCodeLine{110         GSM0808\_CALL\_PRIORITY\_NONE            = 0x00,}
\DoxyCodeLine{111         GSM0808\_CALL\_PRIORITY\_LEVEL\_4              = 0x01,}
\DoxyCodeLine{112         GSM0808\_CALL\_PRIORITY\_LEVEL\_3              = 0x02,}
\DoxyCodeLine{113         GSM0808\_CALL\_PRIORITY\_LEVEL\_2              = 0x03,}
\DoxyCodeLine{114         GSM0808\_CALL\_PRIORITY\_LEVEL\_1              = 0x04,}
\DoxyCodeLine{115         GSM0808\_CALL\_PRIORITY\_LEVEL\_0              = 0x05,}
\DoxyCodeLine{116         GSM0808\_CALL\_PRIORITY\_LEVEL\_B              = 0x06,}
\DoxyCodeLine{117         GSM0808\_CALL\_PRIORITY\_LEVEL\_A              = 0x07,}
\DoxyCodeLine{118 \};}
\DoxyCodeLine{119 }
\DoxyCodeLine{121 \textcolor{keyword}{struct }gsm0808\_group\_callref \{}
\DoxyCodeLine{122 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{123         uint8\_t call\_ref\_hi[3];}
\DoxyCodeLine{124         uint8\_t call\_priority:3,}
\DoxyCodeLine{125                 af:1,                   \textcolor{comment}{/* Acknowledgement flag */}}
\DoxyCodeLine{126                 sf:1,                   \textcolor{comment}{/* Service flag */}}
\DoxyCodeLine{127                 call\_ref\_lo:3;}
\DoxyCodeLine{128         uint8\_t spare:4,}
\DoxyCodeLine{129                 ciphering\_info:4;}
\DoxyCodeLine{130 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{131 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{132         uint8\_t call\_ref\_hi[3];}
\DoxyCodeLine{133         uint8\_t call\_ref\_lo:3, sf:1, af:1, call\_priority:3;}
\DoxyCodeLine{134         uint8\_t ciphering\_info:4, spare:4;}
\DoxyCodeLine{135 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{136 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{comment}{/* TS 48.008 3.2.2.26 */}}
\DoxyCodeLine{139 \textcolor{keyword}{enum} gsm0808\_downlink\_dtx\_flag \{}
\DoxyCodeLine{140         GSM0808\_DTX\_FLAG\_ALLOW                    = 0,}
\DoxyCodeLine{141         GSM0808\_DTX\_FLAG\_FORBID                  = 1,}
\DoxyCodeLine{142 \};}
\DoxyCodeLine{143 }
\DoxyCodeLine{145 \textcolor{keyword}{struct }gsm0808\_cell\_id\_list\_segment \{}
\DoxyCodeLine{146         uint8\_t seq\_last;}
\DoxyCodeLine{147         uint8\_t seq\_number;}
\DoxyCodeLine{148         \textcolor{keyword}{struct }gsm0808\_cell\_id\_list2 cil;}
\DoxyCodeLine{149 \};}
\DoxyCodeLine{150 }
\DoxyCodeLine{152 \textcolor{preprocessor}{\#define CIRCUIT\_POOL\_LIST\_MAXLEN 252}}
\DoxyCodeLine{153 \textcolor{keyword}{struct }gsm0808\_circuit\_pool\_list \{}
\DoxyCodeLine{154         uint8\_t pool[CIRCUIT\_POOL\_LIST\_MAXLEN];}
\DoxyCodeLine{155         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} list\_len;}
\DoxyCodeLine{156 \};}
\DoxyCodeLine{157 }
\DoxyCodeLine{158 \textcolor{comment}{/* 3GPP TS 48.008 Table  3.2.2.90.1 Talker Priority */}}
\DoxyCodeLine{159 \textcolor{keyword}{enum} gsm0808\_talker\_priority \{}
\DoxyCodeLine{160         GSM0808\_TALKER\_PRIORITY\_NORMAL            = 0x00,}
\DoxyCodeLine{161         GSM0808\_TALKER\_PRIORITY\_PRIVILEGED    = 0x01,}
\DoxyCodeLine{162         GSM0808\_TALKER\_PRIORITY\_EMERGENCY      = 0x02,}
\DoxyCodeLine{163 \};}
\DoxyCodeLine{164 }
\DoxyCodeLine{166 \textcolor{preprocessor}{\#define LAYER\_3\_INFORMATION\_MAXLEN 252}}
\DoxyCodeLine{167 \textcolor{keyword}{struct }gsm0808\_layer\_3\_information \{}
\DoxyCodeLine{168         uint8\_t l3[LAYER\_3\_INFORMATION\_MAXLEN];}
\DoxyCodeLine{169         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} l3\_len;}
\DoxyCodeLine{170 \};}
\DoxyCodeLine{171 }
\DoxyCodeLine{173 \textcolor{preprocessor}{\#define TALKER\_IDENTITY\_MAXLEN 17}}
\DoxyCodeLine{174 \textcolor{keyword}{struct }gsm0808\_talker\_identity \{}
\DoxyCodeLine{175         uint8\_t talker\_id[TALKER\_IDENTITY\_MAXLEN];}
\DoxyCodeLine{176         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} id\_bits;}
\DoxyCodeLine{177 \};}
\DoxyCodeLine{178 }
\DoxyCodeLine{179 \textcolor{comment}{/* 3GPP TS 48.008 3.2.2.94 VGCS/VBS Cell Status */}}
\DoxyCodeLine{180 \textcolor{keyword}{enum} gsm0808\_vgcs\_vbs\_cell\_status \{}
\DoxyCodeLine{181         GSM0808\_CSTAT\_ESTABLISHED              = 0x00,}
\DoxyCodeLine{182         GSM0808\_CSTAT\_NOT\_ESTABLISHED1            = 0x01,}
\DoxyCodeLine{183         GSM0808\_CSTAT\_RELEASED\_NO\_USER            = 0x02,}
\DoxyCodeLine{184         GSM0808\_CSTAT\_NOT\_ESTABLISHED2            = 0x03,}
\DoxyCodeLine{185 \};}
\DoxyCodeLine{186 }
\DoxyCodeLine{188 \textcolor{preprocessor}{\#define SMS\_TO\_VGCS\_MAXLEN 252}}
\DoxyCodeLine{189 \textcolor{keyword}{struct }gsm0808\_sms\_to\_vgcs \{}
\DoxyCodeLine{190         uint8\_t sms[SMS\_TO\_VGCS\_MAXLEN];}
\DoxyCodeLine{191         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} sms\_len;}
\DoxyCodeLine{192 \};}
\DoxyCodeLine{193 }
\DoxyCodeLine{195 \textcolor{preprocessor}{\#define APP\_DATA\_MAXLEN 9}}
\DoxyCodeLine{196 \textcolor{keyword}{struct }gsm0808\_application\_data \{}
\DoxyCodeLine{197         uint8\_t data[APP\_DATA\_MAXLEN];}
\DoxyCodeLine{198         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} data\_len;}
\DoxyCodeLine{199 \};}
\DoxyCodeLine{200 }
\DoxyCodeLine{202 \textcolor{keyword}{enum} gsm0808\_application\_idndicator \{}
\DoxyCodeLine{203         GSM0808\_AI\_APP\_DATA                  = 0x00,}
\DoxyCodeLine{204         GSM0808\_AI\_CONFIRM\_APP\_DATA          = 0x01,}
\DoxyCodeLine{205 \};}
\DoxyCodeLine{206 }
\DoxyCodeLine{207 \textcolor{preprocessor}{\#define GSM0808\_DP\_MASK\_TALKERS\_LISTENERS       0x04}}
\DoxyCodeLine{208 \textcolor{preprocessor}{\#define GSM0808\_DP\_MASK\_DISPATCHERS             0x02}}
\DoxyCodeLine{209 \textcolor{preprocessor}{\#define GSM0808\_DP\_MASK\_NETWORK\_APP             0x01}}
\DoxyCodeLine{210 }
\DoxyCodeLine{211 \textcolor{keyword}{struct }gsm0808\_data\_identity \{}
\DoxyCodeLine{212 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{213         uint8\_t ai:1,   \textcolor{comment}{/* Application Indicator */}}
\DoxyCodeLine{214                 di:4,   \textcolor{comment}{/* Data identifier */}}
\DoxyCodeLine{215                 dp:3;   \textcolor{comment}{/* Distribution parameter (bit mask) */}}
\DoxyCodeLine{216 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{217 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{218         uint8\_t dp:3, di:4, ai:1;}
\DoxyCodeLine{219 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{220 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{221 }
\DoxyCodeLine{223 \textcolor{preprocessor}{\#define MSISDN\_MAXLEN 20}}
\DoxyCodeLine{224 }
\DoxyCodeLine{226 \textcolor{keyword}{struct }osmo\_lcls \{}
\DoxyCodeLine{227         \textcolor{keyword}{enum} gsm0808\_lcls\_config config;   }
\DoxyCodeLine{228         \textcolor{keyword}{enum} gsm0808\_lcls\_control control; }
\DoxyCodeLine{229         \textcolor{keyword}{struct }osmo\_gcr\_parsed gcr;        }
\DoxyCodeLine{230         \textcolor{keywordtype}{bool} gcr\_available;}
\DoxyCodeLine{231         \textcolor{keywordtype}{bool} corr\_needed;                  }
\DoxyCodeLine{232 \};}
\DoxyCodeLine{233 }
\DoxyCodeLine{234 \textcolor{keywordtype}{char} *osmo\_lcls\_dump(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{235 \textcolor{keywordtype}{char} *osmo\_lcls\_dump\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{236 \textcolor{keywordtype}{char} *osmo\_lcls\_dump\_c(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{237 \textcolor{keywordtype}{char} *osmo\_gcr\_dump(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{238 \textcolor{keywordtype}{char} *osmo\_gcr\_dump\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{239 }
\DoxyCodeLine{240 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string gsm0808\_cell\_id\_discr\_names[];}
\DoxyCodeLine{241 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_discr\_name(\textcolor{keyword}{enum} CELL\_IDENT id\_discr)}
\DoxyCodeLine{242 \{ \textcolor{keywordflow}{return} get\_value\_string(gsm0808\_cell\_id\_discr\_names, id\_discr); \}}
\DoxyCodeLine{243 }
\DoxyCodeLine{244 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *cid);}
\DoxyCodeLine{245 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_name2(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *cid);}
\DoxyCodeLine{246 \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_name\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buflen, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *cid);}
\DoxyCodeLine{247 \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_name\_c(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *cid);}
\DoxyCodeLine{248 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_list\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *cil);}
\DoxyCodeLine{249 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_list\_name\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buflen, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *cil);}
\DoxyCodeLine{250 \textcolor{keywordtype}{char} *gsm0808\_cell\_id\_list\_name\_c(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *cil);}
\DoxyCodeLine{251 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_u\_name(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buflen,}
\DoxyCodeLine{252                            \textcolor{keyword}{enum} CELL\_IDENT id\_discr, \textcolor{keyword}{const} \textcolor{keyword}{union} gsm0808\_cell\_id\_u *u);}
\DoxyCodeLine{253 \textcolor{keywordtype}{bool} gsm0808\_cell\_ids\_match(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *id1, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *id2, \textcolor{keywordtype}{bool} exact\_match);}
\DoxyCodeLine{254 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_matches\_list(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *\textcolor{keywordtype}{id}, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *list,}
\DoxyCodeLine{255                                  \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} match\_nr, \textcolor{keywordtype}{bool} exact\_match);}
\DoxyCodeLine{256 \textcolor{keywordtype}{void} gsm0808\_cell\_id\_from\_cgi(\textcolor{keyword}{struct} gsm0808\_cell\_id *cid, \textcolor{keyword}{enum} CELL\_IDENT id\_discr,}
\DoxyCodeLine{257                               \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_cell\_global\_id *cgi);}
\DoxyCodeLine{258 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_to\_cgi(\textcolor{keyword}{struct} osmo\_cell\_global\_id *cgi, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *cid);}
\DoxyCodeLine{259 \textcolor{keywordtype}{void} gsm0808\_msgb\_put\_cell\_id\_u(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{enum} CELL\_IDENT id\_discr, \textcolor{keyword}{const} \textcolor{keyword}{union} gsm0808\_cell\_id\_u *u);}
\DoxyCodeLine{260 \textcolor{keywordtype}{int} gsm0808\_decode\_cell\_id\_u(\textcolor{keyword}{union} gsm0808\_cell\_id\_u *out, \textcolor{keyword}{enum} CELL\_IDENT discr, \textcolor{keyword}{const} uint8\_t *buf, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} len);}
\DoxyCodeLine{261 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_size(\textcolor{keyword}{enum} CELL\_IDENT discr);}
\DoxyCodeLine{262 }
\DoxyCodeLine{263 uint8\_t gsm0808\_enc\_cause(\textcolor{keyword}{struct} msgb *msg, uint16\_t cause);}
\DoxyCodeLine{264 uint8\_t gsm0808\_enc\_aoip\_trasp\_addr(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{265                                     \textcolor{keyword}{const} \textcolor{keyword}{struct} sockaddr\_storage *ss);}
\DoxyCodeLine{266 \textcolor{keywordtype}{int} gsm0808\_dec\_aoip\_trasp\_addr(\textcolor{keyword}{struct} sockaddr\_storage *ss,}
\DoxyCodeLine{267                                 \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{268 \textcolor{keywordtype}{int} gsm0808\_dec\_osmux\_cid(uint8\_t *cid, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{269 }
\DoxyCodeLine{270 uint8\_t gsm0808\_enc\_lcls(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_lcls *lcls);}
\DoxyCodeLine{271 \textcolor{keywordtype}{int} gsm0808\_dec\_lcls(\textcolor{keyword}{struct} osmo\_lcls *lcls, \textcolor{keyword}{const} \textcolor{keyword}{struct} tlv\_parsed *tp);}
\DoxyCodeLine{272 }
\DoxyCodeLine{273 uint8\_t gsm0808\_enc\_speech\_codec(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{274                                  \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_speech\_codec *sc)}
\DoxyCodeLine{275         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use gsm0808\_enc\_speech\_codec2() instead"{}});}
\DoxyCodeLine{276 \textcolor{keywordtype}{int} gsm0808\_enc\_speech\_codec2(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{277                               \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_speech\_codec *sc);}
\DoxyCodeLine{278 \textcolor{keywordtype}{int} gsm0808\_dec\_speech\_codec(\textcolor{keyword}{struct} gsm0808\_speech\_codec *sc,}
\DoxyCodeLine{279                              \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{280 uint8\_t gsm0808\_enc\_speech\_codec\_list(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{281                                       \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_speech\_codec\_list *scl)}
\DoxyCodeLine{282         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use gsm0808\_enc\_speech\_codec\_list2() instead"{}});}
\DoxyCodeLine{283 \textcolor{keywordtype}{int} gsm0808\_enc\_speech\_codec\_list2(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{284                                    \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_speech\_codec\_list *scl);}
\DoxyCodeLine{285 \textcolor{keywordtype}{int} gsm0808\_dec\_speech\_codec\_list(\textcolor{keyword}{struct} gsm0808\_speech\_codec\_list *scl,}
\DoxyCodeLine{286                                   \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{287 uint8\_t gsm0808\_enc\_channel\_type(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{288                                  \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_channel\_type *ct);}
\DoxyCodeLine{289 \textcolor{keywordtype}{int} gsm0808\_dec\_channel\_type(\textcolor{keyword}{struct} gsm0808\_channel\_type *ct,}
\DoxyCodeLine{290                              \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{291 uint8\_t gsm0808\_enc\_encrypt\_info(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{292                                  \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_encrypt\_info *ei);}
\DoxyCodeLine{293 \textcolor{keywordtype}{int} gsm0808\_dec\_encrypt\_info(\textcolor{keyword}{struct} gsm0808\_encrypt\_info *ei,}
\DoxyCodeLine{294                              \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{295 \textcolor{keywordtype}{int} gsm0808\_enc\_kc128(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} uint8\_t *kc128);}
\DoxyCodeLine{296 \textcolor{keywordtype}{int} gsm0808\_dec\_kc128(uint8\_t *kc128, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{297 uint8\_t gsm0808\_enc\_cell\_id\_list2(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *cil);}
\DoxyCodeLine{298 uint8\_t gsm0808\_enc\_cell\_id\_list(\textcolor{keyword}{struct} msgb *msg,}
\DoxyCodeLine{299                                  \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list *cil)}
\DoxyCodeLine{300                                  OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use gsm0808\_enc\_cell\_id\_list2 instead"{}});}
\DoxyCodeLine{301 \textcolor{keywordtype}{int} gsm0808\_dec\_cell\_id\_list2(\textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *cil, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{302 \textcolor{keywordtype}{int} gsm0808\_dec\_cell\_id\_list(\textcolor{keyword}{struct} gsm0808\_cell\_id\_list *cil,}
\DoxyCodeLine{303                              \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len)}
\DoxyCodeLine{304                              OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use gsm0808\_dec\_cell\_id\_list2 instead"{}});}
\DoxyCodeLine{305 \textcolor{keywordtype}{int} gsm0808\_cell\_id\_list\_add(\textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *dst, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *src);}
\DoxyCodeLine{306 \textcolor{keywordtype}{void} gsm0808\_cell\_id\_to\_list(\textcolor{keyword}{struct} gsm0808\_cell\_id\_list2 *dst, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *src);}
\DoxyCodeLine{307 uint8\_t gsm0808\_enc\_cell\_id(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id *ci);}
\DoxyCodeLine{308 \textcolor{keywordtype}{int} gsm0808\_dec\_cell\_id(\textcolor{keyword}{struct} gsm0808\_cell\_id *ci, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{309 \textcolor{keywordtype}{int} gsm0808\_chan\_type\_to\_speech\_codec(uint8\_t perm\_spch);}
\DoxyCodeLine{310 \textcolor{keywordtype}{int} gsm0808\_speech\_codec\_from\_chan\_type(\textcolor{keyword}{struct} gsm0808\_speech\_codec *sc,}
\DoxyCodeLine{311                                         uint8\_t perm\_spch);}
\DoxyCodeLine{312 uint16\_t gsm0808\_sc\_cfg\_from\_gsm48\_mr\_cfg(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm48\_multi\_rate\_conf *cfg, \textcolor{keywordtype}{bool} fr);}
\DoxyCodeLine{313 \textcolor{keywordtype}{int} gsm48\_mr\_cfg\_from\_gsm0808\_sc\_cfg(\textcolor{keyword}{struct} gsm48\_multi\_rate\_conf *cfg, uint16\_t s15\_s0);}
\DoxyCodeLine{314 }
\DoxyCodeLine{316 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{enum} gsm0808\_cause\_class gsm0808\_cause\_class(\textcolor{keyword}{enum} gsm0808\_cause cause)}
\DoxyCodeLine{317 \{}
\DoxyCodeLine{318         \textcolor{keywordflow}{return} (cause >> 4) \& 0x7;}
\DoxyCodeLine{319 \}}
\DoxyCodeLine{320 }
\DoxyCodeLine{322 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool} gsm0808\_cause\_ext(\textcolor{keyword}{enum} gsm0808\_cause cause)}
\DoxyCodeLine{323 \{}
\DoxyCodeLine{324         \textcolor{comment}{/* check that cause looks like 1XXX0000 where XXX represent class */}}
\DoxyCodeLine{325         \textcolor{keywordflow}{return} (cause \& 0x80) \&\& !(cause \& 0x0F);}
\DoxyCodeLine{326 \}}
\DoxyCodeLine{327 }
\DoxyCodeLine{328 \textcolor{keywordtype}{int} gsm0808\_get\_cipher\_reject\_cause(\textcolor{keyword}{const} \textcolor{keyword}{struct} tlv\_parsed *tp)}
\DoxyCodeLine{329 OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use gsm0808\_get\_cause() instead"{}});}
\DoxyCodeLine{330 }
\DoxyCodeLine{332 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint8\_t gsm0808\_current\_channel\_type\_1(\textcolor{keyword}{enum} gsm\_chan\_t type)}
\DoxyCodeLine{333 \{}
\DoxyCodeLine{334         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{335         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{336                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{337         \textcolor{keywordflow}{case} GSM\_LCHAN\_SDCCH:}
\DoxyCodeLine{338                 \textcolor{keywordflow}{return} 0x01;}
\DoxyCodeLine{339         \textcolor{keywordflow}{case} GSM\_LCHAN\_TCH\_F:}
\DoxyCodeLine{340                 \textcolor{keywordflow}{return} 0x18;}
\DoxyCodeLine{341         \textcolor{keywordflow}{case} GSM\_LCHAN\_TCH\_H:}
\DoxyCodeLine{342                 \textcolor{keywordflow}{return} 0x19;}
\DoxyCodeLine{343         \}}
\DoxyCodeLine{344 \}}
\DoxyCodeLine{345 }
\DoxyCodeLine{348 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{enum} gsm0808\_permitted\_speech gsm0808\_permitted\_speech(\textcolor{keyword}{enum} gsm\_chan\_t type,}
\DoxyCodeLine{349                                                                      \textcolor{keyword}{enum} gsm48\_chan\_mode mode)}
\DoxyCodeLine{350 \{}
\DoxyCodeLine{351 \textcolor{preprocessor}{\#define MODE\_TYPE(mode, type) ((mode << 16) | type)}}
\DoxyCodeLine{352 }
\DoxyCodeLine{353         \textcolor{keywordflow}{switch} (MODE\_TYPE(mode, type)) \{}
\DoxyCodeLine{354         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V1, GSM\_LCHAN\_TCH\_F):}
\DoxyCodeLine{355                 \textcolor{keywordflow}{return} GSM0808\_PERM\_FR1;}
\DoxyCodeLine{356         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V1, GSM\_LCHAN\_TCH\_H):}
\DoxyCodeLine{357                 \textcolor{keywordflow}{return} GSM0808\_PERM\_HR1;}
\DoxyCodeLine{358         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_EFR, GSM\_LCHAN\_TCH\_F):}
\DoxyCodeLine{359                 \textcolor{keywordflow}{return} GSM0808\_PERM\_FR2;}
\DoxyCodeLine{360         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_EFR, GSM\_LCHAN\_TCH\_H):}
\DoxyCodeLine{361                 \textcolor{keywordflow}{return} GSM0808\_PERM\_HR2; \textcolor{comment}{/* (deprecated) */}}
\DoxyCodeLine{362         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_AMR, GSM\_LCHAN\_TCH\_F):}
\DoxyCodeLine{363                 \textcolor{keywordflow}{return} GSM0808\_PERM\_FR3;}
\DoxyCodeLine{364         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_AMR, GSM\_LCHAN\_TCH\_H):}
\DoxyCodeLine{365                 \textcolor{keywordflow}{return} GSM0808\_PERM\_HR3;}
\DoxyCodeLine{366         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V4, GSM\_LCHAN\_TCH\_F):}
\DoxyCodeLine{367                 \textcolor{keywordflow}{return} GSM0808\_PERM\_FR4;}
\DoxyCodeLine{368         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V4, GSM\_LCHAN\_TCH\_H):}
\DoxyCodeLine{369                 \textcolor{keywordflow}{return} GSM0808\_PERM\_HR4;}
\DoxyCodeLine{370         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V5, GSM\_LCHAN\_TCH\_F):}
\DoxyCodeLine{371                 \textcolor{keywordflow}{return} GSM0808\_PERM\_FR5; \textcolor{comment}{/* FR only */}}
\DoxyCodeLine{372         \textcolor{keywordflow}{case} MODE\_TYPE(GSM48\_CMODE\_SPEECH\_V6, GSM\_LCHAN\_TCH\_H):}
\DoxyCodeLine{373                 \textcolor{keywordflow}{return} GSM0808\_PERM\_HR6; \textcolor{comment}{/* HR only */}}
\DoxyCodeLine{374         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{375                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{376         \}}
\DoxyCodeLine{377 }
\DoxyCodeLine{378 \textcolor{preprocessor}{\#undef MODE\_TYPE}}
\DoxyCodeLine{379 \}}
\DoxyCodeLine{380 }
\DoxyCodeLine{382 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint8\_t gsm0808\_chosen\_channel(\textcolor{keyword}{enum} gsm\_chan\_t type, \textcolor{keyword}{enum} gsm48\_chan\_mode mode)}
\DoxyCodeLine{383 \{}
\DoxyCodeLine{384         uint8\_t channel\_mode = 0, channel = 0;}
\DoxyCodeLine{385 }
\DoxyCodeLine{386         \textcolor{keywordflow}{switch} (mode) \{}
\DoxyCodeLine{387         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_V1:}
\DoxyCodeLine{388         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_EFR:}
\DoxyCodeLine{389         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_AMR:}
\DoxyCodeLine{390         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_V4:}
\DoxyCodeLine{391         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_V5:}
\DoxyCodeLine{392         \textcolor{keywordflow}{case} GSM48\_CMODE\_SPEECH\_V6:}
\DoxyCodeLine{393                 channel\_mode = 0x9;}
\DoxyCodeLine{394                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{395         \textcolor{keywordflow}{case} GSM48\_CMODE\_SIGN:}
\DoxyCodeLine{396                 channel\_mode = 0x8;}
\DoxyCodeLine{397                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{398         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_14k5:}
\DoxyCodeLine{399                 channel\_mode = 0xe;}
\DoxyCodeLine{400                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{401         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_12k0:}
\DoxyCodeLine{402                 channel\_mode = 0xb;}
\DoxyCodeLine{403                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{404         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_6k0:}
\DoxyCodeLine{405                 channel\_mode = 0xc;}
\DoxyCodeLine{406                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{407         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_3k6:}
\DoxyCodeLine{408                 channel\_mode = 0xd;}
\DoxyCodeLine{409                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{410         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_29k0:}
\DoxyCodeLine{411                 channel\_mode = 0x1;}
\DoxyCodeLine{412                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{413         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_32k0:}
\DoxyCodeLine{414                 channel\_mode = 0x2;}
\DoxyCodeLine{415                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{416         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_43k5:}
\DoxyCodeLine{417                 channel\_mode = 0x3;}
\DoxyCodeLine{418                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{419         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_43k5\_14k5:}
\DoxyCodeLine{420                 channel\_mode = 0x4;}
\DoxyCodeLine{421                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{422         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_29k0\_14k5:}
\DoxyCodeLine{423                 channel\_mode = 0x5;}
\DoxyCodeLine{424                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{425         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_43k5\_29k0:}
\DoxyCodeLine{426                 channel\_mode = 0x6;}
\DoxyCodeLine{427                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{428         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_14k5\_43k5:}
\DoxyCodeLine{429                 channel\_mode = 0x7;}
\DoxyCodeLine{430                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{431         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_14k5\_29k0:}
\DoxyCodeLine{432                 channel\_mode = 0xa;}
\DoxyCodeLine{433                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{434         \textcolor{keywordflow}{case} GSM48\_CMODE\_DATA\_29k0\_43k5:}
\DoxyCodeLine{435                 channel\_mode = 0xf;}
\DoxyCodeLine{436                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{437         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{438                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{439         \}}
\DoxyCodeLine{440 }
\DoxyCodeLine{441         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{442         \textcolor{keywordflow}{case} GSM\_LCHAN\_NONE:}
\DoxyCodeLine{443                 channel = 0x0;}
\DoxyCodeLine{444                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{445         \textcolor{keywordflow}{case} GSM\_LCHAN\_SDCCH:}
\DoxyCodeLine{446                 channel = 0x1;}
\DoxyCodeLine{447                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{448         \textcolor{keywordflow}{case} GSM\_LCHAN\_TCH\_F:}
\DoxyCodeLine{449                 channel = 0x8;}
\DoxyCodeLine{450                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{451         \textcolor{keywordflow}{case} GSM\_LCHAN\_TCH\_H:}
\DoxyCodeLine{452                 channel = 0x9;}
\DoxyCodeLine{453                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{454         \textcolor{comment}{/* TODO: more than 1 TCHs? */}}
\DoxyCodeLine{455         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{456                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{457         \}}
\DoxyCodeLine{458 }
\DoxyCodeLine{459         \textcolor{keywordflow}{return} channel\_mode << 4 | channel;}
\DoxyCodeLine{460 \}}
\DoxyCodeLine{461 }
\DoxyCodeLine{462 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0808\_channel\_type\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_channel\_type *ct);}
\DoxyCodeLine{463 \textcolor{keywordtype}{char} *gsm0808\_channel\_type\_name\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_channel\_type *ct);}
\DoxyCodeLine{464 \textcolor{keywordtype}{char} *gsm0808\_channel\_type\_name\_c(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_channel\_type *ct);}
\DoxyCodeLine{465 }
\DoxyCodeLine{466 uint8\_t gsm0808\_enc\_group\_callref(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_group\_callref *gc);}
\DoxyCodeLine{467 \textcolor{keywordtype}{int} gsm0808\_dec\_group\_callref(\textcolor{keyword}{struct} gsm0808\_group\_callref *gc, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{468 uint8\_t gsm0808\_enc\_priority(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_priority *pri);}
\DoxyCodeLine{469 \textcolor{keywordtype}{int} gsm0808\_dec\_priority(\textcolor{keyword}{struct} gsm0808\_priority *pri, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{470 uint8\_t gsm0808\_enc\_vgcs\_feature\_flags(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_vgcs\_feature\_flags *ff);}
\DoxyCodeLine{471 \textcolor{keywordtype}{int} gsm0808\_dec\_vgcs\_feature\_flags(\textcolor{keyword}{struct} gsm0808\_vgcs\_feature\_flags *ff, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{472 uint8\_t gsm0808\_enc\_talker\_identity(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_talker\_identity *ti);}
\DoxyCodeLine{473 \textcolor{keywordtype}{int} gsm0808\_dec\_talker\_identity(\textcolor{keyword}{struct} gsm0808\_talker\_identity *ti, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{474 uint8\_t gsm0808\_enc\_data\_identity(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_data\_identity *ai);}
\DoxyCodeLine{475 \textcolor{keywordtype}{int} gsm0808\_dec\_data\_identity(\textcolor{keyword}{struct} gsm0808\_data\_identity *ai, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{476 uint8\_t gsm0808\_enc\_msisdn(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *msisdn);}
\DoxyCodeLine{477 \textcolor{keywordtype}{int} gsm0808\_dec\_msisdn(\textcolor{keywordtype}{char} *msisdn, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *elem, uint8\_t len);}
\DoxyCodeLine{478 uint8\_t gsm0808\_enc\_assign\_req(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{enum} gsm0808\_assignment\_requirement ar);}
\DoxyCodeLine{479 \textcolor{keywordtype}{int} gsm0808\_dec\_assign\_req(\textcolor{keyword}{enum} gsm0808\_assignment\_requirement *ar, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{480 uint8\_t gsm0808\_enc\_cell\_id\_list\_segment(\textcolor{keyword}{struct} msgb *msg, uint8\_t ie\_type,}
\DoxyCodeLine{481                                          \textcolor{keyword}{const} \textcolor{keyword}{struct} gsm0808\_cell\_id\_list\_segment *ci);}
\DoxyCodeLine{482 \textcolor{keywordtype}{int} gsm0808\_dec\_cell\_id\_list\_segment(\textcolor{keyword}{struct} gsm0808\_cell\_id\_list\_segment *ci, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{483 \textcolor{keywordtype}{int} gsm0808\_dec\_call\_id(uint32\_t *ci, \textcolor{keyword}{const} uint8\_t *elem, uint8\_t len);}
\DoxyCodeLine{484 }

\end{DoxyCode}
