\doxysection{gsup.\+h}
\label{gsup_8h_source}\index{include/osmocom/gsm/gsup.h@{include/osmocom/gsm/gsup.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{18 \textcolor{comment}{/*}}
\DoxyCodeLine{19 \textcolor{comment}{ * (C) 2014 by sysmocom -\/ s.f.m.c. GmbH, Author: Jacob Erlbeck}}
\DoxyCodeLine{20 \textcolor{comment}{ * (C) 2016 by Harald Welte <laforge@gnumonks.org>}}
\DoxyCodeLine{21 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{22 \textcolor{comment}{ *}}
\DoxyCodeLine{23 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{24 \textcolor{comment}{ *}}
\DoxyCodeLine{25 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{26 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{27 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}}
\DoxyCodeLine{28 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{29 \textcolor{comment}{ *}}
\DoxyCodeLine{30 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{31 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{32 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{33 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{34 \textcolor{comment}{ *}}
\DoxyCodeLine{35 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}}
\DoxyCodeLine{36 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{37 \textcolor{comment}{ *}}
\DoxyCodeLine{38 \textcolor{comment}{ */}}
\DoxyCodeLine{39 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{40 \textcolor{preprocessor}{\#if (!EMBEDDED)}}
\DoxyCodeLine{41 }
\DoxyCodeLine{42 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{43 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{44 \textcolor{preprocessor}{\#include <osmocom/core/defs.h>}}
\DoxyCodeLine{45 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{46 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{47 \textcolor{preprocessor}{\#include <osmocom/gsm/gsup\_sms.h>}}
\DoxyCodeLine{48 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_23\_003.h>}}
\DoxyCodeLine{49 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_03\_40.h>}}
\DoxyCodeLine{50 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08\_gprs.h>}}
\DoxyCodeLine{51 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_08\_08.h>}}
\DoxyCodeLine{52 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm\_utils.h>}}
\DoxyCodeLine{53 \textcolor{preprocessor}{\#include <osmocom/crypt/auth.h>}}
\DoxyCodeLine{54 }
\DoxyCodeLine{55 \textcolor{preprocessor}{\#define OSMO\_GSUP\_PORT 4222}}
\DoxyCodeLine{56 }
\DoxyCodeLine{58 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_NUM\_PDP\_INFO              10 }\textcolor{comment}{/* GSM 09.02 limits this to 50 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{60 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_NUM\_AUTH\_INFO             5}}
\DoxyCodeLine{62 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_MSISDN\_LEN                9}}
\DoxyCodeLine{63 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_CALLED\_PARTY\_BCD\_LEN      43 }\textcolor{comment}{/* TS 24.008 10.5.4.7 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{64 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_PCO\_LEN                   251}}
\DoxyCodeLine{65 }
\DoxyCodeLine{67 \textcolor{keyword}{enum} osmo\_gsup\_iei \{}
\DoxyCodeLine{68         OSMO\_GSUP\_IMSI\_IE                      = 0x01,}
\DoxyCodeLine{69         OSMO\_GSUP\_CAUSE\_IE                    = 0x02,}
\DoxyCodeLine{70         OSMO\_GSUP\_AUTH\_TUPLE\_IE                  = 0x03,}
\DoxyCodeLine{71         OSMO\_GSUP\_PDP\_INFO\_COMPL\_IE          = 0x04,}
\DoxyCodeLine{72         OSMO\_GSUP\_PDP\_INFO\_IE                      = 0x05,}
\DoxyCodeLine{73         OSMO\_GSUP\_CANCEL\_TYPE\_IE                = 0x06,}
\DoxyCodeLine{74         OSMO\_GSUP\_FREEZE\_PTMSI\_IE              = 0x07,}
\DoxyCodeLine{75         OSMO\_GSUP\_MSISDN\_IE                  = 0x08,}
\DoxyCodeLine{76         OSMO\_GSUP\_HLR\_NUMBER\_IE                  = 0x09,}
\DoxyCodeLine{77         OSMO\_GSUP\_MESSAGE\_CLASS\_IE            = 0x0a,}
\DoxyCodeLine{78         OSMO\_GSUP\_PDP\_CONTEXT\_ID\_IE          = 0x10,}
\DoxyCodeLine{79         OSMO\_GSUP\_PDP\_ADDRESS\_IE                = 0x11,}
\DoxyCodeLine{80 \textcolor{preprocessor}{\#define OSMO\_GSUP\_PDP\_TYPE\_IE                   OSMO\_GSUP\_PDP\_ADDRESS\_IE }\textcolor{comment}{/* Backward compat */}\textcolor{preprocessor}{}}
\DoxyCodeLine{81         OSMO\_GSUP\_ACCESS\_POINT\_NAME\_IE            = 0x12,}
\DoxyCodeLine{82         OSMO\_GSUP\_PDP\_QOS\_IE                        = 0x13,}
\DoxyCodeLine{83         OSMO\_GSUP\_CHARG\_CHAR\_IE                  = 0x14,}
\DoxyCodeLine{84         OSMO\_GSUP\_PCO\_IE                        = 0x15,}
\DoxyCodeLine{85         OSMO\_GSUP\_RAND\_IE                      = 0x20,}
\DoxyCodeLine{86         OSMO\_GSUP\_SRES\_IE                      = 0x21,}
\DoxyCodeLine{87         OSMO\_GSUP\_KC\_IE                          = 0x22,}
\DoxyCodeLine{88         \textcolor{comment}{/* 3G support */}}
\DoxyCodeLine{89         OSMO\_GSUP\_IK\_IE                          = 0x23,}
\DoxyCodeLine{90         OSMO\_GSUP\_CK\_IE                          = 0x24,}
\DoxyCodeLine{91         OSMO\_GSUP\_AUTN\_IE                      = 0x25,}
\DoxyCodeLine{92         OSMO\_GSUP\_AUTS\_IE                      = 0x26,}
\DoxyCodeLine{93         OSMO\_GSUP\_RES\_IE                        = 0x27,}
\DoxyCodeLine{94         OSMO\_GSUP\_CN\_DOMAIN\_IE                    = 0x28,}
\DoxyCodeLine{95         OSMO\_GSUP\_SUPPORTED\_RAT\_TYPES\_IE        = 0x29, \textcolor{comment}{/* supported RAT types */}}
\DoxyCodeLine{96         OSMO\_GSUP\_CURRENT\_RAT\_TYPE\_IE              = 0x2a, \textcolor{comment}{/* currently used RAT type */}}
\DoxyCodeLine{97 }
\DoxyCodeLine{98         OSMO\_GSUP\_SESSION\_ID\_IE                  = 0x30,}
\DoxyCodeLine{99         OSMO\_GSUP\_SESSION\_STATE\_IE            = 0x31,}
\DoxyCodeLine{100 }
\DoxyCodeLine{102         OSMO\_GSUP\_SS\_INFO\_IE                        = 0x35,}
\DoxyCodeLine{103 }
\DoxyCodeLine{104         \textcolor{comment}{/* SM related IEs (see 3GPP TS 29.002, section 7.6.8) */}}
\DoxyCodeLine{105         OSMO\_GSUP\_SM\_RP\_MR\_IE                      = 0x40,}
\DoxyCodeLine{106         OSMO\_GSUP\_SM\_RP\_DA\_IE                      = 0x41,}
\DoxyCodeLine{107         OSMO\_GSUP\_SM\_RP\_OA\_IE                      = 0x42,}
\DoxyCodeLine{108         OSMO\_GSUP\_SM\_RP\_UI\_IE                      = 0x43,}
\DoxyCodeLine{109         OSMO\_GSUP\_SM\_RP\_CAUSE\_IE                = 0x44,}
\DoxyCodeLine{110         OSMO\_GSUP\_SM\_RP\_MMS\_IE                    = 0x45,}
\DoxyCodeLine{111         OSMO\_GSUP\_SM\_ALERT\_RSN\_IE              = 0x46,}
\DoxyCodeLine{112 }
\DoxyCodeLine{113         OSMO\_GSUP\_IMEI\_IE                      = 0x50,}
\DoxyCodeLine{114         OSMO\_GSUP\_IMEI\_RESULT\_IE                = 0x51,}
\DoxyCodeLine{115         OSMO\_GSUP\_NUM\_VECTORS\_REQ\_IE                = 0x52,}
\DoxyCodeLine{116 }
\DoxyCodeLine{117         \textcolor{comment}{/* Inter-\/MSC handover related */}}
\DoxyCodeLine{118         OSMO\_GSUP\_SOURCE\_NAME\_IE                = 0x60,}
\DoxyCodeLine{119         OSMO\_GSUP\_DESTINATION\_NAME\_IE              = 0x61,}
\DoxyCodeLine{120         OSMO\_GSUP\_AN\_APDU\_IE                        = 0x62,}
\DoxyCodeLine{121         OSMO\_GSUP\_CAUSE\_RR\_IE                      = 0x63,}
\DoxyCodeLine{122         OSMO\_GSUP\_CAUSE\_BSSAP\_IE                = 0x64,}
\DoxyCodeLine{123         OSMO\_GSUP\_CAUSE\_SM\_IE                      = 0x65,}
\DoxyCodeLine{124 }
\DoxyCodeLine{125         \_OSMO\_GSUP\_IEI\_END\_MARKER}
\DoxyCodeLine{126 \};}
\DoxyCodeLine{127 }
\DoxyCodeLine{140 \textcolor{keyword}{enum} osmo\_gsup\_message\_type \{}
\DoxyCodeLine{141         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_REQUEST    = 0b00000100,}
\DoxyCodeLine{142         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_ERROR        = 0b00000101,}
\DoxyCodeLine{143         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_RESULT      = 0b00000110,}
\DoxyCodeLine{144 }
\DoxyCodeLine{145         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_REQUEST      = 0b00001000,}
\DoxyCodeLine{146         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_ERROR  = 0b00001001,}
\DoxyCodeLine{147         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_RESULT        = 0b00001010,}
\DoxyCodeLine{148 }
\DoxyCodeLine{149         OSMO\_GSUP\_MSGT\_AUTH\_FAIL\_REPORT          = 0b00001011,}
\DoxyCodeLine{150 }
\DoxyCodeLine{151         OSMO\_GSUP\_MSGT\_PURGE\_MS\_REQUEST          = 0b00001100,}
\DoxyCodeLine{152         OSMO\_GSUP\_MSGT\_PURGE\_MS\_ERROR              = 0b00001101,}
\DoxyCodeLine{153         OSMO\_GSUP\_MSGT\_PURGE\_MS\_RESULT            = 0b00001110,}
\DoxyCodeLine{154 }
\DoxyCodeLine{155         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_REQUEST    = 0b00010000,}
\DoxyCodeLine{156         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_ERROR        = 0b00010001,}
\DoxyCodeLine{157         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_RESULT      = 0b00010010,}
\DoxyCodeLine{158 }
\DoxyCodeLine{159         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_REQUEST    = 0b00010100,}
\DoxyCodeLine{160         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_ERROR        = 0b00010101,}
\DoxyCodeLine{161         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_RESULT      = 0b00010110,}
\DoxyCodeLine{162 }
\DoxyCodeLine{163         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_REQUEST    = 0b00011100,}
\DoxyCodeLine{164         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_ERROR        = 0b00011101,}
\DoxyCodeLine{165         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_RESULT      = 0b00011110,}
\DoxyCodeLine{166 }
\DoxyCodeLine{167         OSMO\_GSUP\_MSGT\_PROC\_SS\_REQUEST            = 0b00100000,}
\DoxyCodeLine{168         OSMO\_GSUP\_MSGT\_PROC\_SS\_ERROR                = 0b00100001,}
\DoxyCodeLine{169         OSMO\_GSUP\_MSGT\_PROC\_SS\_RESULT              = 0b00100010,}
\DoxyCodeLine{170 }
\DoxyCodeLine{171         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_REQUEST        = 0b00100100,}
\DoxyCodeLine{172         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_ERROR    = 0b00100101,}
\DoxyCodeLine{173         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_RESULT  = 0b00100110,}
\DoxyCodeLine{174 }
\DoxyCodeLine{175         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_REQUEST        = 0b00101000,}
\DoxyCodeLine{176         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_ERROR    = 0b00101001,}
\DoxyCodeLine{177         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_RESULT  = 0b00101010,}
\DoxyCodeLine{178 }
\DoxyCodeLine{179         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_REQUEST  = 0b00101100,}
\DoxyCodeLine{180         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_ERROR      = 0b00101101,}
\DoxyCodeLine{181         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_RESULT    = 0b00101110,}
\DoxyCodeLine{182 }
\DoxyCodeLine{183         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_REQUEST      = 0b00110000,}
\DoxyCodeLine{184         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_ERROR          = 0b00110001,}
\DoxyCodeLine{185         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_RESULT        = 0b00110010,}
\DoxyCodeLine{186 }
\DoxyCodeLine{187         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_REQUEST              = 0b00110100,}
\DoxyCodeLine{188         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_ERROR                  = 0b00110101,}
\DoxyCodeLine{189         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_RESULT                = 0b00110110,}
\DoxyCodeLine{190 }
\DoxyCodeLine{191         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_REQUEST        = 0b00111000,}
\DoxyCodeLine{192         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_ERROR    = 0b00111001,}
\DoxyCodeLine{193         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_RESULT  = 0b00111010,}
\DoxyCodeLine{194 }
\DoxyCodeLine{195         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_REQUEST                = 0b00111100,}
\DoxyCodeLine{196         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_ERROR                    = 0b00111101,}
\DoxyCodeLine{197         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_RESULT                  = 0b00111110,}
\DoxyCodeLine{198 }
\DoxyCodeLine{199         OSMO\_GSUP\_MSGT\_E\_PROCESS\_ACCESS\_SIGNALLING\_REQUEST    = 0b01000000,}
\DoxyCodeLine{200         OSMO\_GSUP\_MSGT\_E\_FORWARD\_ACCESS\_SIGNALLING\_REQUEST    = 0b01000100,}
\DoxyCodeLine{201 }
\DoxyCodeLine{202         OSMO\_GSUP\_MSGT\_E\_CLOSE                                    = 0b01000111,}
\DoxyCodeLine{203         OSMO\_GSUP\_MSGT\_E\_ABORT                                    = 0b01001011,}
\DoxyCodeLine{204 }
\DoxyCodeLine{205         OSMO\_GSUP\_MSGT\_ROUTING\_ERROR                                = 0b01001110,}
\DoxyCodeLine{206 }
\DoxyCodeLine{207         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_REQUEST                    = 0b01010000,}
\DoxyCodeLine{208         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_ERROR                        = 0b01010001,}
\DoxyCodeLine{209         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_RESULT                      = 0b01010010,}
\DoxyCodeLine{210 \};}
\DoxyCodeLine{211 }
\DoxyCodeLine{212 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MSGT\_E\_ROUTING\_ERROR OSMO\_GSUP\_MSGT\_ROUTING\_ERROR}}
\DoxyCodeLine{213 }
\DoxyCodeLine{214 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_REQUEST(msgt) (((msgt) \& 0b00000011) == 0b00)}}
\DoxyCodeLine{215 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_ERROR(msgt)   (((msgt) \& 0b00000011) == 0b01)}}
\DoxyCodeLine{216 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_RESULT(msgt)  (((msgt) \& 0b00000011) == 0b10)}}
\DoxyCodeLine{217 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_REQUEST(msgt) (((msgt) \& 0b11111100))}}
\DoxyCodeLine{218 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_ERROR(msgt)   (((msgt) \& 0b11111100) | 0b01)}}
\DoxyCodeLine{219 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_RESULT(msgt)  (((msgt) \& 0b11111100) | 0b10)}}
\DoxyCodeLine{220 }
\DoxyCodeLine{221 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_message\_type\_names[];}
\DoxyCodeLine{222 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{223 osmo\_gsup\_message\_type\_name(\textcolor{keyword}{enum} osmo\_gsup\_message\_type val)}
\DoxyCodeLine{224 \{       \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_message\_type\_names, val); \}}
\DoxyCodeLine{225 }
\DoxyCodeLine{226 \textcolor{keyword}{enum} osmo\_gsup\_cancel\_type \{}
\DoxyCodeLine{227         OSMO\_GSUP\_CANCEL\_TYPE\_UPDATE                = 1, \textcolor{comment}{/* on wire: 0 */}}
\DoxyCodeLine{228         OSMO\_GSUP\_CANCEL\_TYPE\_WITHDRAW            = 2, \textcolor{comment}{/* on wire: 1 */}}
\DoxyCodeLine{229 \};}
\DoxyCodeLine{230 }
\DoxyCodeLine{231 \textcolor{keyword}{enum} osmo\_gsup\_cn\_domain \{}
\DoxyCodeLine{232         OSMO\_GSUP\_CN\_DOMAIN\_PS                    = 1,}
\DoxyCodeLine{233         OSMO\_GSUP\_CN\_DOMAIN\_CS                    = 2,}
\DoxyCodeLine{234 \};}
\DoxyCodeLine{235 }
\DoxyCodeLine{236 \textcolor{keyword}{enum} osmo\_gsup\_imei\_result \{}
\DoxyCodeLine{237         OSMO\_GSUP\_IMEI\_RESULT\_ACK              = 1, \textcolor{comment}{/* on wire: 0 */}}
\DoxyCodeLine{238         OSMO\_GSUP\_IMEI\_RESULT\_NACK            = 2, \textcolor{comment}{/* on wire: 1 */}}
\DoxyCodeLine{239 \};}
\DoxyCodeLine{240 }
\DoxyCodeLine{241 \textcolor{comment}{/* 3GPP 29.002 AccessNetworkProtocolId */}}
\DoxyCodeLine{242 \textcolor{keyword}{enum} osmo\_gsup\_access\_network\_protocol \{}
\DoxyCodeLine{243         OSMO\_GSUP\_ACCESS\_NETWORK\_PROTOCOL\_TS3G\_48006 = 1,}
\DoxyCodeLine{244         OSMO\_GSUP\_ACCESS\_NETWORK\_PROTOCOL\_TS3G\_25413 = 2,}
\DoxyCodeLine{245 \};}
\DoxyCodeLine{246 }
\DoxyCodeLine{248 \textcolor{keyword}{enum} osmo\_gsup\_session\_state \{}
\DoxyCodeLine{250         OSMO\_GSUP\_SESSION\_STATE\_NONE                = 0x00,}
\DoxyCodeLine{252         OSMO\_GSUP\_SESSION\_STATE\_BEGIN              = 0x01,}
\DoxyCodeLine{254         OSMO\_GSUP\_SESSION\_STATE\_CONTINUE        = 0x02,}
\DoxyCodeLine{256         OSMO\_GSUP\_SESSION\_STATE\_END          = 0x03,}
\DoxyCodeLine{257 \};}
\DoxyCodeLine{258 }
\DoxyCodeLine{259 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_session\_state\_names[];}
\DoxyCodeLine{260 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{261 osmo\_gsup\_session\_state\_name(\textcolor{keyword}{enum} osmo\_gsup\_session\_state val)}
\DoxyCodeLine{262 \{       \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_session\_state\_names, val); \}}
\DoxyCodeLine{263 }
\DoxyCodeLine{265 \textcolor{keyword}{struct }osmo\_gsup\_pdp\_info \{}
\DoxyCodeLine{266         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}                    context\_id;}
\DoxyCodeLine{267         \textcolor{keywordtype}{int}                             have\_info;}
\DoxyCodeLine{269         \textcolor{keyword}{union }\{}
\DoxyCodeLine{270                 uint16\_t pdp\_type OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use pdp\_type\_org and pdp\_type\_nr instead"{}});}
\DoxyCodeLine{271                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{272 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{273                         uint8\_t pdp\_type\_nr; \textcolor{comment}{/* enum gsm48\_pdp\_type\_nr */}}
\DoxyCodeLine{274                         uint8\_t pdp\_type\_org; \textcolor{comment}{/* enum gsm48\_pdp\_type\_org */}}
\DoxyCodeLine{275 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{276                         uint8\_t pdp\_type\_org; \textcolor{comment}{/* enum gsm48\_pdp\_type\_org */}}
\DoxyCodeLine{277                         uint8\_t pdp\_type\_nr; \textcolor{comment}{/* enum gsm48\_pdp\_type\_nr */}}
\DoxyCodeLine{278 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{279                 \};}
\DoxyCodeLine{280         \};}
\DoxyCodeLine{281         \textcolor{keyword}{struct }osmo\_sockaddr               pdp\_address[2];}
\DoxyCodeLine{284         \textcolor{keyword}{const} uint8\_t                   *apn\_enc;}
\DoxyCodeLine{286         \textcolor{keywordtype}{size\_t}                          apn\_enc\_len;}
\DoxyCodeLine{289         \textcolor{keyword}{const} uint8\_t                   *qos\_enc;}
\DoxyCodeLine{291         \textcolor{keywordtype}{size\_t}                          qos\_enc\_len;}
\DoxyCodeLine{294         \textcolor{keyword}{const} uint8\_t                   *pdp\_charg\_enc;}
\DoxyCodeLine{296         \textcolor{keywordtype}{size\_t}                          pdp\_charg\_enc\_len;}
\DoxyCodeLine{297 \};}
\DoxyCodeLine{298 }
\DoxyCodeLine{299 \textcolor{keyword}{enum} osmo\_gsup\_message\_class \{}
\DoxyCodeLine{300         OSMO\_GSUP\_MESSAGE\_CLASS\_UNSET = 0,}
\DoxyCodeLine{301         OSMO\_GSUP\_MESSAGE\_CLASS\_SUBSCRIBER\_MANAGEMENT = 1,}
\DoxyCodeLine{302         OSMO\_GSUP\_MESSAGE\_CLASS\_SMS = 2,}
\DoxyCodeLine{303         OSMO\_GSUP\_MESSAGE\_CLASS\_USSD = 3,}
\DoxyCodeLine{304         OSMO\_GSUP\_MESSAGE\_CLASS\_INTER\_MSC = 4,}
\DoxyCodeLine{305         OSMO\_GSUP\_MESSAGE\_CLASS\_IPSEC\_EPDG = 5,}
\DoxyCodeLine{306         \textcolor{comment}{/* Keep this as last entry with a value of max(enum osmo\_gsup\_message\_class) + 1.}}
\DoxyCodeLine{307 \textcolor{comment}{         * This value shall serve as the size for an array to aid de-\/muxing all known GSUP classes. */}}
\DoxyCodeLine{308         OSMO\_GSUP\_MESSAGE\_CLASS\_ARRAYSIZE}
\DoxyCodeLine{309 \};}
\DoxyCodeLine{310 }
\DoxyCodeLine{311 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_message\_class\_names[];}
\DoxyCodeLine{312 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_gsup\_message\_class\_name(\textcolor{keyword}{enum} osmo\_gsup\_message\_class val)}
\DoxyCodeLine{313 \{ \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_message\_class\_names, val); \}}
\DoxyCodeLine{314 }
\DoxyCodeLine{316 \textcolor{keyword}{struct }osmo\_gsup\_an\_apdu \{}
\DoxyCodeLine{317         \textcolor{comment}{/* AccessNetworkProtocolId as in 3GPP TS 29.002. */}}
\DoxyCodeLine{318         \textcolor{keyword}{enum} osmo\_gsup\_access\_network\_protocol access\_network\_proto;}
\DoxyCodeLine{319         \textcolor{keyword}{const} uint8\_t *data;}
\DoxyCodeLine{320         \textcolor{keywordtype}{size\_t} data\_len;}
\DoxyCodeLine{321 \};}
\DoxyCodeLine{322 }
\DoxyCodeLine{324 \textcolor{keyword}{struct }osmo\_gsup\_message \{}
\DoxyCodeLine{325         \textcolor{keyword}{enum} osmo\_gsup\_message\_type       message\_type;}
\DoxyCodeLine{326         \textcolor{keywordtype}{char}                            imsi[OSMO\_IMSI\_BUF\_SIZE];}
\DoxyCodeLine{327         \textcolor{keyword}{enum} gsm48\_gmm\_cause             cause;}
\DoxyCodeLine{328         \textcolor{keyword}{enum} osmo\_gsup\_cancel\_type cancel\_type;}
\DoxyCodeLine{329         \textcolor{keywordtype}{int}                             pdp\_info\_compl;}
\DoxyCodeLine{330         \textcolor{keywordtype}{int}                             freeze\_ptmsi;}
\DoxyCodeLine{331         \textcolor{keyword}{struct }osmo\_auth\_vector         auth\_vectors[OSMO\_GSUP\_MAX\_NUM\_AUTH\_INFO];}
\DoxyCodeLine{332         \textcolor{keywordtype}{size\_t}                          num\_auth\_vectors;}
\DoxyCodeLine{333         \textcolor{keyword}{struct }osmo\_gsup\_pdp\_info     pdp\_infos[OSMO\_GSUP\_MAX\_NUM\_PDP\_INFO];}
\DoxyCodeLine{334         \textcolor{keywordtype}{size\_t}                          num\_pdp\_infos;}
\DoxyCodeLine{335         \textcolor{keyword}{const} uint8\_t                   *msisdn\_enc;}
\DoxyCodeLine{336         \textcolor{keywordtype}{size\_t}                          msisdn\_enc\_len;}
\DoxyCodeLine{337         \textcolor{keyword}{const} uint8\_t                   *hlr\_enc;}
\DoxyCodeLine{338         \textcolor{keywordtype}{size\_t}                          hlr\_enc\_len;}
\DoxyCodeLine{339         \textcolor{keyword}{const} uint8\_t                   *auts;}
\DoxyCodeLine{340         \textcolor{keyword}{const} uint8\_t                   *rand;}
\DoxyCodeLine{341         \textcolor{keyword}{enum} osmo\_gsup\_cn\_domain     cn\_domain;}
\DoxyCodeLine{342         \textcolor{keyword}{const} uint8\_t                   *pdp\_charg\_enc;}
\DoxyCodeLine{343         \textcolor{keywordtype}{size\_t}                          pdp\_charg\_enc\_len;}
\DoxyCodeLine{344 }
\DoxyCodeLine{346         \textcolor{keyword}{enum} osmo\_gsup\_session\_state     session\_state;}
\DoxyCodeLine{349         uint32\_t                        session\_id;}
\DoxyCodeLine{350 }
\DoxyCodeLine{352         uint8\_t                         *ss\_info;}
\DoxyCodeLine{353         \textcolor{keywordtype}{size\_t}                          ss\_info\_len;}
\DoxyCodeLine{354 }
\DoxyCodeLine{358         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_mr;}
\DoxyCodeLine{360         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_rp\_oda\_t sm\_rp\_da\_type;}
\DoxyCodeLine{361         \textcolor{keywordtype}{size\_t}                          sm\_rp\_da\_len;}
\DoxyCodeLine{362         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_da;}
\DoxyCodeLine{364         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_rp\_oda\_t sm\_rp\_oa\_type;}
\DoxyCodeLine{365         \textcolor{keywordtype}{size\_t}                          sm\_rp\_oa\_len;}
\DoxyCodeLine{366         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_oa;}
\DoxyCodeLine{368         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_ui;}
\DoxyCodeLine{369         \textcolor{keywordtype}{size\_t}                          sm\_rp\_ui\_len;}
\DoxyCodeLine{371         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_cause;}
\DoxyCodeLine{373         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_mms;}
\DoxyCodeLine{375         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_alert\_rsn\_t   sm\_alert\_rsn;}
\DoxyCodeLine{376 }
\DoxyCodeLine{377         \textcolor{keyword}{const} uint8\_t                   *imei\_enc;}
\DoxyCodeLine{378         \textcolor{keywordtype}{size\_t}                          imei\_enc\_len;}
\DoxyCodeLine{379         \textcolor{keyword}{enum} osmo\_gsup\_imei\_result imei\_result;}
\DoxyCodeLine{380 }
\DoxyCodeLine{384         \textcolor{keyword}{enum} osmo\_gsup\_message\_class             message\_class;}
\DoxyCodeLine{385 }
\DoxyCodeLine{387         \textcolor{keyword}{const} uint8\_t                   *source\_name;}
\DoxyCodeLine{389         \textcolor{keywordtype}{size\_t}                          source\_name\_len;}
\DoxyCodeLine{392         \textcolor{keyword}{const} uint8\_t                   *destination\_name;}
\DoxyCodeLine{394         \textcolor{keywordtype}{size\_t}                          destination\_name\_len;}
\DoxyCodeLine{395 }
\DoxyCodeLine{397         \textcolor{keyword}{struct }osmo\_gsup\_an\_apdu       an\_apdu;}
\DoxyCodeLine{398 }
\DoxyCodeLine{399         uint8\_t                         cause\_rr; }
\DoxyCodeLine{400         \textcolor{keywordtype}{bool}                            cause\_rr\_set; }
\DoxyCodeLine{402         \textcolor{keyword}{enum} gsm0808\_cause         cause\_bssap; }
\DoxyCodeLine{403         \textcolor{keywordtype}{bool}                            cause\_bssap\_set; }
\DoxyCodeLine{406         \textcolor{keyword}{enum} gsm48\_gsm\_cause             cause\_sm;}
\DoxyCodeLine{407 }
\DoxyCodeLine{408         \textcolor{keyword}{enum} osmo\_rat\_type         current\_rat\_type;}
\DoxyCodeLine{409         \textcolor{keyword}{enum} osmo\_rat\_type         supported\_rat\_types[8]; }
\DoxyCodeLine{410         \textcolor{keywordtype}{size\_t}                          supported\_rat\_types\_len;}
\DoxyCodeLine{411 }
\DoxyCodeLine{413         \textcolor{keyword}{const} uint8\_t                   *pco;}
\DoxyCodeLine{415         \textcolor{keywordtype}{size\_t}                          pco\_len;}
\DoxyCodeLine{416 }
\DoxyCodeLine{417 \};}
\DoxyCodeLine{418 }
\DoxyCodeLine{419 \textcolor{keywordtype}{int} osmo\_gsup\_decode(\textcolor{keyword}{const} uint8\_t *data, \textcolor{keywordtype}{size\_t} data\_len,}
\DoxyCodeLine{420                      \textcolor{keyword}{struct} osmo\_gsup\_message *gsup\_msg);}
\DoxyCodeLine{421 \textcolor{keywordtype}{int} osmo\_gsup\_encode(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsup\_message *gsup\_msg);}
\DoxyCodeLine{422 \textcolor{keywordtype}{int} osmo\_gsup\_get\_err\_msg\_type(\textcolor{keyword}{enum} osmo\_gsup\_message\_type type\_in)}
\DoxyCodeLine{423         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use OSMO\_GSUP\_TO\_MSGT\_ERROR() instead"{}});}
\DoxyCodeLine{424 }
\DoxyCodeLine{425 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* (!EMBEDDED) */}\textcolor{preprocessor}{}}

\end{DoxyCode}
