Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 1 | module BSSAP_LE_Types { |
| 2 | |
| 3 | /* BSSAP_LE_Types, defining abstract TTCN-3 data types for the 3GPP BSSMAP-LE protocol. |
| 4 | * |
| 5 | * BSSMAP-LE is a 3GPP standard protocol used by SMLC and its peers in a GSM network. |
| 6 | * This file covers 3GPP TS 49.031 version 15.0.0 Release 15 |
| 7 | * |
| 8 | * (C) 2020 by Harald Welte <laforge@gnumonks.org> |
| 9 | * All rights reserved. |
| 10 | * |
| 11 | * Released under the terms of GNU General Public License, Version 2 or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 15 | */ |
| 16 | |
| 17 | import from General_Types all; |
| 18 | import from Osmocom_Types all; |
| 19 | import from BSSAP_Types all; |
| 20 | import from BSSLAP_Types all; |
| 21 | import from MobileL3_CommonIE_Types all; |
| 22 | |
| 23 | /* TS 49.031 Section 10.1 */ |
| 24 | type enumerated BSSMAP_LE_MsgType { |
| 25 | BSSMAP_LE_PERFORM_LOC_REQ ('00101011'B), |
| 26 | BSSMAP_LE_PERFORM_LOC_RESP ('00101101'B), |
| 27 | BSSMAP_LE_PERFORM_LOC_ABORT ('00101110'B), |
| 28 | BSSMAP_LE_PERFORM_LOC_INFO ('00101111'B), |
| 29 | BSSMAP_LE_ASSIST_INFO_REQ ('00100000'B), |
| 30 | BSSMAP_LE_ASSIST_INFO_RESP ('00100001'B), |
| 31 | |
| 32 | BSSMAP_LE_CONN_ORIENTED_INFO ('00101010'B), |
| 33 | BSSMAP_LE_CONN_LESS_INFO ('00111010'B), |
| 34 | |
| 35 | BSSMAP_LE_RESET ('00110000'B), |
| 36 | BSSMAP_LE_RESET_ACK ('00110001'B) |
Vadim Yanitskiy | ac1a4fd | 2020-09-08 14:19:57 +0700 | [diff] [blame] | 37 | } with { variant "FIELDLENGTH(8)" }; |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 38 | |
| 39 | /* TS 49.031 Section 10.2 */ |
| 40 | type enumerated BSSMAP_LE_IEI { |
| 41 | BSSMAP_LE_IEI_LCS_QoS ('00111110'B), |
| 42 | BSSMAP_LE_IEI_LCS_PRIORITY ('01000011'B), |
| 43 | BSSMAP_LE_IEI_LOCATION_TYPE ('01000100'B), |
| 44 | BSSMAP_LE_IEI_GANSS_LOCATION_TYPE ('10000010'B), |
| 45 | BSSMAP_LE_IEI_GEO_LOCATION ('01000101'B), |
| 46 | BSSMAP_LE_IEI_POSITIONING_DATA ('01000110'B), |
| 47 | BSSMAP_LE_IEI_GANSS_POS_DATA ('10000011'B), |
| 48 | BSSMAP_LE_IEI_VELOCITY_DATA ('01010101'B), |
| 49 | BSSMAP_LE_IEI_LCS_CAUSE ('01000111'B), |
| 50 | BSSMAP_LE_IEI_LCS_CLIENT_TYPE ('01001000'B), |
| 51 | BSSMAP_LE_IEI_APDU ('01001001'B), |
| 52 | BSSMAP_LE_IEI_NET_ELEM_ID ('01001010'B), |
| 53 | BSSMAP_LE_IEI_REQ_GPS_ASS_D ('01001011'B), |
| 54 | BSSMAP_LE_IEI_REQ_GANSS_ASS_D ('01000001'B), |
| 55 | BSSMAP_LE_IEI_DECIPH_KEYS ('01001100'B), |
| 56 | BSSMAP_LE_IEI_RET_ERR_REQ ('01001101'B), |
| 57 | BSSMAP_LE_IEI_RET_ERR_CAUSE ('01001110'B), |
| 58 | BSSMAP_LE_IEI_SEGMENTATION ('01001111'B), |
| 59 | BSSMAP_LE_IEI_CLASSMARK3_INFO ('00010011'B), |
| 60 | BSSMAP_LE_IEI_CAUSE ('00000100'B), |
| 61 | BSSMAP_LE_IEI_CELL_ID ('00000101'B), |
| 62 | BSSMAP_LE_IEI_CHOSEN_CHAN ('00100001'B), |
| 63 | BSSMAP_LE_IEI_IMSI ('00000000'B), |
| 64 | BSSMAP_LE_IEI_LCS_CAPABILITY ('01010000'B), |
| 65 | BSSMAP_LE_IEI_PKT_MEAS_REP ('01010001'B), |
| 66 | BSSMAP_LE_IEI_CELL_ID_LIST ('01010010'B), |
| 67 | BSSMAP_LE_IEI_IMEI ('10000000'B), |
| 68 | BSSMAP_LE_IEI_BSS_MLAT_CAP ('10000100'B), |
| 69 | BSSMAP_LE_IEI_CELL_INFO_LIST ('10000101'B), |
| 70 | BSSMAP_LE_IEI_BTS_RX_ACC_LVL ('10000110'B), |
| 71 | BSSMAP_LE_IEI_MLAT_METHOD ('10000111'B), |
| 72 | BSSMAP_LE_IEI_MLAT_TA ('10001000'B), |
| 73 | BSSMAP_LE_IEI_MS_SYNC_ACC ('10001001'B), |
| 74 | BSSMAP_LE_IEI_SHORT_ID_SET ('10001010'B), |
| 75 | BSSMAP_LE_IEI_RANDOM_ID_SET ('10001011'B), |
| 76 | BSSMAP_LE_IEI_SHORT_BSS_ID ('10001100'B), |
| 77 | BSSMAP_LE_IEI_RANDOM_ID ('10001101'B), |
| 78 | BSSMAP_LE_IEI_SHORT_ID ('10001110'B), |
| 79 | BSSMAP_LE_IEI_COVERAGE_CLASS ('10001111'B), |
| 80 | BSSMAP_LE_IEI_MTA_ACC_SEC_RQD ('10010000'B) |
Vadim Yanitskiy | ac1a4fd | 2020-09-08 14:19:57 +0700 | [diff] [blame] | 81 | } with { variant "FIELDLENGTH(8)" }; |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 82 | |
| 83 | /* Section 9.1 */ |
| 84 | type record BSSMAP_LE_PerfLocReq { |
| 85 | BSSMAP_LE_MsgType msg_type, |
| 86 | BSSMAP_LE_IE_LocationType location_type, |
| 87 | BSSMAP_IE_CellIdentifier cell_id, |
| 88 | BSSMAP_IE_ClassmarkInformationType3 cm3 optional, |
| 89 | BSSMAP_LE_IE_LcsClientType lcs_client_type optional, |
| 90 | BSSMAP_IE_ChosenChannel chosen_channel optional, |
| 91 | BSSMAP_LE_IE_LcsPriority lcs_priority optional, |
| 92 | BSSMAP_LE_IE_LcsQoS lcs_qos optional, |
| 93 | BSSMAP_LE_IE_ReqGpsAssD req_gps_ass_d optional, |
| 94 | BSSMAP_LE_IE_APDU bsslap_apdu optional, |
| 95 | BSSMAP_LE_IE_LcsCapability lcs_capability optional, |
| 96 | BSSMAP_LE_IE_PacketMeasRep packet_meas_rep optional, |
| 97 | BSSMAP_LE_IE_CellIdList meas_cell_id_list optional, |
| 98 | BSSMAP_LE_IE_IMSI imsi optional, |
| 99 | BSSMAP_LE_IE_IMEI imei optional |
| 100 | // TODO: more optional IEs |
| 101 | }; |
| 102 | |
| 103 | /* Section 9.2 */ |
| 104 | type record BSSMAP_LE_PerfLocResp { |
| 105 | BSSMAP_LE_MsgType msg_type, |
| 106 | BSSMAP_LE_IE_GeographicLoc geographic_loc optional, |
| 107 | BSSMAP_LE_IE_PositioningData pos_data optional, |
| 108 | BSSMAP_LE_IE_DecipheringKeys deciph_keys optional, |
| 109 | BSSMAP_LE_IE_LcsCause lcs_cause optional, |
| 110 | BSSMAP_LE_IE_VelocityData velocity_data optional, |
| 111 | BSSMAP_LE_IE_GanssPosData ganss_pos_data optional |
| 112 | }; |
| 113 | |
| 114 | /* Section 9.4 */ |
| 115 | type record BSSMAP_LE_PerfLocAbort { |
| 116 | BSSMAP_LE_MsgType msg_type, |
| 117 | BSSMAP_LE_IE_LcsCause lcs_cause |
| 118 | }; |
| 119 | |
| 120 | /* Section 9.8 */ |
| 121 | type record BSSMAP_LE_ConnOrientedInfo { |
| 122 | BSSMAP_LE_MsgType msg_type, |
| 123 | BSSMAP_LE_IE_APDU bsslap_apdu, |
| 124 | BSSMAP_LE_IE_Segmentation segmentation optional |
| 125 | // TODO: MLA related optional IEs |
| 126 | }; |
| 127 | |
| 128 | /* Section 9.9 */ |
| 129 | type record BSSMAP_LE_ConnLessInfo { |
| 130 | BSSMAP_LE_MsgType msg_type, |
| 131 | BSSMAP_LE_IE_NetElementId source_id, |
| 132 | BSSMAP_LE_IE_NetElementId dest_id, |
| 133 | BSSMAP_LE_IE_APDU bsslap_apdu optional, |
| 134 | BSSMAP_LE_IE_Segmentation segmentation optional, |
| 135 | BSSMAP_LE_IE_RetErrReq ret_err_req optional, |
| 136 | BSSMAP_LE_IE_RetErrCause ret_err_cause optional |
| 137 | }; |
| 138 | |
| 139 | /* Section 9.10 */ |
| 140 | type record BSSMAP_LE_Reset { |
| 141 | BSSMAP_LE_MsgType msg_type, |
| 142 | BSSMAP_IE_Cause cause |
| 143 | }; |
| 144 | |
| 145 | /* Section 9.11 */ |
| 146 | type record BSSMAP_LE_ResetAck { |
| 147 | BSSMAP_LE_MsgType msg_type |
| 148 | }; |
| 149 | |
| 150 | /* Section 9.12 */ |
| 151 | type record BSSMAP_LE_PerformLocInfo { |
| 152 | BSSMAP_LE_MsgType msg_type, |
| 153 | BSSMAP_IE_CellIdentifier cell_id, |
| 154 | BSSMAP_LE_IE_APDU bsslap_apdu optional |
| 155 | }; |
| 156 | |
| 157 | type union BSSMAP_LE_PDU { |
| 158 | BSSMAP_LE_PerfLocReq perf_loc_req, |
| 159 | BSSMAP_LE_PerfLocResp perf_loc_resp, |
| 160 | BSSMAP_LE_PerfLocAbort perf_loc_abort, |
| 161 | BSSMAP_LE_ConnOrientedInfo co_info, |
| 162 | BSSMAP_LE_ConnLessInfo cl_info, |
| 163 | BSSMAP_LE_Reset reset, |
| 164 | BSSMAP_LE_ResetAck reset_ack, |
| 165 | BSSMAP_LE_PerformLocInfo perf_loc_info, |
| 166 | /* The following BSSMAP messages defined in 3GPP TS 48.008 are applicable to the Lb interface to |
| 167 | * support signaling to a Type A LMU using an SDCCH */ |
| 168 | PDU_BSSMAP_CipherModeCommand cipherModeCommand, |
| 169 | PDU_BSSMAP_CipherModeComplete cipherModeComplete, |
| 170 | PDU_BSSMAP_CipherModeReject cipherModeReject, |
| 171 | PDU_BSSMAP_ClassmarkUpdate classmarkUpdate, |
| 172 | PDU_BSSMAP_ClearCommand clearCommand, |
| 173 | PDU_BSSMAP_ClearComplete clearComplete, |
| 174 | PDU_BSSMAP_ClearRequest clearRequest, |
| 175 | PDU_BSSMAP_CompleteLayer3Information completeLayer3Information, |
| 176 | PDU_BSSMAP_Confusion confusion, |
| 177 | PDU_BSSMAP_HandoverRequired handoverRequired, |
| 178 | PDU_BSSMAP_HandoverRequiredReject handoverRequiredReject, |
| 179 | PDU_BSSMAP_HandoverPerformed handoverPerformed, |
| 180 | PDU_BSSMAP_Paging paging |
| 181 | } with { |
| 182 | variant "TAG( |
| 183 | perf_loc_req, msg_type = BSSMAP_LE_PERFORM_LOC_REQ; |
| 184 | perf_loc_resp, msg_type = BSSMAP_LE_PERFORM_LOC_RESP; |
| 185 | perf_loc_abort, msg_type = BSSMAP_LE_PERFORM_LOC_ABORT; |
| 186 | co_info, msg_type = BSSMAP_LE_CONN_ORIENTED_INFO; |
| 187 | cl_info, msg_type = BSSMAP_LE_CONN_LESS_INFO; |
| 188 | reset, msg_type = BSSMAP_LE_RESET; |
| 189 | reset_ack, msg_type = BSSMAP_LE_RESET_ACK; |
| 190 | perf_loc_info, msg_type = BSSMAP_LE_PERFORM_LOC_INFO; |
| 191 | )" |
| 192 | }; |
| 193 | |
| 194 | /* Section 10.3 */ |
| 195 | type record BSSMAP_LE_IE_APDU { |
| 196 | BSSMAP_LE_IEI iei, |
| 197 | uint16_t len, |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 198 | BSSMAP_LE_ProtocolId protocol_id, |
Neels Hofmeyr | c4c2a91 | 2020-09-05 19:02:05 +0000 | [diff] [blame] | 199 | BIT1 spare, |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 200 | octetstring data |
| 201 | } with { |
| 202 | variant "PRESENCE(iei = BSSMAP_LE_IEI_APDU)" |
Neels Hofmeyr | c4c2a91 | 2020-09-05 19:02:05 +0000 | [diff] [blame] | 203 | variant (len) "LENGTHTO(protocol_id,spare,data)" |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 204 | }; |
| 205 | type enumerated BSSMAP_LE_ProtocolId { |
| 206 | BSSMAP_LE_PROT_RESERVED ('0000000'B), |
| 207 | BSSMAP_LE_PROT_BSSLAP ('0000001'B), |
| 208 | BSSMAP_LE_PROT_LLP ('0000010'B), |
| 209 | BSSMAP_LE_PROT_SMLCPP ('0000011'B) |
| 210 | } with { variant "FIELDLENGTH(7)" }; |
| 211 | |
| 212 | /* Section 10.8 */ |
| 213 | type record BSSMAP_LE_IE_DecipheringKeys { |
| 214 | BSSMAP_LE_IEI iei, |
| 215 | uint8_t len, |
| 216 | BIT7 spare, |
| 217 | boolean ciph_key_flag, |
| 218 | OCT7 cur_deciph_key, |
| 219 | OCT7 next_deciph_key |
| 220 | } with { |
| 221 | variant "PRESENCE(iei = BSSMAP_LE_IEI_DECIPH_KEYS)" |
| 222 | variant (len) "LENGTHTO(spare,ciph_key_flag,cur_deciph_key,next_deciph_key)" |
| 223 | } |
| 224 | |
| 225 | /* Section 10.9 */ |
| 226 | type record BSSMAP_LE_IE_GeographicLoc { |
| 227 | BSSMAP_LE_IEI iei, |
| 228 | uint8_t len, |
| 229 | octetstring location |
| 230 | } with { |
| 231 | variant "PRESENCE(iei = BSSMAP_LE_IEI_GEO_LOCATION)" |
| 232 | variant (len) "LENGTHTO(location)" |
| 233 | } |
| 234 | |
| 235 | /* Section 10.10 */ |
| 236 | type record BSSMAP_LE_IE_ReqGpsAssD { |
| 237 | BSSMAP_LE_IEI iei, |
| 238 | uint8_t len, |
| 239 | BIT16 flags, |
| 240 | octetstring sat_data |
| 241 | } with { |
| 242 | variant "PRESENCE(iei = BSSMAP_LE_IEI_REQ_GPS_ASS_D)" |
| 243 | variant (len) "LENGTHTO(flags,sat_data)" |
| 244 | } |
| 245 | |
| 246 | /* Section 10.11 */ |
| 247 | type record BSSMAP_LE_IE_IMSI { |
| 248 | BSSMAP_LE_IEI iei, |
| 249 | uint8_t len, |
| 250 | MobileIdentityV imsi |
| 251 | } with { |
| 252 | variant "PRESENCE(iei = BSSMAP_LE_IEI_IMSI)" |
| 253 | variant (len) "LENGTHTO(imsi)" |
| 254 | } |
| 255 | |
| 256 | /* Section 10.13 */ |
| 257 | type record BSSMAP_LE_IE_LcsCause { |
| 258 | BSSMAP_LE_IEI iei, |
| 259 | uint8_t len, |
| 260 | BSSMAP_LE_LcsCause cause, |
| 261 | OCT1 diag_val optional |
| 262 | } with { |
| 263 | variant "PRESENCE(iei = BSSMAP_LE_IEI_IMSI)" |
| 264 | variant (len) "LENGTHTO(cause,diag_val)" |
| 265 | } |
| 266 | type enumerated BSSMAP_LE_LcsCause { |
Neels Hofmeyr | 7b562bf | 2020-09-18 23:48:03 +0200 | [diff] [blame] | 267 | BSSMAP_LE_LCS_CAUSE_UNSPECIFIED ('00000000'B), |
Harald Welte | f7c2b20 | 2020-03-29 17:34:11 +0200 | [diff] [blame] | 268 | BSSMAP_LE_LCS_CAUSE_SYSTEM_FAILURE ('00000001'B), |
| 269 | BSSMAP_LE_LCS_CAUSE_PROTOCOL_ERROR ('00000010'B), |
| 270 | BSSMAP_LE_LCS_CAUSE_DATA_MISSING_IN_REQ ('00000011'B), |
| 271 | BSSMAP_LE_LCS_CAUSE_UNEXP_DATA_IN_REQ ('00000100'B), |
| 272 | BSSMAP_LE_LCS_CAUSE_POS_METH_FAILURE ('00000101'B), |
| 273 | BSSMAP_LE_LCS_CAUSE_TGT_MS_UNREACHABLE ('00000110'B), |
| 274 | BSSMAP_LE_LCS_CAUSE_REQUEST_ABORTED ('00000111'B), |
| 275 | BSSMAP_LE_LCS_CAUSE_FACILITY_NOTSUPP ('00001000'B), |
| 276 | BSSMAP_LE_LCS_CAUSE_INTER_BSC_HO ('00001001'B), |
| 277 | BSSMAP_LE_LCS_CAUSE_INTRA_BSC_HO ('00001010'B), |
| 278 | BSSMAP_LE_LCS_CAUSE_CONGESTION ('00001011'B), |
| 279 | BSSMAP_LE_LCS_CAUSE_INTER_NSE_CHG ('00001100'B), |
| 280 | BSSMAP_LE_LCS_CAUSE_RA_UPDAT ('00001101'B), |
| 281 | BSSMAP_LE_LCS_CAUSE_PTMSI_REALLOC ('00001110'B), |
| 282 | BSSMAP_LE_LCS_CAUSE_GPRS_SUSPENSION ('00001111'B) |
| 283 | } with { variant "FIELDLENGTH(8)" }; |
| 284 | |
| 285 | /* Section 10.14 */ |
| 286 | type record BSSMAP_LE_IE_LcsClientType { |
| 287 | BSSMAP_LE_IEI iei, |
| 288 | uint8_t len, |
| 289 | BSSMAP_LE_ClientType cltype |
| 290 | } with { |
| 291 | variant "PRESENCE(iei = BSSMAP_LE_IEI_CAUSE)" |
| 292 | variant (len) "LENGTHTO(cltype)" |
| 293 | } |
| 294 | type enumerated BSSMAP_LE_ClientType { |
| 295 | BSSMAP_LE_LCS_CTYPE_VALUE_ADDED_UNSPECIFIED ('00000000'B), |
| 296 | BSSMAP_LE_LCS_CTYPE_PLMN_OPER_UNSPECIFIED ('00100000'B), |
| 297 | BSSMAP_LE_LCS_CTYPE_PLMN_OPER_BCAST_SERVICE ('00100001'B), |
| 298 | BSSMAP_LE_LCS_CTYPE_PLMN_OPER_OAM ('00100010'B), |
| 299 | BSSMAP_LE_LCS_CTYPE_PLMN_OPER_ANON_STATS ('00100011'B), |
| 300 | BSSMAP_LE_LCS_CTYPE_PLMN_OPER_TGT_MS_SVC ('00100100'B), |
| 301 | BSSMAP_LE_LCS_CTYPE_EMERG_SVC_UNSPECIFIED ('00110000'B), |
| 302 | BSSMAP_LE_LCS_CTYPE_LI_UNSPECIFIED ('01000000'B) |
| 303 | } with { variant "FIELDLENGTH(8)" }; |
| 304 | |
| 305 | /* Section 10.15 */ |
| 306 | type record BSSMAP_LE_IE_LcsPriority { |
| 307 | BSSMAP_LE_IEI iei, |
| 308 | uint8_t len, |
| 309 | OCT1 priority |
| 310 | } with { |
| 311 | variant "PRESENCE(iei = BSSMAP_LE_IEI_LCS_PRIORITY)" |
| 312 | variant (len) "LENGTHTO(priority)" |
| 313 | } |
| 314 | |
| 315 | /* Section 10.16 */ |
| 316 | type record BSSMAP_LE_IE_LcsQoS { |
| 317 | BSSMAP_LE_IEI iei, |
| 318 | uint8_t len, |
| 319 | |
| 320 | BIT6 spare, |
| 321 | boolean vel, |
| 322 | boolean vert, |
| 323 | |
| 324 | boolean ha, |
| 325 | uint7_t horiz_acc, |
| 326 | |
| 327 | boolean va, |
| 328 | uint7_t vert_acc, |
| 329 | |
| 330 | BIT2 rt, |
| 331 | BIT6 spare2 |
| 332 | } with { |
| 333 | variant "PRESENCE(iei = BSSMAP_LE_IEI_LCS_QoS)" |
| 334 | variant (len) "LENGTHTO(spare,vel,vert,ha,horiz_acc,va,vert_acc,rt,spare2)" |
| 335 | } |
| 336 | |
| 337 | /* Section 10.18 */ |
| 338 | type record BSSMAP_LE_IE_LocationType { |
| 339 | BSSMAP_LE_IEI iei, |
| 340 | uint8_t len, |
| 341 | BSSMAP_LE_LocInfo loc_info, |
| 342 | BSSMAP_LE_PosMethod pos_method optional |
| 343 | } with { |
| 344 | variant "PRESENCE(iei = BSSMAP_LE_IEI_LOCATION_TYPE)" |
| 345 | variant (len) "LENGTHTO(loc_info,pos_method)" |
| 346 | variant (pos_method) "PRESENCE(loc_info = BSSMAP_LE_LOC_INFO_ASS_INFO_FOR_TGT_MS, |
| 347 | loc_info = BSSMAP_LE_LOC_INFO_DECIPH_KEYS_FOR_BCAST)" |
| 348 | } |
| 349 | type enumerated BSSMAP_LE_LocInfo { |
| 350 | BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC_LOC ('00000000'B), |
| 351 | BSSMAP_LE_LOC_INFO_ASS_INFO_FOR_TGT_MS ('00000001'B), |
| 352 | BSSMAP_LE_LOC_INFO_DECIPH_KEYS_FOR_BCAST ('00000010'B) |
| 353 | } with { variant "FIELDLENGTH(8)" }; |
| 354 | type enumerated BSSMAP_LE_PosMethod { |
| 355 | BSSMAP_LE_POS_METHOD_RESERVED ('00000000'B), |
| 356 | BSSMAP_LE_POS_MOBILE_ASSISTED_EOTD ('00000001'B), |
| 357 | BSSMAP_LE_POS_MOBILE_BASED_EOTD ('00000010'B), |
| 358 | BSSMAP_LE_POS_ASSISTED_GPS ('00000011'B), |
| 359 | BSSMAP_LE_POS_ASSISTED_GANSS ('00000100'B), |
| 360 | BSSMAP_LE_POS_ASSISTED_GPS_AND_GANSS ('00000101'B) |
| 361 | } with { variant "FIELDLENGTH(8)" }; |
| 362 | |
| 363 | /* Section 10.19 */ |
| 364 | type record BSSMAP_LE_IE_NetElementId { |
| 365 | BSSMAP_LE_IEI iei, |
| 366 | uint8_t len, |
| 367 | BIT4 spare, |
| 368 | BSSMAP_LE_IdDiscr id_discr, |
| 369 | BSSMAP_LE_IdU u |
| 370 | } with { |
| 371 | variant "PRESENCE(iei = BSSMAP_LE_IEI_NET_ELEM_ID)" |
| 372 | variant (len) "LENGTHTO(spare,id_discr,u)" |
| 373 | variant (u) "CROSSTAG( |
| 374 | cgi, id_discr = BSSMAP_LE_ID_DISC_CGI; |
| 375 | lac_ci, id_discr = BSSMAP_LE_ID_DISC_LAC_CI; |
| 376 | lai, id_discr = BSSMAP_LE_ID_DISC_LAI; |
| 377 | lac, id_discr = BSSMAP_LE_ID_DISC_LAC; |
| 378 | lmu, id_discr = BSSMAP_LE_ID_LMU; |
| 379 | )" |
| 380 | }; |
| 381 | type enumerated BSSMAP_LE_IdDiscr { |
| 382 | BSSMAP_LE_ID_DISC_CGI ('0000'B), |
| 383 | BSSMAP_LE_ID_DISC_LAC_CI ('0001'B), |
| 384 | BSSMAP_LE_ID_DISC_LAI ('0100'B), |
| 385 | BSSMAP_LE_ID_DISC_LAC ('0101'B), |
| 386 | BSSMAP_LE_ID_LMU ('0110'B) |
| 387 | } with { variant "FIELDLENGTH(4)" }; |
| 388 | type union BSSMAP_LE_IdU { |
| 389 | BSSMAP_LE_Id_CGI cgi, |
| 390 | BSSMAP_LE_Id_LAC_CI lac_ci, |
| 391 | BSSMAP_LE_Id_LAI lai, |
| 392 | uint16_t lac, |
| 393 | octetstring lmu |
| 394 | }; |
| 395 | type record BSSMAP_LE_Id_CGI { |
| 396 | HEX6n mcc_mnc, |
| 397 | uint16_t lac, |
| 398 | uint16_t ci |
| 399 | }; |
| 400 | type record BSSMAP_LE_Id_LAC_CI { |
| 401 | uint16_t lac, |
| 402 | uint16_t ci |
| 403 | }; |
| 404 | type record BSSMAP_LE_Id_LAI { |
| 405 | HEX6n mcc_mnc, |
| 406 | uint16_t lac |
| 407 | }; |
| 408 | |
| 409 | /* Section 10.20 */ |
| 410 | type record BSSMAP_LE_IE_PositioningData { |
| 411 | BSSMAP_LE_IEI iei, |
| 412 | uint8_t len, |
| 413 | BIT4 spare, |
| 414 | uint4_t discr, |
| 415 | BSSMAP_LE_PosMethList pos_meth |
| 416 | } with { |
| 417 | variant "PRESENCE(iei = BSSMAP_LE_IEI_POSITIONING_DATA)" |
| 418 | variant (len) "LENGTHTO(spare,discr,pos_meth)" |
| 419 | }; |
| 420 | type record of BSSMAP_LE_PosMethodN BSSMAP_LE_PosMethList; |
| 421 | type record BSSMAP_LE_PosMethodN { |
| 422 | BSSMAP_LE_Method method, |
| 423 | BSSMAP_LE_Usage usage |
| 424 | }; |
| 425 | type enumerated BSSMAP_LE_Method { |
| 426 | BSSMAP_LE_METHOD_TA ('00000'B), |
| 427 | BSSMAP_LE_METHOD_RESERVED0 ('00001'B), |
| 428 | BSSMAP_LE_METHOD_RESERVED1 ('00010'B), |
| 429 | BSSMAP_LE_METHOD_MOBILE_ASS_EOTD ('00011'B), |
| 430 | BSSMAP_LE_METHOD_MOBILE_BASED_EOTD ('00100'B), |
| 431 | BSSMAP_LE_METHOD_MOBILE_ASS_GPS ('00101'B), |
| 432 | BSSMAP_LE_METHOD_MOBILE_BASED_GPS ('00110'B), |
| 433 | BSSMAP_LE_METHOD_CONVENTIONAL_GPS ('00111'B), |
| 434 | BSSMAP_LE_METHOD_UTDOA ('01000'B), |
| 435 | BSSMAP_LE_METHOD_CELL_ID ('01100'B) |
| 436 | } with { variant "FIELDLENGTH(5)" }; |
| 437 | type enumerated BSSMAP_LE_Usage { |
| 438 | BSSMAP_LE_USAGE_ATTEMPTED_UNSUCC ('000'B), |
| 439 | BSSMAP_LE_USAGE_ATTEMPTED_SUCC_NOT_USED ('001'B), |
| 440 | BSSMAP_LE_USAGE_ATTEMPTED_SUCC_USED_VRFY_NOT_GEN ('010'B), |
| 441 | BSSMAP_LE_USAGE_ATTEMPTED_SUCC_USED_GEN ('011'B), |
| 442 | BSSMAP_LE_USAGE_ATTEMPTED_SUCC_USAGE_UNDETERMINED ('100'B) |
| 443 | } with { variant "FIELDLENGTH(3)" }; |
| 444 | |
| 445 | /* Section 10.21 */ |
| 446 | type record BSSMAP_LE_IE_RetErrReq { |
| 447 | BSSMAP_LE_IEI iei, |
| 448 | uint8_t len, |
| 449 | OCT1 ret_err_type |
| 450 | } with { |
| 451 | variant "PRESENCE(iei = BSSMAP_LE_IEI_RET_ERR_REQ)" |
| 452 | variant (len) "LENGTHTO(ret_err_type)" |
| 453 | } |
| 454 | |
| 455 | /* Section 10.22 */ |
| 456 | type record BSSMAP_LE_IE_RetErrCause { |
| 457 | BSSMAP_LE_IEI iei, |
| 458 | uint8_t len, |
| 459 | BSSMAP_LE_RetErrCause cause |
| 460 | } with { |
| 461 | variant "PRESENCE(iei = BSSMAP_LE_IEI_RET_ERR_REQ)" |
| 462 | variant (len) "LENGTHTO(cause)" |
| 463 | } |
| 464 | type enumerated BSSMAP_LE_RetErrCause { |
| 465 | BSSMAP_LE_RE_CAUSE_UNSPECIFIED ('00000000'B), |
| 466 | BSSMAP_LE_RE_CAUSE_SYSTEM_FAILURE ('00000001'B), |
| 467 | BSSMAP_LE_RE_CAUSE_PROTOCOL_ERROR ('00000010'B), |
| 468 | BSSMAP_LE_RE_CAUSE_DEST_UNKNOWN ('00000011'B), |
| 469 | BSSMAP_LE_RE_CAUSE_DEST_UNREACHABLE ('00000100'B), |
| 470 | BSSMAP_LE_RE_CAUSE_CONGESTION ('00000101'B) |
| 471 | } with { variant "FIELDLENGTH(8)" }; |
| 472 | |
| 473 | /* Section 10.24 */ |
| 474 | type record BSSMAP_LE_IE_Segmentation { |
| 475 | BSSMAP_LE_IEI iei, |
| 476 | uint8_t len, |
| 477 | BIT3 spare, |
| 478 | boolean s_non_final, |
| 479 | uint4_t seg_nr, |
| 480 | OCT2 msg_id optional |
| 481 | } with { |
| 482 | variant "PRESENCE(iei = BSSMAP_LE_IEI_SEGMENTATION)" |
| 483 | variant (len) "LENGTHTO(spare,s_non_final,seg_nr,msg_id)" |
| 484 | } |
| 485 | |
| 486 | /* Section 10.26 */ |
| 487 | type record BSSMAP_LE_IE_LcsCapability { |
| 488 | BSSMAP_LE_IEI iei, |
| 489 | uint8_t len, |
| 490 | octetstring lcs_cap |
| 491 | } with { |
| 492 | variant "PRESENCE(iei = BSSMAP_LE_IEI_LCS_CAPABILITY)" |
| 493 | variant (len) "LENGTHTO(lcs_cap)" |
| 494 | } |
| 495 | |
| 496 | type record BSSMAP_LE_IE_PacketMeasRep { |
| 497 | BSSMAP_LE_IEI iei, |
| 498 | uint8_t len, |
| 499 | octetstring pkt_meas_rep |
| 500 | } with { |
| 501 | variant "PRESENCE(iei = BSSMAP_LE_IEI_PKT_MEAS_REP)" |
| 502 | variant (len) "LENGTHTO(pkt_meas_rep)" |
| 503 | } |
| 504 | |
| 505 | type record BSSMAP_LE_IE_CellIdList { |
| 506 | BSSMAP_LE_IEI iei, |
| 507 | uint8_t len, |
| 508 | BSSLAP_CellIdList cell_id_list |
| 509 | } with { |
| 510 | variant "PRESENCE(iei = BSSMAP_LE_IEI_CELL_ID_LIST)" |
| 511 | variant (len) "LENGTHTO(cell_id_list)" |
| 512 | } |
| 513 | |
| 514 | /* Section 10.29 */ |
| 515 | type record BSSMAP_LE_IE_IMEI { |
| 516 | BSSMAP_LE_IEI iei, |
| 517 | uint8_t len, |
| 518 | MobileIdentityV imei |
| 519 | } with { |
| 520 | variant "PRESENCE(iei = BSSMAP_LE_IEI_IMEI)" |
| 521 | variant (len) "LENGTHTO(imei)" |
| 522 | } |
| 523 | |
| 524 | /* Section 10.30 */ |
| 525 | type record BSSMAP_LE_IE_VelocityData { |
| 526 | BSSMAP_LE_IEI iei, |
| 527 | uint8_t len, |
| 528 | octetstring data |
| 529 | } with { |
| 530 | variant "PRESENCE(iei = BSSMAP_LE_IEI_VELOCITY_DATA)" |
| 531 | variant (len) "LENGTHTO(data)" |
| 532 | } |
| 533 | |
| 534 | /* Section 10.32 */ |
| 535 | type record BSSMAP_LE_IE_GanssPosData { |
| 536 | BSSMAP_LE_IEI iei, |
| 537 | uint8_t len, |
| 538 | BSSMAP_LE_GanssList list |
| 539 | } with { |
| 540 | variant "PRESENCE(iei = BSSMAP_LE_IEI_VELOCITY_DATA)" |
| 541 | variant (len) "LENGTHTO(list)" |
| 542 | } |
| 543 | type record of BSSMAP_LE_Ganss BSSMAP_LE_GanssList; |
| 544 | type record BSSMAP_LE_Ganss { |
| 545 | BSSMAP_LE_GanssMethod method, |
| 546 | BSSMAP_LE_GanssId id, |
| 547 | BSSMAP_LE_Usage usage |
| 548 | }; |
| 549 | type enumerated BSSMAP_LE_GanssMethod { |
| 550 | BSSMAP_LE_GANSS_METH_MS_BASED ('00'B), |
| 551 | BSSMAP_LE_GANSS_METH_MS_ASSISTED ('01'B), |
| 552 | BSSMAP_LE_GANSS_METH_MS_CONVENTIONAL ('10'B), |
| 553 | BSSMAP_LE_GANSS_METH_MS_RESERVED ('11'B) |
| 554 | } with { variant "FIELDLENGTH(2)" }; |
| 555 | type enumerated BSSMAP_LE_GanssId { |
| 556 | BSSMAP_LE_GANSS_ID_GALILEO ('000'B), |
| 557 | BSSMAP_LE_GANSS_ID_SBAS ('001'B), |
| 558 | BSSMAP_LE_GANSS_ID_MODERNIZED_GPS ('010'B), |
| 559 | BSSMAP_LE_GANSS_ID_QZSS ('011'B), |
| 560 | BSSMAP_LE_GANSS_ID_GLONASS ('100'B), |
| 561 | BSSMAP_LE_GANSS_ID_BDS ('101'B) |
| 562 | } with { variant "FIELDLENGTH(3)" }; |
| 563 | |
| 564 | /* FIXME: Further IEs */ |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | type union BSSMAPLEorDTAP { |
| 570 | BSSMAP_LE_PDU bssmap, |
| 571 | octetstring dtap |
| 572 | } |
| 573 | |
| 574 | type record PDU_BSSAP_LE { |
| 575 | BIT1 discriminator, // 0 = BSSMAP-LE; 1 = DTAP-LE |
| 576 | BIT7 spare, // always '0000000'B |
| 577 | OCT1 dlci optional, |
| 578 | LIN1 lengthIndicator, |
| 579 | BSSMAPLEorDTAP pdu |
| 580 | } with { |
| 581 | variant (lengthIndicator) "LENGTHTO(pdu)" |
| 582 | variant (pdu) "CROSSTAG(bssmap, discriminator='0'B; |
| 583 | dtap, discriminator='1'B)" |
| 584 | variant (dlci) "PRESENCE(discriminator='1'B)" |
| 585 | } |
| 586 | |
| 587 | |
| 588 | external function enc_PDU_BSSAP_LE(in PDU_BSSAP_LE pdu) return octetstring |
| 589 | with { extension "prototype(convert) encode(RAW)" } |
| 590 | external function dec_PDU_BSSAP_LE(in octetstring stream) return PDU_BSSAP_LE |
| 591 | with { extension "prototype(convert) decode(RAW)" } |
| 592 | |
| 593 | |
Neels Hofmeyr | c4c2a91 | 2020-09-05 19:02:05 +0000 | [diff] [blame] | 594 | } with { encode "RAW" ; } |