\doxysection{gsm\+\_\+49\+\_\+031.\+h}
\label{gsm__49__031_8h_source}\index{include/osmocom/gsm/protocol/gsm\_49\_031.h@{include/osmocom/gsm/protocol/gsm\_49\_031.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{5 \textcolor{comment}{/*}}
\DoxyCodeLine{6 \textcolor{comment}{ * (C) 2020 by sysmocom -\/ s.f.m.c. GmbH <info@sysmocom.de>}}
\DoxyCodeLine{7 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{8 \textcolor{comment}{ *}}
\DoxyCodeLine{9 \textcolor{comment}{ * Author: Neels Hofmeyr <neels@hofmeyr.de>}}
\DoxyCodeLine{10 \textcolor{comment}{ *}}
\DoxyCodeLine{11 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{12 \textcolor{comment}{ *}}
\DoxyCodeLine{13 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{14 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{15 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}}
\DoxyCodeLine{16 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{17 \textcolor{comment}{ *}}
\DoxyCodeLine{18 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{19 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{20 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{21 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{22 \textcolor{comment}{ *}}
\DoxyCodeLine{23 \textcolor{comment}{ */}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{27 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{28 }
\DoxyCodeLine{29 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_48\_071.h>}}
\DoxyCodeLine{31 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_23\_032.h>}}
\DoxyCodeLine{32 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm0808\_utils.h>}}
\DoxyCodeLine{33 \textcolor{preprocessor}{\#include <osmocom/gsm/gsm48.h>}}
\DoxyCodeLine{34 }
\DoxyCodeLine{36 \textcolor{keyword}{enum} lcs\_cause \{}
\DoxyCodeLine{37         LCS\_CAUSE\_UNSPECIFIED = 0,}
\DoxyCodeLine{38         LCS\_CAUSE\_SYSTEM\_FAILURE = 1,}
\DoxyCodeLine{39         LCS\_CAUSE\_PROTOCOL\_ERROR = 2,}
\DoxyCodeLine{40         LCS\_CAUSE\_DATA\_MISSING\_IN\_REQ = 3,}
\DoxyCodeLine{41         LCS\_CAUSE\_UNEXP\_DATA\_IN\_REQ = 4,}
\DoxyCodeLine{42         LCS\_CAUSE\_POS\_METH\_FAILURE = 5,}
\DoxyCodeLine{43         LCS\_CAUSE\_TGT\_MS\_UNREACHABLE = 6,}
\DoxyCodeLine{44         LCS\_CAUSE\_REQUEST\_ABORTED = 7,}
\DoxyCodeLine{45         LCS\_CAUSE\_FACILITY\_NOTSUPP = 8,}
\DoxyCodeLine{46         LCS\_CAUSE\_INTER\_BSC\_HO = 9,}
\DoxyCodeLine{47         LCS\_CAUSE\_INTRA\_BSC\_HO = 10,}
\DoxyCodeLine{48         LCS\_CAUSE\_CONGESTION = 11,}
\DoxyCodeLine{49         LCS\_CAUSE\_INTER\_NSE\_CHG = 12,}
\DoxyCodeLine{50         LCS\_CAUSE\_RA\_UPDAT = 13,}
\DoxyCodeLine{51         LCS\_CAUSE\_PTMSI\_REALLOC = 14,}
\DoxyCodeLine{52         LCS\_CAUSE\_GPRS\_SUSPENSION = 15,}
\DoxyCodeLine{53 \};}
\DoxyCodeLine{54 }
\DoxyCodeLine{56 \textcolor{keyword}{struct }lcs\_cause\_ie \{}
\DoxyCodeLine{57         \textcolor{keywordtype}{bool} present;}
\DoxyCodeLine{58         \textcolor{keyword}{enum} lcs\_cause cause\_val;}
\DoxyCodeLine{59         \textcolor{keywordtype}{bool} diag\_val\_present;}
\DoxyCodeLine{60         uint8\_t diag\_val;}
\DoxyCodeLine{61 \};}
\DoxyCodeLine{62 }
\DoxyCodeLine{63 \textcolor{comment}{/* 3GPP TS 49.031 10.16 LCS QoS IE */}}
\DoxyCodeLine{64 \textcolor{keyword}{struct }osmo\_bssmap\_le\_lcs\_qos \{}
\DoxyCodeLine{65 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{66         uint8\_t vert:1, vel:1, spare1:6;}
\DoxyCodeLine{67         uint8\_t ha\_val:7, ha\_ind:1;}
\DoxyCodeLine{68         uint8\_t va\_val:7, va\_ind:1;}
\DoxyCodeLine{69         uint8\_t spare3:6, rt:2;}
\DoxyCodeLine{70 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{71 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{72         uint8\_t spare1:6, vel:1, vert:1;}
\DoxyCodeLine{73         uint8\_t ha\_ind:1, ha\_val:7;}
\DoxyCodeLine{74         uint8\_t va\_ind:1, va\_val:7;}
\DoxyCodeLine{75         uint8\_t rt:2, spare3:6;}
\DoxyCodeLine{76 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{77 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{78 }
\DoxyCodeLine{79 \textcolor{keyword}{enum} bssap\_le\_msg\_discr \{}
\DoxyCodeLine{80         BSSAP\_LE\_MSG\_DISCR\_BSSMAP\_LE = 0,}
\DoxyCodeLine{81 \};}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{keyword}{enum} bssmap\_le\_msgt \{}
\DoxyCodeLine{84         BSSMAP\_LE\_MSGT\_PERFORM\_LOC\_REQ = 0x2b,}
\DoxyCodeLine{85         BSSMAP\_LE\_MSGT\_PERFORM\_LOC\_RESP = 0x2d,}
\DoxyCodeLine{86         BSSMAP\_LE\_MSGT\_PERFORM\_LOC\_ABORT = 0x2e,}
\DoxyCodeLine{87         BSSMAP\_LE\_MSGT\_PERFORM\_LOC\_INFO = 0x2f,}
\DoxyCodeLine{88         BSSMAP\_LE\_MSGT\_ASSIST\_INFO\_REQ = 0x20,}
\DoxyCodeLine{89         BSSMAP\_LE\_MSGT\_ASSIST\_INFO\_RESP = 0x21,}
\DoxyCodeLine{90         BSSMAP\_LE\_MSGT\_CONN\_ORIENTED\_INFO = 0x2a,}
\DoxyCodeLine{91         BSSMAP\_LE\_MSGT\_CONN\_LESS\_INFO = 0x3a,}
\DoxyCodeLine{92         BSSMAP\_LE\_MSGT\_RESET = 0x30,}
\DoxyCodeLine{93         BSSMAP\_LE\_MSGT\_RESET\_ACK = 0x31,}
\DoxyCodeLine{94 \};}
\DoxyCodeLine{95 }
\DoxyCodeLine{96 \textcolor{keyword}{enum} bssmap\_le\_iei \{}
\DoxyCodeLine{97         BSSMAP\_LE\_IEI\_LCS\_QoS = 0x3e,}
\DoxyCodeLine{98         BSSMAP\_LE\_IEI\_LCS\_PRIORITY = 0x43,}
\DoxyCodeLine{99         BSSMAP\_LE\_IEI\_LOCATION\_TYPE = 0x44,}
\DoxyCodeLine{100         BSSMAP\_LE\_IEI\_GANSS\_LOCATION\_TYPE = 0x82,}
\DoxyCodeLine{101         BSSMAP\_LE\_IEI\_GEO\_LOCATION = 0x45,}
\DoxyCodeLine{102         BSSMAP\_LE\_IEI\_POSITIONING\_DATA = 0x46,}
\DoxyCodeLine{103         BSSMAP\_LE\_IEI\_GANSS\_POS\_DATA = 0x83,}
\DoxyCodeLine{104         BSSMAP\_LE\_IEI\_VELOCITY\_DATA = 0x55,}
\DoxyCodeLine{105         BSSMAP\_LE\_IEI\_LCS\_CAUSE = 0x47,}
\DoxyCodeLine{106         BSSMAP\_LE\_IEI\_LCS\_CLIENT\_TYPE = 0x48,}
\DoxyCodeLine{107         BSSMAP\_LE\_IEI\_APDU = 0x49,}
\DoxyCodeLine{108         BSSMAP\_LE\_IEI\_NET\_ELEM\_ID = 0x4a,}
\DoxyCodeLine{109         BSSMAP\_LE\_IEI\_REQ\_GPS\_ASS\_D = 0x4b,}
\DoxyCodeLine{110         BSSMAP\_LE\_IEI\_REQ\_GANSS\_ASS\_D = 0x41,}
\DoxyCodeLine{111         BSSMAP\_LE\_IEI\_DECIPH\_KEYS = 0x4c,}
\DoxyCodeLine{112         BSSMAP\_LE\_IEI\_RET\_ERR\_REQ = 0x4d,}
\DoxyCodeLine{113         BSSMAP\_LE\_IEI\_RET\_ERR\_CAUSE = 0x4e,}
\DoxyCodeLine{114         BSSMAP\_LE\_IEI\_SEGMENTATION = 0x4f,}
\DoxyCodeLine{115         BSSMAP\_LE\_IEI\_CLASSMARK3\_INFO = 0x13,}
\DoxyCodeLine{116         BSSMAP\_LE\_IEI\_CAUSE = 0x4,}
\DoxyCodeLine{117         BSSMAP\_LE\_IEI\_CELL\_ID = 0x5,}
\DoxyCodeLine{118         BSSMAP\_LE\_IEI\_CHOSEN\_CHAN = 0x21,}
\DoxyCodeLine{119         BSSMAP\_LE\_IEI\_IMSI = 0x0,}
\DoxyCodeLine{120         BSSMAP\_LE\_IEI\_LCS\_CAPABILITY = 0x50,}
\DoxyCodeLine{121         BSSMAP\_LE\_IEI\_PKT\_MEAS\_REP = 0x51,}
\DoxyCodeLine{122         BSSMAP\_LE\_IEI\_CELL\_ID\_LIST = 0x52,}
\DoxyCodeLine{123         BSSMAP\_LE\_IEI\_IMEI = 0x80,}
\DoxyCodeLine{124         BSSMAP\_LE\_IEI\_BSS\_MLAT\_CAP = 0x84,}
\DoxyCodeLine{125         BSSMAP\_LE\_IEI\_CELL\_INFO\_LIST = 0x85,}
\DoxyCodeLine{126         BSSMAP\_LE\_IEI\_BTS\_RX\_ACC\_LVL = 0x86,}
\DoxyCodeLine{127         BSSMAP\_LE\_IEI\_MLAT\_METHOD = 0x87,}
\DoxyCodeLine{128         BSSMAP\_LE\_IEI\_MLAT\_TA = 0x88,}
\DoxyCodeLine{129         BSSMAP\_LE\_IEI\_MS\_SYNC\_ACC = 0x89,}
\DoxyCodeLine{130         BSSMAP\_LE\_IEI\_SHORT\_ID\_SET = 0x8a,}
\DoxyCodeLine{131         BSSMAP\_LE\_IEI\_RANDOM\_ID\_SET = 0x8b,}
\DoxyCodeLine{132         BSSMAP\_LE\_IEI\_SHORT\_BSS\_ID = 0x8c,}
\DoxyCodeLine{133         BSSMAP\_LE\_IEI\_RANDOM\_ID = 0x8d,}
\DoxyCodeLine{134         BSSMAP\_LE\_IEI\_SHORT\_ID = 0x8e,}
\DoxyCodeLine{135         BSSMAP\_LE\_IEI\_COVERAGE\_CLASS = 0x8f,}
\DoxyCodeLine{136         BSSMAP\_LE\_IEI\_MTA\_ACC\_SEC\_RQD = 0x90,}
\DoxyCodeLine{137 \};}
\DoxyCodeLine{138 }
\DoxyCodeLine{139 \textcolor{keyword}{enum} bssmap\_le\_apdu\_proto \{}
\DoxyCodeLine{140         BSSMAP\_LE\_APDU\_PROT\_RESERVED = 0,}
\DoxyCodeLine{141         BSSMAP\_LE\_APDU\_PROT\_BSSLAP = 1,}
\DoxyCodeLine{142         BSSMAP\_LE\_APDU\_PROT\_LLP = 2,}
\DoxyCodeLine{143         BSSMAP\_LE\_APDU\_PROT\_SMLCPP = 3,}
\DoxyCodeLine{144 \};}
\DoxyCodeLine{145 }
\DoxyCodeLine{146 \textcolor{keyword}{enum} bssmap\_le\_location\_information \{}
\DoxyCodeLine{147         BSSMAP\_LE\_LOC\_INFO\_CURRENT\_GEOGRAPHIC = 0x0,}
\DoxyCodeLine{148         BSSMAP\_LE\_LOC\_INFO\_ASSIST\_TARGET\_MS = 0x1,}
\DoxyCodeLine{149         BSSMAP\_LE\_LOC\_INFO\_BC\_DECIPHER\_KEYS = 0x2,}
\DoxyCodeLine{150 \};}
\DoxyCodeLine{151 }
\DoxyCodeLine{152 \textcolor{keyword}{enum} bssmap\_le\_positioning\_method \{}
\DoxyCodeLine{153         BSSMAP\_LE\_POS\_METHOD\_OMITTED = 0x0,}
\DoxyCodeLine{154         BSSMAP\_LE\_POS\_METHOD\_MOBILE\_ASSISTED\_E\_OTD = 0x1,}
\DoxyCodeLine{155         BSSMAP\_LE\_POS\_METHOD\_MOBILE\_BASED\_E\_OTD = 0x2,}
\DoxyCodeLine{156         BSSMAP\_LE\_POS\_METHOD\_ASSISTED\_GPS = 0x3,}
\DoxyCodeLine{157 \};}
\DoxyCodeLine{158 }
\DoxyCodeLine{159 \textcolor{keyword}{struct }bssmap\_le\_location\_type \{}
\DoxyCodeLine{160         \textcolor{keyword}{enum} bssmap\_le\_location\_information location\_information;}
\DoxyCodeLine{161         \textcolor{keyword}{enum} bssmap\_le\_positioning\_method positioning\_method;}
\DoxyCodeLine{162 \};}
\DoxyCodeLine{163 }
\DoxyCodeLine{164 \textcolor{keyword}{enum} bssmap\_le\_lcs\_client\_type \{}
\DoxyCodeLine{165         BSSMAP\_LE\_LCS\_CTYPE\_VALUE\_ADDED\_UNSPECIFIED = 0x0,}
\DoxyCodeLine{166         BSSMAP\_LE\_LCS\_CTYPE\_PLMN\_OPER\_UNSPECIFIED = 0x20,}
\DoxyCodeLine{167         BSSMAP\_LE\_LCS\_CTYPE\_PLMN\_OPER\_BCAST\_SERVICE = 0x21,}
\DoxyCodeLine{168         BSSMAP\_LE\_LCS\_CTYPE\_PLMN\_OPER\_OAM = 0x22,}
\DoxyCodeLine{169         BSSMAP\_LE\_LCS\_CTYPE\_PLMN\_OPER\_ANON\_STATS = 0x23,}
\DoxyCodeLine{170         BSSMAP\_LE\_LCS\_CTYPE\_PLMN\_OPER\_TGT\_MS\_SVC = 0x24,}
\DoxyCodeLine{171         BSSMAP\_LE\_LCS\_CTYPE\_EMERG\_SVC\_UNSPECIFIED = 0x30,}
\DoxyCodeLine{172         BSSMAP\_LE\_LCS\_CTYPE\_LI\_UNSPECIFIED = 0x40,}
\DoxyCodeLine{173 \};}
\DoxyCodeLine{174 }
\DoxyCodeLine{175 \textcolor{keyword}{struct }bssmap\_le\_perform\_loc\_req \{}
\DoxyCodeLine{176         \textcolor{keyword}{struct }bssmap\_le\_location\_type location\_type;}
\DoxyCodeLine{177         \textcolor{keyword}{struct }gsm0808\_cell\_id cell\_id;}
\DoxyCodeLine{178 }
\DoxyCodeLine{179         \textcolor{keywordtype}{bool} lcs\_client\_type\_present;}
\DoxyCodeLine{180         \textcolor{keyword}{enum} bssmap\_le\_lcs\_client\_type lcs\_client\_type;}
\DoxyCodeLine{181 }
\DoxyCodeLine{182         \textcolor{keyword}{struct }osmo\_mobile\_identity imsi;}
\DoxyCodeLine{183         \textcolor{keyword}{struct }osmo\_mobile\_identity imei;}
\DoxyCodeLine{184 }
\DoxyCodeLine{185         \textcolor{keywordtype}{bool} apdu\_present;}
\DoxyCodeLine{186         \textcolor{keyword}{struct }bsslap\_pdu apdu;}
\DoxyCodeLine{187 }
\DoxyCodeLine{188         \textcolor{keywordtype}{bool} more\_items; }
\DoxyCodeLine{190         \textcolor{keywordtype}{bool} lcs\_priority\_present;}
\DoxyCodeLine{191         uint8\_t lcs\_priority; }
\DoxyCodeLine{193         \textcolor{keywordtype}{bool} lcs\_qos\_present;}
\DoxyCodeLine{194         \textcolor{keyword}{struct }osmo\_bssmap\_le\_lcs\_qos lcs\_qos;}
\DoxyCodeLine{195 }
\DoxyCodeLine{196         \textcolor{keywordtype}{bool} more\_items2; }
\DoxyCodeLine{197 \};}
\DoxyCodeLine{198 }
\DoxyCodeLine{199 \textcolor{keyword}{struct }bssmap\_le\_perform\_loc\_resp \{}
\DoxyCodeLine{200         \textcolor{keywordtype}{bool} location\_estimate\_present;}
\DoxyCodeLine{201         \textcolor{keyword}{union }gad\_raw location\_estimate;}
\DoxyCodeLine{202 }
\DoxyCodeLine{203         \textcolor{keyword}{struct }lcs\_cause\_ie lcs\_cause;}
\DoxyCodeLine{204 }
\DoxyCodeLine{205         \textcolor{keywordtype}{bool} more\_items; }
\DoxyCodeLine{206 \};}
\DoxyCodeLine{207 }
\DoxyCodeLine{208 \textcolor{keyword}{struct }bssmap\_le\_conn\_oriented\_info \{}
\DoxyCodeLine{209         \textcolor{keyword}{struct }bsslap\_pdu apdu;}
\DoxyCodeLine{210 }
\DoxyCodeLine{211         \textcolor{keywordtype}{bool} more\_items; }
\DoxyCodeLine{212 \};}
\DoxyCodeLine{213 }
\DoxyCodeLine{214 \textcolor{keyword}{struct }bssmap\_le\_pdu \{}
\DoxyCodeLine{215         \textcolor{keyword}{enum} bssmap\_le\_msgt msg\_type;}
\DoxyCodeLine{216         \textcolor{keyword}{union }\{}
\DoxyCodeLine{217                 \textcolor{keyword}{enum} gsm0808\_cause reset;}
\DoxyCodeLine{218                 \textcolor{comment}{/* reset\_ack consists only of the message type */}}
\DoxyCodeLine{219                 \textcolor{keyword}{struct }bssmap\_le\_perform\_loc\_req perform\_loc\_req;}
\DoxyCodeLine{220                 \textcolor{keyword}{struct }bssmap\_le\_perform\_loc\_resp perform\_loc\_resp;}
\DoxyCodeLine{221                 \textcolor{keyword}{struct }lcs\_cause\_ie perform\_loc\_abort;}
\DoxyCodeLine{222                 \textcolor{keyword}{struct }bssmap\_le\_conn\_oriented\_info conn\_oriented\_info;}
\DoxyCodeLine{223         \};}
\DoxyCodeLine{224 \};}
\DoxyCodeLine{225 }
\DoxyCodeLine{226 \textcolor{keyword}{struct }bssap\_le\_pdu \{}
\DoxyCodeLine{227         \textcolor{keyword}{enum} bssap\_le\_msg\_discr discr;}
\DoxyCodeLine{228         \textcolor{keyword}{union }\{}
\DoxyCodeLine{229                 \textcolor{keyword}{struct }bssmap\_le\_pdu bssmap\_le;}
\DoxyCodeLine{230                 \textcolor{comment}{/* future: add DTAP PDU, currently not implemented */}}
\DoxyCodeLine{231         \};}
\DoxyCodeLine{232 \};}
\DoxyCodeLine{233 }

\end{DoxyCode}
