\doxysection{gsm\+\_\+29\+\_\+118.\+h}
\label{gsm__29__118_8h_source}\index{include/osmocom/gsm/protocol/gsm\_29\_118.h@{include/osmocom/gsm/protocol/gsm\_29\_118.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{comment}{/* TS 29.118 Section 9.2 */}}
\DoxyCodeLine{6 \textcolor{keyword}{enum} sgsap\_msg\_type \{}
\DoxyCodeLine{7         \textcolor{comment}{/* unassigned */}}
\DoxyCodeLine{8         SGSAP\_MSGT\_PAGING\_REQ                      = 0x01,}
\DoxyCodeLine{9         SGSAP\_MSGT\_PAGING\_REJ                      = 0x02,}
\DoxyCodeLine{10         \textcolor{comment}{/* unassigned */}}
\DoxyCodeLine{11         SGSAP\_MSGT\_SERVICE\_REQ                    = 0x06,}
\DoxyCodeLine{12         SGSAP\_MSGT\_DL\_UD                        = 0x07,}
\DoxyCodeLine{13         SGSAP\_MSGT\_UL\_UD                        = 0x08,}
\DoxyCodeLine{14         SGSAP\_MSGT\_LOC\_UPD\_REQ                    = 0x09,}
\DoxyCodeLine{15         SGSAP\_MSGT\_LOC\_UPD\_ACK                    = 0x0a,}
\DoxyCodeLine{16         SGSAP\_MSGT\_LOC\_UPD\_REJ                    = 0x0b,}
\DoxyCodeLine{17         SGSAP\_MSGT\_TMSI\_REALL\_CMPL            = 0x0c,}
\DoxyCodeLine{18         SGSAP\_MSGT\_ALERT\_REQ                        = 0x0d,}
\DoxyCodeLine{19         SGSAP\_MSGT\_ALERT\_ACK                        = 0x0e,}
\DoxyCodeLine{20         SGSAP\_MSGT\_ALERT\_REJ                        = 0x0f,}
\DoxyCodeLine{21         SGSAP\_MSGT\_UE\_ACT\_IND                      = 0x10,}
\DoxyCodeLine{22         SGSAP\_MSGT\_EPS\_DET\_IND                    = 0x11,}
\DoxyCodeLine{23         SGSAP\_MSGT\_EPS\_DET\_ACK                    = 0x12,}
\DoxyCodeLine{24         SGSAP\_MSGT\_IMSI\_DET\_IND                  = 0x13,}
\DoxyCodeLine{25         SGSAP\_MSGT\_IMSI\_DET\_ACK                  = 0x14,}
\DoxyCodeLine{26         SGSAP\_MSGT\_RESET\_IND                        = 0x15,}
\DoxyCodeLine{27         SGSAP\_MSGT\_RESET\_ACK                        = 0x16,}
\DoxyCodeLine{28         SGSAP\_MSGT\_SERVICE\_ABORT\_REQ                = 0x17,}
\DoxyCodeLine{29         SGSAP\_MSGT\_MO\_CSFB\_IND                    = 0x18,}
\DoxyCodeLine{30         \textcolor{comment}{/* unassigned */}}
\DoxyCodeLine{31         SGSAP\_MSGT\_MM\_INFO\_REQ                    = 0x1a,}
\DoxyCodeLine{32         SGSAP\_MSGT\_RELEASE\_REQ                    = 0x1b,}
\DoxyCodeLine{33         \textcolor{comment}{/* unassigned */}}
\DoxyCodeLine{34         SGSAP\_MSGT\_STATUS                      = 0x1d,}
\DoxyCodeLine{35         \textcolor{comment}{/* unassigned */}}
\DoxyCodeLine{36         SGSAP\_MSGT\_UE\_UNREACHABLE              = 0x1f,}
\DoxyCodeLine{37 \};}
\DoxyCodeLine{38 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_msg\_type\_names[];}
\DoxyCodeLine{39 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_msg\_type\_name(\textcolor{keyword}{enum} sgsap\_msg\_type msgt) \{}
\DoxyCodeLine{40         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_msg\_type\_names, msgt);}
\DoxyCodeLine{41 \}}
\DoxyCodeLine{42 }
\DoxyCodeLine{43 \textcolor{comment}{/* TS 29.118 Section 9.3 */}}
\DoxyCodeLine{44 \textcolor{keyword}{enum} sgsap\_iei \{}
\DoxyCodeLine{45         SGSAP\_IE\_IMSI                              = 0x01,}
\DoxyCodeLine{46         SGSAP\_IE\_VLR\_NAME                      = 0x02,}
\DoxyCodeLine{47         SGSAP\_IE\_TMSI                              = 0x03,}
\DoxyCodeLine{48         SGSAP\_IE\_LAI                                = 0x04,}
\DoxyCodeLine{49         SGSAP\_IE\_CHAN\_NEEDED                        = 0x05,}
\DoxyCodeLine{50         SGSAP\_IE\_EMLPP\_PRIORITY                  = 0x06,}
\DoxyCodeLine{51         SGSAP\_IE\_TMSI\_STATUS                        = 0x07,}
\DoxyCodeLine{52         SGSAP\_IE\_SGS\_CAUSE                    = 0x08,}
\DoxyCodeLine{53         SGSAP\_IE\_MME\_NAME                      = 0x09,}
\DoxyCodeLine{54         SGSAP\_IE\_EPS\_LU\_TYPE                        = 0x0a,}
\DoxyCodeLine{55         SGSAP\_IE\_GLOBAL\_CN\_ID                      = 0x0b,}
\DoxyCodeLine{56         SGSAP\_IE\_MOBILE\_ID                    = 0x0e,}
\DoxyCodeLine{57         SGSAP\_IE\_REJECT\_CAUSE                      = 0x0f,}
\DoxyCodeLine{58         SGSAP\_IE\_IMSI\_DET\_EPS\_TYPE            = 0x10,}
\DoxyCodeLine{59         SGSAP\_IE\_IMSI\_DET\_NONEPS\_TYPE              = 0x11,}
\DoxyCodeLine{60         SGSAP\_IE\_IMEISV                          = 0x15,}
\DoxyCodeLine{61         SGSAP\_IE\_NAS\_MSG\_CONTAINER            = 0x16,}
\DoxyCodeLine{62         SGSAP\_IE\_MM\_INFO                        = 0x17,}
\DoxyCodeLine{63         SGSAP\_IE\_ERR\_MSG                        = 0x1b,}
\DoxyCodeLine{64         SGSAP\_IE\_CLI                                = 0x1c,}
\DoxyCodeLine{65         SGSAP\_IE\_LCS\_CLIENT\_ID                    = 0x1d,}
\DoxyCodeLine{66         SGSAP\_IE\_LCS\_INDICATOR                    = 0x1e,}
\DoxyCodeLine{67         SGSAP\_IE\_SS\_CODE                        = 0x1f,}
\DoxyCodeLine{68         SGSAP\_IE\_SERVICE\_INDICATOR            = 0x20,}
\DoxyCodeLine{69         SGSAP\_IE\_UE\_TIMEZONE                        = 0x21,}
\DoxyCodeLine{70         SGSAP\_IE\_MS\_CLASSMARK2                    = 0x22,}
\DoxyCodeLine{71         SGSAP\_IE\_TAI                                = 0x23,}
\DoxyCodeLine{72         SGSAP\_IE\_EUTRAN\_CGI                  = 0x24,}
\DoxyCodeLine{73         SGSAP\_IE\_UE\_EMM\_MODE                        = 0x25,}
\DoxyCodeLine{74         SGSAP\_IE\_ADDL\_PAGING\_INDICATORS          = 0x26,}
\DoxyCodeLine{75         SGSAP\_IE\_TMSI\_BASED\_NRI\_CONT                = 0x27,}
\DoxyCodeLine{76         SGSAP\_IE\_MO\_FALLBACK\_VALUE            = 0xf1,}
\DoxyCodeLine{77 \};}
\DoxyCodeLine{78 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_iei\_names[];}
\DoxyCodeLine{79 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_iei\_name(\textcolor{keyword}{enum} sgsap\_iei iei) \{}
\DoxyCodeLine{80         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_iei\_names, iei);}
\DoxyCodeLine{81 \}}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{comment}{/* TS 29.118 Section 9.4.2 */}}
\DoxyCodeLine{84 \textcolor{keyword}{enum} sgsap\_eps\_lu\_type \{}
\DoxyCodeLine{85         SGSAP\_EPS\_LUT\_IMSI\_ATTACH              = 0x01,}
\DoxyCodeLine{86         SGSAP\_EPS\_LUT\_NORMAL                        = 0x02,}
\DoxyCodeLine{87 \};}
\DoxyCodeLine{88 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_eps\_lu\_type\_names[];}
\DoxyCodeLine{89 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_eps\_lu\_type\_name(\textcolor{keyword}{enum} sgsap\_eps\_lu\_type lut) \{}
\DoxyCodeLine{90         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_eps\_lu\_type\_names, lut);}
\DoxyCodeLine{91 \}}
\DoxyCodeLine{92 }
\DoxyCodeLine{93 \textcolor{comment}{/* TS 29.118 Section 9.4.7 */}}
\DoxyCodeLine{94 \textcolor{keyword}{enum} sgsap\_imsi\_det\_eps\_type \{}
\DoxyCodeLine{95         SGSAP\_ID\_EPS\_T\_NETWORK\_INITIATED        = 0x01,}
\DoxyCodeLine{96         SGSAP\_ID\_EPS\_T\_UE\_INITIATED          = 0x02,}
\DoxyCodeLine{97         SGSAP\_ID\_EPS\_T\_EPS\_NOT\_ALLOWED            = 0x03,}
\DoxyCodeLine{98 \};}
\DoxyCodeLine{99 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_ismi\_det\_eps\_type\_names[];}
\DoxyCodeLine{100 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_imsi\_det\_eps\_type\_name(\textcolor{keyword}{enum} sgsap\_imsi\_det\_eps\_type idt) \{}
\DoxyCodeLine{101         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_ismi\_det\_eps\_type\_names, idt);}
\DoxyCodeLine{102 \}}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{comment}{/* TS 29.118 Section 9.4.8 */}}
\DoxyCodeLine{105 \textcolor{keyword}{enum} sgsap\_imsi\_det\_noneps\_type \{}
\DoxyCodeLine{106         SGSAP\_ID\_NONEPS\_T\_EXPLICIT\_UE\_NONEPS                = 0x01,}
\DoxyCodeLine{107         SGSAP\_ID\_NONEPS\_T\_COMBINED\_UE\_EPS\_NONEPS        = 0x02,}
\DoxyCodeLine{108         SGSAP\_ID\_NONEPS\_T\_IMPLICIT\_UE\_EPS\_NONEPS        = 0x03,}
\DoxyCodeLine{109 \};}
\DoxyCodeLine{110 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_ismi\_det\_noneps\_type\_names[];}
\DoxyCodeLine{111 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_imsi\_det\_noneps\_type\_name(\textcolor{keyword}{enum} sgsap\_imsi\_det\_noneps\_type idt) \{}
\DoxyCodeLine{112         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_ismi\_det\_noneps\_type\_names, idt);}
\DoxyCodeLine{113 \}}
\DoxyCodeLine{114 }
\DoxyCodeLine{115 \textcolor{comment}{/* TS 29.118 Section 9.4.17 */}}
\DoxyCodeLine{116 \textcolor{keyword}{enum} sgsap\_service\_ind \{}
\DoxyCodeLine{117         SGSAP\_SERV\_IND\_CS\_CALL            = 0x01,}
\DoxyCodeLine{118         SGSAP\_SERV\_IND\_SMS            = 0x02,}
\DoxyCodeLine{119         SGSAP\_SERV\_IND\_PAGING\_TIMEOUT      = 0xfe, \textcolor{comment}{/* Osmocom specific to drop the paging */}}
\DoxyCodeLine{120 \};}
\DoxyCodeLine{121 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_service\_ind\_names[];}
\DoxyCodeLine{122 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_service\_ind\_name(\textcolor{keyword}{enum} sgsap\_service\_ind si) \{}
\DoxyCodeLine{123         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_service\_ind\_names, si);}
\DoxyCodeLine{124 \}}
\DoxyCodeLine{125 }
\DoxyCodeLine{126 \textcolor{comment}{/* TS 29.118 Section 9.4.18 */}}
\DoxyCodeLine{127 \textcolor{keyword}{enum} sgsap\_sgs\_cause \{}
\DoxyCodeLine{128         SGSAP\_SGS\_CAUSE\_IMSI\_DET\_EPS                = 0x01,}
\DoxyCodeLine{129         SGSAP\_SGS\_CAUSE\_IMSI\_DET\_EPS\_NONEPS  = 0x02,}
\DoxyCodeLine{130         SGSAP\_SGS\_CAUSE\_IMSI\_UNKNOWN                = 0x03,}
\DoxyCodeLine{131         SGSAP\_SGS\_CAUSE\_IMSI\_DET\_NON\_EPS        = 0x04,}
\DoxyCodeLine{132         SGSAP\_SGS\_CAUSE\_IMSI\_IMPL\_DET\_NON\_EPS      = 0x05,}
\DoxyCodeLine{133         SGSAP\_SGS\_CAUSE\_UE\_UNREACHABLE            = 0x06,}
\DoxyCodeLine{134         SGSAP\_SGS\_CAUSE\_MSG\_INCOMP\_STATE        = 0x07,}
\DoxyCodeLine{135         SGSAP\_SGS\_CAUSE\_MISSING\_MAND\_IE          = 0x08,}
\DoxyCodeLine{136         SGSAP\_SGS\_CAUSE\_INVALID\_MAND\_IE          = 0x09,}
\DoxyCodeLine{137         SGSAP\_SGS\_CAUSE\_COND\_IE\_ERROR              = 0x0a,}
\DoxyCodeLine{138         SGSAP\_SGS\_CAUSE\_SEMANT\_INCORR\_MSG      = 0x0b,}
\DoxyCodeLine{139         SGSAP\_SGS\_CAUSE\_MSG\_UNKNOWN          = 0x0c,}
\DoxyCodeLine{140         SGSAP\_SGS\_CAUSE\_MT\_CSFB\_REJ\_USER        = 0x0d,}
\DoxyCodeLine{141         SGSAP\_SGS\_CAUSE\_UE\_TEMP\_UNREACHABLE  = 0x0e,}
\DoxyCodeLine{142 \};}
\DoxyCodeLine{143 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_sgs\_cause\_names[];}
\DoxyCodeLine{144 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_sgs\_cause\_name(\textcolor{keyword}{enum} sgsap\_sgs\_cause cause) \{}
\DoxyCodeLine{145         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_sgs\_cause\_names, cause);}
\DoxyCodeLine{146 \}}
\DoxyCodeLine{147 }
\DoxyCodeLine{148 \textcolor{comment}{/* TS 29.118 Section 9.4.21c */}}
\DoxyCodeLine{149 \textcolor{keyword}{enum} sgsap\_ue\_emm\_mode \{}
\DoxyCodeLine{150         SGSAP\_UE\_EMM\_MODE\_IDLE                    = 0x00,}
\DoxyCodeLine{151         SGSAP\_UE\_EMM\_MODE\_CONNECTED          = 0x01,}
\DoxyCodeLine{152 \};}
\DoxyCodeLine{153 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string sgsap\_ue\_emm\_mode\_names[];}
\DoxyCodeLine{154 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sgsap\_ue\_emm\_mode\_name(\textcolor{keyword}{enum} sgsap\_ue\_emm\_mode mode) \{}
\DoxyCodeLine{155         \textcolor{keywordflow}{return} get\_value\_string(sgsap\_ue\_emm\_mode\_names, mode);}
\DoxyCodeLine{156 \}}
\DoxyCodeLine{157 }
\DoxyCodeLine{158 \textcolor{comment}{/* TS 29.118 Section 10.1 Table 10.1.2 */}}
\DoxyCodeLine{159 \textcolor{preprocessor}{\#define SGS\_TS5\_DEFAULT         10      }\textcolor{comment}{/* Guards the Paging Procedure at the VLR */}\textcolor{preprocessor}{}}
\DoxyCodeLine{160 \textcolor{preprocessor}{\#define SGS\_TS6\_2\_DEFAULT       40      }\textcolor{comment}{/* Guards the TMSI reallocation procedure */}\textcolor{preprocessor}{}}
\DoxyCodeLine{161 \textcolor{preprocessor}{\#define SGS\_TS7\_DEFAULT          4      }\textcolor{comment}{/* Guards the non-\/EPS alert procedure */}\textcolor{preprocessor}{}}
\DoxyCodeLine{162 \textcolor{preprocessor}{\#define SGS\_TS11\_DEFAULT         4      }\textcolor{comment}{/* Guards the VLR reset procedure */}\textcolor{preprocessor}{}}
\DoxyCodeLine{163 \textcolor{preprocessor}{\#define SGS\_TS14\_DEFAULT        10      }\textcolor{comment}{/* Guards the UE fallback to UTRAN/GERAN */}\textcolor{preprocessor}{}}
\DoxyCodeLine{164 \textcolor{preprocessor}{\#define SGS\_TS15\_DEFAULT        10      }\textcolor{comment}{/* Guards the MO UE fallback to UTRAN/GERAN */}\textcolor{preprocessor}{}}
\DoxyCodeLine{165 }
\DoxyCodeLine{166 \textcolor{comment}{/* TS 29.118 Section 10.2 Table 10.2.1 */}}
\DoxyCodeLine{167 \textcolor{preprocessor}{\#define SGS\_NS7\_DEFAULT         2}}
\DoxyCodeLine{168 \textcolor{preprocessor}{\#define SGS\_NS11\_DEFAULT        2}}
\DoxyCodeLine{169 \textcolor{comment}{/* TS 29.118 Section 10.2 Table 10.2.2 */}}
\DoxyCodeLine{170 \textcolor{preprocessor}{\#define SGS\_NS8\_DEFAULT         2}}
\DoxyCodeLine{171 \textcolor{preprocessor}{\#define SGS\_NS9\_DEFAULT         2}}
\DoxyCodeLine{172 \textcolor{preprocessor}{\#define SGS\_NS10\_DEFAULT        2}}
\DoxyCodeLine{173 \textcolor{preprocessor}{\#define SGS\_NS12\_DEFAULT        2}}
\DoxyCodeLine{174 }
\DoxyCodeLine{175 \textcolor{comment}{/* TS 29.118 Section 6.3 */}}
\DoxyCodeLine{176 \textcolor{preprocessor}{\#define SGS\_PORT\_DEFAULT 29118}}
\DoxyCodeLine{177 }
\DoxyCodeLine{178 \textcolor{comment}{/* TS 29.118 Section 9.4.13 MME Name */}}
\DoxyCodeLine{179 \textcolor{preprocessor}{\#define SGS\_MME\_NAME\_LEN 55}}
\DoxyCodeLine{180 }
\DoxyCodeLine{181 \textcolor{comment}{/* TS 29.118 Section 9.4.22 VLR name}}
\DoxyCodeLine{182 \textcolor{comment}{ * See also: RFC1123 Section 2.1 Host Names and Numbers */}}
\DoxyCodeLine{183 \textcolor{preprocessor}{\#define SGS\_VLR\_NAME\_MAXLEN 255}}
\DoxyCodeLine{184 }
\DoxyCodeLine{185 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }tlv\_definition sgsap\_ie\_tlvdef;}

\end{DoxyCode}
