\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 }
\DoxyCodeLine{41 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{42 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{43 \textcolor{preprocessor}{\#include <osmocom/core/defs.h>}}
\DoxyCodeLine{44 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{45 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{46 \textcolor{preprocessor}{\#include <osmocom/gsm/gsup\_sms.h>}}
\DoxyCodeLine{47 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_23\_003.h>}}
\DoxyCodeLine{48 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_03\_40.h>}}
\DoxyCodeLine{49 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08\_gprs.h>}}
\DoxyCodeLine{50 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_08\_08.h>}}
\DoxyCodeLine{51 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm\_utils.h>}}
\DoxyCodeLine{52 \textcolor{preprocessor}{\#include <osmocom/crypt/auth.h>}}
\DoxyCodeLine{53 }
\DoxyCodeLine{54 \textcolor{preprocessor}{\#define OSMO\_GSUP\_PORT 4222}}
\DoxyCodeLine{55 }
\DoxyCodeLine{57 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_NUM\_PDP\_INFO              10 }\textcolor{comment}{/* GSM 09.02 limits this to 50 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{59 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_NUM\_AUTH\_INFO             5}}
\DoxyCodeLine{61 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_MSISDN\_LEN                9}}
\DoxyCodeLine{62 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_CALLED\_PARTY\_BCD\_LEN      43 }\textcolor{comment}{/* TS 24.008 10.5.4.7 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{63 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MAX\_PCO\_LEN                   251}}
\DoxyCodeLine{64 }
\DoxyCodeLine{66 \textcolor{keyword}{enum} osmo\_gsup\_iei \{}
\DoxyCodeLine{67         OSMO\_GSUP\_IMSI\_IE                      = 0x01,}
\DoxyCodeLine{68         OSMO\_GSUP\_CAUSE\_IE                    = 0x02,}
\DoxyCodeLine{69         OSMO\_GSUP\_AUTH\_TUPLE\_IE                  = 0x03,}
\DoxyCodeLine{70         OSMO\_GSUP\_PDP\_INFO\_COMPL\_IE          = 0x04,}
\DoxyCodeLine{71         OSMO\_GSUP\_PDP\_INFO\_IE                      = 0x05,}
\DoxyCodeLine{72         OSMO\_GSUP\_CANCEL\_TYPE\_IE                = 0x06,}
\DoxyCodeLine{73         OSMO\_GSUP\_FREEZE\_PTMSI\_IE              = 0x07,}
\DoxyCodeLine{74         OSMO\_GSUP\_MSISDN\_IE                  = 0x08,}
\DoxyCodeLine{75         OSMO\_GSUP\_HLR\_NUMBER\_IE                  = 0x09,}
\DoxyCodeLine{76         OSMO\_GSUP\_MESSAGE\_CLASS\_IE            = 0x0a,}
\DoxyCodeLine{77         OSMO\_GSUP\_PDP\_CONTEXT\_ID\_IE          = 0x10,}
\DoxyCodeLine{78         OSMO\_GSUP\_PDP\_ADDRESS\_IE                = 0x11,}
\DoxyCodeLine{79 \textcolor{preprocessor}{\#define OSMO\_GSUP\_PDP\_TYPE\_IE                   OSMO\_GSUP\_PDP\_ADDRESS\_IE }\textcolor{comment}{/* Backward compat */}\textcolor{preprocessor}{}}
\DoxyCodeLine{80         OSMO\_GSUP\_ACCESS\_POINT\_NAME\_IE            = 0x12,}
\DoxyCodeLine{81         OSMO\_GSUP\_PDP\_QOS\_IE                        = 0x13,}
\DoxyCodeLine{82         OSMO\_GSUP\_CHARG\_CHAR\_IE                  = 0x14,}
\DoxyCodeLine{83         OSMO\_GSUP\_PCO\_IE                        = 0x15,}
\DoxyCodeLine{84         OSMO\_GSUP\_RAND\_IE                      = 0x20,}
\DoxyCodeLine{85         OSMO\_GSUP\_SRES\_IE                      = 0x21,}
\DoxyCodeLine{86         OSMO\_GSUP\_KC\_IE                          = 0x22,}
\DoxyCodeLine{87         \textcolor{comment}{/* 3G support */}}
\DoxyCodeLine{88         OSMO\_GSUP\_IK\_IE                          = 0x23,}
\DoxyCodeLine{89         OSMO\_GSUP\_CK\_IE                          = 0x24,}
\DoxyCodeLine{90         OSMO\_GSUP\_AUTN\_IE                      = 0x25,}
\DoxyCodeLine{91         OSMO\_GSUP\_AUTS\_IE                      = 0x26,}
\DoxyCodeLine{92         OSMO\_GSUP\_RES\_IE                        = 0x27,}
\DoxyCodeLine{93         OSMO\_GSUP\_CN\_DOMAIN\_IE                    = 0x28,}
\DoxyCodeLine{94         OSMO\_GSUP\_SUPPORTED\_RAT\_TYPES\_IE        = 0x29, \textcolor{comment}{/* supported RAT types */}}
\DoxyCodeLine{95         OSMO\_GSUP\_CURRENT\_RAT\_TYPE\_IE              = 0x2a, \textcolor{comment}{/* currently used RAT type */}}
\DoxyCodeLine{96 }
\DoxyCodeLine{97         OSMO\_GSUP\_SESSION\_ID\_IE                  = 0x30,}
\DoxyCodeLine{98         OSMO\_GSUP\_SESSION\_STATE\_IE            = 0x31,}
\DoxyCodeLine{99 }
\DoxyCodeLine{101         OSMO\_GSUP\_SS\_INFO\_IE                        = 0x35,}
\DoxyCodeLine{102 }
\DoxyCodeLine{103         \textcolor{comment}{/* SM related IEs (see 3GPP TS 29.002, section 7.6.8) */}}
\DoxyCodeLine{104         OSMO\_GSUP\_SM\_RP\_MR\_IE                      = 0x40,}
\DoxyCodeLine{105         OSMO\_GSUP\_SM\_RP\_DA\_IE                      = 0x41,}
\DoxyCodeLine{106         OSMO\_GSUP\_SM\_RP\_OA\_IE                      = 0x42,}
\DoxyCodeLine{107         OSMO\_GSUP\_SM\_RP\_UI\_IE                      = 0x43,}
\DoxyCodeLine{108         OSMO\_GSUP\_SM\_RP\_CAUSE\_IE                = 0x44,}
\DoxyCodeLine{109         OSMO\_GSUP\_SM\_RP\_MMS\_IE                    = 0x45,}
\DoxyCodeLine{110         OSMO\_GSUP\_SM\_ALERT\_RSN\_IE              = 0x46,}
\DoxyCodeLine{111 }
\DoxyCodeLine{112         OSMO\_GSUP\_IMEI\_IE                      = 0x50,}
\DoxyCodeLine{113         OSMO\_GSUP\_IMEI\_RESULT\_IE                = 0x51,}
\DoxyCodeLine{114         OSMO\_GSUP\_NUM\_VECTORS\_REQ\_IE                = 0x52,}
\DoxyCodeLine{115 }
\DoxyCodeLine{116         \textcolor{comment}{/* Inter-\/MSC handover related */}}
\DoxyCodeLine{117         OSMO\_GSUP\_SOURCE\_NAME\_IE                = 0x60,}
\DoxyCodeLine{118         OSMO\_GSUP\_DESTINATION\_NAME\_IE              = 0x61,}
\DoxyCodeLine{119         OSMO\_GSUP\_AN\_APDU\_IE                        = 0x62,}
\DoxyCodeLine{120         OSMO\_GSUP\_CAUSE\_RR\_IE                      = 0x63,}
\DoxyCodeLine{121         OSMO\_GSUP\_CAUSE\_BSSAP\_IE                = 0x64,}
\DoxyCodeLine{122         OSMO\_GSUP\_CAUSE\_SM\_IE                      = 0x65,}
\DoxyCodeLine{123 }
\DoxyCodeLine{124         \_OSMO\_GSUP\_IEI\_END\_MARKER}
\DoxyCodeLine{125 \};}
\DoxyCodeLine{126 }
\DoxyCodeLine{139 \textcolor{keyword}{enum} osmo\_gsup\_message\_type \{}
\DoxyCodeLine{140         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_REQUEST    = 0b00000100,}
\DoxyCodeLine{141         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_ERROR        = 0b00000101,}
\DoxyCodeLine{142         OSMO\_GSUP\_MSGT\_UPDATE\_LOCATION\_RESULT      = 0b00000110,}
\DoxyCodeLine{143 }
\DoxyCodeLine{144         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_REQUEST      = 0b00001000,}
\DoxyCodeLine{145         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_ERROR  = 0b00001001,}
\DoxyCodeLine{146         OSMO\_GSUP\_MSGT\_SEND\_AUTH\_INFO\_RESULT        = 0b00001010,}
\DoxyCodeLine{147 }
\DoxyCodeLine{148         OSMO\_GSUP\_MSGT\_AUTH\_FAIL\_REPORT          = 0b00001011,}
\DoxyCodeLine{149 }
\DoxyCodeLine{150         OSMO\_GSUP\_MSGT\_PURGE\_MS\_REQUEST          = 0b00001100,}
\DoxyCodeLine{151         OSMO\_GSUP\_MSGT\_PURGE\_MS\_ERROR              = 0b00001101,}
\DoxyCodeLine{152         OSMO\_GSUP\_MSGT\_PURGE\_MS\_RESULT            = 0b00001110,}
\DoxyCodeLine{153 }
\DoxyCodeLine{154         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_REQUEST    = 0b00010000,}
\DoxyCodeLine{155         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_ERROR        = 0b00010001,}
\DoxyCodeLine{156         OSMO\_GSUP\_MSGT\_INSERT\_DATA\_RESULT      = 0b00010010,}
\DoxyCodeLine{157 }
\DoxyCodeLine{158         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_REQUEST    = 0b00010100,}
\DoxyCodeLine{159         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_ERROR        = 0b00010101,}
\DoxyCodeLine{160         OSMO\_GSUP\_MSGT\_DELETE\_DATA\_RESULT      = 0b00010110,}
\DoxyCodeLine{161 }
\DoxyCodeLine{162         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_REQUEST    = 0b00011100,}
\DoxyCodeLine{163         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_ERROR        = 0b00011101,}
\DoxyCodeLine{164         OSMO\_GSUP\_MSGT\_LOCATION\_CANCEL\_RESULT      = 0b00011110,}
\DoxyCodeLine{165 }
\DoxyCodeLine{166         OSMO\_GSUP\_MSGT\_PROC\_SS\_REQUEST            = 0b00100000,}
\DoxyCodeLine{167         OSMO\_GSUP\_MSGT\_PROC\_SS\_ERROR                = 0b00100001,}
\DoxyCodeLine{168         OSMO\_GSUP\_MSGT\_PROC\_SS\_RESULT              = 0b00100010,}
\DoxyCodeLine{169 }
\DoxyCodeLine{170         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_REQUEST        = 0b00100100,}
\DoxyCodeLine{171         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_ERROR    = 0b00100101,}
\DoxyCodeLine{172         OSMO\_GSUP\_MSGT\_MO\_FORWARD\_SM\_RESULT  = 0b00100110,}
\DoxyCodeLine{173 }
\DoxyCodeLine{174         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_REQUEST        = 0b00101000,}
\DoxyCodeLine{175         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_ERROR    = 0b00101001,}
\DoxyCodeLine{176         OSMO\_GSUP\_MSGT\_MT\_FORWARD\_SM\_RESULT  = 0b00101010,}
\DoxyCodeLine{177 }
\DoxyCodeLine{178         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_REQUEST  = 0b00101100,}
\DoxyCodeLine{179         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_ERROR      = 0b00101101,}
\DoxyCodeLine{180         OSMO\_GSUP\_MSGT\_READY\_FOR\_SM\_RESULT    = 0b00101110,}
\DoxyCodeLine{181 }
\DoxyCodeLine{182         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_REQUEST      = 0b00110000,}
\DoxyCodeLine{183         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_ERROR          = 0b00110001,}
\DoxyCodeLine{184         OSMO\_GSUP\_MSGT\_CHECK\_IMEI\_RESULT        = 0b00110010,}
\DoxyCodeLine{185 }
\DoxyCodeLine{186         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_REQUEST              = 0b00110100,}
\DoxyCodeLine{187         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_ERROR                  = 0b00110101,}
\DoxyCodeLine{188         OSMO\_GSUP\_MSGT\_E\_PREPARE\_HANDOVER\_RESULT                = 0b00110110,}
\DoxyCodeLine{189 }
\DoxyCodeLine{190         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_REQUEST        = 0b00111000,}
\DoxyCodeLine{191         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_ERROR    = 0b00111001,}
\DoxyCodeLine{192         OSMO\_GSUP\_MSGT\_E\_PREPARE\_SUBSEQUENT\_HANDOVER\_RESULT  = 0b00111010,}
\DoxyCodeLine{193 }
\DoxyCodeLine{194         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_REQUEST                = 0b00111100,}
\DoxyCodeLine{195         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_ERROR                    = 0b00111101,}
\DoxyCodeLine{196         OSMO\_GSUP\_MSGT\_E\_SEND\_END\_SIGNAL\_RESULT                  = 0b00111110,}
\DoxyCodeLine{197 }
\DoxyCodeLine{198         OSMO\_GSUP\_MSGT\_E\_PROCESS\_ACCESS\_SIGNALLING\_REQUEST    = 0b01000000,}
\DoxyCodeLine{199         OSMO\_GSUP\_MSGT\_E\_FORWARD\_ACCESS\_SIGNALLING\_REQUEST    = 0b01000100,}
\DoxyCodeLine{200 }
\DoxyCodeLine{201         OSMO\_GSUP\_MSGT\_E\_CLOSE                                    = 0b01000111,}
\DoxyCodeLine{202         OSMO\_GSUP\_MSGT\_E\_ABORT                                    = 0b01001011,}
\DoxyCodeLine{203 }
\DoxyCodeLine{204         OSMO\_GSUP\_MSGT\_ROUTING\_ERROR                                = 0b01001110,}
\DoxyCodeLine{205 }
\DoxyCodeLine{206         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_REQUEST                    = 0b01010000,}
\DoxyCodeLine{207         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_ERROR                        = 0b01010001,}
\DoxyCodeLine{208         OSMO\_GSUP\_MSGT\_EPDG\_TUNNEL\_RESULT                      = 0b01010010,}
\DoxyCodeLine{209 \};}
\DoxyCodeLine{210 }
\DoxyCodeLine{211 \textcolor{preprocessor}{\#define OSMO\_GSUP\_MSGT\_E\_ROUTING\_ERROR OSMO\_GSUP\_MSGT\_ROUTING\_ERROR}}
\DoxyCodeLine{212 }
\DoxyCodeLine{213 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_REQUEST(msgt) (((msgt) \& 0b00000011) == 0b00)}}
\DoxyCodeLine{214 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_ERROR(msgt)   (((msgt) \& 0b00000011) == 0b01)}}
\DoxyCodeLine{215 \textcolor{preprocessor}{\#define OSMO\_GSUP\_IS\_MSGT\_RESULT(msgt)  (((msgt) \& 0b00000011) == 0b10)}}
\DoxyCodeLine{216 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_REQUEST(msgt) (((msgt) \& 0b11111100))}}
\DoxyCodeLine{217 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_ERROR(msgt)   (((msgt) \& 0b11111100) | 0b01)}}
\DoxyCodeLine{218 \textcolor{preprocessor}{\#define OSMO\_GSUP\_TO\_MSGT\_RESULT(msgt)  (((msgt) \& 0b11111100) | 0b10)}}
\DoxyCodeLine{219 }
\DoxyCodeLine{220 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_message\_type\_names[];}
\DoxyCodeLine{221 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{222 osmo\_gsup\_message\_type\_name(\textcolor{keyword}{enum} osmo\_gsup\_message\_type val)}
\DoxyCodeLine{223 \{       \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_message\_type\_names, val); \}}
\DoxyCodeLine{224 }
\DoxyCodeLine{225 \textcolor{keyword}{enum} osmo\_gsup\_cancel\_type \{}
\DoxyCodeLine{226         OSMO\_GSUP\_CANCEL\_TYPE\_UPDATE                = 1, \textcolor{comment}{/* on wire: 0 */}}
\DoxyCodeLine{227         OSMO\_GSUP\_CANCEL\_TYPE\_WITHDRAW            = 2, \textcolor{comment}{/* on wire: 1 */}}
\DoxyCodeLine{228 \};}
\DoxyCodeLine{229 }
\DoxyCodeLine{230 \textcolor{keyword}{enum} osmo\_gsup\_cn\_domain \{}
\DoxyCodeLine{231         OSMO\_GSUP\_CN\_DOMAIN\_PS                    = 1,}
\DoxyCodeLine{232         OSMO\_GSUP\_CN\_DOMAIN\_CS                    = 2,}
\DoxyCodeLine{233 \};}
\DoxyCodeLine{234 }
\DoxyCodeLine{235 \textcolor{keyword}{enum} osmo\_gsup\_imei\_result \{}
\DoxyCodeLine{236         OSMO\_GSUP\_IMEI\_RESULT\_ACK              = 1, \textcolor{comment}{/* on wire: 0 */}}
\DoxyCodeLine{237         OSMO\_GSUP\_IMEI\_RESULT\_NACK            = 2, \textcolor{comment}{/* on wire: 1 */}}
\DoxyCodeLine{238 \};}
\DoxyCodeLine{239 }
\DoxyCodeLine{240 \textcolor{comment}{/* 3GPP 29.002 AccessNetworkProtocolId */}}
\DoxyCodeLine{241 \textcolor{keyword}{enum} osmo\_gsup\_access\_network\_protocol \{}
\DoxyCodeLine{242         OSMO\_GSUP\_ACCESS\_NETWORK\_PROTOCOL\_TS3G\_48006 = 1,}
\DoxyCodeLine{243         OSMO\_GSUP\_ACCESS\_NETWORK\_PROTOCOL\_TS3G\_25413 = 2,}
\DoxyCodeLine{244 \};}
\DoxyCodeLine{245 }
\DoxyCodeLine{247 \textcolor{keyword}{enum} osmo\_gsup\_session\_state \{}
\DoxyCodeLine{249         OSMO\_GSUP\_SESSION\_STATE\_NONE                = 0x00,}
\DoxyCodeLine{251         OSMO\_GSUP\_SESSION\_STATE\_BEGIN              = 0x01,}
\DoxyCodeLine{253         OSMO\_GSUP\_SESSION\_STATE\_CONTINUE        = 0x02,}
\DoxyCodeLine{255         OSMO\_GSUP\_SESSION\_STATE\_END          = 0x03,}
\DoxyCodeLine{256 \};}
\DoxyCodeLine{257 }
\DoxyCodeLine{258 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_session\_state\_names[];}
\DoxyCodeLine{259 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{260 osmo\_gsup\_session\_state\_name(\textcolor{keyword}{enum} osmo\_gsup\_session\_state val)}
\DoxyCodeLine{261 \{       \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_session\_state\_names, val); \}}
\DoxyCodeLine{262 }
\DoxyCodeLine{264 \textcolor{keyword}{struct }osmo\_gsup\_pdp\_info \{}
\DoxyCodeLine{265         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}                    context\_id;}
\DoxyCodeLine{266         \textcolor{keywordtype}{int}                             have\_info;}
\DoxyCodeLine{268         \textcolor{keyword}{union }\{}
\DoxyCodeLine{269                 uint16\_t pdp\_type OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}use pdp\_type\_org and pdp\_type\_nr instead"{}});}
\DoxyCodeLine{270                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{271 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{272                         uint8\_t pdp\_type\_nr; \textcolor{comment}{/* enum gsm48\_pdp\_type\_nr */}}
\DoxyCodeLine{273                         uint8\_t pdp\_type\_org; \textcolor{comment}{/* enum gsm48\_pdp\_type\_org */}}
\DoxyCodeLine{274 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{275                         uint8\_t pdp\_type\_org; \textcolor{comment}{/* enum gsm48\_pdp\_type\_org */}}
\DoxyCodeLine{276                         uint8\_t pdp\_type\_nr; \textcolor{comment}{/* enum gsm48\_pdp\_type\_nr */}}
\DoxyCodeLine{277 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{278                 \};}
\DoxyCodeLine{279         \};}
\DoxyCodeLine{280         \textcolor{keyword}{struct }osmo\_sockaddr               pdp\_address[2];}
\DoxyCodeLine{283         \textcolor{keyword}{const} uint8\_t                   *apn\_enc;}
\DoxyCodeLine{285         \textcolor{keywordtype}{size\_t}                          apn\_enc\_len;}
\DoxyCodeLine{288         \textcolor{keyword}{const} uint8\_t                   *qos\_enc;}
\DoxyCodeLine{290         \textcolor{keywordtype}{size\_t}                          qos\_enc\_len;}
\DoxyCodeLine{293         \textcolor{keyword}{const} uint8\_t                   *pdp\_charg\_enc;}
\DoxyCodeLine{295         \textcolor{keywordtype}{size\_t}                          pdp\_charg\_enc\_len;}
\DoxyCodeLine{296 \};}
\DoxyCodeLine{297 }
\DoxyCodeLine{298 \textcolor{keyword}{enum} osmo\_gsup\_message\_class \{}
\DoxyCodeLine{299         OSMO\_GSUP\_MESSAGE\_CLASS\_UNSET = 0,}
\DoxyCodeLine{300         OSMO\_GSUP\_MESSAGE\_CLASS\_SUBSCRIBER\_MANAGEMENT = 1,}
\DoxyCodeLine{301         OSMO\_GSUP\_MESSAGE\_CLASS\_SMS = 2,}
\DoxyCodeLine{302         OSMO\_GSUP\_MESSAGE\_CLASS\_USSD = 3,}
\DoxyCodeLine{303         OSMO\_GSUP\_MESSAGE\_CLASS\_INTER\_MSC = 4,}
\DoxyCodeLine{304         OSMO\_GSUP\_MESSAGE\_CLASS\_IPSEC\_EPDG = 5,}
\DoxyCodeLine{305         \textcolor{comment}{/* Keep this as last entry with a value of max(enum osmo\_gsup\_message\_class) + 1.}}
\DoxyCodeLine{306 \textcolor{comment}{         * This value shall serve as the size for an array to aid de-\/muxing all known GSUP classes. */}}
\DoxyCodeLine{307         OSMO\_GSUP\_MESSAGE\_CLASS\_ARRAYSIZE}
\DoxyCodeLine{308 \};}
\DoxyCodeLine{309 }
\DoxyCodeLine{310 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gsup\_message\_class\_names[];}
\DoxyCodeLine{311 \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{312 \{ \textcolor{keywordflow}{return} get\_value\_string(osmo\_gsup\_message\_class\_names, val); \}}
\DoxyCodeLine{313 }
\DoxyCodeLine{315 \textcolor{keyword}{struct }osmo\_gsup\_an\_apdu \{}
\DoxyCodeLine{316         \textcolor{comment}{/* AccessNetworkProtocolId as in 3GPP TS 29.002. */}}
\DoxyCodeLine{317         \textcolor{keyword}{enum} osmo\_gsup\_access\_network\_protocol access\_network\_proto;}
\DoxyCodeLine{318         \textcolor{keyword}{const} uint8\_t *data;}
\DoxyCodeLine{319         \textcolor{keywordtype}{size\_t} data\_len;}
\DoxyCodeLine{320 \};}
\DoxyCodeLine{321 }
\DoxyCodeLine{323 \textcolor{keyword}{struct }osmo\_gsup\_message \{}
\DoxyCodeLine{324         \textcolor{keyword}{enum} osmo\_gsup\_message\_type       message\_type;}
\DoxyCodeLine{325         \textcolor{keywordtype}{char}                            imsi[OSMO\_IMSI\_BUF\_SIZE];}
\DoxyCodeLine{326         \textcolor{keyword}{enum} gsm48\_gmm\_cause             cause;}
\DoxyCodeLine{327         \textcolor{keyword}{enum} osmo\_gsup\_cancel\_type cancel\_type;}
\DoxyCodeLine{328         \textcolor{keywordtype}{int}                             pdp\_info\_compl;}
\DoxyCodeLine{329         \textcolor{keywordtype}{int}                             freeze\_ptmsi;}
\DoxyCodeLine{330         \textcolor{keyword}{struct }osmo\_auth\_vector         auth\_vectors[OSMO\_GSUP\_MAX\_NUM\_AUTH\_INFO];}
\DoxyCodeLine{331         \textcolor{keywordtype}{size\_t}                          num\_auth\_vectors;}
\DoxyCodeLine{332         \textcolor{keyword}{struct }osmo\_gsup\_pdp\_info     pdp\_infos[OSMO\_GSUP\_MAX\_NUM\_PDP\_INFO];}
\DoxyCodeLine{333         \textcolor{keywordtype}{size\_t}                          num\_pdp\_infos;}
\DoxyCodeLine{334         \textcolor{keyword}{const} uint8\_t                   *msisdn\_enc;}
\DoxyCodeLine{335         \textcolor{keywordtype}{size\_t}                          msisdn\_enc\_len;}
\DoxyCodeLine{336         \textcolor{keyword}{const} uint8\_t                   *hlr\_enc;}
\DoxyCodeLine{337         \textcolor{keywordtype}{size\_t}                          hlr\_enc\_len;}
\DoxyCodeLine{338         \textcolor{keyword}{const} uint8\_t                   *auts;}
\DoxyCodeLine{339         \textcolor{keyword}{const} uint8\_t                   *rand;}
\DoxyCodeLine{340         \textcolor{keyword}{enum} osmo\_gsup\_cn\_domain     cn\_domain;}
\DoxyCodeLine{341         \textcolor{keyword}{const} uint8\_t                   *pdp\_charg\_enc;}
\DoxyCodeLine{342         \textcolor{keywordtype}{size\_t}                          pdp\_charg\_enc\_len;}
\DoxyCodeLine{343 }
\DoxyCodeLine{345         \textcolor{keyword}{enum} osmo\_gsup\_session\_state     session\_state;}
\DoxyCodeLine{348         uint32\_t                        session\_id;}
\DoxyCodeLine{349 }
\DoxyCodeLine{351         uint8\_t                         *ss\_info;}
\DoxyCodeLine{352         \textcolor{keywordtype}{size\_t}                          ss\_info\_len;}
\DoxyCodeLine{353 }
\DoxyCodeLine{357         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_mr;}
\DoxyCodeLine{359         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_rp\_oda\_t sm\_rp\_da\_type;}
\DoxyCodeLine{360         \textcolor{keywordtype}{size\_t}                          sm\_rp\_da\_len;}
\DoxyCodeLine{361         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_da;}
\DoxyCodeLine{363         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_rp\_oda\_t sm\_rp\_oa\_type;}
\DoxyCodeLine{364         \textcolor{keywordtype}{size\_t}                          sm\_rp\_oa\_len;}
\DoxyCodeLine{365         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_oa;}
\DoxyCodeLine{367         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_ui;}
\DoxyCodeLine{368         \textcolor{keywordtype}{size\_t}                          sm\_rp\_ui\_len;}
\DoxyCodeLine{370         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_cause;}
\DoxyCodeLine{372         \textcolor{keyword}{const} uint8\_t                   *sm\_rp\_mms;}
\DoxyCodeLine{374         \textcolor{keyword}{enum} osmo\_gsup\_sms\_sm\_alert\_rsn\_t   sm\_alert\_rsn;}
\DoxyCodeLine{375 }
\DoxyCodeLine{376         \textcolor{keyword}{const} uint8\_t                   *imei\_enc;}
\DoxyCodeLine{377         \textcolor{keywordtype}{size\_t}                          imei\_enc\_len;}
\DoxyCodeLine{378         \textcolor{keyword}{enum} osmo\_gsup\_imei\_result imei\_result;}
\DoxyCodeLine{379 }
\DoxyCodeLine{383         \textcolor{keyword}{enum} osmo\_gsup\_message\_class             message\_class;}
\DoxyCodeLine{384 }
\DoxyCodeLine{386         \textcolor{keyword}{const} uint8\_t                   *source\_name;}
\DoxyCodeLine{388         \textcolor{keywordtype}{size\_t}                          source\_name\_len;}
\DoxyCodeLine{391         \textcolor{keyword}{const} uint8\_t                   *destination\_name;}
\DoxyCodeLine{393         \textcolor{keywordtype}{size\_t}                          destination\_name\_len;}
\DoxyCodeLine{394 }
\DoxyCodeLine{396         \textcolor{keyword}{struct }osmo\_gsup\_an\_apdu       an\_apdu;}
\DoxyCodeLine{397 }
\DoxyCodeLine{398         uint8\_t                         cause\_rr; }
\DoxyCodeLine{399         \textcolor{keywordtype}{bool}                            cause\_rr\_set; }
\DoxyCodeLine{401         \textcolor{keyword}{enum} gsm0808\_cause         cause\_bssap; }
\DoxyCodeLine{402         \textcolor{keywordtype}{bool}                            cause\_bssap\_set; }
\DoxyCodeLine{405         \textcolor{keyword}{enum} gsm48\_gsm\_cause             cause\_sm;}
\DoxyCodeLine{406 }
\DoxyCodeLine{407         \textcolor{keyword}{enum} osmo\_rat\_type         current\_rat\_type;}
\DoxyCodeLine{408         \textcolor{keyword}{enum} osmo\_rat\_type         supported\_rat\_types[8]; }
\DoxyCodeLine{409         \textcolor{keywordtype}{size\_t}                          supported\_rat\_types\_len;}
\DoxyCodeLine{410 }
\DoxyCodeLine{412         \textcolor{keyword}{const} uint8\_t                   *pco;}
\DoxyCodeLine{414         \textcolor{keywordtype}{size\_t}                          pco\_len;}
\DoxyCodeLine{415 }
\DoxyCodeLine{416 \};}
\DoxyCodeLine{417 }
\DoxyCodeLine{418 \textcolor{keywordtype}{int} osmo\_gsup\_decode(\textcolor{keyword}{const} uint8\_t *data, \textcolor{keywordtype}{size\_t} data\_len,}
\DoxyCodeLine{419                      \textcolor{keyword}{struct} osmo\_gsup\_message *gsup\_msg);}
\DoxyCodeLine{420 \textcolor{keywordtype}{int} osmo\_gsup\_encode(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsup\_message *gsup\_msg);}
\DoxyCodeLine{421 \textcolor{keywordtype}{int} osmo\_gsup\_get\_err\_msg\_type(\textcolor{keyword}{enum} osmo\_gsup\_message\_type type\_in)}
\DoxyCodeLine{422         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use OSMO\_GSUP\_TO\_MSGT\_ERROR() instead"{}});}

\end{DoxyCode}
