Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 1 | module GSUP_Types { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* GSUP_Types, defining abstract TTCN-3 data types for the GSUP protocol. |
| 4 | * |
| 5 | * GSUP is a non-standard protocol used between OsmoMSC/OsmoSGSN and OsmoHLR |
| 6 | * in order to replace the complex TCAP/MAP protocol. |
| 7 | * |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 8 | * (C) 2017-2019 by Harald Welte <laforge@gnumonks.org> |
| 9 | * contributions by sysmocom - s.f.m.c. GmbH |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 10 | * All rights reserved. |
| 11 | * |
| 12 | * Released under the terms of GNU General Public License, Version 2 or |
| 13 | * (at your option) any later version. |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 14 | * |
| 15 | * SPDX-License-Identifier: GPL-2.0-or-later |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 16 | */ |
| 17 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 18 | import from General_Types all; |
| 19 | import from Osmocom_Types all; |
| 20 | |
| 21 | type enumerated GSUP_IEI { |
| 22 | OSMO_GSUP_IMSI_IE ('01'O), |
| 23 | OSMO_GSUP_CAUSE_IE ('02'O), |
| 24 | OSMO_GSUP_AUTH_TUPLE_IE ('03'O), |
| 25 | OSMO_GSUP_PDP_INFO_COMPL_IE ('04'O), |
| 26 | OSMO_GSUP_PDP_INFO_IE ('05'O), |
| 27 | OSMO_GSUP_CANCEL_TYPE_IE ('06'O), |
| 28 | OSMO_GSUP_FREEZE_PTMSI_IE ('07'O), |
| 29 | OSMO_GSUP_MSISDN_IE ('08'O), |
| 30 | OSMO_GSUP_HLR_NUMBER_IE ('09'O), |
| 31 | OSMO_GSUP_PDP_CONTEXT_ID_IE ('10'O), |
| 32 | OSMO_GSUP_PDP_TYPE_IE ('11'O), |
| 33 | OSMO_GSUP_ACCESS_POINT_NAME_IE ('12'O), |
| 34 | OSMO_GSUP_PDP_QOS_IE ('13'O), |
| 35 | OSMO_GSUP_CHARG_CHAR_IE ('14'O), |
| 36 | |
| 37 | OSMO_GSUP_RAND_IE ('20'O), |
| 38 | OSMO_GSUP_SRES_IE ('21'O), |
| 39 | OSMO_GSUP_KC_IE ('22'O), |
| 40 | OSMO_GSUP_IK_IE ('23'O), |
| 41 | OSMO_GSUP_CK_IE ('24'O), |
| 42 | OSMO_GSUP_AUTN_IE ('25'O), |
| 43 | OSMO_GSUP_AUTS_IE ('26'O), |
| 44 | OSMO_GSUP_RES_IE ('27'O), |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 45 | OSMO_GSUP_CN_DOMAIN_IE ('28'O), |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 46 | OSMO_GSUP_SUPPORTED_RAT_TYPES_IE ('29'O), |
| 47 | OSMO_GSUP_CURRENT_RAT_TYPE_IE ('2a'O), |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 48 | |
| 49 | OSMO_GSUP_SESSION_ID_IE ('30'O), |
| 50 | OSMO_GSUP_SESSION_STATE_IE ('31'O), |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 51 | OSMO_GSUP_SS_INFO_IE ('35'O), |
| 52 | |
| 53 | /* SM related IEs (see 3GPP TS 29.002, section 7.6.8) */ |
| 54 | OSMO_GSUP_SM_RP_MR_IE ('40'O), |
| 55 | OSMO_GSUP_SM_RP_DA_IE ('41'O), |
| 56 | OSMO_GSUP_SM_RP_OA_IE ('42'O), |
| 57 | OSMO_GSUP_SM_RP_UI_IE ('43'O), |
| 58 | OSMO_GSUP_SM_RP_CAUSE_IE ('44'O), |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 59 | OSMO_GSUP_SM_RP_MMS_IE ('45'O), |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 60 | OSMO_GSUP_SM_ALERT_RSN_IE ('46'O), |
| 61 | |
| 62 | OSMO_GSUP_IMEI_IE ('50'O), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 63 | OSMO_GSUP_IMEI_RESULT_IE ('51'O), |
| 64 | |
| 65 | OSMO_GSUP_MESSAGE_CLASS_IE ('0a'O), |
| 66 | |
| 67 | OSMO_GSUP_SOURCE_NAME_IE ('60'O), |
| 68 | OSMO_GSUP_DESTINATION_NAME_IE ('61'O), |
| 69 | OSMO_GSUP_AN_APDU_IE ('62'O), |
| 70 | OSMO_GSUP_CAUSE_RR_IE ('63'O), |
| 71 | OSMO_GSUP_CAUSE_BSSAP_IE ('64'O), |
| 72 | OSMO_GSUP_CAUSE_SM_IE ('65'O) |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 73 | } with { variant "FIELDLENGTH(8)" }; |
| 74 | |
| 75 | type enumerated GSUP_MessageType { |
| 76 | OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST ('00000100'B), |
| 77 | OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR ('00000101'B), |
| 78 | OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT ('00000110'B), |
| 79 | |
| 80 | OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST ('00001000'B), |
| 81 | OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR ('00001001'B), |
| 82 | OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT ('00001010'B), |
| 83 | |
| 84 | OSMO_GSUP_MSGT_AUTH_FAIL_REPORT ('00001011'B), |
| 85 | |
| 86 | OSMO_GSUP_MSGT_PURGE_MS_REQUEST ('00001100'B), |
| 87 | OSMO_GSUP_MSGT_PURGE_MS_ERROR ('00001101'B), |
| 88 | OSMO_GSUP_MSGT_PURGE_MS_RESULT ('00001110'B), |
| 89 | |
| 90 | OSMO_GSUP_MSGT_INSERT_DATA_REQUEST ('00010000'B), |
| 91 | OSMO_GSUP_MSGT_INSERT_DATA_ERROR ('00010001'B), |
| 92 | OSMO_GSUP_MSGT_INSERT_DATA_RESULT ('00010010'B), |
| 93 | |
| 94 | OSMO_GSUP_MSGT_DELETE_DATA_REQUEST ('00010100'B), |
| 95 | OSMO_GSUP_MSGT_DELETE_DATA_ERROR ('00010101'B), |
| 96 | OSMO_GSUP_MSGT_DELETE_DATA_RESULT ('00010110'B), |
| 97 | |
| 98 | OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST ('00011100'B), |
| 99 | OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR ('00011101'B), |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 100 | OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT ('00011110'B), |
| 101 | |
| 102 | OSMO_GSUP_MSGT_PROC_SS_REQUEST ('00100000'B), |
| 103 | OSMO_GSUP_MSGT_PROC_SS_ERROR ('00100001'B), |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 104 | OSMO_GSUP_MSGT_PROC_SS_RESULT ('00100010'B), |
| 105 | |
| 106 | OSMO_GSUP_MSGT_MO_FORWARD_SM_REQUEST ('00100100'B), |
| 107 | OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR ('00100101'B), |
| 108 | OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT ('00100110'B), |
| 109 | |
| 110 | OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST ('00101000'B), |
| 111 | OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR ('00101001'B), |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 112 | OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT ('00101010'B), |
| 113 | |
| 114 | OSMO_GSUP_MSGT_READY_FOR_SM_REQUEST ('00101100'B), |
| 115 | OSMO_GSUP_MSGT_READY_FOR_SM_ERROR ('00101101'B), |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 116 | OSMO_GSUP_MSGT_READY_FOR_SM_RESULT ('00101110'B), |
| 117 | |
| 118 | OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST ('00110000'B), |
| 119 | OSMO_GSUP_MSGT_CHECK_IMEI_ERROR ('00110001'B), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 120 | OSMO_GSUP_MSGT_CHECK_IMEI_RESULT ('00110010'B), |
| 121 | |
| 122 | OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST ('00110100'B), |
| 123 | OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR ('00110101'B), |
| 124 | OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT ('00110110'B), |
| 125 | |
| 126 | OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST ('00111000'B), |
| 127 | OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR ('00111001'B), |
| 128 | OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT ('00111010'B), |
| 129 | |
| 130 | OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST ('00111100'B), |
| 131 | OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR ('00111101'B), |
| 132 | OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT ('00111110'B), |
| 133 | |
| 134 | OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST ('01000000'B), |
| 135 | OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST ('01000100'B), |
| 136 | |
| 137 | OSMO_GSUP_MSGT_E_CLOSE ('01000111'B), |
| 138 | OSMO_GSUP_MSGT_E_ABORT ('01001011'B), |
| 139 | |
| 140 | OSMO_GSUP_MSGT_E_ROUTING_ERROR ('01001110'B) |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 141 | } with { variant "FIELDLENGTH(8)" }; |
| 142 | |
| 143 | type enumerated GSUP_CancelType { |
Alexander Couzens | 4786b3f | 2018-09-16 03:33:30 +0200 | [diff] [blame] | 144 | OSMO_GSUP_CANCEL_TYPE_UPDATE (0), |
| 145 | OSMO_GSUP_CANCEL_TYPE_WITHDRAW (1) |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 146 | } with { variant "FIELDLENGTH(8)" }; |
| 147 | |
| 148 | type enumerated GSUP_CnDomain { |
| 149 | OSMO_GSUP_CN_DOMAIN_PS (1), |
| 150 | OSMO_GSUP_CN_DOMAIN_CS (2) |
| 151 | } with { variant "FIELDLENGTH(8)" }; |
| 152 | |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 153 | type enumerated GSUP_IMEIResult { |
| 154 | OSMO_GSUP_IMEI_RESULT_ACK (0), |
| 155 | OSMO_GSUP_IMEI_RESULT_NACK (1) |
| 156 | } with { variant "FIELDLENGTH(8)" }; |
| 157 | |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 158 | type enumerated GSUP_SessionState { |
| 159 | OSMO_GSUP_SESSION_STATE_NONE (0), |
| 160 | OSMO_GSUP_SESSION_STATE_BEGIN (1), |
| 161 | OSMO_GSUP_SESSION_STATE_CONTINUE (2), |
| 162 | OSMO_GSUP_SESSION_STATE_END (3) |
| 163 | } with { variant "FIELDLENGTH(8)" }; |
| 164 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 165 | type enumerated GSUP_Message_Class { |
| 166 | OSMO_GSUP_MESSAGE_CLASS_UNSET (0), |
| 167 | OSMO_GSUP_MESSAGE_CLASS_SUBSCRIBER_MANAGEMENT (1), |
| 168 | OSMO_GSUP_MESSAGE_CLASS_SMS (2), |
| 169 | OSMO_GSUP_MESSAGE_CLASS_USSD (3), |
| 170 | OSMO_GSUP_MESSAGE_CLASS_INTER_MSC (4) |
| 171 | } with { variant "FIELDLENGTH(8)" }; |
| 172 | |
Harald Welte | 3f95be8 | 2018-01-27 00:48:13 +0100 | [diff] [blame] | 173 | type record GSUP_MSISDN { |
| 174 | uint8_t len, |
| 175 | hexstring digits optional |
| 176 | } with { variant (len) "LENGTHTO(digits)" }; |
| 177 | |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 178 | type record GSUP_IMEI { |
| 179 | uint8_t len, |
| 180 | hexstring digits optional |
| 181 | } with { variant (len) "LENGTHTO(digits)" }; |
| 182 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 183 | type enumerated GSUP_AN_PROTO { |
| 184 | OSMO_GSUP_AN_PROTO_48006 (1), |
| 185 | OSMO_GSUP_AN_PROTO_25413 (2) |
| 186 | } with { variant "FIELDLENGTH(8)" }; |
| 187 | |
| 188 | type record GSUP_AN_APDU { |
| 189 | GSUP_AN_PROTO proto, |
| 190 | octetstring pdu |
| 191 | }; |
| 192 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 193 | type record GSUP_IE { |
| 194 | GSUP_IEI tag, |
| 195 | uint8_t len, |
| 196 | GSUP_IeValue val |
| 197 | } with { variant (len) "LENGTHTO(val)" |
| 198 | variant (val) "CROSSTAG(imsi, tag = OSMO_GSUP_IMSI_IE; |
| 199 | cause, tag = OSMO_GSUP_CAUSE_IE; |
| 200 | cancel_type, tag = OSMO_GSUP_CANCEL_TYPE_IE; |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 201 | auth_tuple, tag = OSMO_GSUP_AUTH_TUPLE_IE; |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 202 | auts, tag = OSMO_GSUP_AUTS_IE; |
| 203 | rand, tag = OSMO_GSUP_RAND_IE; |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 204 | sres, tag = OSMO_GSUP_SRES_IE; |
| 205 | kc, tag = OSMO_GSUP_KC_IE; |
| 206 | ik, tag = OSMO_GSUP_IK_IE; |
| 207 | ck, tag = OSMO_GSUP_CK_IE; |
| 208 | autn, tag = OSMO_GSUP_AUTN_IE; |
| 209 | res, tag = OSMO_GSUP_RES_IE; |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 210 | msisdn, tag = OSMO_GSUP_MSISDN_IE; |
| 211 | hlr_number, tag = OSMO_GSUP_HLR_NUMBER_IE; |
| 212 | cn_domain, tag = OSMO_GSUP_CN_DOMAIN_IE; |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 213 | pdp_info, tag = OSMO_GSUP_PDP_INFO_IE; |
| 214 | apn, tag = OSMO_GSUP_ACCESS_POINT_NAME_IE; |
| 215 | pdp_qos, tag = OSMO_GSUP_PDP_QOS_IE; |
| 216 | pdp_type, tag = OSMO_GSUP_PDP_TYPE_IE; |
| 217 | charg_char, tag = OSMO_GSUP_CHARG_CHAR_IE; |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 218 | session_state, tag = OSMO_GSUP_SESSION_STATE_IE; |
| 219 | session_id, tag = OSMO_GSUP_SESSION_ID_IE; |
| 220 | ss_info, tag = OSMO_GSUP_SS_INFO_IE; |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 221 | sm_rp_mr, tag = OSMO_GSUP_SM_RP_MR_IE; |
| 222 | sm_rp_da, tag = OSMO_GSUP_SM_RP_DA_IE; |
| 223 | sm_rp_oa, tag = OSMO_GSUP_SM_RP_OA_IE; |
| 224 | sm_rp_ui, tag = OSMO_GSUP_SM_RP_UI_IE; |
| 225 | sm_rp_cause, tag = OSMO_GSUP_SM_RP_CAUSE_IE; |
| 226 | sm_rp_mms, tag = OSMO_GSUP_SM_RP_MMS_IE; |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 227 | sm_alert_rsn, tag = OSMO_GSUP_SM_ALERT_RSN_IE; |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 228 | imei, tag = OSMO_GSUP_IMEI_IE; |
| 229 | imei_result, tag = OSMO_GSUP_IMEI_RESULT_IE; |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 230 | message_class, tag = OSMO_GSUP_MESSAGE_CLASS_IE; |
| 231 | source_name, tag = OSMO_GSUP_SOURCE_NAME_IE; |
| 232 | destination_name, tag = OSMO_GSUP_DESTINATION_NAME_IE; |
| 233 | an_apdu, tag = OSMO_GSUP_AN_APDU_IE; |
| 234 | cause_rr, tag = OSMO_GSUP_CAUSE_RR_IE; |
| 235 | cause_bssap, tag = OSMO_GSUP_CAUSE_BSSAP_IE; |
| 236 | cause_sm, tag = OSMO_GSUP_CAUSE_SM_IE; |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 237 | supported_rat_types, tag = OSMO_GSUP_SUPPORTED_RAT_TYPES_IE; |
| 238 | current_rat_type, tag = OSMO_GSUP_CURRENT_RAT_TYPE_IE; |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 239 | )" |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 240 | }; |
| 241 | |
| 242 | type record of GSUP_IE GSUP_IEs; |
| 243 | |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 244 | type enumerated GSUP_RatType { |
| 245 | RAT_TYPE_UNKNOWN (0), |
| 246 | RAT_TYPE_GERAN_A (1), |
| 247 | RAT_TYPE_UTRAN_Iu (2), |
| 248 | RAT_TYPE_EUTRAN_SGs (3) |
| 249 | } with { variant "FIELDLENGTH(8)" }; |
| 250 | |
| 251 | type record of GSUP_RatType GSUP_RatTypes; |
| 252 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 253 | type union GSUP_IeValue { |
| 254 | hexstring imsi, |
| 255 | integer cause, |
| 256 | GSUP_CancelType cancel_type, |
| 257 | //boolean pdp_info_compl, |
| 258 | //boolean freeze_ptmsi, |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 259 | GSUP_IEs auth_tuple, |
| 260 | octetstring auts, |
| 261 | octetstring rand, |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 262 | octetstring sres, |
| 263 | octetstring kc, |
| 264 | octetstring ik, |
| 265 | octetstring ck, |
| 266 | octetstring autn, |
| 267 | octetstring res, |
Harald Welte | 3f95be8 | 2018-01-27 00:48:13 +0100 | [diff] [blame] | 268 | GSUP_MSISDN msisdn, |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 269 | octetstring hlr_number, |
| 270 | GSUP_CnDomain cn_domain, |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 271 | /* PDP context + nested IEs */ |
| 272 | GSUP_IEs pdp_info, |
| 273 | octetstring apn, |
| 274 | octetstring pdp_qos, |
| 275 | OCT2 pdp_type, |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 276 | octetstring charg_char, |
| 277 | /* Session information */ |
| 278 | GSUP_SessionState session_state, |
| 279 | OCT4 session_id, |
| 280 | /* Supplementary Services */ |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 281 | octetstring ss_info, |
| 282 | /* Short Message Service */ |
| 283 | OCT1 sm_rp_mr, |
| 284 | GSUP_SM_RP_DA sm_rp_da, |
| 285 | GSUP_SM_RP_OA sm_rp_oa, |
| 286 | octetstring sm_rp_ui, |
| 287 | OCT1 sm_rp_cause, |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 288 | OCT1 sm_rp_mms, |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 289 | GSUP_SM_ALERT_RSN_Type sm_alert_rsn, |
| 290 | |
| 291 | GSUP_IMEI imei, |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 292 | GSUP_IMEIResult imei_result, |
| 293 | |
| 294 | GSUP_Message_Class message_class, |
| 295 | |
| 296 | octetstring source_name, |
| 297 | octetstring destination_name, |
| 298 | |
| 299 | GSUP_AN_APDU an_apdu, |
| 300 | |
| 301 | OCT1 cause_rr, |
| 302 | OCT1 cause_bssap, |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 303 | OCT1 cause_sm, |
| 304 | |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 305 | GSUP_RatTypes supported_rat_types, |
| 306 | GSUP_RatType current_rat_type |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | type record GSUP_PDU { |
| 310 | GSUP_MessageType msg_type, |
| 311 | GSUP_IEs ies |
| 312 | }; |
| 313 | |
| 314 | external function enc_GSUP_PDU(in GSUP_PDU msg) return octetstring |
| 315 | with { extension "prototype(convert) encode(RAW)" }; |
| 316 | |
| 317 | external function dec_GSUP_PDU(in octetstring msg) return GSUP_PDU |
| 318 | with { extension "prototype(convert) decode(RAW)" }; |
| 319 | |
Harald Welte | 2f562b1 | 2018-01-24 20:52:38 +0100 | [diff] [blame] | 320 | function f_gsup_postprocess_decoded(inout GSUP_PDU gsup) { |
| 321 | if (gsup.ies[0].tag == OSMO_GSUP_IMSI_IE) { |
| 322 | /* if last digit is 'F', then there's an odd number of digits and we must strip the F */ |
| 323 | var integer num_digits := lengthof(gsup.ies[0].val.imsi); |
| 324 | if (gsup.ies[0].val.imsi[num_digits-1] == 'F'H) { |
| 325 | gsup.ies[0].val.imsi := substr(gsup.ies[0].val.imsi, 0, num_digits-1); |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | function f_gsup_preprocess_encoded(inout GSUP_PDU gsup) { |
| 331 | if (ischosen(gsup.ies[0].val.imsi)) { |
| 332 | /* if number of digits is odd, add a 'F' as padding at the end */ |
| 333 | var integer num_digits := lengthof(gsup.ies[0].val.imsi); |
| 334 | if (num_digits rem 2 == 1) { |
| 335 | gsup.ies[0].val.imsi := gsup.ies[0].val.imsi & 'F'H; |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | |
Harald Welte | 3f95be8 | 2018-01-27 00:48:13 +0100 | [diff] [blame] | 340 | template (value) GSUP_MSISDN ts_GSUP_MSISDN(hexstring digits, |
| 341 | BIT3 ton := '000'B, |
| 342 | BIT4 npi := '0000'B) := { |
| 343 | len := 0, /* overwritten */ |
| 344 | /* numberingPlanIdentification := npi, |
| 345 | typeOfNumber := ton, |
| 346 | ext1 := '0'B, */ |
| 347 | digits := digits |
| 348 | } |
| 349 | |
| 350 | template GSUP_MSISDN tr_GSUP_MSISDN(template hexstring digits, |
| 351 | template BIT3 ton := ?, |
| 352 | template BIT4 npi := ?) := { |
| 353 | len := ?, |
| 354 | /* numberingPlanIdentification := npi, |
| 355 | typeOfNumber := ton, |
| 356 | ext1 := '0'B, */ |
| 357 | digits := digits |
| 358 | } |
| 359 | |
| 360 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 361 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 362 | template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, |
| 363 | octetstring kc) := { |
| 364 | tag := OSMO_GSUP_AUTH_TUPLE_IE, |
| 365 | len := 0, /* overwritten */ |
| 366 | val := { |
| 367 | auth_tuple := { |
| 368 | valueof(ts_GSUP_IE_RAND(rand)), |
| 369 | valueof(ts_GSUP_IE_SRES(sres)), |
| 370 | valueof(ts_GSUP_IE_Kc(kc)) |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | template GSUP_IE ts_GSUP_IE_AuthTuple2G3G(octetstring rand, octetstring sres, |
| 376 | octetstring kc, octetstring ik, |
| 377 | octetstring ck, octetstring autn, |
| 378 | octetstring res) := { |
| 379 | tag := OSMO_GSUP_AUTH_TUPLE_IE, |
| 380 | len := 0, /* overwritten */ |
| 381 | val := { |
| 382 | auth_tuple := { |
| 383 | valueof(ts_GSUP_IE_RAND(rand)), |
| 384 | valueof(ts_GSUP_IE_SRES(sres)), |
| 385 | valueof(ts_GSUP_IE_Kc(kc)), |
| 386 | valueof(ts_GSUP_IE_IK(ik)), |
| 387 | valueof(ts_GSUP_IE_CK(ck)), |
| 388 | valueof(ts_GSUP_IE_AUTN(autn)), |
| 389 | valueof(ts_GSUP_IE_RES(res)) |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 394 | template GSUP_IE ts_GSUP_IE_PdpInfo(octetstring apn, octetstring pdp_type, octetstring pdp_qos) := { |
| 395 | tag := OSMO_GSUP_PDP_INFO_IE, |
| 396 | len := 0, /* overwritten */ |
| 397 | val := { |
| 398 | pdp_info := { |
| 399 | valueof(ts_GSUP_IE_APN(apn)), |
| 400 | valueof(ts_GSUP_IE_PDP_TYPE(pdp_type)), |
| 401 | valueof(ts_GSUP_IE_PDP_QOS(pdp_qos)) |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | template (value) GSUP_IE ts_GSUP_IE_PDP_TYPE(OCT2 pdp_type) := { |
| 407 | tag := OSMO_GSUP_PDP_TYPE_IE, |
| 408 | len := 0, |
| 409 | val := { |
| 410 | pdp_type := pdp_type |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | template (value) GSUP_IE ts_GSUP_IE_PDP_QOS(octetstring pdp_qos) := { |
| 415 | tag := OSMO_GSUP_PDP_QOS_IE, |
| 416 | len := 0, |
| 417 | val := { |
| 418 | pdp_qos := pdp_qos |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 423 | template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := { |
| 424 | msg_type := msgt, |
| 425 | ies := ies |
| 426 | } |
| 427 | |
Harald Welte | 8a1dd53 | 2018-01-27 15:38:18 +0100 | [diff] [blame] | 428 | template GSUP_PDU tr_GSUP_IMSI(template GSUP_MessageType msgt := ?, template hexstring imsi) := { |
| 429 | msg_type := msgt, |
| 430 | ies := { tr_GSUP_IE_IMSI(imsi), * } |
| 431 | } |
| 432 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 433 | template GSUP_PDU ts_GSUP(GSUP_MessageType msgt, GSUP_IEs ies := {}) := { |
| 434 | msg_type := msgt, |
| 435 | ies := ies |
| 436 | } |
| 437 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 438 | template (value) GSUP_IMEI ts_GSUP_IMEI(hexstring digits) := { |
| 439 | len := 0, /* overwritten */ |
| 440 | digits := digits |
| 441 | } |
| 442 | |
| 443 | template GSUP_IMEI tr_GSUP_IMEI(template hexstring digits) := { |
| 444 | len := ?, |
| 445 | digits := digits |
| 446 | } |
| 447 | |
| 448 | |
Harald Welte | 6aa04e3 | 2018-01-27 15:35:19 +0100 | [diff] [blame] | 449 | template (value) GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 450 | ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); |
| 451 | |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 452 | template (value) GSUP_PDU ts_GSUP_SAI_REQ_EPS(hexstring imsi) := |
| 453 | ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { |
| 454 | valueof(ts_GSUP_IE_IMSI(imsi)), |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 455 | valueof(ts_GSUP_IE_CURRENT_RAT_TYPE(RAT_TYPE_EUTRAN_SGs)) |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 456 | }); |
| 457 | |
Harald Welte | ef9fa87 | 2018-01-22 03:00:17 +0100 | [diff] [blame] | 458 | template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := |
Harald Welte | 8a1dd53 | 2018-01-27 15:38:18 +0100 | [diff] [blame] | 459 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, imsi); |
Harald Welte | ef9fa87 | 2018-01-22 03:00:17 +0100 | [diff] [blame] | 460 | |
Alexander Couzens | d24973d | 2018-09-04 16:10:14 +0200 | [diff] [blame] | 461 | template GSUP_PDU tr_GSUP_SAI_REQ_UMTS_AKA_RESYNC( |
| 462 | template hexstring imsi, |
| 463 | template octetstring auts, |
| 464 | template octetstring rand) := |
| 465 | tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { |
| 466 | tr_GSUP_IE_IMSI(imsi), |
| 467 | tr_GSUP_IE_AUTS(auts), |
| 468 | tr_GSUP_IE_RAND(rand), |
| 469 | * |
| 470 | }); |
| 471 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 472 | template (value) GSUP_PDU ts_GSUP_SAI_RES(hexstring imsi, GSUP_IE auth_tuple) := |
| 473 | ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { |
| 474 | valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple }); |
| 475 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 476 | template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 477 | tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 478 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); |
| 479 | |
Harald Welte | 6aa04e3 | 2018-01-27 15:35:19 +0100 | [diff] [blame] | 480 | template (value) GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := |
| 481 | ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { |
| 482 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 483 | |
| 484 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 485 | template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) := |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 486 | tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 487 | tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); |
| 488 | |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 489 | template (value) GSUP_PDU ts_GSUP_UL_REQ(hexstring imsi) := |
| 490 | ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { |
| 491 | valueof(ts_GSUP_IE_IMSI(imsi)) }); |
| 492 | |
Harald Welte | dfe94dd | 2018-01-21 13:55:22 +0100 | [diff] [blame] | 493 | template GSUP_PDU tr_GSUP_UL_REQ(template hexstring imsi) := |
Harald Welte | 8a1dd53 | 2018-01-27 15:38:18 +0100 | [diff] [blame] | 494 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, imsi); |
Harald Welte | dfe94dd | 2018-01-21 13:55:22 +0100 | [diff] [blame] | 495 | |
Harald Welte | 6aa04e3 | 2018-01-27 15:35:19 +0100 | [diff] [blame] | 496 | template (value) GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := |
Harald Welte | dfe94dd | 2018-01-21 13:55:22 +0100 | [diff] [blame] | 497 | ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); |
| 498 | |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 499 | template GSUP_PDU tr_GSUP_UL_RES(template hexstring imsi) := |
| 500 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, imsi); |
| 501 | |
Harald Welte | 6aa04e3 | 2018-01-27 15:35:19 +0100 | [diff] [blame] | 502 | template (value) GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 503 | ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { |
| 504 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); |
| 505 | |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 506 | template GSUP_PDU tr_GSUP_UL_ERR(template hexstring imsi, template integer cause := ?) := |
| 507 | tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { |
| 508 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); |
| 509 | |
Harald Welte | 6aa04e3 | 2018-01-27 15:35:19 +0100 | [diff] [blame] | 510 | template (value) GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 511 | ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { |
| 512 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); |
| 513 | |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 514 | template GSUP_PDU tr_GSUP_ISD_REQ(template hexstring imsi, template hexstring msisdn := ?) := |
| 515 | tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { |
Harald Welte | 8f6ac16 | 2018-03-01 22:43:28 +0100 | [diff] [blame] | 516 | tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE_MSISDN(msisdn), * }); |
Harald Welte | c2c5255 | 2018-03-01 21:20:39 +0100 | [diff] [blame] | 517 | |
| 518 | template (value) GSUP_PDU ts_GSUP_ISD_RES(hexstring imsi) := |
| 519 | ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { |
| 520 | valueof(ts_GSUP_IE_IMSI(imsi)) }); |
| 521 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 522 | template GSUP_PDU tr_GSUP_ISD_RES(template hexstring imsi) := |
Harald Welte | 8a1dd53 | 2018-01-27 15:38:18 +0100 | [diff] [blame] | 523 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, imsi); |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 524 | |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 525 | template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := |
Harald Welte | 8a1dd53 | 2018-01-27 15:38:18 +0100 | [diff] [blame] | 526 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi); |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 527 | |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 528 | template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType ctype) := |
| 529 | ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, { |
| 530 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CancelType(ctype)) }); |
| 531 | |
| 532 | template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) := |
| 533 | tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi); |
| 534 | |
| 535 | template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer cause := ?) := |
| 536 | tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, { |
Alexander Couzens | 4cfff3a | 2018-05-22 17:08:36 +0200 | [diff] [blame] | 537 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause), * }); |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 538 | |
Harald Welte | 958f8b4 | 2018-03-01 23:40:17 +0100 | [diff] [blame] | 539 | template (value) GSUP_PDU ts_GSUP_PURGE_MS_REQ(hexstring imsi, GSUP_CnDomain dom) := |
| 540 | ts_GSUP(OSMO_GSUP_MSGT_PURGE_MS_REQUEST, { |
| 541 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CnDomain(dom)) }); |
| 542 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 543 | template GSUP_PDU tr_GSUP_PURGE_MS_REQ(template hexstring imsi, template GSUP_CnDomain dom := ?) := |
| 544 | tr_GSUP(OSMO_GSUP_MSGT_PURGE_MS_REQUEST, { |
| 545 | tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE_CnDomain(dom) }); |
| 546 | |
| 547 | template (value) GSUP_PDU ts_GSUP_PURGE_MS_RES(hexstring imsi) := |
| 548 | ts_GSUP(OSMO_GSUP_MSGT_PURGE_MS_RESULT, { |
| 549 | valueof(ts_GSUP_IE_IMSI(imsi)) }); |
| 550 | |
Harald Welte | 958f8b4 | 2018-03-01 23:40:17 +0100 | [diff] [blame] | 551 | template GSUP_PDU tr_GSUP_PURGE_MS_RES(template hexstring imsi) := |
| 552 | tr_GSUP(OSMO_GSUP_MSGT_PURGE_MS_RESULT, { |
| 553 | tr_GSUP_IE_IMSI(imsi), * }); |
| 554 | |
| 555 | template GSUP_PDU tr_GSUP_PURGE_MS_ERR(template hexstring imsi, template integer cause) := |
| 556 | tr_GSUP(OSMO_GSUP_MSGT_PURGE_MS_ERROR, { |
| 557 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); |
| 558 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 559 | template (value) GSUP_PDU ts_GSUP_CHECK_IMEI_REQ(hexstring imsi, hexstring imei) := |
| 560 | ts_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST, { |
| 561 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_IMEI(imei)) }); |
| 562 | |
Oliver Smith | 1d118ff | 2019-07-03 10:57:35 +0200 | [diff] [blame] | 563 | template GSUP_PDU tr_GSUP_CHECK_IMEI_REQ( |
| 564 | template hexstring imsi, |
| 565 | template hexstring imei |
| 566 | ) := tr_GSUP( |
| 567 | OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST, |
| 568 | { |
| 569 | tr_GSUP_IE_IMSI(imsi), |
| 570 | tr_GSUP_IE_IMEI(imei), |
| 571 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SUBSCRIBER_MANAGEMENT) |
| 572 | } |
| 573 | ); |
| 574 | |
| 575 | template (value) GSUP_PDU ts_GSUP_CHECK_IMEI_RES(hexstring imsi, GSUP_IMEIResult result) := |
| 576 | ts_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_RESULT, { |
| 577 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_IMEI_Result(result)) }); |
| 578 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 579 | template GSUP_PDU tr_GSUP_CHECK_IMEI_RES(template hexstring imsi, template GSUP_IMEIResult result) := |
| 580 | tr_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_RESULT, { |
| 581 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_IMEI_Result(result) }); |
| 582 | |
Oliver Smith | 1d118ff | 2019-07-03 10:57:35 +0200 | [diff] [blame] | 583 | template (value) GSUP_PDU ts_GSUP_CHECK_IMEI_ERR(hexstring imsi, integer cause) := |
| 584 | ts_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_ERROR, { |
| 585 | valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); |
| 586 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 587 | template GSUP_PDU tr_GSUP_CHECK_IMEI_ERR(template hexstring imsi, template integer cause) := |
| 588 | tr_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_ERROR, { |
| 589 | tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); |
| 590 | |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 591 | |
| 592 | template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := { |
| 593 | tag := OSMO_GSUP_CANCEL_TYPE_IE, |
| 594 | len := 0, /* overwritten */ |
| 595 | val := { |
| 596 | cancel_type := ctype |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | template GSUP_IE tr_GSUP_IE_CancelType(template GSUP_CancelType ctype) := |
| 601 | tr_GSUP_IE(OSMO_GSUP_CANCEL_TYPE_IE, GSUP_IeValue:{cancel_type:=ctype}); |
| 602 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 603 | template GSUP_IE tr_GSUP_IE_CnDomain(template GSUP_CnDomain domain) := |
| 604 | tr_GSUP_IE(OSMO_GSUP_CN_DOMAIN_IE, GSUP_IeValue:{cn_domain:=domain}); |
| 605 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 606 | template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { |
| 607 | tag := iei, |
| 608 | len := ?, |
| 609 | val := val |
| 610 | } |
| 611 | |
| 612 | template (value) GSUP_IE ts_GSUP_IE_IMSI(hexstring imsi) := { |
| 613 | tag := OSMO_GSUP_IMSI_IE, |
| 614 | len := 0, /* overwritten */ |
| 615 | val := { |
| 616 | imsi := imsi |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | template GSUP_IE tr_GSUP_IE_IMSI(template hexstring imsi) := { |
| 621 | tag := OSMO_GSUP_IMSI_IE, |
| 622 | len := ?, |
| 623 | val := { |
| 624 | imsi := imsi |
| 625 | } |
| 626 | } |
| 627 | |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 628 | template (value) GSUP_IE ts_GSUP_IE_MSISDN(hexstring msisdn) := { |
| 629 | tag := OSMO_GSUP_MSISDN_IE, |
| 630 | len := 0, /* overwritten */ |
| 631 | val := { |
Harald Welte | 3f95be8 | 2018-01-27 00:48:13 +0100 | [diff] [blame] | 632 | msisdn := ts_GSUP_MSISDN(msisdn) |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 633 | } |
| 634 | } |
| 635 | |
| 636 | template GSUP_IE tr_GSUP_IE_MSISDN(template hexstring msisdn) := { |
| 637 | tag := OSMO_GSUP_MSISDN_IE, |
| 638 | len := ?, |
| 639 | val := { |
Harald Welte | 3f95be8 | 2018-01-27 00:48:13 +0100 | [diff] [blame] | 640 | msisdn := tr_GSUP_MSISDN(msisdn) |
Harald Welte | 6ff8190 | 2018-01-21 19:09:08 +0100 | [diff] [blame] | 641 | } |
| 642 | } |
| 643 | |
| 644 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 645 | template (value) GSUP_IE ts_GSUP_IE_Cause(integer cause) := { |
| 646 | tag := OSMO_GSUP_CAUSE_IE, |
| 647 | len := 0, /* overwritten */ |
| 648 | val := { |
| 649 | cause := cause |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | template GSUP_IE tr_GSUP_IE_Cause(template integer cause) := { |
| 654 | tag := OSMO_GSUP_CAUSE_IE, |
| 655 | len := ?, |
| 656 | val := { |
| 657 | cause := cause |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | template (value) GSUP_IE ts_GSUP_IE_AUTS(octetstring auts) := { |
| 662 | tag := OSMO_GSUP_AUTS_IE, |
| 663 | len := 0, /* overwritten */ |
| 664 | val := { |
| 665 | auts := auts |
| 666 | } |
| 667 | } |
| 668 | |
Alexander Couzens | d24973d | 2018-09-04 16:10:14 +0200 | [diff] [blame] | 669 | template GSUP_IE tr_GSUP_IE_AUTS(template octetstring auts) := { |
| 670 | tag := OSMO_GSUP_AUTS_IE, |
| 671 | len := ?, |
| 672 | val := { |
| 673 | auts := auts |
| 674 | } |
| 675 | } |
| 676 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 677 | template (value) GSUP_IE ts_GSUP_IE_RAND(octetstring rand) := { |
| 678 | tag := OSMO_GSUP_RAND_IE, |
| 679 | len := 0, /* overwritten */ |
| 680 | val := { |
| 681 | rand := rand |
| 682 | } |
| 683 | } |
| 684 | |
Alexander Couzens | d24973d | 2018-09-04 16:10:14 +0200 | [diff] [blame] | 685 | template GSUP_IE tr_GSUP_IE_RAND(template octetstring rand) := { |
| 686 | tag := OSMO_GSUP_RAND_IE, |
| 687 | len := ?, |
| 688 | val := { |
| 689 | rand := rand |
| 690 | } |
| 691 | } |
| 692 | |
Harald Welte | 77a8eba | 2018-01-22 21:22:32 +0100 | [diff] [blame] | 693 | template (value) GSUP_IE ts_GSUP_IE_SRES(octetstring sres) := { |
| 694 | tag := OSMO_GSUP_SRES_IE, |
| 695 | len := 0, /* overwritten */ |
| 696 | val := { |
| 697 | sres := sres |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | template (value) GSUP_IE ts_GSUP_IE_Kc(octetstring kc) := { |
| 702 | tag := OSMO_GSUP_KC_IE, |
| 703 | len := 0, /* overwritten */ |
| 704 | val := { |
| 705 | kc := kc |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | template (value) GSUP_IE ts_GSUP_IE_IK(octetstring ik) := { |
| 710 | tag := OSMO_GSUP_IK_IE, |
| 711 | len := 0, /* overwritten */ |
| 712 | val := { |
| 713 | ik := ik |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | template (value) GSUP_IE ts_GSUP_IE_CK(octetstring ck) := { |
| 718 | tag := OSMO_GSUP_CK_IE, |
| 719 | len := 0, /* overwritten */ |
| 720 | val := { |
| 721 | ck := ck |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | template (value) GSUP_IE ts_GSUP_IE_AUTN(octetstring autn) := { |
| 726 | tag := OSMO_GSUP_AUTN_IE, |
| 727 | len := 0, /* overwritten */ |
| 728 | val := { |
| 729 | autn := autn |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | template (value) GSUP_IE ts_GSUP_IE_RES(octetstring res) := { |
| 734 | tag := OSMO_GSUP_RES_IE, |
| 735 | len := 0, /* overwritten */ |
| 736 | val := { |
| 737 | res := res |
| 738 | } |
| 739 | } |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 740 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 741 | template (value) GSUP_IE ts_GSUP_IE_APN(octetstring apn) := { |
| 742 | tag := OSMO_GSUP_ACCESS_POINT_NAME_IE, |
| 743 | len := 0, /* overwritten */ |
| 744 | val := { |
| 745 | apn := apn |
| 746 | } |
| 747 | } |
| 748 | |
Harald Welte | 958f8b4 | 2018-03-01 23:40:17 +0100 | [diff] [blame] | 749 | template (value) GSUP_IE ts_GSUP_IE_CnDomain(GSUP_CnDomain dom) := { |
| 750 | tag := OSMO_GSUP_CN_DOMAIN_IE, |
| 751 | len := 0, /* overwritten */ |
| 752 | val := { |
| 753 | cn_domain := dom |
| 754 | } |
| 755 | } |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 756 | |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 757 | template (value) GSUP_IE ts_GSUP_IE_SessionId(OCT4 sid) := { |
| 758 | tag := OSMO_GSUP_SESSION_ID_IE, |
| 759 | len := 0, /* overwritten */ |
| 760 | val := { |
| 761 | session_id := sid |
| 762 | } |
| 763 | } |
| 764 | template GSUP_IE tr_GSUP_IE_SessionId(template OCT4 sid) := { |
| 765 | tag := OSMO_GSUP_SESSION_ID_IE, |
| 766 | len := ?, |
| 767 | val := { |
| 768 | session_id := sid |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | template (value) GSUP_IE ts_GSUP_IE_SessionState(GSUP_SessionState state) := { |
| 773 | tag := OSMO_GSUP_SESSION_STATE_IE, |
| 774 | len := 0, /* overwritten */ |
| 775 | val := { |
| 776 | session_state := state |
| 777 | } |
| 778 | } |
| 779 | template GSUP_IE tr_GSUP_IE_SessionState(template GSUP_SessionState state) := { |
| 780 | tag := OSMO_GSUP_SESSION_STATE_IE, |
| 781 | len := ?, |
| 782 | val := { |
| 783 | session_state := state |
| 784 | } |
| 785 | } |
| 786 | |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 787 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_MR(OCT1 ref) := { |
| 788 | tag := OSMO_GSUP_SM_RP_MR_IE, |
| 789 | len := 0, /* overwritten */ |
| 790 | val := { |
| 791 | sm_rp_mr := ref |
| 792 | } |
| 793 | } |
| 794 | template GSUP_IE tr_GSUP_IE_SM_RP_MR(template OCT1 ref) := { |
| 795 | tag := OSMO_GSUP_SM_RP_MR_IE, |
| 796 | len := ?, |
| 797 | val := { |
| 798 | sm_rp_mr := ref |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_CAUSE(OCT1 cause) := { |
| 803 | tag := OSMO_GSUP_SM_RP_CAUSE_IE, |
| 804 | len := 0, /* overwritten */ |
| 805 | val := { |
| 806 | sm_rp_cause := cause |
| 807 | } |
| 808 | } |
| 809 | template GSUP_IE tr_GSUP_IE_SM_RP_CAUSE(template OCT1 cause) := { |
| 810 | tag := OSMO_GSUP_SM_RP_CAUSE_IE, |
| 811 | len := ?, |
| 812 | val := { |
| 813 | sm_rp_cause := cause |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_MMS(OCT1 mms) := { |
| 818 | tag := OSMO_GSUP_SM_RP_MMS_IE, |
| 819 | len := 0, /* overwritten */ |
| 820 | val := { |
| 821 | sm_rp_mms := mms |
| 822 | } |
| 823 | } |
| 824 | template GSUP_IE tr_GSUP_IE_SM_RP_MMS(template OCT1 mms) := { |
| 825 | tag := OSMO_GSUP_SM_RP_MMS_IE, |
| 826 | len := ?, |
| 827 | val := { |
| 828 | sm_rp_mms := mms |
| 829 | } |
| 830 | } |
| 831 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 832 | template (value) GSUP_IE ts_GSUP_IE_IMEI(hexstring imei) := { |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 833 | tag := OSMO_GSUP_IMEI_IE, |
| 834 | len := 0, /* overwritten */ |
| 835 | val := { |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 836 | imei := ts_GSUP_IMEI(imei) |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 837 | } |
| 838 | } |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 839 | template GSUP_IE tr_GSUP_IE_IMEI(template hexstring imei) := { |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 840 | tag := OSMO_GSUP_IMEI_IE, |
| 841 | len := ?, |
| 842 | val := { |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 843 | imei := tr_GSUP_IMEI(imei) |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 844 | } |
| 845 | } |
| 846 | |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 847 | template (value) GSUP_IE ts_GSUP_IE_IMEI_Result(GSUP_IMEIResult result) := { |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 848 | tag := OSMO_GSUP_IMEI_RESULT_IE, |
| 849 | len := 0, /* overwritten */ |
| 850 | val := { |
| 851 | imei_result := result |
| 852 | } |
| 853 | } |
Oliver Smith | 936dbe6 | 2019-06-04 15:54:17 +0200 | [diff] [blame] | 854 | template GSUP_IE tr_GSUP_IE_IMEI_Result(template GSUP_IMEIResult result) := { |
Oliver Smith | c574829 | 2019-02-22 15:02:48 +0100 | [diff] [blame] | 855 | tag := OSMO_GSUP_IMEI_RESULT_IE, |
| 856 | len := ?, |
| 857 | val := { |
| 858 | imei_result := result |
| 859 | } |
| 860 | } |
| 861 | |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 862 | /* Possible identity types for SM-RP-{OA|DA} IEs */ |
| 863 | type enumerated GSUP_SM_RP_ODA_IdType { |
| 864 | OSMO_GSUP_SM_RP_ODA_ID_NONE ('00'O), |
| 865 | OSMO_GSUP_SM_RP_ODA_ID_IMSI ('01'O), |
| 866 | OSMO_GSUP_SM_RP_ODA_ID_MSISDN ('02'O), |
| 867 | OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR ('03'O), |
| 868 | /* Special value for noSM-RP-DA and noSM-RP-OA */ |
| 869 | OSMO_GSUP_SM_RP_ODA_ID_NULL ('FF'O) |
| 870 | } with { variant "FIELDLENGTH(8)" }; |
| 871 | |
| 872 | /** |
| 873 | * SM-RP-DA represents the SM Destination Address, see 7.6.8.1. |
| 874 | * It can be either of the following: |
| 875 | * - IMSI |
| 876 | * - LMSI (not implemented) |
| 877 | * - MSISDN |
| 878 | * - roaming number (not implemented) |
| 879 | * - service centre address |
| 880 | */ |
| 881 | type union GSUP_SM_RP_DA_ID { |
| 882 | hexstring imsi, |
| 883 | hexstring msisdn, |
| 884 | hexstring smsc_addr |
| 885 | }; |
| 886 | |
| 887 | type record GSUP_SM_RP_DA { |
| 888 | GSUP_SM_RP_ODA_IdType id_type, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 889 | GSUP_SM_RP_DA_ID id_enc optional |
Vadim Yanitskiy | f1f39bd | 2018-12-14 08:00:33 +0700 | [diff] [blame] | 890 | } with { variant (id_enc) "CROSSTAG( |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 891 | imsi, id_type = OSMO_GSUP_SM_RP_ODA_ID_IMSI; |
| 892 | msisdn, id_type = OSMO_GSUP_SM_RP_ODA_ID_MSISDN; |
| 893 | smsc_addr, id_type = OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR; |
| 894 | /* FIXME: how to handle noSM-RP-DA? */ |
| 895 | )" |
| 896 | }; |
| 897 | |
| 898 | template (value) GSUP_SM_RP_DA ts_GSUP_SM_RP_DA_IMSI(hexstring imsi) := { |
| 899 | id_type := OSMO_GSUP_SM_RP_ODA_ID_IMSI, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 900 | id_enc := { imsi := imsi } |
| 901 | } |
| 902 | template GSUP_SM_RP_DA tr_GSUP_SM_RP_DA_IMSI(template hexstring imsi) := { |
| 903 | id_type := OSMO_GSUP_SM_RP_ODA_ID_IMSI, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 904 | id_enc := { imsi := imsi } |
| 905 | } |
| 906 | |
| 907 | template (value) GSUP_SM_RP_DA ts_GSUP_SM_RP_DA_MSISDN(hexstring msisdn) := { |
| 908 | id_type := OSMO_GSUP_SM_RP_ODA_ID_MSISDN, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 909 | id_enc := { msisdn := msisdn } |
| 910 | } |
| 911 | template GSUP_SM_RP_DA tr_GSUP_SM_RP_DA_MSISDN(template hexstring msisdn) := { |
| 912 | id_type := OSMO_GSUP_SM_RP_ODA_ID_MSISDN, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 913 | id_enc := { msisdn := msisdn } |
| 914 | } |
| 915 | |
| 916 | template (value) GSUP_SM_RP_DA ts_GSUP_SM_RP_DA_SMSC_ADDR(hexstring smsc_addr) := { |
| 917 | id_type := OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 918 | id_enc := { smsc_addr := smsc_addr } |
| 919 | } |
| 920 | template GSUP_SM_RP_DA tr_GSUP_SM_RP_DA_SMSC_ADDR(template hexstring smsc_addr) := { |
| 921 | id_type := OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 922 | id_enc := { smsc_addr := smsc_addr } |
| 923 | } |
| 924 | |
| 925 | template (value) GSUP_SM_RP_DA ts_GSUP_SM_RP_DA_NULL := { |
| 926 | id_type := OSMO_GSUP_SM_RP_ODA_ID_NULL, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 927 | id_enc := omit |
| 928 | } |
| 929 | template GSUP_SM_RP_DA tr_GSUP_SM_RP_DA_NULL := { |
| 930 | id_type := OSMO_GSUP_SM_RP_ODA_ID_NULL, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 931 | id_enc := omit |
| 932 | } |
| 933 | |
| 934 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_DA(GSUP_SM_RP_DA val) := { |
| 935 | tag := OSMO_GSUP_SM_RP_DA_IE, |
| 936 | len := 0, /* overwritten */ |
| 937 | val := { |
| 938 | sm_rp_da := val |
| 939 | } |
| 940 | } |
| 941 | template GSUP_IE tr_GSUP_IE_SM_RP_DA(template GSUP_SM_RP_DA val) := { |
| 942 | tag := OSMO_GSUP_SM_RP_DA_IE, |
| 943 | len := ?, |
| 944 | val := { |
| 945 | sm_rp_da := val |
| 946 | } |
| 947 | } |
| 948 | |
| 949 | /** |
| 950 | * SM-RP-OA represents the SM Originating Address, see 7.6.8.2. |
| 951 | * It can be either of the following: |
| 952 | * - MSISDN |
| 953 | * - service centre address |
| 954 | */ |
| 955 | type union GSUP_SM_RP_OA_ID { |
| 956 | hexstring msisdn, |
| 957 | hexstring smsc_addr |
| 958 | }; |
| 959 | |
| 960 | type record GSUP_SM_RP_OA { |
| 961 | GSUP_SM_RP_ODA_IdType id_type, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 962 | GSUP_SM_RP_OA_ID id_enc optional |
Vadim Yanitskiy | f1f39bd | 2018-12-14 08:00:33 +0700 | [diff] [blame] | 963 | } with { variant (id_enc) "CROSSTAG( |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 964 | msisdn, id_type = OSMO_GSUP_SM_RP_ODA_ID_MSISDN; |
| 965 | smsc_addr, id_type = OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR; |
| 966 | /* FIXME: how to handle noSM-RP-OA? */ |
| 967 | )" |
| 968 | }; |
| 969 | |
| 970 | template (value) GSUP_SM_RP_OA ts_GSUP_SM_RP_OA_MSISDN(hexstring msisdn) := { |
| 971 | id_type := OSMO_GSUP_SM_RP_ODA_ID_MSISDN, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 972 | id_enc := { msisdn := msisdn } |
| 973 | } |
| 974 | template GSUP_SM_RP_OA tr_GSUP_SM_RP_OA_MSISDN(template hexstring msisdn) := { |
| 975 | id_type := OSMO_GSUP_SM_RP_ODA_ID_MSISDN, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 976 | id_enc := { msisdn := msisdn } |
| 977 | } |
| 978 | |
| 979 | template (value) GSUP_SM_RP_OA ts_GSUP_SM_RP_OA_SMSC_ADDR(hexstring smsc_addr) := { |
| 980 | id_type := OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 981 | id_enc := { smsc_addr := smsc_addr } |
| 982 | } |
| 983 | template GSUP_SM_RP_OA tr_GSUP_SM_RP_OA_SMSC_ADDR(template hexstring smsc_addr) := { |
| 984 | id_type := OSMO_GSUP_SM_RP_ODA_ID_SMSC_ADDR, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 985 | id_enc := { smsc_addr := smsc_addr } |
| 986 | } |
| 987 | |
| 988 | template (value) GSUP_SM_RP_OA ts_GSUP_SM_RP_OA_NULL := { |
| 989 | id_type := OSMO_GSUP_SM_RP_ODA_ID_NULL, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 990 | id_enc := omit |
| 991 | } |
| 992 | template GSUP_SM_RP_OA tr_GSUP_SM_RP_OA_NULL := { |
| 993 | id_type := OSMO_GSUP_SM_RP_ODA_ID_NULL, |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 994 | id_enc := omit |
| 995 | } |
| 996 | |
| 997 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_OA(GSUP_SM_RP_OA val) := { |
| 998 | tag := OSMO_GSUP_SM_RP_OA_IE, |
| 999 | len := 0, /* overwritten */ |
| 1000 | val := { |
| 1001 | sm_rp_oa := val |
| 1002 | } |
| 1003 | } |
| 1004 | template GSUP_IE tr_GSUP_IE_SM_RP_OA(template GSUP_SM_RP_OA val) := { |
| 1005 | tag := OSMO_GSUP_SM_RP_OA_IE, |
| 1006 | len := ?, |
| 1007 | val := { |
| 1008 | sm_rp_oa := val |
| 1009 | } |
| 1010 | } |
| 1011 | |
| 1012 | /* SM-RP-UI represents the SM TPDU, see 7.6.8.4 */ |
| 1013 | template (value) GSUP_IE ts_GSUP_IE_SM_RP_UI(octetstring val) := { |
| 1014 | tag := OSMO_GSUP_SM_RP_UI_IE, |
| 1015 | len := 0, /* overwritten */ |
| 1016 | val := { |
| 1017 | sm_rp_ui := val |
| 1018 | } |
| 1019 | } |
| 1020 | template GSUP_IE tr_GSUP_IE_SM_RP_UI(template octetstring val) := { |
| 1021 | tag := OSMO_GSUP_SM_RP_UI_IE, |
| 1022 | len := ?, |
| 1023 | val := { |
| 1024 | sm_rp_ui := val |
| 1025 | } |
| 1026 | } |
| 1027 | |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 1028 | /* SM Alert Reason types, see 7.6.8.8 */ |
| 1029 | type enumerated GSUP_SM_ALERT_RSN_Type { |
| 1030 | GSUP_SM_ALERT_RSN_TYPE_NONE ('00'O), |
| 1031 | GSUP_SM_ALERT_RSN_TYPE_MS_PRESENT ('01'O), |
| 1032 | GSUP_SM_ALERT_RSN_TYPE_MEM_AVAIL ('02'O) |
| 1033 | } with { variant "FIELDLENGTH(8)" }; |
| 1034 | |
| 1035 | /* SM Alert Reason IE (used in READY-FOR-SM), see 7.6.8.8 */ |
| 1036 | template (value) GSUP_IE ts_GSUP_IE_SM_ALERT_RSN(GSUP_SM_ALERT_RSN_Type rsn) := { |
| 1037 | tag := OSMO_GSUP_SM_ALERT_RSN_IE, |
| 1038 | len := 0, /* overwritten */ |
| 1039 | val := { |
| 1040 | sm_alert_rsn := rsn |
| 1041 | } |
| 1042 | } |
| 1043 | template GSUP_IE tr_GSUP_IE_SM_ALERT_RSN(template GSUP_SM_ALERT_RSN_Type rsn) := { |
| 1044 | tag := OSMO_GSUP_SM_ALERT_RSN_IE, |
| 1045 | len := ?, |
| 1046 | val := { |
| 1047 | sm_alert_rsn := rsn |
| 1048 | } |
| 1049 | } |
| 1050 | |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1051 | template (value) GSUP_IE ts_GSUP_IE_SSInfo(octetstring ss) := { |
| 1052 | tag := OSMO_GSUP_SS_INFO_IE, |
| 1053 | len := 0, /* overwritten */ |
| 1054 | val := { |
| 1055 | ss_info := ss |
| 1056 | } |
| 1057 | } |
| 1058 | template GSUP_IE tr_GSUP_IE_SSInfo(template octetstring ss) := { |
| 1059 | tag := OSMO_GSUP_SS_INFO_IE, |
| 1060 | len := ?, |
| 1061 | val := { |
| 1062 | ss_info := ss |
| 1063 | } |
| 1064 | } |
| 1065 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1066 | template GSUP_IE tr_GSUP_IE_Message_Class(template GSUP_Message_Class val) := { |
| 1067 | tag := OSMO_GSUP_MESSAGE_CLASS_IE, |
| 1068 | len := ?, |
| 1069 | val := { |
| 1070 | message_class := val |
| 1071 | } |
| 1072 | } |
| 1073 | |
| 1074 | template (value) GSUP_IE ts_GSUP_IE_Message_Class(GSUP_Message_Class val) := { |
| 1075 | tag := OSMO_GSUP_MESSAGE_CLASS_IE, |
| 1076 | len := 0, /* overwritten */ |
| 1077 | val := { |
| 1078 | message_class := val |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | template GSUP_IE tr_GSUP_IE_Source_Name(template octetstring name) := { |
| 1083 | tag := OSMO_GSUP_SOURCE_NAME_IE, |
| 1084 | len := ?, |
| 1085 | val := { |
| 1086 | source_name := name |
| 1087 | } |
| 1088 | } |
| 1089 | |
| 1090 | template (value) GSUP_IE ts_GSUP_IE_Source_Name(octetstring name) := { |
| 1091 | tag := OSMO_GSUP_SOURCE_NAME_IE, |
| 1092 | len := 0, /* overwritten */ |
| 1093 | val := { |
| 1094 | source_name := name |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | template GSUP_IE tr_GSUP_IE_Destination_Name(template octetstring name) := { |
| 1099 | tag := OSMO_GSUP_DESTINATION_NAME_IE, |
| 1100 | len := ?, |
| 1101 | val := { |
| 1102 | destination_name := name |
| 1103 | } |
| 1104 | } |
| 1105 | |
| 1106 | template (value) GSUP_IE ts_GSUP_IE_Destination_Name(octetstring name) := { |
| 1107 | tag := OSMO_GSUP_DESTINATION_NAME_IE, |
| 1108 | len := 0, /* overwritten */ |
| 1109 | val := { |
| 1110 | destination_name := name |
| 1111 | } |
| 1112 | } |
| 1113 | |
| 1114 | template GSUP_IE tr_GSUP_IE_AN_APDU(template GSUP_AN_APDU an_apdu) := { |
| 1115 | tag := OSMO_GSUP_AN_APDU_IE, |
| 1116 | len := ?, |
| 1117 | val := { |
| 1118 | an_apdu := an_apdu |
| 1119 | } |
| 1120 | } |
| 1121 | |
| 1122 | template (value) GSUP_IE ts_GSUP_IE_AN_APDU(GSUP_AN_APDU an_apdu) := { |
| 1123 | tag := OSMO_GSUP_AN_APDU_IE, |
| 1124 | len := 0, /* overwritten */ |
| 1125 | val := { |
| 1126 | an_apdu := an_apdu |
| 1127 | } |
| 1128 | } |
| 1129 | |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 1130 | template (present) GSUP_IE tr_GSUP_IE_SUPPORTED_RAT_TYPES(template (present) GSUP_RatTypes ratt) := { |
| 1131 | tag := OSMO_GSUP_SUPPORTED_RAT_TYPES_IE, |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1132 | len := ?, |
| 1133 | val := { |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 1134 | supported_rat_types := ratt |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1135 | } |
| 1136 | } |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 1137 | template (value) GSUP_IE ts_GSUP_IE_SUPPORTED_RAT_TYPES(GSUP_RatTypes ratt) := { |
| 1138 | tag := OSMO_GSUP_SUPPORTED_RAT_TYPES_IE, |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1139 | len := 0, /* overwritten */ |
| 1140 | val := { |
Harald Welte | 0a1fd0e | 2019-12-03 20:01:08 +0100 | [diff] [blame^] | 1141 | supported_rat_types := ratt |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | template (present) GSUP_IE tr_GSUP_IE_CURRENT_RAT_TYPE(template (present) GSUP_RatType ratt) := { |
| 1146 | tag := OSMO_GSUP_CURRENT_RAT_TYPE_IE, |
| 1147 | len := ?, |
| 1148 | val := { |
| 1149 | current_rat_type := ratt |
| 1150 | } |
| 1151 | } |
| 1152 | template (value) GSUP_IE ts_GSUP_IE_CURRENT_RAT_TYPE(GSUP_RatType ratt) := { |
| 1153 | tag := OSMO_GSUP_CURRENT_RAT_TYPE_IE, |
| 1154 | len := 0, /* overwritten */ |
| 1155 | val := { |
| 1156 | current_rat_type := ratt |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1157 | } |
| 1158 | } |
| 1159 | |
| 1160 | |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1161 | private function f_gen_ts_ss_ies( |
| 1162 | hexstring imsi, |
| 1163 | OCT4 sid, |
| 1164 | GSUP_SessionState state, |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1165 | template (omit) octetstring ss := omit, |
| 1166 | template (omit) integer cause := omit |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1167 | ) return GSUP_IEs { |
| 1168 | /* Mandatory IEs */ |
| 1169 | var GSUP_IEs ies := { |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1170 | valueof(ts_GSUP_IE_IMSI(imsi)) |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1171 | }; |
| 1172 | |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1173 | /* Cause IE is needed for PROC_SS_ERR */ |
| 1174 | if (isvalue(cause)) { |
| 1175 | ies := ies & { valueof(ts_GSUP_IE_Cause(valueof(cause))) }; |
| 1176 | } |
| 1177 | |
| 1178 | /* Mandatory session IEs */ |
| 1179 | ies := ies & { valueof(ts_GSUP_IE_SessionId(sid)) }; |
| 1180 | ies := ies & { valueof(ts_GSUP_IE_SessionState(state)) }; |
| 1181 | |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1182 | /* Optional SS payload */ |
| 1183 | if (isvalue(ss)) { |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1184 | ies := ies & { valueof(ts_GSUP_IE_SSInfo(valueof(ss))) }; |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1185 | } |
| 1186 | |
| 1187 | return ies; |
| 1188 | } |
| 1189 | private function f_gen_tr_ss_ies( |
| 1190 | template hexstring imsi, |
| 1191 | template OCT4 sid := ?, |
| 1192 | template GSUP_SessionState state := ?, |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1193 | template octetstring ss := omit, |
| 1194 | template integer cause := omit |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1195 | ) return template GSUP_IEs { |
| 1196 | /* Mandatory IEs */ |
| 1197 | var template GSUP_IEs ies := { |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1198 | tr_GSUP_IE_IMSI(imsi) |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1199 | }; |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1200 | var integer idx := 1; |
| 1201 | |
| 1202 | /* Cause IE is needed for PROC_SS_ERR */ |
| 1203 | if (istemplatekind(cause, "*")) { |
| 1204 | ies[idx] := *; |
| 1205 | idx := idx + 1; |
| 1206 | } else if (not istemplatekind(cause, "omit")) { |
| 1207 | ies[idx] := tr_GSUP_IE_Cause(cause); |
| 1208 | idx := idx + 1; |
| 1209 | } |
| 1210 | |
| 1211 | /* Mandatory session IEs */ |
| 1212 | ies[idx] := tr_GSUP_IE_SessionId(sid); |
| 1213 | ies[idx + 1] := tr_GSUP_IE_SessionState(state); |
| 1214 | idx := idx + 2; |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1215 | |
| 1216 | /* Optional SS payload */ |
| 1217 | if (istemplatekind(ss, "*")) { |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1218 | ies[idx] := *; |
| 1219 | idx := idx + 1; |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1220 | } else if (not istemplatekind(ss, "omit")) { |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1221 | ies[idx] := tr_GSUP_IE_SSInfo(ss); |
| 1222 | idx := idx + 1; |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1223 | } |
| 1224 | |
Harald Welte | 0622a9f | 2019-05-11 10:58:15 +0200 | [diff] [blame] | 1225 | /* the GSUP Message Class IE is optional, as old implementations don't have it yet */ |
| 1226 | var template GSUP_IEs ies2 := ies; |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1227 | ies2[idx] := tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_USSD); |
| 1228 | idx := idx + 1; |
Harald Welte | 0622a9f | 2019-05-11 10:58:15 +0200 | [diff] [blame] | 1229 | |
| 1230 | return (ies, ies2); |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1231 | } |
| 1232 | |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1233 | template (value) GSUP_PDU ts_GSUP_PROC_SS_REQ( |
| 1234 | hexstring imsi, |
| 1235 | OCT4 sid, |
| 1236 | GSUP_SessionState state, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1237 | template (omit) octetstring ss := omit |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1238 | ) := ts_GSUP( |
| 1239 | OSMO_GSUP_MSGT_PROC_SS_REQUEST, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1240 | f_gen_ts_ss_ies(imsi, sid, state, ss) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1241 | ); |
| 1242 | template GSUP_PDU tr_GSUP_PROC_SS_REQ( |
| 1243 | template hexstring imsi, |
| 1244 | template OCT4 sid := ?, |
| 1245 | template GSUP_SessionState state := ?, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1246 | template octetstring ss := * |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1247 | ) := tr_GSUP( |
| 1248 | OSMO_GSUP_MSGT_PROC_SS_REQUEST, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1249 | f_gen_tr_ss_ies(imsi, sid, state, ss) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1250 | ); |
| 1251 | |
| 1252 | template (value) GSUP_PDU ts_GSUP_PROC_SS_RES( |
| 1253 | hexstring imsi, |
| 1254 | OCT4 sid, |
| 1255 | GSUP_SessionState state, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1256 | template (omit) octetstring ss := omit |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1257 | ) := ts_GSUP( |
| 1258 | OSMO_GSUP_MSGT_PROC_SS_RESULT, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1259 | f_gen_ts_ss_ies(imsi, sid, state, ss) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1260 | ); |
| 1261 | template GSUP_PDU tr_GSUP_PROC_SS_RES( |
| 1262 | template hexstring imsi, |
| 1263 | template OCT4 sid := ?, |
| 1264 | template GSUP_SessionState state := ?, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1265 | template octetstring ss := * |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1266 | ) := tr_GSUP( |
| 1267 | OSMO_GSUP_MSGT_PROC_SS_RESULT, |
Vadim Yanitskiy | 911257e | 2018-06-21 04:18:54 +0700 | [diff] [blame] | 1268 | f_gen_tr_ss_ies(imsi, sid, state, ss) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1269 | ); |
| 1270 | |
| 1271 | template (value) GSUP_PDU ts_GSUP_PROC_SS_ERR( |
| 1272 | hexstring imsi, |
| 1273 | OCT4 sid, |
Vadim Yanitskiy | 21c4233 | 2018-11-29 00:18:05 +0700 | [diff] [blame] | 1274 | GSUP_SessionState state, |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1275 | integer cause |
| 1276 | ) := ts_GSUP( |
| 1277 | OSMO_GSUP_MSGT_PROC_SS_ERROR, |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1278 | f_gen_ts_ss_ies(imsi, sid, state, cause := cause) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1279 | ); |
| 1280 | template GSUP_PDU tr_GSUP_PROC_SS_ERR( |
| 1281 | template hexstring imsi, |
| 1282 | template OCT4 sid := ?, |
Vadim Yanitskiy | 21c4233 | 2018-11-29 00:18:05 +0700 | [diff] [blame] | 1283 | template GSUP_SessionState state := ?, |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1284 | template integer cause := ? |
| 1285 | ) := tr_GSUP( |
| 1286 | OSMO_GSUP_MSGT_PROC_SS_ERROR, |
Vadim Yanitskiy | 6c9fafc | 2019-06-15 02:51:22 +0700 | [diff] [blame] | 1287 | f_gen_tr_ss_ies(imsi, sid, state, cause := cause) |
Vadim Yanitskiy | b761d14 | 2018-06-02 21:05:04 +0700 | [diff] [blame] | 1288 | ); |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 1289 | |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1290 | template (value) GSUP_PDU ts_GSUP_MO_FORWARD_SM_REQ( |
| 1291 | hexstring imsi, |
| 1292 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1293 | GSUP_SM_RP_DA sm_rp_da, /* Destination Address, see 7.6.8.1 */ |
| 1294 | GSUP_SM_RP_OA sm_rp_oa, /* Originating Address, see 7.6.8.2 */ |
| 1295 | octetstring sm_rp_ui /* SM TPDU, see 7.6.8.4 */ |
| 1296 | ) := ts_GSUP( |
| 1297 | OSMO_GSUP_MSGT_MO_FORWARD_SM_REQUEST, |
| 1298 | { |
| 1299 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1300 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1301 | valueof(ts_GSUP_IE_SM_RP_DA(sm_rp_da)), |
| 1302 | valueof(ts_GSUP_IE_SM_RP_OA(sm_rp_oa)), |
| 1303 | valueof(ts_GSUP_IE_SM_RP_UI(sm_rp_ui)) |
| 1304 | } |
| 1305 | ); |
| 1306 | template GSUP_PDU tr_GSUP_MO_FORWARD_SM_REQ( |
| 1307 | template hexstring imsi := ?, |
| 1308 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1309 | template GSUP_SM_RP_DA sm_rp_da, /* Destination Address, see 7.6.8.1 */ |
| 1310 | template GSUP_SM_RP_OA sm_rp_oa, /* Originating Address, see 7.6.8.2 */ |
| 1311 | template octetstring sm_rp_ui /* SM TPDU, see 7.6.8.4 */ |
| 1312 | ) := tr_GSUP( |
| 1313 | OSMO_GSUP_MSGT_MO_FORWARD_SM_REQUEST, |
| 1314 | { |
| 1315 | tr_GSUP_IE_IMSI(imsi), |
| 1316 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
| 1317 | tr_GSUP_IE_SM_RP_DA(sm_rp_da), |
| 1318 | tr_GSUP_IE_SM_RP_OA(sm_rp_oa), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1319 | tr_GSUP_IE_SM_RP_UI(sm_rp_ui), |
| 1320 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1321 | } |
| 1322 | ); |
| 1323 | |
| 1324 | template (value) GSUP_PDU ts_GSUP_MO_FORWARD_SM_RES( |
| 1325 | hexstring imsi, |
| 1326 | OCT1 sm_rp_mr /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1327 | ) := ts_GSUP( |
| 1328 | OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT, |
| 1329 | { |
| 1330 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1331 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)) |
| 1332 | } |
| 1333 | ); |
| 1334 | template GSUP_PDU tr_GSUP_MO_FORWARD_SM_RES( |
| 1335 | template hexstring imsi := ?, |
| 1336 | template OCT1 sm_rp_mr := ? /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1337 | ) := tr_GSUP( |
| 1338 | OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT, |
| 1339 | { |
| 1340 | tr_GSUP_IE_IMSI(imsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1341 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
| 1342 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1343 | } |
| 1344 | ); |
| 1345 | |
| 1346 | template (value) GSUP_PDU ts_GSUP_MO_FORWARD_SM_ERR( |
| 1347 | hexstring imsi, |
| 1348 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1349 | OCT1 sm_rp_cause /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1350 | ) := ts_GSUP( |
| 1351 | OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR, |
| 1352 | { |
| 1353 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1354 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1355 | valueof(ts_GSUP_IE_SM_RP_CAUSE(sm_rp_cause)) |
| 1356 | } |
| 1357 | ); |
| 1358 | template GSUP_PDU tr_GSUP_MO_FORWARD_SM_ERR( |
| 1359 | template hexstring imsi := ?, |
| 1360 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1361 | template OCT1 sm_rp_cause := ? /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1362 | ) := tr_GSUP( |
| 1363 | OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR, |
| 1364 | { |
| 1365 | tr_GSUP_IE_IMSI(imsi), |
| 1366 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1367 | tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), |
| 1368 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1369 | } |
| 1370 | ); |
| 1371 | |
| 1372 | template (value) GSUP_PDU ts_GSUP_MT_FORWARD_SM_REQ( |
| 1373 | hexstring imsi, |
| 1374 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1375 | GSUP_SM_RP_DA sm_rp_da, /* Destination Address, see 7.6.8.1 */ |
| 1376 | GSUP_SM_RP_OA sm_rp_oa, /* Originating Address, see 7.6.8.2 */ |
| 1377 | octetstring sm_rp_ui, /* SM TPDU, see 7.6.8.4 */ |
| 1378 | OCT1 sm_rp_mms /* MMS (More Messages to Send), see 7.6.8.7 */ |
| 1379 | ) := ts_GSUP( |
| 1380 | OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST, |
| 1381 | { |
| 1382 | /** |
| 1383 | * TODO: add MT-specific fields (and IEs): |
| 1384 | * - smDeliveryTimer |
| 1385 | * - smDeliveryStartTime |
| 1386 | */ |
| 1387 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1388 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1389 | valueof(ts_GSUP_IE_SM_RP_DA(sm_rp_da)), |
| 1390 | valueof(ts_GSUP_IE_SM_RP_OA(sm_rp_oa)), |
| 1391 | valueof(ts_GSUP_IE_SM_RP_UI(sm_rp_ui)), |
| 1392 | valueof(ts_GSUP_IE_SM_RP_MMS(sm_rp_mms)) |
| 1393 | } |
| 1394 | ); |
| 1395 | template GSUP_PDU tr_GSUP_MT_FORWARD_SM_REQ( |
| 1396 | template hexstring imsi := ?, |
| 1397 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1398 | template GSUP_SM_RP_DA sm_rp_da, /* Destination Address, see 7.6.8.1 */ |
| 1399 | template GSUP_SM_RP_OA sm_rp_oa, /* Originating Address, see 7.6.8.2 */ |
| 1400 | template octetstring sm_rp_ui, /* SM TPDU, see 7.6.8.4 */ |
| 1401 | template OCT1 sm_rp_mms /* MMS (More Messages to Send), see 7.6.8.7 */ |
| 1402 | ) := tr_GSUP( |
| 1403 | OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST, |
| 1404 | { |
| 1405 | /** |
| 1406 | * TODO: add MT-specific fields (and IEs): |
| 1407 | * - smDeliveryTimer |
| 1408 | * - smDeliveryStartTime |
| 1409 | */ |
| 1410 | tr_GSUP_IE_IMSI(imsi), |
| 1411 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
| 1412 | tr_GSUP_IE_SM_RP_DA(sm_rp_da), |
| 1413 | tr_GSUP_IE_SM_RP_OA(sm_rp_oa), |
| 1414 | tr_GSUP_IE_SM_RP_UI(sm_rp_ui), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1415 | tr_GSUP_IE_SM_RP_MMS(sm_rp_mms), |
| 1416 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1417 | } |
| 1418 | ); |
| 1419 | |
| 1420 | template (value) GSUP_PDU ts_GSUP_MT_FORWARD_SM_RES( |
| 1421 | hexstring imsi, |
| 1422 | OCT1 sm_rp_mr /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1423 | ) := ts_GSUP( |
| 1424 | OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT, |
| 1425 | { |
| 1426 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1427 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)) |
| 1428 | } |
| 1429 | ); |
| 1430 | template GSUP_PDU tr_GSUP_MT_FORWARD_SM_RES( |
| 1431 | template hexstring imsi := ?, |
| 1432 | template OCT1 sm_rp_mr := ? /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1433 | ) := tr_GSUP( |
| 1434 | OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT, |
| 1435 | { |
| 1436 | tr_GSUP_IE_IMSI(imsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1437 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
| 1438 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1439 | } |
| 1440 | ); |
| 1441 | |
| 1442 | template (value) GSUP_PDU ts_GSUP_MT_FORWARD_SM_ERR( |
| 1443 | hexstring imsi, |
| 1444 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1445 | OCT1 sm_rp_cause /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1446 | ) := ts_GSUP( |
| 1447 | OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR, |
| 1448 | { |
| 1449 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1450 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1451 | valueof(ts_GSUP_IE_SM_RP_CAUSE(sm_rp_cause)) |
| 1452 | } |
| 1453 | ); |
| 1454 | template GSUP_PDU tr_GSUP_MT_FORWARD_SM_ERR( |
| 1455 | template hexstring imsi := ?, |
| 1456 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1457 | template OCT1 sm_rp_cause := ? /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1458 | ) := tr_GSUP( |
| 1459 | OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR, |
| 1460 | { |
| 1461 | tr_GSUP_IE_IMSI(imsi), |
| 1462 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1463 | tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), |
| 1464 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 8a1d4b6 | 2018-09-23 20:28:23 +0700 | [diff] [blame] | 1465 | } |
| 1466 | ); |
| 1467 | |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 1468 | template (value) GSUP_PDU ts_GSUP_MO_READY_FOR_SM_REQ( |
| 1469 | hexstring imsi, |
| 1470 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1471 | GSUP_SM_ALERT_RSN_Type sm_alert_rsn /* SM Alert Reason, see 7.6.8.8 */ |
| 1472 | ) := ts_GSUP( |
| 1473 | OSMO_GSUP_MSGT_READY_FOR_SM_REQUEST, |
| 1474 | { |
| 1475 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1476 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1477 | valueof(ts_GSUP_IE_SM_ALERT_RSN(sm_alert_rsn)) |
| 1478 | } |
| 1479 | ); |
| 1480 | template GSUP_PDU tr_GSUP_MO_READY_FOR_SM_REQ( |
| 1481 | template hexstring imsi := ?, |
| 1482 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1483 | template GSUP_SM_ALERT_RSN_Type sm_alert_rsn := ? /* SM Alert Reason, see 7.6.8.8 */ |
| 1484 | ) := tr_GSUP( |
| 1485 | OSMO_GSUP_MSGT_READY_FOR_SM_REQUEST, |
| 1486 | { |
| 1487 | tr_GSUP_IE_IMSI(imsi), |
| 1488 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1489 | tr_GSUP_IE_SM_ALERT_RSN(sm_alert_rsn), |
| 1490 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 1491 | } |
| 1492 | ); |
| 1493 | |
| 1494 | template (value) GSUP_PDU ts_GSUP_MO_READY_FOR_SM_RES( |
| 1495 | hexstring imsi, |
| 1496 | OCT1 sm_rp_mr /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1497 | ) := ts_GSUP( |
| 1498 | OSMO_GSUP_MSGT_READY_FOR_SM_RESULT, |
| 1499 | { |
| 1500 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1501 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)) |
| 1502 | } |
| 1503 | ); |
| 1504 | template GSUP_PDU tr_GSUP_MO_READY_FOR_SM_RES( |
| 1505 | template hexstring imsi := ?, |
| 1506 | template OCT1 sm_rp_mr := ? /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1507 | ) := tr_GSUP( |
| 1508 | OSMO_GSUP_MSGT_READY_FOR_SM_RESULT, |
| 1509 | { |
| 1510 | tr_GSUP_IE_IMSI(imsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1511 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
| 1512 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 1513 | } |
| 1514 | ); |
| 1515 | |
| 1516 | template (value) GSUP_PDU ts_GSUP_MO_READY_FOR_SM_ERR( |
| 1517 | hexstring imsi, |
| 1518 | OCT1 sm_rp_mr, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1519 | OCT1 sm_rp_cause /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1520 | ) := ts_GSUP( |
| 1521 | OSMO_GSUP_MSGT_READY_FOR_SM_ERROR, |
| 1522 | { |
| 1523 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1524 | valueof(ts_GSUP_IE_SM_RP_MR(sm_rp_mr)), |
| 1525 | valueof(ts_GSUP_IE_SM_RP_CAUSE(sm_rp_cause)) |
| 1526 | } |
| 1527 | ); |
| 1528 | template GSUP_PDU tr_GSUP_MO_READY_FOR_SM_ERR( |
| 1529 | template hexstring imsi := ?, |
| 1530 | template OCT1 sm_rp_mr := ?, /* Message Reference, see GSM TS 04.11, 8.2.3 */ |
| 1531 | template OCT1 sm_rp_cause := ? /* RP-Cause value, see GSM TS 04.11, 8.2.5.4 */ |
| 1532 | ) := tr_GSUP( |
| 1533 | OSMO_GSUP_MSGT_READY_FOR_SM_ERROR, |
| 1534 | { |
| 1535 | tr_GSUP_IE_IMSI(imsi), |
| 1536 | tr_GSUP_IE_SM_RP_MR(sm_rp_mr), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1537 | tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), |
| 1538 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_SMS) |
Vadim Yanitskiy | 88e2323 | 2018-11-13 03:04:02 +0700 | [diff] [blame] | 1539 | } |
| 1540 | ); |
| 1541 | |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1542 | function f_gsup_find_nested_ie(GSUP_IEs ies, GSUP_IEI iei, out GSUP_IeValue ret) return boolean { |
| 1543 | for (var integer i := 0; i < sizeof(ies); i := i+1) { |
| 1544 | if (ies[i].tag == iei) { |
| 1545 | ret := ies[i].val; |
Harald Welte | f9d449e | 2018-06-24 22:27:47 +0200 | [diff] [blame] | 1546 | return true; |
| 1547 | } |
| 1548 | } |
Harald Welte | 8eebb6c | 2019-08-22 12:40:03 +0200 | [diff] [blame] | 1549 | return false; |
| 1550 | } |
| 1551 | |
| 1552 | function f_gsup_find_ie(GSUP_PDU msg, GSUP_IEI iei, out GSUP_IeValue ret) return boolean { |
| 1553 | return f_gsup_find_nested_ie(msg.ies, iei, ret); |
Harald Welte | f9d449e | 2018-06-24 22:27:47 +0200 | [diff] [blame] | 1554 | } |
| 1555 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1556 | template GSUP_AN_APDU t_GSUP_AN_APDU( |
| 1557 | template GSUP_AN_PROTO an_proto := ?, |
| 1558 | template octetstring pdu := ? |
| 1559 | ) := { |
| 1560 | proto := an_proto, |
| 1561 | pdu := pdu |
| 1562 | }; |
| 1563 | |
| 1564 | template GSUP_PDU tr_GSUP_E_AN_APDU( |
| 1565 | template GSUP_MessageType msgt, |
| 1566 | template hexstring imsi := ?, |
| 1567 | template octetstring source_name := ?, |
| 1568 | template octetstring destination_name := ?, |
| 1569 | template GSUP_AN_APDU an_apdu := ? |
| 1570 | ) := tr_GSUP( |
| 1571 | msgt, |
| 1572 | { |
| 1573 | tr_GSUP_IE_IMSI(imsi), |
| 1574 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_INTER_MSC), |
| 1575 | tr_GSUP_IE_Source_Name(source_name), |
| 1576 | tr_GSUP_IE_Destination_Name(destination_name), |
| 1577 | tr_GSUP_IE_AN_APDU(an_apdu) |
| 1578 | } |
| 1579 | ); |
| 1580 | |
| 1581 | template GSUP_PDU tr_GSUP_E_NO_PDU( |
| 1582 | template GSUP_MessageType msgt, |
| 1583 | template hexstring imsi := ?, |
| 1584 | template octetstring source_name := ?, |
| 1585 | template octetstring destination_name := ? |
| 1586 | ) := tr_GSUP( |
| 1587 | msgt, |
| 1588 | { |
| 1589 | tr_GSUP_IE_IMSI(imsi), |
| 1590 | tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_INTER_MSC), |
| 1591 | tr_GSUP_IE_Source_Name(source_name), |
| 1592 | tr_GSUP_IE_Destination_Name(destination_name) |
| 1593 | } |
| 1594 | ); |
| 1595 | |
| 1596 | template (value) GSUP_PDU ts_GSUP_E_AN_APDU( |
| 1597 | GSUP_MessageType msgt, |
| 1598 | hexstring imsi, |
| 1599 | octetstring source_name, |
| 1600 | octetstring destination_name, |
| 1601 | GSUP_AN_APDU an_apdu |
| 1602 | ) := ts_GSUP( |
| 1603 | msgt, |
| 1604 | { |
| 1605 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1606 | valueof(ts_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_INTER_MSC)), |
| 1607 | valueof(ts_GSUP_IE_Source_Name(source_name)), |
| 1608 | valueof(ts_GSUP_IE_Destination_Name(destination_name)), |
| 1609 | valueof(ts_GSUP_IE_AN_APDU(an_apdu)) |
| 1610 | } |
| 1611 | ); |
| 1612 | |
| 1613 | template (value) GSUP_PDU ts_GSUP_E_PrepareHandoverResult( |
| 1614 | hexstring imsi, |
| 1615 | hexstring msisdn, |
| 1616 | octetstring source_name, |
| 1617 | octetstring destination_name, |
| 1618 | GSUP_AN_APDU an_apdu |
| 1619 | ) := ts_GSUP( |
| 1620 | OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT, |
| 1621 | { |
| 1622 | valueof(ts_GSUP_IE_IMSI(imsi)), |
| 1623 | valueof(ts_GSUP_IE_MSISDN(msisdn)), |
| 1624 | valueof(ts_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_INTER_MSC)), |
| 1625 | valueof(ts_GSUP_IE_Source_Name(source_name)), |
| 1626 | valueof(ts_GSUP_IE_Destination_Name(destination_name)), |
| 1627 | valueof(ts_GSUP_IE_AN_APDU(an_apdu)) |
| 1628 | } |
| 1629 | ); |
Harald Welte | f9d449e | 2018-06-24 22:27:47 +0200 | [diff] [blame] | 1630 | |
Harald Welte | df32723 | 2017-12-28 22:51:51 +0100 | [diff] [blame] | 1631 | } with { encode "RAW"; variant "FIELDORDER(msb)" } |