Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 1 | module SGSN_Tests { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 5 | import from Native_Functions all; |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 6 | import from NS_Types all; |
| 7 | import from NS_Emulation all; |
| 8 | import from BSSGP_Types all; |
| 9 | import from BSSGP_Emulation all; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 10 | import from Osmocom_Gb_Types all; |
| 11 | |
| 12 | import from MobileL3_CommonIE_Types all; |
| 13 | import from MobileL3_GMM_SM_Types all; |
| 14 | import from MobileL3_Types all; |
| 15 | import from L3_Templates all; |
| 16 | import from L3_Common all; |
| 17 | |
| 18 | import from GSUP_Emulation all; |
| 19 | import from GSUP_Types all; |
| 20 | import from IPA_Emulation all; |
| 21 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 22 | import from GTP_Emulation all; |
| 23 | import from GTP_Templates all; |
| 24 | import from GTP_CodecPort all; |
| 25 | import from GTPC_Types all; |
| 26 | import from GTPU_Types all; |
| 27 | |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 28 | import from LLC_Types all; |
| 29 | import from LLC_Templates all; |
| 30 | |
| 31 | import from SNDCP_Types all; |
| 32 | |
Harald Welte | bd19472 | 2018-02-16 22:11:08 +0100 | [diff] [blame] | 33 | import from TELNETasp_PortType all; |
| 34 | import from Osmocom_VTY_Functions all; |
| 35 | |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 36 | import from GSM_RR_Types all; |
| 37 | |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 38 | import from MobileL3_MM_Types all; |
| 39 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 40 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 41 | modulepar { |
| 42 | /* IP/port on which we run our internal GSUP/HLR emulation */ |
| 43 | charstring mp_hlr_ip := "127.0.0.1"; |
| 44 | integer mp_hlr_port := 4222; |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 45 | charstring mp_ggsn_ip := "127.0.0.2"; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | type record GbInstance { |
| 49 | NS_CT vc_NS, |
| 50 | BSSGP_CT vc_BSSGP, |
| 51 | BssgpConfig cfg |
| 52 | }; |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 53 | |
| 54 | type component test_CT { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 55 | var GbInstance g_gb[3]; |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 56 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 57 | var GSUP_Emulation_CT vc_GSUP; |
| 58 | var IPA_Emulation_CT vc_GSUP_IPA; |
| 59 | /* only to get events from IPA underneath GSUP */ |
| 60 | port IPA_CTRL_PT GSUP_IPA_EVENT; |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 61 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 62 | var GTP_Emulation_CT vc_GTP; |
| 63 | |
Harald Welte | bd19472 | 2018-02-16 22:11:08 +0100 | [diff] [blame] | 64 | port TELNETasp_PT SGSNVTY; |
| 65 | |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 66 | var boolean g_initialized := false; |
| 67 | }; |
| 68 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 69 | type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, GTP_ConnHdlr { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 70 | var BSSGP_ConnHdlrPars g_pars; |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 71 | timer g_Tguard; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | type record SGSN_ConnHdlrNetworkPars { |
| 75 | boolean expect_ptmsi, |
| 76 | boolean expect_auth, |
| 77 | boolean expect_ciph |
| 78 | }; |
| 79 | |
| 80 | type record BSSGP_ConnHdlrPars { |
| 81 | /* IMEI of the simulated ME */ |
| 82 | hexstring imei, |
Alexander Couzens | 8f0fb00 | 2018-05-02 19:30:55 +0200 | [diff] [blame^] | 83 | /* IMSI of the simulated MS */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 84 | hexstring imsi, |
| 85 | /* MSISDN of the simulated MS (probably unused) */ |
| 86 | hexstring msisdn, |
| 87 | /* P-TMSI allocated to the simulated MS */ |
| 88 | OCT4 p_tmsi optional, |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 89 | OCT3 p_tmsi_sig optional, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 90 | /* TLLI of the simulated MS */ |
| 91 | OCT4 tlli, |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 92 | OCT4 tlli_old optional, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 93 | RoutingAreaIdentificationV ra optional, |
| 94 | BssgpCellId bssgp_cell_id, |
| 95 | AuthVector vec optional, |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 96 | SGSN_ConnHdlrNetworkPars net, |
| 97 | float t_guard |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 98 | }; |
| 99 | |
Harald Welte | 3fdbe82 | 2018-02-18 19:10:18 +0100 | [diff] [blame] | 100 | private function f_init_gb(inout GbInstance gb, charstring id) runs on test_CT { |
| 101 | gb.vc_NS := NS_CT.create(id & "-NS"); |
| 102 | gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP"); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 103 | /* connect lower end of BSSGP emulation with NS upper port */ |
| 104 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 105 | /* connect lower end of NS emulation to NS codec port (on top of IPL4) */ |
| 106 | map(gb.vc_NS:NSCP, system:NS_CODEC_PORT); |
| 107 | |
| 108 | gb.vc_NS.start(NSStart()); |
| 109 | gb.vc_BSSGP.start(BssgpStart(gb.cfg)); |
| 110 | } |
| 111 | |
| 112 | private function f_init_gsup(charstring id) runs on test_CT { |
| 113 | id := id & "-GSUP"; |
| 114 | var GsupOps ops := { |
| 115 | create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) |
| 116 | }; |
| 117 | |
| 118 | vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); |
| 119 | vc_GSUP := GSUP_Emulation_CT.create(id); |
| 120 | |
| 121 | map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); |
| 122 | connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); |
| 123 | /* we use this hack to get events like ASP_IPA_EVENT_UP */ |
| 124 | connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); |
| 125 | |
| 126 | vc_GSUP.start(GSUP_Emulation.main(ops, id)); |
| 127 | vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); |
| 128 | |
| 129 | /* wait for incoming connection to GSUP port before proceeding */ |
| 130 | timer T := 10.0; |
| 131 | T.start; |
| 132 | alt { |
| 133 | [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } |
| 134 | [] T.timeout { |
| 135 | setverdict(fail, "No connection to GSUP Port"); |
| 136 | self.stop; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 141 | private function f_init_gtp(charstring id) runs on test_CT { |
| 142 | id := id & "-GTP"; |
| 143 | |
| 144 | var GtpEmulationCfg gtp_cfg := { |
| 145 | gtpc_bind_ip := mp_ggsn_ip, |
| 146 | gtpc_bind_port := GTP1C_PORT, |
| 147 | gtpu_bind_ip := mp_ggsn_ip, |
| 148 | gtpu_bind_port := GTP1U_PORT, |
| 149 | sgsn_role := false |
| 150 | }; |
| 151 | |
| 152 | vc_GTP := GTP_Emulation_CT.create(id); |
| 153 | vc_GTP.start(GTP_Emulation.main(gtp_cfg)); |
| 154 | } |
| 155 | |
Harald Welte | bd19472 | 2018-02-16 22:11:08 +0100 | [diff] [blame] | 156 | private function f_init_vty() runs on test_CT { |
| 157 | map(self:SGSNVTY, system:SGSNVTY); |
| 158 | f_vty_set_prompts(SGSNVTY); |
| 159 | f_vty_transceive(SGSNVTY, "enable"); |
| 160 | f_vty_config(SGSNVTY, "sgsn", "auth-policy remote"); |
| 161 | } |
| 162 | |
| 163 | |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 164 | function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 165 | if (g_initialized == true) { |
| 166 | return; |
| 167 | } |
| 168 | g_initialized := true; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 169 | g_gb[0].cfg := { |
| 170 | nsei := 96, |
| 171 | bvci := 196, |
| 172 | cell_id := { |
| 173 | ra_id := { |
| 174 | lai := { |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 175 | mcc_mnc := mcc_mnc, lac := 13135}, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 176 | rac := 0 |
| 177 | }, |
| 178 | cell_id := 20960 |
| 179 | }, |
| 180 | sgsn_role := false |
| 181 | }; |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 182 | |
Harald Welte | 3fdbe82 | 2018-02-18 19:10:18 +0100 | [diff] [blame] | 183 | f_init_gb(g_gb[0], "SGSN_Test-Gb0"); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 184 | f_init_gsup("SGSN_Test"); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 185 | f_init_gtp("SGSN_Test"); |
Harald Welte | bd19472 | 2018-02-16 22:11:08 +0100 | [diff] [blame] | 186 | f_init_vty(); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 187 | } |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 188 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 189 | type function void_fn(charstring id) runs on BSSGP_ConnHdlr; |
| 190 | |
| 191 | /* helper function to create, connect and start a BSSGP_ConnHdlr component */ |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 192 | function f_start_handler(void_fn fn, charstring id, GbInstance gb, integer imsi_suffix, |
| 193 | float t_guard := 30.0) |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 194 | runs on test_CT return BSSGP_ConnHdlr { |
| 195 | var BSSGP_ConnHdlr vc_conn; |
| 196 | var SGSN_ConnHdlrNetworkPars net_pars := { |
| 197 | expect_ptmsi := true, |
| 198 | expect_auth := true, |
| 199 | expect_ciph := false |
| 200 | }; |
| 201 | var BSSGP_ConnHdlrPars pars := { |
| 202 | imei := f_gen_imei(imsi_suffix), |
| 203 | imsi := f_gen_imsi(imsi_suffix), |
| 204 | msisdn := f_gen_msisdn(imsi_suffix), |
| 205 | p_tmsi := omit, |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 206 | p_tmsi_sig := omit, |
Harald Welte | 14a0f94 | 2018-02-16 20:42:23 +0100 | [diff] [blame] | 207 | tlli := f_gprs_tlli_random(), |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 208 | tlli_old := omit, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 209 | ra := omit, |
| 210 | bssgp_cell_id := gb.cfg.cell_id, |
| 211 | vec := omit, |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 212 | net := net_pars, |
| 213 | t_guard := t_guard |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 214 | }; |
| 215 | |
| 216 | vc_conn := BSSGP_ConnHdlr.create(id); |
| 217 | connect(vc_conn:BSSGP, gb.vc_BSSGP:BSSGP_SP); |
| 218 | connect(vc_conn:BSSGP_PROC, gb.vc_BSSGP:BSSGP_PROC); |
| 219 | |
| 220 | connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); |
| 221 | connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); |
| 222 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 223 | connect(vc_conn:GTP, vc_GTP:CLIENT); |
| 224 | connect(vc_conn:GTP_PROC, vc_GTP:CLIENT_PROC); |
| 225 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 226 | vc_conn.start(f_handler_init(fn, id, pars)); |
| 227 | return vc_conn; |
| 228 | } |
| 229 | |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 230 | private altstep as_Tguard() runs on BSSGP_ConnHdlr { |
| 231 | [] g_Tguard.timeout { |
| 232 | setverdict(fail, "Tguard timeout"); |
| 233 | self.stop; |
| 234 | } |
| 235 | } |
| 236 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 237 | /* first function called in every ConnHdlr */ |
| 238 | private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars) |
| 239 | runs on BSSGP_ConnHdlr { |
| 240 | /* do some common stuff like setting up g_pars */ |
| 241 | g_pars := pars; |
| 242 | |
| 243 | /* register with BSSGP core */ |
| 244 | f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id); |
| 245 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 246 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 247 | /* tell GTP dispatcher to send this IMSI to us */ |
| 248 | f_gtp_register_imsi(g_pars.imsi); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 249 | |
Harald Welte | 62e2958 | 2018-02-16 21:17:11 +0100 | [diff] [blame] | 250 | g_Tguard.start(pars.t_guard); |
| 251 | activate(as_Tguard()); |
| 252 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 253 | /* call the user-supplied test case function */ |
| 254 | fn.apply(id); |
| 255 | f_bssgp_client_unregister(g_pars.imsi); |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | /* TODO: |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 259 | * Detach without Attach |
| 260 | * SM procedures without attach / RAU |
| 261 | * ATTACH / RAU |
| 262 | ** with / without authentication |
| 263 | ** with / without P-TMSI allocation |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 264 | * re-transmissions of LLC frames |
| 265 | * PDP Context activation |
| 266 | ** with different GGSN config in SGSN VTY |
| 267 | ** with different PDP context type (v4/v6/v46) |
| 268 | ** timeout from GGSN |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 269 | ** multiple / secondary PDP context |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 270 | */ |
| 271 | |
| 272 | testcase TC_wait_ns_up() runs on test_CT { |
| 273 | f_init(); |
| 274 | f_sleep(20.0); |
| 275 | } |
| 276 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 277 | altstep as_mm_identity() runs on BSSGP_ConnHdlr { |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 278 | var MobileL3_CommonIE_Types.MobileIdentityLV mi; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 279 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) { |
| 280 | mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
| 281 | BSSGP.send(ts_GMM_ID_RESP(mi)); |
| 282 | repeat; |
| 283 | } |
| 284 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) { |
| 285 | mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); |
| 286 | BSSGP.send(ts_GMM_ID_RESP(mi)); |
| 287 | repeat; |
| 288 | } |
| 289 | } |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 290 | |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 291 | /* perform GMM authentication (if expected). |
| 292 | * Note, for umts_aka_challenge to work, the revisionLevelIndicatior needs to |
| 293 | * be 1 to mark R99 capability, in the GMM Attach Request, see f_gmm_attach(). */ |
| 294 | function f_gmm_auth (boolean umts_aka_challenge := false, boolean force_gsm_sres := false) runs on BSSGP_ConnHdlr { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 295 | var BssgpDecoded bd; |
| 296 | var PDU_L3_MS_SGSN l3_mo; |
| 297 | var PDU_L3_SGSN_MS l3_mt; |
| 298 | var default di := activate(as_mm_identity()); |
| 299 | if (g_pars.net.expect_auth) { |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 300 | var GSUP_IE auth_tuple; |
| 301 | var template AuthenticationParameterAUTNTLV autn; |
| 302 | |
| 303 | if (umts_aka_challenge) { |
| 304 | g_pars.vec := f_gen_auth_vec_3g(); |
| 305 | autn := { |
| 306 | elementIdentifier := '28'O, |
| 307 | lengthIndicator := lengthof(g_pars.vec.autn), |
| 308 | autnValue := g_pars.vec.autn |
| 309 | }; |
| 310 | |
| 311 | auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G3G(g_pars.vec.rand, |
| 312 | g_pars.vec.sres, |
| 313 | g_pars.vec.kc, |
| 314 | g_pars.vec.ik, |
| 315 | g_pars.vec.ck, |
| 316 | g_pars.vec.autn, |
| 317 | g_pars.vec.res)); |
| 318 | log("GSUP sends 2G and 3G auth tuples", auth_tuple); |
| 319 | } else { |
| 320 | g_pars.vec := f_gen_auth_vec_2g(); |
| 321 | autn := omit; |
| 322 | auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, |
| 323 | g_pars.vec.sres, |
| 324 | g_pars.vec.kc)); |
| 325 | log("GSUP sends only 2G auth tuple", auth_tuple); |
| 326 | } |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 327 | GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); |
| 328 | GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 329 | |
| 330 | var template PDU_L3_SGSN_MS auth_ciph_req := tr_GMM_AUTH_REQ(g_pars.vec.rand); |
| 331 | auth_ciph_req.msgs.gprs_mm.authenticationAndCipheringRequest.authenticationParameterAUTN := autn; |
| 332 | BSSGP.receive(tr_BD_L3_MT(auth_ciph_req)) -> value bd; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 333 | l3_mt := bd.l3_mt; |
| 334 | var BIT4 ac_ref := l3_mt.msgs.gprs_mm.authenticationAndCipheringRequest.acReferenceNumber.valueField; |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 335 | var template PDU_L3_MS_SGSN auth_ciph_resp := ts_GMM_AUTH_RESP_2G(ac_ref, g_pars.vec.sres); |
| 336 | |
| 337 | if (umts_aka_challenge and not force_gsm_sres) { |
| 338 | /* set UMTS response instead */ |
| 339 | auth_ciph_resp.msgs.gprs_mm.authenticationAndCipheringResponse.authenticationParResp := { |
| 340 | valueField := substr(g_pars.vec.res, 0, 4) |
| 341 | }; |
| 342 | auth_ciph_resp.msgs.gprs_mm.authenticationAndCipheringResponse.authenticationRespParExt := { |
| 343 | elementIdentifier := '21'O, |
| 344 | lengthIndicator := lengthof(g_pars.vec.res) - 4, |
| 345 | valueField := substr(g_pars.vec.res, 4, lengthof(g_pars.vec.res) - 4) |
| 346 | }; |
| 347 | } |
| 348 | |
| 349 | l3_mo := valueof(auth_ciph_resp); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 350 | if (ispresent(l3_mt.msgs.gprs_mm.authenticationAndCipheringRequest.imeisvRequest) and |
| 351 | l3_mt.msgs.gprs_mm.authenticationAndCipheringRequest.imeisvRequest.valueField == '001'B) { |
| 352 | l3_mo.msgs.gprs_mm.authenticationAndCipheringResponse.imeisv := |
| 353 | valueof(ts_MI_IMEISV_TLV(g_pars.imei & '0'H)); |
| 354 | } |
| 355 | BSSGP.send(l3_mo); |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 356 | } else { |
| 357 | /* wait for identity procedure */ |
| 358 | f_sleep(1.0); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 359 | } |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 360 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 361 | deactivate(di); |
| 362 | } |
| 363 | |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 364 | function f_upd_ptmsi_and_tlli(OCT4 p_tmsi) runs on BSSGP_ConnHdlr { |
| 365 | g_pars.p_tmsi := p_tmsi; |
| 366 | /* update TLLI */ |
| 367 | g_pars.tlli_old := g_pars.tlli; |
| 368 | g_pars.tlli := g_pars.p_tmsi or4b 'c0000000'O; |
| 369 | f_bssgp_client_llgmm_assign(g_pars.tlli_old, g_pars.tlli); |
| 370 | } |
| 371 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 372 | function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr { |
| 373 | /* mandatory IE */ |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 374 | var hexstring aa_plmn := f_RAI_to_plmn_hexstr(aa.routingAreaIdentification); |
| 375 | if (not (g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc == aa_plmn)) { |
| 376 | setverdict(fail, "mismatching PLMN in Attach Accept: " & hex2str(aa_plmn) |
| 377 | & "; expected " & hex2str(g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc)); |
| 378 | self.stop; |
| 379 | } |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 380 | g_pars.ra := aa.routingAreaIdentification; |
| 381 | if (ispresent(aa.allocatedPTMSI)) { |
| 382 | if (not g_pars.net.expect_ptmsi) { |
| 383 | setverdict(fail, "unexpected P-TMSI allocation"); |
| 384 | self.stop; |
| 385 | } |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 386 | f_upd_ptmsi_and_tlli(aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 387 | } |
| 388 | if (ispresent(aa.msIdentity)) { |
| 389 | setverdict(fail, "unexpected TMSI allocation in non-combined attach"); |
| 390 | self.stop; |
| 391 | } |
| 392 | /* P-TMSI.sig */ |
| 393 | if (ispresent(aa.ptmsiSignature)) { |
| 394 | g_pars.p_tmsi_sig := aa.ptmsiSignature.valueField; |
| 395 | } |
| 396 | /* updateTimer */ |
| 397 | // aa.readyTimer |
| 398 | /* T3302, T3319, T3323, T3312_ext, T3324 */ |
| 399 | } |
| 400 | |
Harald Welte | 91636de | 2018-02-17 10:16:14 +0100 | [diff] [blame] | 401 | function f_process_rau_accept(PDU_GMM_RoutingAreaUpdateAccept ra) runs on BSSGP_ConnHdlr { |
| 402 | /* mandatory IE */ |
| 403 | g_pars.ra := ra.routingAreaId; |
| 404 | if (ispresent(ra.allocatedPTMSI)) { |
| 405 | if (not g_pars.net.expect_ptmsi) { |
| 406 | setverdict(fail, "unexpected P-TMSI allocation"); |
| 407 | self.stop; |
| 408 | } |
| 409 | f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); |
| 410 | } |
| 411 | if (ispresent(ra.msIdentity)) { |
| 412 | setverdict(fail, "unexpected TMSI allocation in non-combined attach"); |
| 413 | self.stop; |
| 414 | } |
| 415 | /* P-TMSI.sig */ |
| 416 | if (ispresent(ra.ptmsiSignature)) { |
| 417 | g_pars.p_tmsi_sig := ra.ptmsiSignature.valueField; |
| 418 | } |
| 419 | /* updateTimer */ |
| 420 | // aa.readyTimer |
| 421 | /* T3302, T3319, T3323, T3312_ext, T3324 */ |
| 422 | } |
| 423 | |
| 424 | |
Harald Welte | 5a4fa04 | 2018-02-16 20:59:21 +0100 | [diff] [blame] | 425 | function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV { |
| 426 | return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); |
| 427 | } |
| 428 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 429 | /* return a MobileIdentityLV: P-TMSI if we have one, IMSI otherwise */ |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 430 | private function f_mi_get_lv() runs on BSSGP_ConnHdlr return MobileL3_CommonIE_Types.MobileIdentityLV { |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 431 | if (ispresent(g_pars.p_tmsi)) { |
| 432 | return valueof(ts_MI_TMSI_LV(g_pars.p_tmsi)); |
| 433 | } else { |
| 434 | return valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
| 435 | } |
| 436 | } |
| 437 | |
Harald Welte | 311ec27 | 2018-02-17 09:40:03 +0100 | [diff] [blame] | 438 | private function f_gmm_gsup_lu_isd() runs on BSSGP_ConnHdlr { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 439 | var GSUP_PDU gsup; |
Harald Welte | 311ec27 | 2018-02-17 09:40:03 +0100 | [diff] [blame] | 440 | /* Expect MSC to perform LU with HLR */ |
| 441 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 442 | gsup := valueof(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); |
| 443 | gsup.ies := gsup.ies & { valueof(ts_GSUP_IE_PdpInfo(char2oct("*"), '0121'O, ''O)) }; |
| 444 | GSUP.send(gsup); |
Harald Welte | 311ec27 | 2018-02-17 09:40:03 +0100 | [diff] [blame] | 445 | GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); |
| 446 | GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); |
| 447 | } |
| 448 | |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 449 | private function f_gmm_attach(boolean umts_aka_challenge, boolean force_gsm_sres) runs on BSSGP_ConnHdlr { |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 450 | var BssgpDecoded bd; |
Harald Welte | 5a4fa04 | 2018-02-16 20:59:21 +0100 | [diff] [blame] | 451 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 452 | var template PDU_L3_MS_SGSN attach_req := ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 453 | |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 454 | /* indicate R99 capability of the MS to enable UMTS AKA in presence of |
| 455 | * 3G auth vectors */ |
| 456 | attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.revisionLevelIndicatior := '1'B; |
| 457 | /* The thing is, if the solSACapability is 'omit', then the |
| 458 | * revisionLevelIndicatior is at the wrong place! */ |
| 459 | attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.solSACapability := '0'B; |
| 460 | |
| 461 | BSSGP.send(attach_req); |
| 462 | f_gmm_auth(umts_aka_challenge, force_gsm_sres); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 463 | /* Expect MSC to perform LU with HLR */ |
Harald Welte | 311ec27 | 2018-02-17 09:40:03 +0100 | [diff] [blame] | 464 | f_gmm_gsup_lu_isd(); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 465 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 466 | BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { |
| 467 | f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); |
| 468 | } |
| 469 | /* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 470 | BSSGP.send(ts_GMM_ATTACH_COMPL); |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { |
| 474 | f_gmm_attach(false, false); |
Harald Welte | 5a4fa04 | 2018-02-16 20:59:21 +0100 | [diff] [blame] | 475 | setverdict(pass); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 476 | } |
| 477 | |
| 478 | testcase TC_attach() runs on test_CT { |
| 479 | var BSSGP_ConnHdlr vc_conn; |
| 480 | f_init(); |
| 481 | f_sleep(1.0); |
| 482 | vc_conn := f_start_handler(refers(f_TC_attach), testcasename(), g_gb[0], 1); |
| 483 | vc_conn.done; |
| 484 | } |
| 485 | |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 486 | testcase TC_attach_mnc3() runs on test_CT { |
| 487 | var BSSGP_ConnHdlr vc_conn; |
| 488 | f_init('023042'H); |
| 489 | f_sleep(1.0); |
| 490 | vc_conn := f_start_handler(refers(f_TC_attach), testcasename(), g_gb[0], 1001); |
| 491 | vc_conn.done; |
| 492 | } |
| 493 | |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 494 | private function f_TC_attach_umts_aka_umts_res(charstring id) runs on BSSGP_ConnHdlr { |
| 495 | f_gmm_attach(true, false); |
| 496 | setverdict(pass); |
| 497 | } |
| 498 | testcase TC_attach_umts_aka_umts_res() runs on test_CT { |
| 499 | var BSSGP_ConnHdlr vc_conn; |
| 500 | f_init(); |
| 501 | f_sleep(1.0); |
| 502 | vc_conn := f_start_handler(refers(f_TC_attach_umts_aka_umts_res), testcasename(), g_gb[0], 1002); |
| 503 | vc_conn.done; |
| 504 | } |
| 505 | |
| 506 | private function f_TC_attach_umts_aka_gsm_sres(charstring id) runs on BSSGP_ConnHdlr { |
| 507 | f_gmm_attach(true, true); |
| 508 | setverdict(pass); |
| 509 | } |
| 510 | testcase TC_attach_umts_aka_gsm_sres() runs on test_CT { |
| 511 | var BSSGP_ConnHdlr vc_conn; |
| 512 | f_init(); |
| 513 | f_sleep(1.0); |
| 514 | vc_conn := f_start_handler(refers(f_TC_attach_umts_aka_gsm_sres), testcasename(), g_gb[0], 1003); |
| 515 | vc_conn.done; |
| 516 | } |
| 517 | |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 518 | /* MS never responds to ID REQ, expect ATTACH REJECT */ |
| 519 | private function f_TC_attach_auth_id_timeout(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 520 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 521 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 522 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 523 | alt { |
Harald Welte | 1967d47 | 2018-02-16 21:54:21 +0100 | [diff] [blame] | 524 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ(?))) { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 525 | /* don't send ID Response */ |
| 526 | repeat; |
| 527 | } |
Harald Welte | 1967d47 | 2018-02-16 21:54:21 +0100 | [diff] [blame] | 528 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('09'O))) { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 529 | setverdict(pass); |
| 530 | } |
Harald Welte | 1967d47 | 2018-02-16 21:54:21 +0100 | [diff] [blame] | 531 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 532 | setverdict(fail, "Wrong Attach Reject Cause"); |
| 533 | } |
| 534 | } |
| 535 | } |
| 536 | testcase TC_attach_auth_id_timeout() runs on test_CT { |
| 537 | var BSSGP_ConnHdlr vc_conn; |
| 538 | f_init(); |
| 539 | vc_conn := f_start_handler(refers(f_TC_attach_auth_id_timeout), testcasename(), g_gb[0], 2, 40.0); |
| 540 | vc_conn.done; |
| 541 | } |
| 542 | |
| 543 | /* HLR never responds to SAI REQ, expect ATTACH REJECT */ |
| 544 | private function f_TC_attach_auth_sai_timeout(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 545 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 546 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 547 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 548 | alt { |
| 549 | [] as_mm_identity(); |
| 550 | [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { } |
| 551 | } |
| 552 | /* don't send SAI-response from HLR */ |
Harald Welte | 1967d47 | 2018-02-16 21:54:21 +0100 | [diff] [blame] | 553 | BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 554 | setverdict(pass); |
| 555 | } |
| 556 | testcase TC_attach_auth_sai_timeout() runs on test_CT { |
| 557 | var BSSGP_ConnHdlr vc_conn; |
| 558 | f_init(); |
| 559 | vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_timeout), testcasename(), g_gb[0], 3); |
| 560 | vc_conn.done; |
| 561 | } |
| 562 | |
Harald Welte | fe25388 | 2018-02-17 09:25:00 +0100 | [diff] [blame] | 563 | /* HLR rejects SAI, expect ATTACH REJECT */ |
| 564 | private function f_TC_attach_auth_sai_reject(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | fe25388 | 2018-02-17 09:25:00 +0100 | [diff] [blame] | 565 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 566 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 567 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | fe25388 | 2018-02-17 09:25:00 +0100 | [diff] [blame] | 568 | alt { |
| 569 | [] as_mm_identity(); |
| 570 | [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { |
| 571 | GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 23)); |
| 572 | } |
| 573 | } |
| 574 | BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))); |
| 575 | setverdict(pass); |
| 576 | } |
| 577 | testcase TC_attach_auth_sai_reject() runs on test_CT { |
| 578 | var BSSGP_ConnHdlr vc_conn; |
| 579 | f_init(); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 580 | vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 4); |
Harald Welte | fe25388 | 2018-02-17 09:25:00 +0100 | [diff] [blame] | 581 | vc_conn.done; |
| 582 | } |
| 583 | |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 584 | /* HLR never responds to UL REQ, expect ATTACH REJECT */ |
| 585 | private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 586 | var BssgpDecoded bd; |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 587 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 588 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 589 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 590 | f_gmm_auth(); |
| 591 | /* Expect MSC to perform LU with HLR */ |
| 592 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); |
| 593 | /* Never follow-up with ISD_REQ or UL_RES */ |
| 594 | alt { |
Harald Welte | 1967d47 | 2018-02-16 21:54:21 +0100 | [diff] [blame] | 595 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 596 | setverdict(pass); |
| 597 | } |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 598 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { |
| 599 | f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 600 | setverdict(fail); |
| 601 | } |
| 602 | } |
| 603 | } |
| 604 | testcase TC_attach_gsup_lu_timeout() runs on test_CT { |
| 605 | var BSSGP_ConnHdlr vc_conn; |
| 606 | f_init(); |
| 607 | f_sleep(1.0); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 608 | vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb[0], 5); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 609 | vc_conn.done; |
| 610 | } |
| 611 | |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 612 | /* HLR rejects UL REQ, expect ATTACH REJECT */ |
| 613 | private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdlr { |
| 614 | var BssgpDecoded bd; |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 615 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 616 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 617 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 618 | f_gmm_auth(); |
| 619 | /* Expect MSC to perform LU with HLR */ |
| 620 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { |
| 621 | GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 0)); |
| 622 | } |
| 623 | alt { |
| 624 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { |
| 625 | setverdict(pass); |
| 626 | } |
| 627 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { |
| 628 | f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); |
| 629 | setverdict(fail); |
| 630 | } |
| 631 | } |
| 632 | } |
| 633 | testcase TC_attach_gsup_lu_reject() runs on test_CT { |
| 634 | var BSSGP_ConnHdlr vc_conn; |
| 635 | f_init(); |
| 636 | f_sleep(1.0); |
| 637 | vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_reject), testcasename(), g_gb[0], 6); |
| 638 | vc_conn.done; |
| 639 | } |
| 640 | |
| 641 | |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 642 | /* Attempt of combined GPRS + IMSI attach: network should ACK only GPRS attach */ |
| 643 | private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 644 | var BssgpDecoded bd; |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 645 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 646 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 647 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit)); |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 648 | f_gmm_auth(); |
| 649 | /* Expect MSC to perform LU with HLR */ |
Harald Welte | 311ec27 | 2018-02-17 09:40:03 +0100 | [diff] [blame] | 650 | f_gmm_gsup_lu_isd(); |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 651 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 652 | BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { |
| 653 | f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); |
| 654 | } |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 655 | BSSGP.send(ts_GMM_ATTACH_COMPL); |
| 656 | setverdict(pass); |
| 657 | } |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 658 | testcase TC_attach_combined() runs on test_CT { |
| 659 | var BSSGP_ConnHdlr vc_conn; |
| 660 | f_init(); |
| 661 | f_sleep(1.0); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 662 | vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 7); |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 663 | vc_conn.done; |
| 664 | } |
| 665 | |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 666 | /* Attempt of GPRS ATTACH in 'accept all' mode */ |
| 667 | private function f_TC_attach_accept_all(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 668 | var BssgpDecoded bd; |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 669 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 670 | |
| 671 | g_pars.net.expect_auth := false; |
| 672 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 673 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 674 | f_gmm_auth(); |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 675 | BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { |
| 676 | f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); |
| 677 | } |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 678 | BSSGP.send(ts_GMM_ATTACH_COMPL); |
| 679 | setverdict(pass); |
| 680 | } |
| 681 | testcase TC_attach_accept_all() runs on test_CT { |
| 682 | var BSSGP_ConnHdlr vc_conn; |
| 683 | f_init(); |
| 684 | f_sleep(1.0); |
| 685 | f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all"); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 686 | vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 8); |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 687 | vc_conn.done; |
| 688 | } |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 689 | |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 690 | /* Attempt of GPRS ATTACH in 'accept all' mode */ |
| 691 | private function f_TC_attach_closed_foreign(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 692 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 693 | |
| 694 | /* Simulate a foreign IMSI */ |
| 695 | g_pars.imsi := '001010123456789'H; |
| 696 | f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id); |
| 697 | |
| 698 | g_pars.net.expect_auth := false; |
| 699 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 700 | BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 701 | alt { |
| 702 | [] as_mm_identity(); |
| 703 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('07'O))) { |
| 704 | setverdict(pass); |
| 705 | } |
| 706 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { |
| 707 | setverdict(pass); |
| 708 | } |
| 709 | } |
| 710 | } |
| 711 | testcase TC_attach_closed() runs on test_CT { |
| 712 | var BSSGP_ConnHdlr vc_conn; |
| 713 | f_init(); |
| 714 | f_sleep(1.0); |
| 715 | f_vty_config(SGSNVTY, "sgsn", "auth-policy closed"); |
| 716 | /* test with foreign IMSI: Must Reject */ |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 717 | vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9); |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 718 | vc_conn.done; |
| 719 | /* test with home IMSI: Must Accept */ |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 720 | vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 10); |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 721 | vc_conn.done; |
| 722 | } |
| 723 | |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 724 | /* Routing Area Update from Unknown TLLI -> REJECT */ |
| 725 | private function f_TC_rau_unknown(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 726 | var RoutingAreaIdentificationV old_ra := f_random_RAI(); |
| 727 | |
Harald Welte | 23178c5 | 2018-02-17 09:36:33 +0100 | [diff] [blame] | 728 | BSSGP.send(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit)); |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 729 | alt { |
| 730 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT('0a'O))) { |
| 731 | setverdict(pass); |
| 732 | } |
| 733 | /* FIXME: Expect XID RESET? */ |
| 734 | [] BSSGP.receive { repeat; } |
| 735 | } |
| 736 | } |
| 737 | testcase TC_rau_unknown() runs on test_CT { |
| 738 | var BSSGP_ConnHdlr vc_conn; |
| 739 | f_init(); |
| 740 | f_sleep(1.0); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 741 | vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb[0], 11); |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 742 | vc_conn.done; |
| 743 | } |
| 744 | |
Harald Welte | 91636de | 2018-02-17 10:16:14 +0100 | [diff] [blame] | 745 | private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr { |
| 746 | var BssgpDecoded bd; |
| 747 | |
| 748 | /* first perform regular attach */ |
| 749 | f_TC_attach(id); |
| 750 | |
| 751 | /* then send RAU */ |
| 752 | BSSGP.send(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit)); |
| 753 | alt { |
| 754 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_ACCEPT)) -> value bd { |
| 755 | f_process_rau_accept(bd.l3_mt.msgs.gprs_mm.routingAreaUpdateAccept); |
| 756 | setverdict(pass); |
| 757 | } |
| 758 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) { |
| 759 | setverdict(fail, "Unexpected RAU Reject"); |
| 760 | } |
| 761 | [] BSSGP.receive { repeat; } |
| 762 | } |
| 763 | } |
| 764 | testcase TC_attach_rau() runs on test_CT { |
| 765 | var BSSGP_ConnHdlr vc_conn; |
| 766 | f_init(); |
| 767 | f_sleep(1.0); |
| 768 | vc_conn := f_start_handler(refers(f_TC_attach_rau), testcasename(), g_gb[0], 12); |
| 769 | vc_conn.done; |
| 770 | } |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 771 | |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 772 | /* general GPRS DETACH helper */ |
| 773 | function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge) runs on BSSGP_ConnHdlr { |
| 774 | var BssgpDecoded bd; |
| 775 | timer T := 5.0; |
| 776 | BSSGP.send(ts_GMM_DET_REQ_MO(detach_type, power_off)); |
| 777 | if (expect_purge) { |
| 778 | GSUP.receive(tr_GSUP_PURGE_MS_REQ(g_pars.imsi, OSMO_GSUP_CN_DOMAIN_PS)); |
| 779 | GSUP.send(ts_GSUP_PURGE_MS_RES(g_pars.imsi)); |
| 780 | } |
| 781 | T.start; |
| 782 | alt { |
| 783 | [not expect_purge] GSUP.receive(tr_GSUP_PURGE_MS_REQ(?)) { |
| 784 | setverdict(fail, "Unexpected GSUP PURGE MS for unregistered TLLI"); |
| 785 | } |
| 786 | [power_off] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd { |
| 787 | g_pars.ra := omit; |
| 788 | setverdict(fail, "Unexpected ATTACH ACCEPT in no-power-off DETACH"); |
| 789 | /* TODO: check if any PDP contexts are deactivated on network side? */ |
| 790 | } |
| 791 | [power_off] T.timeout { |
| 792 | setverdict(pass); |
| 793 | } |
| 794 | [not power_off] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd { |
| 795 | g_pars.ra := omit; |
| 796 | setverdict(pass); |
| 797 | /* TODO: check if any PDP contexts are deactivated on network side? */ |
| 798 | } |
| 799 | [] BSSGP.receive { repeat; } |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | /* IMSI DETACH (non-power-off) for unknown TLLI */ |
| 804 | private function f_TC_detach_unknown_nopoweroff(charstring id) runs on BSSGP_ConnHdlr { |
| 805 | f_detach_mo(c_GMM_DTT_MO_GPRS, false, false); |
| 806 | } |
| 807 | testcase TC_detach_unknown_nopoweroff() runs on test_CT { |
| 808 | var BSSGP_ConnHdlr vc_conn; |
| 809 | f_init(); |
| 810 | f_sleep(1.0); |
| 811 | vc_conn := f_start_handler(refers(f_TC_detach_unknown_nopoweroff), testcasename(), g_gb[0], 13); |
| 812 | vc_conn.done; |
| 813 | } |
| 814 | |
| 815 | /* IMSI DETACH (power-off) for unknown TLLI */ |
| 816 | private function f_TC_detach_unknown_poweroff(charstring id) runs on BSSGP_ConnHdlr { |
| 817 | f_detach_mo(c_GMM_DTT_MO_GPRS, true, false); |
| 818 | } |
| 819 | testcase TC_detach_unknown_poweroff() runs on test_CT { |
| 820 | var BSSGP_ConnHdlr vc_conn; |
| 821 | f_init(); |
| 822 | f_sleep(1.0); |
| 823 | vc_conn := f_start_handler(refers(f_TC_detach_unknown_poweroff), testcasename(), g_gb[0], 14); |
| 824 | vc_conn.done; |
| 825 | } |
| 826 | |
| 827 | /* IMSI DETACH (non-power-off) for known TLLI */ |
| 828 | private function f_TC_detach_nopoweroff(charstring id) runs on BSSGP_ConnHdlr { |
| 829 | /* first perform regular attach */ |
| 830 | f_TC_attach(id); |
| 831 | |
| 832 | f_detach_mo(c_GMM_DTT_MO_GPRS, false, true); |
| 833 | } |
| 834 | testcase TC_detach_nopoweroff() runs on test_CT { |
| 835 | var BSSGP_ConnHdlr vc_conn; |
| 836 | f_init(); |
| 837 | f_sleep(1.0); |
| 838 | vc_conn := f_start_handler(refers(f_TC_detach_nopoweroff), testcasename(), g_gb[0], 15); |
| 839 | vc_conn.done; |
| 840 | } |
| 841 | |
| 842 | /* IMSI DETACH (power-off) for known TLLI */ |
| 843 | private function f_TC_detach_poweroff(charstring id) runs on BSSGP_ConnHdlr { |
| 844 | /* first perform regular attach */ |
| 845 | f_TC_attach(id); |
| 846 | |
| 847 | f_detach_mo(c_GMM_DTT_MO_GPRS, true, true); |
| 848 | } |
| 849 | testcase TC_detach_poweroff() runs on test_CT { |
| 850 | var BSSGP_ConnHdlr vc_conn; |
| 851 | f_init(); |
| 852 | f_sleep(1.0); |
| 853 | vc_conn := f_start_handler(refers(f_TC_detach_poweroff), testcasename(), g_gb[0], 16); |
| 854 | vc_conn.done; |
| 855 | } |
| 856 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 857 | type record PdpActPars { |
Harald Welte | 822f910 | 2018-02-18 20:39:06 +0100 | [diff] [blame] | 858 | BIT3 tid, /* L3 Transaction ID */ |
| 859 | BIT4 nsapi, /* SNDCP NSAPI */ |
| 860 | BIT4 sapi, /* LLC SAPI */ |
| 861 | QoSV qos, /* QoS parameters */ |
| 862 | PDPAddressV addr, /* IP address */ |
| 863 | octetstring apn optional, /* APN name */ |
| 864 | ProtocolConfigOptionsV pco optional, /* protoco config opts */ |
| 865 | OCT1 exp_rej_cause optional, /* expected SM reject cause */ |
Harald Welte | 1d6ae93 | 2018-02-18 21:24:44 +0100 | [diff] [blame] | 866 | OCT1 gtp_resp_cause, /* GTP response cause */ |
Harald Welte | 822f910 | 2018-02-18 20:39:06 +0100 | [diff] [blame] | 867 | OCT4 chg_id, /* GTP Charging Identifier */ |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 868 | |
Harald Welte | 822f910 | 2018-02-18 20:39:06 +0100 | [diff] [blame] | 869 | OCT4 ggsn_tei_c, /* GGSN TEI Control*/ |
| 870 | OCT4 ggsn_tei_u, /* GGSN TEI User */ |
| 871 | octetstring ggsn_ip_c, /* GGSN IP Control */ |
| 872 | octetstring ggsn_ip_u, /* GGSN IP User */ |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 873 | |
Harald Welte | 822f910 | 2018-02-18 20:39:06 +0100 | [diff] [blame] | 874 | OCT4 sgsn_tei_c optional, /* SGSN TEI Control */ |
| 875 | OCT4 sgsn_tei_u optional, /* SGSN TEI User */ |
| 876 | octetstring sgsn_ip_c optional, /* SGSN IP Control */ |
| 877 | octetstring sgsn_ip_u optional /* SGSN IP USer */ |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 878 | }; |
| 879 | |
Harald Welte | 5b5ca1b | 2018-02-18 21:25:03 +0100 | [diff] [blame] | 880 | |
| 881 | private function f_process_gtp_ctx_act_req(inout PdpActPars apars, PDU_GTPC gtpc) runs on BSSGP_ConnHdlr { |
| 882 | var GTPC_PDUs gtpc_rx := gtpc.gtpc_pdu; |
| 883 | apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; |
| 884 | apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; |
| 885 | apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; |
| 886 | apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; |
| 887 | f_gtp_register_teid(apars.ggsn_tei_c); |
| 888 | f_gtp_register_teid(apars.ggsn_tei_u); |
| 889 | } |
| 890 | |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 891 | function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 892 | var boolean exp_rej := ispresent(apars.exp_rej_cause); |
| 893 | var Gtp1cUnitdata g_ud; |
| 894 | |
| 895 | BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, |
| 896 | apars.apn, apars.pco)); |
Harald Welte | 5b5ca1b | 2018-02-18 21:25:03 +0100 | [diff] [blame] | 897 | GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { |
| 898 | f_process_gtp_ctx_act_req(apars, g_ud.gtpc); |
| 899 | var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); |
| 900 | GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, |
| 901 | apars.sgsn_tei_c, apars.gtp_resp_cause, |
| 902 | apars.ggsn_tei_c, apars.ggsn_tei_u, |
| 903 | apars.nsapi, |
| 904 | apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 905 | } |
| 906 | alt { |
Harald Welte | 2830708 | 2018-02-18 12:14:18 +0100 | [diff] [blame] | 907 | [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 908 | setverdict(pass); |
| 909 | } |
Harald Welte | 2830708 | 2018-02-18 12:14:18 +0100 | [diff] [blame] | 910 | [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 911 | setverdict(fail, "Unexpected PDP CTX ACT ACC"); |
| 912 | } |
Harald Welte | 2830708 | 2018-02-18 12:14:18 +0100 | [diff] [blame] | 913 | [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 914 | setverdict(fail, "Unexpected PDP CTX ACT FAIL"); |
| 915 | } |
Harald Welte | 2830708 | 2018-02-18 12:14:18 +0100 | [diff] [blame] | 916 | [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 917 | setverdict(pass); |
| 918 | } |
Harald Welte | 5b5ca1b | 2018-02-18 21:25:03 +0100 | [diff] [blame] | 919 | [] as_xid(apars); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 920 | } |
| 921 | } |
| 922 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 923 | function f_pdp_ctx_deact_mo(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { |
| 924 | var boolean exp_rej := ispresent(apars.exp_rej_cause); |
| 925 | var Gtp1cUnitdata g_ud; |
| 926 | |
| 927 | BSSGP.send(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit)); |
| 928 | GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { |
| 929 | var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); |
| 930 | BSSGP.clear; |
| 931 | GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); |
| 932 | } |
| 933 | alt { |
| 934 | [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) { |
| 935 | setverdict(pass); |
| 936 | } |
| 937 | [] as_xid(apars); |
| 938 | } |
| 939 | } |
| 940 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 941 | function f_pdp_ctx_deact_mt(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { |
| 942 | var Gtp1cUnitdata g_ud; |
| 943 | var integer seq_nr := 23; |
| 944 | var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); |
| 945 | |
| 946 | BSSGP.clear; |
| 947 | GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, omit)); |
| 948 | |
| 949 | interleave { |
| 950 | [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { |
| 951 | BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); |
| 952 | } |
| 953 | [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } |
| 954 | } |
| 955 | } |
| 956 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 957 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 958 | /* Table 10.5.156/3GPP TS 24.008 */ |
| 959 | template (value) QoSV t_QosDefault := { |
| 960 | reliabilityClass := '011'B, /* unacknowledged GTP+LLC, acknowledged RLC */ |
| 961 | delayClass := '100'B, /* best effort */ |
| 962 | spare1 := '00'B, |
| 963 | precedenceClass := '010'B, /* normal */ |
| 964 | spare2 := '0'B, |
| 965 | peakThroughput := '0000'B, /* subscribed */ |
| 966 | meanThroughput := '00000'B, /* subscribed */ |
| 967 | spare3 := '000'B, |
| 968 | deliverErroneusSDU := omit, |
| 969 | deliveryOrder := omit, |
| 970 | trafficClass := omit, |
| 971 | maxSDUSize := omit, |
| 972 | maxBitrateUplink := omit, |
| 973 | maxBitrateDownlink := omit, |
| 974 | sduErrorRatio := omit, |
| 975 | residualBER := omit, |
| 976 | trafficHandlingPriority := omit, |
| 977 | transferDelay := omit, |
| 978 | guaranteedBitRateUplink := omit, |
| 979 | guaranteedBitRateDownlink := omit, |
| 980 | sourceStatisticsDescriptor := omit, |
| 981 | signallingIndication := omit, |
| 982 | spare4 := omit, |
| 983 | maxBitrateDownlinkExt := omit, |
| 984 | guaranteedBitRateDownlinkExt := omit, |
| 985 | maxBitrateUplinkExt := omit, |
| 986 | guaranteedBitRateUplinkExt := omit, |
| 987 | maxBitrateDownlinkExt2 := omit, |
| 988 | guaranteedBitRateDownlinkExt2 := omit, |
| 989 | maxBitrateUplinkExt2 := omit, |
| 990 | guaranteedBitRateUplinkExt2 := omit |
| 991 | } |
| 992 | |
| 993 | /* 10.5.6.4 / 3GPP TS 24.008 */ |
| 994 | template (value) PDPAddressV t_AddrIPv4dyn := { |
| 995 | pdpTypeOrg := '0001'B, /* IETF */ |
| 996 | spare := '0000'B, |
| 997 | pdpTypeNum := '21'O, /* IPv4 */ |
| 998 | addressInfo := omit |
| 999 | } |
| 1000 | template (value) PDPAddressV t_AddrIPv6dyn := { |
| 1001 | pdpTypeOrg := '0001'B, /* IETF */ |
| 1002 | spare := '0000'B, |
| 1003 | pdpTypeNum := '53'O, /* IPv6 */ |
| 1004 | addressInfo := omit |
| 1005 | } |
| 1006 | |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1007 | template (value) PdpActPars t_PdpActPars(charstring ggsn_ip) := { |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1008 | tid := '000'B, |
| 1009 | nsapi := '0101'B, /* < 5 are reserved */ |
| 1010 | sapi := '0011'B, /* 3/5/9/11 */ |
| 1011 | qos := t_QosDefault, |
| 1012 | addr := t_AddrIPv4dyn, |
| 1013 | apn := omit, |
| 1014 | pco := omit, |
| 1015 | exp_rej_cause := omit, |
Harald Welte | 1d6ae93 | 2018-02-18 21:24:44 +0100 | [diff] [blame] | 1016 | gtp_resp_cause := int2oct(128, 1), |
| 1017 | chg_id := f_rnd_octstring(4), |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1018 | |
| 1019 | /* FIXME: make below dynamic !! */ |
Harald Welte | 1d6ae93 | 2018-02-18 21:24:44 +0100 | [diff] [blame] | 1020 | ggsn_tei_c := f_rnd_octstring(4), |
| 1021 | ggsn_tei_u := f_rnd_octstring(4), |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1022 | ggsn_ip_c := f_inet_addr(ggsn_ip), |
| 1023 | ggsn_ip_u := f_inet_addr(ggsn_ip), |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1024 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1025 | sgsn_tei_c := omit, |
Harald Welte | f8af5d6 | 2018-02-18 15:06:42 +0100 | [diff] [blame] | 1026 | sgsn_tei_u := omit, |
| 1027 | sgsn_ip_c := omit, |
| 1028 | sgsn_ip_u := omit |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1029 | } |
| 1030 | |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1031 | template (value) GtpPeer ts_GtpPeerU(octetstring ip) := { |
| 1032 | connId := 1, |
| 1033 | remName := f_inet_ntoa(ip), |
| 1034 | remPort := GTP1U_PORT |
| 1035 | } |
| 1036 | |
| 1037 | template (value) GtpPeer ts_GtpPeerC(octetstring ip) := { |
| 1038 | connId := 1, |
| 1039 | remName := f_inet_ntoa(ip), |
| 1040 | remPort := GTP1C_PORT |
| 1041 | } |
| 1042 | |
| 1043 | private function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { |
| 1044 | var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); |
| 1045 | GTP.send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload)); |
| 1046 | } |
| 1047 | |
| 1048 | private altstep as_xid(PdpActPars apars) runs on BSSGP_ConnHdlr { |
| 1049 | [] BSSGP.receive(tr_BD_LLC(tr_LLC_XID(?, apars.sapi))) { |
| 1050 | repeat; |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | template PDU_SN tr_SN_UD(template BIT4 nsapi, template octetstring payload) := { |
| 1055 | pDU_SN_UNITDATA := { |
| 1056 | nsapi := nsapi, |
| 1057 | moreBit := ?, |
| 1058 | snPduType := '1'B, |
| 1059 | firstSegmentIndicator := ?, |
| 1060 | spareBit := ?, |
| 1061 | pcomp := ?, |
| 1062 | dcomp := ?, |
| 1063 | npduNumber := ?, |
| 1064 | segmentNumber := ?, |
| 1065 | npduNumberContinued := ?, |
| 1066 | dataSegmentSnUnitdataPdu := payload |
| 1067 | } |
| 1068 | } |
| 1069 | |
| 1070 | /* simple case: single segment, no compression */ |
| 1071 | template (value) PDU_SN ts_SN_UD(BIT4 nsapi, octetstring payload) := { |
| 1072 | pDU_SN_UNITDATA := { |
| 1073 | nsapi := nsapi, |
| 1074 | moreBit := '0'B, |
| 1075 | snPduType := '1'B, |
| 1076 | firstSegmentIndicator := '1'B, |
| 1077 | spareBit := '0'B, |
| 1078 | pcomp := '0000'B, |
| 1079 | dcomp := '0000'B, |
| 1080 | npduNumber := '0000'B, |
| 1081 | segmentNumber := '0000'B, |
| 1082 | npduNumberContinued := '00'O, |
| 1083 | dataSegmentSnUnitdataPdu := payload |
| 1084 | } |
| 1085 | } |
| 1086 | |
| 1087 | /* Transceive given 'payload' as MT message from GTP -> OsmoSGSN -> Gb */ |
| 1088 | private function f_gtpu_xceive_mt(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { |
| 1089 | /* Send PDU via GTP from our simulated GGSN to the SGSN */ |
| 1090 | f_gtpu_send(apars, payload); |
| 1091 | /* Expect PDU via BSSGP/LLC on simulated PCU from SGSN */ |
| 1092 | alt { |
| 1093 | [] as_xid(apars); |
| 1094 | [] BSSGP.receive(tr_BD_SNDCP(apars.sapi, tr_SN_UD(apars.nsapi, payload))); |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | private function f_gtpu_xceive_mo(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { |
| 1099 | /* Send PDU via SNDCP/LLC/BSSGP/NS via simulated MS/PCU to the SGSN */ |
| 1100 | var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); |
| 1101 | var PDU_SN sndcp := valueof(ts_SN_UD(apars.nsapi, payload)); |
| 1102 | BSSGP.send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, 0)); |
| 1103 | f_gtpu_send(apars, payload); |
| 1104 | /* Expect PDU via GTP from SGSN on simulated GGSN */ |
| 1105 | alt { |
| 1106 | [] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)); |
| 1107 | } |
| 1108 | } |
| 1109 | |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1110 | private function f_TC_attach_pdp_act(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1111 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1112 | |
| 1113 | /* first perform regular attach */ |
| 1114 | f_TC_attach(id); |
| 1115 | |
| 1116 | f_pdp_ctx_act(apars); |
| 1117 | } |
| 1118 | testcase TC_attach_pdp_act() runs on test_CT { |
| 1119 | var BSSGP_ConnHdlr vc_conn; |
| 1120 | f_init(); |
| 1121 | vc_conn := f_start_handler(refers(f_TC_attach_pdp_act), testcasename(), g_gb[0], 17); |
| 1122 | vc_conn.done; |
| 1123 | } |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 1124 | |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 1125 | /* PDP Context activation for not-attached subscriber; expect fail */ |
| 1126 | private function f_TC_pdp_act_unattached(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1127 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 1128 | BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, |
| 1129 | apars.apn, apars.pco)); |
| 1130 | alt { |
| 1131 | /* We might want toalso actually expect a PDPC CTX ACT REJ? */ |
| 1132 | [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(?, ?))) { |
| 1133 | setverdict(pass); |
| 1134 | } |
| 1135 | [] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { |
| 1136 | setverdict(fail, "Unexpected GTP PDP CTX ACT"); |
| 1137 | } |
| 1138 | [] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(?, ?))) { |
| 1139 | setverdict(fail, "Unexpected SM PDP CTX ACT ACK"); |
| 1140 | } |
| 1141 | [] BSSGP.receive { repeat; } |
| 1142 | } |
| 1143 | } |
| 1144 | testcase TC_pdp_act_unattached() runs on test_CT { |
| 1145 | var BSSGP_ConnHdlr vc_conn; |
| 1146 | f_init(); |
| 1147 | vc_conn := f_start_handler(refers(f_TC_pdp_act_unattached), testcasename(), g_gb[0], 18); |
| 1148 | vc_conn.done; |
| 1149 | } |
| 1150 | |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1151 | /* ATTACH + PDP CTX ACT + user plane traffic */ |
| 1152 | private function f_TC_attach_pdp_act_user(charstring id) runs on BSSGP_ConnHdlr { |
| 1153 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
| 1154 | |
| 1155 | /* first perform regular attach */ |
| 1156 | f_TC_attach(id); |
| 1157 | /* then activate PDP context */ |
| 1158 | f_pdp_ctx_act(apars); |
| 1159 | /* then transceive a downlink PDU */ |
| 1160 | f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); |
| 1161 | f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); |
| 1162 | } |
| 1163 | testcase TC_attach_pdp_act_user() runs on test_CT { |
| 1164 | var BSSGP_ConnHdlr vc_conn; |
| 1165 | f_init(); |
| 1166 | vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb[0], 19); |
| 1167 | vc_conn.done; |
| 1168 | } |
| 1169 | |
Harald Welte | 5b5ca1b | 2018-02-18 21:25:03 +0100 | [diff] [blame] | 1170 | /* ATTACH + PDP CTX ACT; reject from GGSN */ |
| 1171 | private function f_TC_attach_pdp_act_ggsn_reject(charstring id) runs on BSSGP_ConnHdlr { |
| 1172 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
| 1173 | |
| 1174 | apars.gtp_resp_cause := int2oct(199, 1); /* no resources available */ |
| 1175 | apars.exp_rej_cause := '1a'O; /* insufficient resources */ |
| 1176 | |
| 1177 | /* first perform regular attach */ |
| 1178 | f_TC_attach(id); |
| 1179 | /* then activate PDP context */ |
| 1180 | f_pdp_ctx_act(apars); |
| 1181 | } |
| 1182 | testcase TC_attach_pdp_act_ggsn_reject() runs on test_CT { |
| 1183 | var BSSGP_ConnHdlr vc_conn; |
| 1184 | f_init(); |
| 1185 | vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_ggsn_reject), testcasename(), g_gb[0], 20); |
| 1186 | vc_conn.done; |
| 1187 | } |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 1188 | |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1189 | /* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MO direction */ |
| 1190 | private function f_TC_attach_pdp_act_user_deact_mo(charstring id) runs on BSSGP_ConnHdlr { |
| 1191 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
| 1192 | |
| 1193 | /* first perform regular attach */ |
| 1194 | f_TC_attach(id); |
| 1195 | /* then activate PDP context */ |
| 1196 | f_pdp_ctx_act(apars); |
| 1197 | /* then transceive a downlink PDU */ |
| 1198 | f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); |
| 1199 | f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); |
| 1200 | |
| 1201 | f_pdp_ctx_deact_mo(apars, '00'O); |
| 1202 | } |
| 1203 | testcase TC_attach_pdp_act_user_deact_mo() runs on test_CT { |
| 1204 | var BSSGP_ConnHdlr vc_conn; |
| 1205 | f_init(); |
| 1206 | vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_deact_mo), testcasename(), g_gb[0], 21); |
| 1207 | vc_conn.done; |
| 1208 | } |
| 1209 | |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 1210 | /* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction */ |
| 1211 | private function f_TC_attach_pdp_act_user_deact_mt(charstring id) runs on BSSGP_ConnHdlr { |
| 1212 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
| 1213 | |
| 1214 | /* first perform regular attach */ |
| 1215 | f_TC_attach(id); |
| 1216 | /* then activate PDP context */ |
| 1217 | f_pdp_ctx_act(apars); |
| 1218 | /* then transceive a downlink PDU */ |
| 1219 | f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); |
| 1220 | f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); |
| 1221 | |
| 1222 | f_pdp_ctx_deact_mt(apars, '00'O); |
| 1223 | } |
| 1224 | testcase TC_attach_pdp_act_user_deact_mt() runs on test_CT { |
| 1225 | var BSSGP_ConnHdlr vc_conn; |
| 1226 | f_init(); |
| 1227 | vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_deact_mt), testcasename(), g_gb[0], 22); |
| 1228 | vc_conn.done; |
| 1229 | } |
| 1230 | |
| 1231 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 1232 | |
| 1233 | control { |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 1234 | execute( TC_attach() ); |
Neels Hofmeyr | 8df7d15 | 2018-03-14 19:03:28 +0100 | [diff] [blame] | 1235 | execute( TC_attach_mnc3() ); |
Neels Hofmeyr | 0ecb2e3 | 2018-04-30 15:13:55 +0200 | [diff] [blame] | 1236 | execute( TC_attach_umts_aka_umts_res() ); |
| 1237 | execute( TC_attach_umts_aka_gsm_sres() ); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 1238 | execute( TC_attach_auth_id_timeout() ); |
| 1239 | execute( TC_attach_auth_sai_timeout() ); |
Harald Welte | fe25388 | 2018-02-17 09:25:00 +0100 | [diff] [blame] | 1240 | execute( TC_attach_auth_sai_reject() ); |
Harald Welte | 5b7c812 | 2018-02-16 21:48:17 +0100 | [diff] [blame] | 1241 | execute( TC_attach_gsup_lu_timeout() ); |
Harald Welte | b7c14e9 | 2018-02-17 09:29:16 +0100 | [diff] [blame] | 1242 | execute( TC_attach_gsup_lu_reject() ); |
Harald Welte | 3823e2e | 2018-02-16 21:53:48 +0100 | [diff] [blame] | 1243 | execute( TC_attach_combined() ); |
Harald Welte | 76dee09 | 2018-02-16 22:12:59 +0100 | [diff] [blame] | 1244 | execute( TC_attach_accept_all() ); |
Harald Welte | b2124b2 | 2018-02-16 22:26:56 +0100 | [diff] [blame] | 1245 | execute( TC_attach_closed() ); |
Harald Welte | 04683d0 | 2018-02-16 22:43:45 +0100 | [diff] [blame] | 1246 | execute( TC_rau_unknown() ); |
Harald Welte | 91636de | 2018-02-17 10:16:14 +0100 | [diff] [blame] | 1247 | execute( TC_attach_rau() ); |
Harald Welte | 6abb9fe | 2018-02-17 15:24:48 +0100 | [diff] [blame] | 1248 | execute( TC_detach_unknown_nopoweroff() ); |
| 1249 | execute( TC_detach_unknown_poweroff() ); |
| 1250 | execute( TC_detach_nopoweroff() ); |
| 1251 | execute( TC_detach_poweroff() ); |
Harald Welte | eded9ad | 2018-02-17 20:57:34 +0100 | [diff] [blame] | 1252 | execute( TC_attach_pdp_act() ); |
Harald Welte | 835b15f | 2018-02-18 14:39:11 +0100 | [diff] [blame] | 1253 | execute( TC_pdp_act_unattached() ); |
Harald Welte | 37692d8 | 2018-02-18 15:21:34 +0100 | [diff] [blame] | 1254 | execute( TC_attach_pdp_act_user() ); |
Harald Welte | 5b5ca1b | 2018-02-18 21:25:03 +0100 | [diff] [blame] | 1255 | execute( TC_attach_pdp_act_ggsn_reject() ); |
Harald Welte | 6f20316 | 2018-02-18 22:04:55 +0100 | [diff] [blame] | 1256 | execute( TC_attach_pdp_act_user_deact_mo() ); |
Harald Welte | 57b9b7f | 2018-02-18 22:28:13 +0100 | [diff] [blame] | 1257 | execute( TC_attach_pdp_act_user_deact_mt() ); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 1258 | } |
Harald Welte | 96a33b0 | 2018-02-04 10:36:22 +0100 | [diff] [blame] | 1259 | |
| 1260 | |
| 1261 | |
| 1262 | } |