Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1 | module BSSMAP_Templates { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* BSSMAP Templates, building on top of BSSAP_Types from Ericsson. |
| 4 | * |
| 5 | * (C) 2017 by Harald Welte <laforge@gnumonks.org> |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Released under the terms of GNU General Public License, Version 2 or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 12 | import from General_Types all; |
| 13 | import from Osmocom_Types all; |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 14 | import from GSM_Types all; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 15 | import from BSSAP_Types all; |
| 16 | |
| 17 | type integer BssmapCause; |
| 18 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 19 | /* 48.008 3.2.2.5 - this actually belongs to BSSAP_Types.ttcn */ |
| 20 | type enumerated myBSSMAP_Cause { |
| 21 | /* 000 / 001: Normal event */ |
| 22 | GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE ('0000000'B), |
| 23 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE ('0000001'B), |
| 24 | GSM0808_CAUSE_UPLINK_QUALITY ('0000010'B), |
| 25 | GSM0808_CAUSE_UPLINK_STRENGTH ('0000011'B), |
| 26 | GSM0808_CAUSE_DOWNLINK_QUALITY ('0000100'B), |
| 27 | GSM0808_CAUSE_DOWNLINK_STRENGTH ('0000101'B), |
| 28 | GSM0808_CAUSE_DISTANCE ('0000110'B), |
| 29 | GSM0808_CAUSE_O_AND_M_INTERVENTION ('0000111'B), |
| 30 | GSM0808_CAUSE_RESPONSE_TO_MSC_INVOCATION ('0001000'B), |
| 31 | GSM0808_CAUSE_CALL_CONTROL ('0001001'B), |
| 32 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE_REVERSION ('0001010'B), |
| 33 | GSM0808_CAUSE_HANDOVER_SUCCESSFUL ('0001011'B), |
| 34 | GSM0808_CAUSE_BETTER_CELL ('0001100'B), |
| 35 | GSM0808_CAUSE_DIRECTED_RETRY ('0001101'B), |
| 36 | GSM0808_CAUSE_JOINED_GROUP_CALL_CHANNEL ('0001110'B), |
| 37 | GSM0808_CAUSE_TRAFFIC ('0001111'B), |
| 38 | GSM0808_CAUSE_REDUCE_LOAD_IN_SERVING_CELL ('0010000'B), |
| 39 | GSM0808_CAUSE_TRAFFIC_LOAD_IN_TGT_HIGHER_THAN_IN_SRC_CELL ('0010001'B), |
| 40 | GSM0808_CAUSE_RELOCATION_TRIGGERED ('0010010'B), |
| 41 | GSM0808_CAUSE_REQUSTED_OPT_NOT_AUTHORISED ('0010100'B), |
| 42 | GSM0808_CAUSE_ALT_CHAN_CONFIG_REQUESTED ('0010101'B), |
| 43 | GSM0808_CAUSE_RESP_TO_INT_HO_ENQ_MSG ('0010110'B), |
| 44 | GSM0808_CAUSE_INT_HO_ENQUIRY_REJECT ('0010111'B), |
| 45 | GSM0808_CAUSE_REDUNDANCY_LEVEL_NOT_ADEQUATE ('0011000'B), |
| 46 | /* reserved */ |
| 47 | /* 010: Resource unavailable */ |
| 48 | GSM0808_CAUSE_EQUIPMENT_FAILURE ('0100000'B), |
| 49 | GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE ('0100001'B), |
| 50 | GSM0808_CAUSE_RQSTED_TERRESTRIAL_RESOURCE_UNAVAILABLE ('0100010'B), |
| 51 | GSM0808_CAUSE_CCCH_OVERLOAD ('0100011'B), |
| 52 | GSM0808_CAUSE_PROCESSOR_OVERLOAD ('0100100'B), |
| 53 | GSM0808_CAUSE_BSS_NOT_EQUIPPED ('0100101'B), |
| 54 | GSM0808_CAUSE_MS_NOT_EQUIPPED ('0100110'B), |
| 55 | GSM0808_CAUSE_INVALID_CELL ('0100111'B), |
| 56 | GSM0808_CAUSE_TRAFFIC_LOAD ('0101000'B), |
| 57 | GSM0808_CAUSE_PREEMPTION ('0101001'B), |
| 58 | GSM0808_CAUSE_DTM_HO_SGSN_FAILURE ('0101010'B), |
| 59 | GSM0808_CAUSE_DTM_HO_PS_ALLOC_FAILURE ('0101011'B), |
| 60 | /* reserved */ |
| 61 | /* 011: Service or option not available, but implemented */ |
| 62 | GSM0808_CAUSE_RQSTED_TRANSCODING_RATE_ADAPTION_UNAVAILABLE ('0110000'B), |
| 63 | GSM0808_CAUSE_CIRCUIT_POOL_MISMATCH ('0110001'B), |
| 64 | GSM0808_CAUSE_SWITCH_CIRCUIT_POOL ('0110010'B), |
| 65 | GSM0808_CAUSE_RQSTED_SPEECH_VERSION_UNAVAILABLE ('0110011'B), |
| 66 | GSM0808_CAUSE_LSA_NOT_ALLOWED ('0110100'B), |
| 67 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL ('0110101'B), |
| 68 | GSM0808_CAUSE_REQ_A_IF_TYPE_UNAVAIL ('0110110'B), |
| 69 | GSM0808_CAUSE_INVALID_CSG_CELL ('0110111'B), |
| 70 | /* reserved */ |
| 71 | /* 100: Service or option not implemented or currently disabled */ |
| 72 | GSM0808_CAUSE_REQ_REDUND_LEVEL_NOT_AVAIL ('0111111'B), |
| 73 | GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED ('1000000'B), |
| 74 | GSM0808_CAUSE_GERAN_IU_MODE_FAILURE ('1000001'B), |
| 75 | GSM0808_CAUSE_INC_RELOC_NOT_SUPP_DT_PUESBINE_FEATURE ('1000010'B), |
| 76 | GSM0808_CAUSE_ACCESS_RESTRICTED_DUE_TO_SHARED_NETWORKS ('1000011'B), |
| 77 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP ('1000100'B), |
| 78 | GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP ('1000101'B), |
| 79 | GSM0808_CAUSE_REQ_REDUND_LVL_NOT_SUPP ('1000110'B), |
| 80 | /* reserved */ |
| 81 | /* 101: Invalid message */ |
| 82 | GSM0808_CAUSE_TERRESTRIAL_CIRCUIT_ALREADY_ALLOCATED ('1010000'B), |
| 83 | GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS ('1010001'B), |
| 84 | GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING ('1010010'B), |
| 85 | GSM0808_CAUSE_INCORRECT_VALUE ('1010011'B), |
| 86 | GSM0808_CAUSE_UNKNOWN_MESSAGE_TYPE ('1010100'B), |
| 87 | GSM0808_CAUSE_UNKNOWN_INFORMATION_ELEMENT ('1010101'B), |
| 88 | GSM0808_CAUSE_DTM_HO_INVALID_PS_IND ('1010110'B), |
| 89 | GSM0808_CAUSE_CALL_ID_ALREADY_ALLOC ('1010111'B), |
| 90 | /* reserved */ |
| 91 | /* 110: protocol error */ |
| 92 | GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC ('1100000'B), |
| 93 | GSM0808_CAUSE_VGCS_VBS_CALL_NON_EXISTANT ('1100001'B), |
| 94 | GSM0808_CAUSE_DTM_HO_TIMER_EXPIRY ('1100010'B) |
| 95 | } with { variant "FIELDLENGTH(7)" }; |
| 96 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 97 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 98 | discriminator := '0'B, |
| 99 | spare := '0000000'B, |
| 100 | dlci := omit, |
| 101 | lengthIndicator := 0, /* overwritten by codec */ |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 102 | pdu := { |
| 103 | bssmap := ? |
| 104 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 108 | discriminator := '0'B, |
| 109 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 110 | dlci := *, |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 111 | lengthIndicator := ?, |
| 112 | pdu := { |
| 113 | bssmap := ? |
| 114 | } |
| 115 | } |
| 116 | |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 117 | template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 118 | discriminator := '1'B, |
| 119 | spare := '0000000'B, |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 120 | dlci := dlci, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 121 | lengthIndicator := 0, /* overwritten by codec */ |
| 122 | pdu := { |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 123 | dtap := dtap |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | |
| 127 | template PDU_BSSAP tr_BSSAP_DTAP := { |
| 128 | discriminator := '1'B, |
| 129 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 130 | dlci := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 131 | lengthIndicator := ?, |
| 132 | pdu := { |
| 133 | dtap := ? |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 138 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 139 | elementIdentifier := '04'O, |
| 140 | lengthIndicator := 0, |
| 141 | causeValue := int2bit(val, 7), |
| 142 | extensionCauseValue := '0'B, |
| 143 | spare1 := omit |
| 144 | } |
| 145 | |
| 146 | template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| 147 | pdu := { |
| 148 | bssmap := { |
| 149 | reset := { |
| 150 | messageType := '30'O, |
| 151 | cause := ts_BSSMAP_IE_Cause(cause), |
| 152 | a_InterfaceSelectorForReset := omit |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 158 | template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := { |
| 159 | pdu := { |
| 160 | bssmap := { |
| 161 | reset := { |
| 162 | messageType := '30'O, |
| 163 | cause := ?, |
| 164 | a_InterfaceSelectorForReset := * |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 170 | template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| 171 | pdu := { |
| 172 | bssmap := { |
| 173 | resetAck := { |
| 174 | messageType := '31'O, |
| 175 | a_InterfaceSelectorForReset := omit |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| 182 | pdu := { |
| 183 | bssmap := { |
| 184 | resetAck := { |
| 185 | messageType := '31'O, |
| 186 | a_InterfaceSelectorForReset := * |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 193 | elementIdentifier := '05'O, |
| 194 | lengthIndicator := 0, |
| 195 | cellIdentifierDiscriminator := '0000'B, |
| 196 | spare1_4 := '0000'B, |
| 197 | cellIdentification := ? |
| 198 | } |
| 199 | |
| 200 | type uint16_t BssmapLAC; |
| 201 | type uint16_t BssmapCI; |
| 202 | |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 203 | template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 204 | modifies ts_BSSMAP_IE_CellID := { |
| 205 | cellIdentification := { |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 206 | cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 207 | } |
| 208 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 209 | |
| 210 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 211 | modifies ts_BSSMAP_IE_CellID := { |
| 212 | cellIdentification := { |
| 213 | cI_LAC_CI := { |
| 214 | lac := int2oct(lac, 2), |
| 215 | ci := int2oct(ci, 2) |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 221 | modifies ts_BSSMAP_IE_CellID := { |
| 222 | cellIdentification := { |
| 223 | cI_CI := int2oct(ci, 2) |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 228 | modifies ts_BSSMAP_IE_CellID := { |
| 229 | cellIdentification := { |
| 230 | cI_noCell := ''O |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | |
| 235 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 236 | elementIdentifier := '17'O, |
| 237 | lengthIndicator := 0, |
| 238 | layer3info := l3info |
| 239 | } |
| 240 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 241 | template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring l3info) := { |
| 242 | elementIdentifier := '17'O, |
| 243 | lengthIndicator := ?, |
| 244 | layer3info := l3info |
| 245 | } |
| 246 | |
| 247 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 248 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 249 | modifies ts_BSSAP_BSSMAP := { |
| 250 | pdu := { |
| 251 | bssmap := { |
| 252 | completeLayer3Information := { |
| 253 | messageType := '57'O, |
| 254 | cellIdentifier := cell_id, |
| 255 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 256 | chosenChannel := omit, |
| 257 | lSAIdentifier := omit, |
| 258 | aPDU := omit, |
| 259 | codecList := omit, |
| 260 | redirectAttemptFlag := omit, |
| 261 | sendSequenceNumber := omit, |
| 262 | iMSI := omit |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 268 | template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?, |
| 269 | template BSSMAP_IE_CellIdentifier cell_id := ?) |
| 270 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 271 | pdu := { |
| 272 | bssmap := { |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 273 | completeLayer3Information := { |
| 274 | messageType := '57'O, |
| 275 | cellIdentifier := cell_id, |
| 276 | layer3Information := tr_BSSMAP_IE_L3Info(l3_info), |
| 277 | chosenChannel := *, |
| 278 | lSAIdentifier := *, |
| 279 | aPDU := *, |
| 280 | codecList := *, |
| 281 | redirectAttemptFlag := *, |
| 282 | sendSequenceNumber := *, |
| 283 | iMSI := * |
| 284 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 289 | template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(BSSMAP_FIELD_CellIdentificationList cid_list) := { |
| 290 | elementIdentifier := '1A'O, |
| 291 | lengthIndicator := 0, /* overwritten */ |
| 292 | cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| 293 | spare1_4 := '0000'B, |
| 294 | cellIdentificationList := cid_list |
| 295 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 296 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 297 | template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_FIELD_CellIdentificationList cid_list) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 298 | modifies ts_BSSAP_BSSMAP := { |
| 299 | pdu := { |
| 300 | bssmap := { |
| 301 | handoverRequired := { |
| 302 | messageType := '11'O, |
| 303 | cause := ts_BSSMAP_IE_Cause(cause), |
| 304 | responseRequest := omit, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 305 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 306 | circuitPoolList := omit, |
| 307 | currentChannelType1 := omit, |
| 308 | speechVersion := omit, |
| 309 | queueingIndicator := omit, |
| 310 | oldToNewBSSInfo := omit, |
| 311 | sourceToTargetRNCTransparentInfo := omit, |
| 312 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 313 | gERANClassmark := omit, |
| 314 | talkerPriority := omit, |
| 315 | speechCodec := omit, |
| 316 | cSG_Identifier := omit |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | } |
| 321 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 322 | const OCT1 ChRate_ANY := '00'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 323 | const OCT1 ChRate_TCHF := '08'O; |
| 324 | const OCT1 ChRate_TCHH := '09'O; |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 325 | const OCT1 ChRate_TCHForH_Fpref := '0A'O; |
| 326 | const OCT1 ChRate_TCHForH_Hpref := '0B'O; |
| 327 | const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O; |
| 328 | const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O; |
| 329 | const OCT1 ChRate_TCHForH := '0F'O; |
| 330 | const OCT1 ChRate_TCHForH_nochg := '1F'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 331 | |
| 332 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 333 | elementIdentifier := '0B'O, /* overwritten */ |
| 334 | lengthIndicator := 0, /* overwritten */ |
| 335 | speechOrDataIndicator := '0001'B, /* speech */ |
| 336 | spare1_4 := '0000'B, |
| 337 | channelRateAndType := ChRate_TCHF, |
| 338 | speechId_DataIndicator := '01'O /* FRv1 */ |
| 339 | } |
| 340 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 341 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := { |
| 342 | speechOrDataIndicator := '0100'B /* speech + CTM */ |
| 343 | } |
| 344 | |
| 345 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := { |
| 346 | elementIdentifier := '0B'O, /* overwritten */ |
| 347 | lengthIndicator := 0, /* overwritten */ |
| 348 | speechOrDataIndicator := '0010'B, /* data */ |
| 349 | spare1_4 := '0000'B, |
| 350 | channelRateAndType := ChRate_TCHF, |
| 351 | speechId_DataIndicator := '10'O /* 9600 bps / transparent */ |
| 352 | } |
| 353 | |
| 354 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := { |
| 355 | elementIdentifier := '0B'O, /* overwritten */ |
| 356 | lengthIndicator := 0, /* overwritten */ |
| 357 | speechOrDataIndicator := '0011'B, /* data */ |
| 358 | spare1_4 := '0000'B, |
| 359 | channelRateAndType := ChRate_ANY, |
| 360 | speechId_DataIndicator := '00'O /* spare */ |
| 361 | } |
| 362 | |
| 363 | template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := { |
| 364 | elementIdentifier := '0A'O, |
| 365 | lengthIndicator := 0, /* overwritten */ |
| 366 | permittedAlgorithms := algs, |
| 367 | key := kc |
| 368 | } |
| 369 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 370 | template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { |
| 371 | elementIdentifier := '0A'O, |
| 372 | lengthIndicator := ?, /* overwritten */ |
| 373 | permittedAlgorithms := algs, |
| 374 | key := kc |
| 375 | } |
| 376 | |
| 377 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 378 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 379 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 380 | elementIdentifier := '01'O, /* overwritten */ |
| 381 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 382 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 383 | } |
| 384 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 385 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr, |
| 386 | uint16_t udp_port) := { |
| 387 | elementIdentifier := '7C'O, |
| 388 | lengthIndicator := 0, /* overwritten */ |
| 389 | ipAddress := addr, |
| 390 | uDPPortValue := udp_port |
| 391 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 392 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) := |
| 393 | ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt); |
| 394 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) := |
| 395 | ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt); |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 396 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 397 | template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { |
| 398 | elementIdentifier := '83'O, |
| 399 | kC128_Value := kc128 |
| 400 | } |
| 401 | |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 402 | /* 3.2.2.103 */ |
| 403 | template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := { |
| 404 | codecType := GSM_FR, |
| 405 | tF := '0'B, |
| 406 | pT := '0'B, |
| 407 | pI := '0'B, |
| 408 | fI := '1'B, |
| 409 | extendedCodecType := omit, |
| 410 | s0_7 := omit, |
| 411 | s8_15 := omit |
| 412 | } |
| 413 | template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := { |
| 414 | codecType := GSM_FR |
| 415 | } |
| 416 | template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := { |
| 417 | codecType := GSM_EFR |
| 418 | } |
| 419 | template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := { |
| 420 | codecType := GSM_HR |
| 421 | } |
| 422 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := { |
| 423 | codecType := FR_AMR, |
| 424 | s0_7 := '11111111'B, |
| 425 | s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */ |
| 426 | } |
| 427 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := { |
| 428 | codecType := HR_AMR, |
| 429 | s0_7 := '00111111'B, |
| 430 | s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */ |
| 431 | } |
| 432 | template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { |
| 433 | elementIdentifier := '7D'O, |
| 434 | lengthIndicator := 0, /* overwritten */ |
| 435 | codecElements := valueof(elem) |
| 436 | } |
| 437 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 438 | template PDU_BSSAP |
| 439 | ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 440 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 441 | modifies ts_BSSAP_BSSMAP := { |
| 442 | pdu := { |
| 443 | bssmap := { |
| 444 | assignmentRequest := { |
| 445 | messageType :='01'O, /* overwritten */ |
| 446 | channelType := ts_BSSMAP_IE_ChannelType, |
| 447 | layer3HeaderInfo := omit, |
| 448 | priority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 449 | circuitIdentityCode := cic, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 450 | downLinkDTX_Flag := omit, |
| 451 | interferenceBandToBeUsed := omit, |
| 452 | classmarkInformationType2 := omit, |
| 453 | groupCallReference := omit, |
| 454 | talkerFlag := omit, |
| 455 | configurationEvolutionIndication := omit, |
| 456 | lsaAccesControlSuppression := omit, |
| 457 | serviceHandover := omit, |
| 458 | encryptionInformation := omit, |
| 459 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 460 | aoIPTransportLayer := aoip, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 461 | codecList := omit, |
| 462 | callIdentifier := omit, |
| 463 | kC128 := omit, |
| 464 | globalCallReference := omit, |
| 465 | lCLS_Configuration := omit, |
| 466 | lCLS_ConnectionStatusControl := omit, |
| 467 | lCLS_CorrelationNotNeeded := omit |
| 468 | } |
| 469 | } |
| 470 | } |
| 471 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 472 | |
Harald Welte | ab05d6c | 2017-11-23 18:50:52 +0100 | [diff] [blame] | 473 | template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 474 | pdu := { |
| 475 | bssmap := { |
| 476 | assignmentRequest := { |
| 477 | messageType :='01'O, /* overwritten */ |
| 478 | channelType := ?, |
| 479 | layer3HeaderInfo := *, |
| 480 | priority := *, |
Harald Welte | b6c6ec1 | 2018-01-26 10:33:04 +0100 | [diff] [blame] | 481 | circuitIdentityCode := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 482 | downLinkDTX_Flag := *, |
| 483 | interferenceBandToBeUsed := *, |
| 484 | classmarkInformationType2 := *, |
| 485 | groupCallReference := *, |
| 486 | talkerFlag := *, |
| 487 | configurationEvolutionIndication := *, |
| 488 | lsaAccesControlSuppression := *, |
| 489 | serviceHandover := *, |
| 490 | encryptionInformation := *, |
| 491 | talkerPriority := *, |
| 492 | aoIPTransportLayer := *, |
| 493 | codecList := *, |
| 494 | callIdentifier := *, |
| 495 | kC128 := *, |
| 496 | globalCallReference := *, |
| 497 | lCLS_Configuration := *, |
| 498 | lCLS_ConnectionStatusControl := *, |
| 499 | lCLS_CorrelationNotNeeded := * |
| 500 | } |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 505 | template PDU_BSSAP |
| 506 | ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 507 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit) |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 508 | modifies ts_BSSAP_BSSMAP := { |
| 509 | pdu := { |
| 510 | bssmap := { |
| 511 | assignmentComplete := { |
| 512 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 513 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 514 | circuitIdentityCode := cic, |
| 515 | cellIdentifier := omit, |
| 516 | chosenChannel := omit, |
| 517 | chosenEncryptionAlgorithm := omit, |
| 518 | circuitPool := omit, |
| 519 | speechVersion := omit, |
| 520 | lSAIdentifier := omit, |
| 521 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 522 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 523 | speechCodec := omit, |
| 524 | codecList := omit, |
| 525 | lCLS_BSS_Status := omit |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | } |
| 530 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 531 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *, |
| 532 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) |
| 533 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 534 | pdu := { |
| 535 | bssmap := { |
| 536 | assignmentComplete := { |
| 537 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 538 | rR_Cause := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 539 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 540 | cellIdentifier := *, |
| 541 | chosenChannel := *, |
| 542 | chosenEncryptionAlgorithm := *, |
| 543 | circuitPool := *, |
| 544 | speechVersion := *, |
| 545 | lSAIdentifier := *, |
| 546 | talkerPriority := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 547 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 548 | speechCodec := *, |
| 549 | codecList := *, |
| 550 | lCLS_BSS_Status := * |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 556 | template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := { |
| 557 | pdu := { |
| 558 | bssmap := { |
| 559 | assignmentFailure := { |
| 560 | messageType := '03'O, /* overwritten */ |
| 561 | rR_Cause := *, |
| 562 | circuitPool := *, |
| 563 | circuitPoolList := *, |
| 564 | talkerPriority := *, |
| 565 | codecList := * |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 572 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 573 | modifies ts_BSSAP_BSSMAP := { |
| 574 | pdu := { |
| 575 | bssmap := { |
| 576 | clearCommand := { |
| 577 | messageType := '20'O, /* overwritten */ |
| 578 | layer3HeaderInfo := omit, |
| 579 | cause := ts_BSSMAP_IE_Cause(cause), |
| 580 | cSFB_Indication := omit |
| 581 | } |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 587 | pdu := { |
| 588 | bssmap := { |
| 589 | clearCommand := { |
| 590 | messageType := '20'O, /* overwritten */ |
| 591 | layer3HeaderInfo := *, |
| 592 | cause := ?, |
| 593 | cSFB_Indication := * |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | |
| 599 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 600 | modifies ts_BSSAP_BSSMAP := { |
| 601 | pdu := { |
| 602 | bssmap := { |
| 603 | clearComplete := { |
| 604 | messageType := '21'O /* overwritten */ |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 610 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 611 | pdu := { |
| 612 | bssmap := { |
| 613 | clearComplete := { |
| 614 | messageType := '21'O |
| 615 | } |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 620 | template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) |
| 621 | modifies ts_BSSAP_BSSMAP := { |
| 622 | pdu := { |
| 623 | bssmap := { |
| 624 | clearRequest := { |
| 625 | messageType := '22'O, /* overwritten */ |
| 626 | cause := ts_BSSMAP_IE_Cause(cause) |
| 627 | } |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 632 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 633 | pdu := { |
| 634 | bssmap := { |
| 635 | clearRequest := { |
| 636 | messageType := '22'O, /* overwritten */ |
| 637 | cause := ? |
| 638 | } |
| 639 | } |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 644 | function f_hex_is_odd_length(hexstring digits) return bitstring { |
| 645 | if (lengthof(digits) rem 2 == 1) { |
| 646 | return '1'B; |
| 647 | } else { |
| 648 | return '0'B; |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 653 | elementIdentifier := '08'O, |
| 654 | lengthIndicator := 0, /* overwritten */ |
| 655 | typeOfIdentity := '001'B, /* IMSI */ |
| 656 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 657 | digits := imsi_digits |
| 658 | } |
| 659 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 660 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 661 | cIl_noCell := ''O |
| 662 | } |
| 663 | |
| 664 | private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Stefan Sperling | 6d9309b | 2018-01-08 15:17:18 +0100 | [diff] [blame] | 665 | return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 666 | } |
| 667 | |
| 668 | template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { |
| 669 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 670 | lac := int2oct(lac, 2), |
| 671 | ci := int2oct(ci, 2) |
| 672 | } |
| 673 | |
| 674 | template BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := { |
| 675 | lac := int2oct(lac, 2), |
| 676 | ci := int2oct(ci, 2) |
| 677 | } |
| 678 | |
| 679 | template BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := { |
| 680 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 681 | lac := int2oct(lac, 2) |
| 682 | } |
| 683 | |
| 684 | template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
| 685 | template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 686 | |
| 687 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 688 | elementIdentifier := '24'O, |
| 689 | channel := chneed, |
| 690 | spare := '000000'B |
| 691 | } |
| 692 | |
| 693 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 694 | elementIdentifier := '09'O, |
| 695 | lengthIndicator := 4, |
| 696 | tmsiOctets := tmsi |
| 697 | }; |
| 698 | |
| 699 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 700 | var template BSSMAP_IE_TMSI ret; |
| 701 | if (ispresent(tmsi)) { |
| 702 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 703 | } else { |
| 704 | ret := omit; |
| 705 | } |
| 706 | return ret; |
| 707 | } |
| 708 | |
| 709 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 710 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 711 | template OCT4 tmsi := omit, |
| 712 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 713 | modifies ts_BSSAP_BSSMAP := { |
| 714 | pdu := { |
| 715 | bssmap := { |
| 716 | paging := { |
| 717 | messageType := '51'O, |
| 718 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 719 | tMSI := f_tmsi_or_omit(tmsi), |
| 720 | cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), |
| 721 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 722 | eMLPP_Priority := omit, |
| 723 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 724 | } |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 729 | template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) |
| 730 | modifies ts_BSSAP_BSSMAP := { |
| 731 | pdu := { |
| 732 | bssmap := { |
| 733 | cipherModeCommand := { |
| 734 | messageType := '53'O, |
| 735 | layer3HeaderInfo := omit, |
| 736 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 737 | cipherResponseMode := omit, |
| 738 | kC128 := omit |
| 739 | } |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128) |
| 745 | modifies ts_BSSAP_BSSMAP := { |
| 746 | pdu := { |
| 747 | bssmap := { |
| 748 | cipherModeCommand := { |
| 749 | messageType := '53'O, |
| 750 | layer3HeaderInfo := omit, |
| 751 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 752 | cipherResponseMode := omit, |
| 753 | kC128 := { '83'O, kc128 } |
| 754 | } |
| 755 | } |
| 756 | } |
| 757 | } |
| 758 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 759 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key) |
| 760 | modifies tr_BSSAP_BSSMAP := { |
| 761 | pdu := { |
| 762 | bssmap := { |
| 763 | cipherModeCommand := { |
| 764 | messageType := '53'O, |
| 765 | layer3HeaderInfo := *, |
| 766 | encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg), |
| 767 | cipherResponseMode := *, |
| 768 | kC128 := * |
| 769 | } |
| 770 | } |
| 771 | } |
| 772 | } |
| 773 | |
| 774 | template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) |
| 775 | modifies ts_BSSAP_BSSMAP := { |
| 776 | pdu := { |
| 777 | bssmap := { |
| 778 | cipherModeComplete := { |
| 779 | messageType := '55'O, |
| 780 | layer3MessageContents := omit, |
| 781 | chosenEncryptionAlgorithm := { |
| 782 | elementIdentifier := '2C'O, |
| 783 | algorithmIdentifier := alg |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | } |
| 788 | } |
| 789 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 790 | template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { |
| 791 | pdu := { |
| 792 | bssmap := { |
| 793 | cipherModeComplete := { |
| 794 | messageType := '55'O, |
| 795 | layer3MessageContents := *, |
| 796 | chosenEncryptionAlgorithm := { |
| 797 | elementIdentifier := '2C'O, |
| 798 | algorithmIdentifier := alg |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := { |
| 806 | pdu := { |
| 807 | bssmap := { |
| 808 | cipherModeReject := { |
| 809 | messageType := '59'O, |
| 810 | cause := ? |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 816 | template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { |
| 817 | elementIdentifier := '12'O, |
| 818 | lengthIndicator := 0, /* overwritten */ |
| 819 | /* CM1 */ |
| 820 | rf_PowerCapability := '010'B, /* class3 */ |
| 821 | a5_1 := '0'B, /* supported */ |
| 822 | esind := '1'B, /* early classmark supported */ |
| 823 | revisionLevel := '10'B, /* R99 */ |
| 824 | spare1_1 := '0'B, |
| 825 | /* CM2 */ |
| 826 | fc := '1'B, /* E-GSM support */ |
| 827 | vgcs := '0'B, |
| 828 | vbs := '0'B, |
| 829 | sm_Capability := '1'B, |
| 830 | ss_ScreenIndicator := '00'B, |
| 831 | ps_Capability := '1'B, |
| 832 | spare2_1 := '0'B, |
| 833 | classmarkInformationType2_oct5 := { |
| 834 | a5_2 := '0'B, /* not available */ |
| 835 | a5_3 := '1'B, /* available */ |
| 836 | cmsp := '0'B, /* not supported */ |
| 837 | solsa := '0'B, /* not suported */ |
| 838 | ucs2 := '0'B, /* GSM alphabet preferred */ |
| 839 | lcsvacap := '0'B, /* not supported */ |
| 840 | spare := '0'B, |
| 841 | cm3 := '0'B /* no CM3 */ |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, |
| 846 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) |
| 847 | modifies ts_BSSAP_BSSMAP := { |
| 848 | pdu := { |
| 849 | bssmap := { |
| 850 | classmarkUpdate := { |
| 851 | messageType := '54'O, |
| 852 | classmarkInformationType2 := cm2, |
| 853 | classmarkInformationType3 := cm3, |
| 854 | talkerPriority := omit |
| 855 | } |
| 856 | } |
| 857 | } |
| 858 | } |
| 859 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 860 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 861 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 862 | } with { encode "RAW" }; |