blob: 06fcbced4bf05b4011b2800e8288015b97493a54 [file] [log] [blame]
Neels Hofmeyrc6848f42020-09-18 18:00:50 +02001/*! \defgroup bssmap_le 3GPP TS 49.031 BSSMAP-LE.
2 * @{
3 * \file gsm_49_031.h
4 */
5/*
6 * (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
7 * All Rights Reserved
8 *
9 * Author: Neels Hofmeyr <neels@hofmeyr.de>
10 *
11 * SPDX-License-Identifier: GPL-2.0+
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
Neels Hofmeyrc6848f42020-09-18 18:00:50 +020023 */
24#pragma once
25
26#include <stdint.h>
27#include <stdbool.h>
Neels Hofmeyr02de87b2020-09-18 18:00:50 +020028#include <osmocom/gsm/protocol/gsm_48_071.h>
29#include <osmocom/gsm/protocol/gsm_23_032.h>
30#include <osmocom/gsm/gsm0808_utils.h>
31#include <osmocom/gsm/gsm48.h>
Neels Hofmeyrc6848f42020-09-18 18:00:50 +020032
33/*! 3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former. */
34enum lcs_cause {
35 LCS_CAUSE_UNSPECIFIED = 0,
36 LCS_CAUSE_SYSTEM_FAILURE = 1,
37 LCS_CAUSE_PROTOCOL_ERROR = 2,
38 LCS_CAUSE_DATA_MISSING_IN_REQ = 3,
39 LCS_CAUSE_UNEXP_DATA_IN_REQ = 4,
40 LCS_CAUSE_POS_METH_FAILURE = 5,
41 LCS_CAUSE_TGT_MS_UNREACHABLE = 6,
42 LCS_CAUSE_REQUEST_ABORTED = 7,
43 LCS_CAUSE_FACILITY_NOTSUPP = 8,
44 LCS_CAUSE_INTER_BSC_HO = 9,
45 LCS_CAUSE_INTRA_BSC_HO = 10,
46 LCS_CAUSE_CONGESTION = 11,
47 LCS_CAUSE_INTER_NSE_CHG = 12,
48 LCS_CAUSE_RA_UPDAT = 13,
49 LCS_CAUSE_PTMSI_REALLOC = 14,
50 LCS_CAUSE_GPRS_SUSPENSION = 15,
51};
52
53/*! 3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former. */
54struct lcs_cause_ie {
55 bool present;
56 enum lcs_cause cause_val;
57 bool diag_val_present;
58 uint8_t diag_val;
59};
60
Neels Hofmeyr02de87b2020-09-18 18:00:50 +020061enum bssap_le_msg_discr {
62 BSSAP_LE_MSG_DISCR_BSSMAP_LE = 0,
63};
64
65enum bssmap_le_msgt {
66 BSSMAP_LE_MSGT_PERFORM_LOC_REQ = 0x2b,
67 BSSMAP_LE_MSGT_PERFORM_LOC_RESP = 0x2d,
68 BSSMAP_LE_MSGT_PERFORM_LOC_ABORT = 0x2e,
69 BSSMAP_LE_MSGT_PERFORM_LOC_INFO = 0x2f,
70 BSSMAP_LE_MSGT_ASSIST_INFO_REQ = 0x20,
71 BSSMAP_LE_MSGT_ASSIST_INFO_RESP = 0x21,
72 BSSMAP_LE_MSGT_CONN_ORIENTED_INFO = 0x2a,
73 BSSMAP_LE_MSGT_CONN_LESS_INFO = 0x3a,
74 BSSMAP_LE_MSGT_RESET = 0x30,
75 BSSMAP_LE_MSGT_RESET_ACK = 0x31,
76};
77
78enum bssmap_le_iei {
79 BSSMAP_LE_IEI_LCS_QoS = 0x3e,
80 BSSMAP_LE_IEI_LCS_PRIORITY = 0x43,
81 BSSMAP_LE_IEI_LOCATION_TYPE = 0x44,
82 BSSMAP_LE_IEI_GANSS_LOCATION_TYPE = 0x82,
83 BSSMAP_LE_IEI_GEO_LOCATION = 0x45,
84 BSSMAP_LE_IEI_POSITIONING_DATA = 0x46,
85 BSSMAP_LE_IEI_GANSS_POS_DATA = 0x83,
86 BSSMAP_LE_IEI_VELOCITY_DATA = 0x55,
87 BSSMAP_LE_IEI_LCS_CAUSE = 0x47,
88 BSSMAP_LE_IEI_LCS_CLIENT_TYPE = 0x48,
89 BSSMAP_LE_IEI_APDU = 0x49,
90 BSSMAP_LE_IEI_NET_ELEM_ID = 0x4a,
91 BSSMAP_LE_IEI_REQ_GPS_ASS_D = 0x4b,
92 BSSMAP_LE_IEI_REQ_GANSS_ASS_D = 0x41,
93 BSSMAP_LE_IEI_DECIPH_KEYS = 0x4c,
94 BSSMAP_LE_IEI_RET_ERR_REQ = 0x4d,
95 BSSMAP_LE_IEI_RET_ERR_CAUSE = 0x4e,
96 BSSMAP_LE_IEI_SEGMENTATION = 0x4f,
97 BSSMAP_LE_IEI_CLASSMARK3_INFO = 0x13,
98 BSSMAP_LE_IEI_CAUSE = 0x4,
99 BSSMAP_LE_IEI_CELL_ID = 0x5,
100 BSSMAP_LE_IEI_CHOSEN_CHAN = 0x21,
101 BSSMAP_LE_IEI_IMSI = 0x0,
102 BSSMAP_LE_IEI_LCS_CAPABILITY = 0x50,
103 BSSMAP_LE_IEI_PKT_MEAS_REP = 0x51,
104 BSSMAP_LE_IEI_CELL_ID_LIST = 0x52,
105 BSSMAP_LE_IEI_IMEI = 0x80,
106 BSSMAP_LE_IEI_BSS_MLAT_CAP = 0x84,
107 BSSMAP_LE_IEI_CELL_INFO_LIST = 0x85,
108 BSSMAP_LE_IEI_BTS_RX_ACC_LVL = 0x86,
109 BSSMAP_LE_IEI_MLAT_METHOD = 0x87,
110 BSSMAP_LE_IEI_MLAT_TA = 0x88,
111 BSSMAP_LE_IEI_MS_SYNC_ACC = 0x89,
112 BSSMAP_LE_IEI_SHORT_ID_SET = 0x8a,
113 BSSMAP_LE_IEI_RANDOM_ID_SET = 0x8b,
114 BSSMAP_LE_IEI_SHORT_BSS_ID = 0x8c,
115 BSSMAP_LE_IEI_RANDOM_ID = 0x8d,
116 BSSMAP_LE_IEI_SHORT_ID = 0x8e,
117 BSSMAP_LE_IEI_COVERAGE_CLASS = 0x8f,
118 BSSMAP_LE_IEI_MTA_ACC_SEC_RQD = 0x90,
119};
120
121enum bssmap_le_apdu_proto {
122 BSSMAP_LE_APDU_PROT_RESERVED = 0,
123 BSSMAP_LE_APDU_PROT_BSSLAP = 1,
124 BSSMAP_LE_APDU_PROT_LLP = 2,
125 BSSMAP_LE_APDU_PROT_SMLCPP = 3,
126};
127
128enum bssmap_le_location_information {
129 BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC = 0x0,
130 BSSMAP_LE_LOC_INFO_ASSIST_TARGET_MS = 0x1,
131 BSSMAP_LE_LOC_INFO_BC_DECIPHER_KEYS = 0x2,
132};
133
134enum bssmap_le_positioning_method {
135 BSSMAP_LE_POS_METHOD_OMITTED = 0x0,
136 BSSMAP_LE_POS_METHOD_MOBILE_ASSISTED_E_OTD = 0x1,
137 BSSMAP_LE_POS_METHOD_MOBILE_BASED_E_OTD = 0x2,
138 BSSMAP_LE_POS_METHOD_ASSISTED_GPS = 0x3,
139};
140
141struct bssmap_le_location_type {
142 enum bssmap_le_location_information location_information;
143 enum bssmap_le_positioning_method positioning_method;
144};
145
146enum bssmap_le_lcs_client_type {
147 BSSMAP_LE_LCS_CTYPE_VALUE_ADDED_UNSPECIFIED = 0x0,
148 BSSMAP_LE_LCS_CTYPE_PLMN_OPER_UNSPECIFIED = 0x20,
149 BSSMAP_LE_LCS_CTYPE_PLMN_OPER_BCAST_SERVICE = 0x21,
150 BSSMAP_LE_LCS_CTYPE_PLMN_OPER_OAM = 0x22,
151 BSSMAP_LE_LCS_CTYPE_PLMN_OPER_ANON_STATS = 0x23,
152 BSSMAP_LE_LCS_CTYPE_PLMN_OPER_TGT_MS_SVC = 0x24,
153 BSSMAP_LE_LCS_CTYPE_EMERG_SVC_UNSPECIFIED = 0x30,
154 BSSMAP_LE_LCS_CTYPE_LI_UNSPECIFIED = 0x40,
155};
156
157struct bssmap_le_perform_loc_req {
158 struct bssmap_le_location_type location_type;
159 struct gsm0808_cell_id cell_id;
160
161 bool lcs_client_type_present;
162 enum bssmap_le_lcs_client_type lcs_client_type;
163
164 struct osmo_mobile_identity imsi;
165 struct osmo_mobile_identity imei;
166
167 bool apdu_present;
168 struct bsslap_pdu apdu;
169
170 bool more_items; /*!< always set this to false */
171};
172
173struct bssmap_le_perform_loc_resp {
174 bool location_estimate_present;
175 union gad_raw location_estimate;
176
177 struct lcs_cause_ie lcs_cause;
178
179 bool more_items; /*!< always set this to false */
180};
181
182struct bssmap_le_conn_oriented_info {
183 struct bsslap_pdu apdu;
184
185 bool more_items; /*!< always set this to false */
186};
187
188struct bssmap_le_pdu {
189 enum bssmap_le_msgt msg_type;
190 union {
191 enum gsm0808_cause reset;
192 /* reset_ack consists only of the message type */
193 struct bssmap_le_perform_loc_req perform_loc_req;
194 struct bssmap_le_perform_loc_resp perform_loc_resp;
195 struct lcs_cause_ie perform_loc_abort;
196 struct bssmap_le_conn_oriented_info conn_oriented_info;
197 };
198};
199
200struct bssap_le_pdu {
201 enum bssap_le_msg_discr discr;
202 union {
203 struct bssmap_le_pdu bssmap_le;
204 /* future: add DTAP PDU, currently not implemented */
205 };
206};
207
Neels Hofmeyrc6848f42020-09-18 18:00:50 +0200208/*! @} */