Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 1 | module PGW_Tests { |
| 2 | |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 3 | import from TCCEncoding_Functions all; |
| 4 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 5 | import from General_Types all; |
| 6 | import from Osmocom_Types all; |
| 7 | import from Native_Functions all; |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 8 | import from Misc_Helpers all; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 9 | |
| 10 | import from GTPv2_Types all; |
| 11 | import from GTPv2_Templates all; |
| 12 | import from GTPv2_Emulation all; |
| 13 | |
| 14 | import from UECUPS_Types all; |
| 15 | |
| 16 | import from DNS_Helpers all; |
| 17 | |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 18 | |
| 19 | import from DIAMETER_Types all; |
| 20 | import from DIAMETER_Templates all; |
Pau Espin Pedrol | 867b130 | 2024-01-24 16:14:28 +0100 | [diff] [blame] | 21 | import from DIAMETER_ts29_212_Templates all; |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 22 | import from DIAMETER_ts29_272_Templates all; |
Pau Espin Pedrol | 867b130 | 2024-01-24 16:14:28 +0100 | [diff] [blame] | 23 | import from DIAMETER_ts32_299_Templates all; |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 24 | import from DIAMETER_Emulation all; |
| 25 | |
| 26 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 27 | modulepar { |
Vadim Yanitskiy | 589972f | 2022-01-20 19:38:16 +0600 | [diff] [blame] | 28 | charstring mp_pgw_hostname := "127.0.0.4"; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 29 | charstring mp_local_hostname_c := "127.0.0.1"; |
| 30 | charstring mp_local_hostname_u := "127.0.0.1"; |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 31 | |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 32 | charstring mp_run_prog_log_path := "/tmp"; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 33 | charstring mp_run_prog_as_user := "laforge"; |
| 34 | charstring mp_ping_hostname := "10.45.0.1"; |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 35 | |
Vadim Yanitskiy | 589972f | 2022-01-20 19:38:16 +0600 | [diff] [blame] | 36 | charstring mp_pcrf_local_ip := "127.0.0.9"; |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 37 | integer mp_pcrf_local_port := 3868; |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 38 | |
| 39 | charstring mp_ocs_local_ip := "127.0.0.9"; |
| 40 | integer mp_ocs_local_port := 3869; |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 41 | |
| 42 | charstring mp_diam_realm := "localdomain"; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | /* main component, we typically have one per testcase */ |
Pau Espin Pedrol | bddba3a | 2024-01-09 12:17:01 +0100 | [diff] [blame] | 46 | type component PGW_Test_CT extends GTP2_ConnHdlr { |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 47 | var GTPv2_Emulation_CT vc_GTP2; |
| 48 | port GTP2EM_PT TEID0; |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 49 | |
| 50 | /* emulated PCRF */ |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 51 | var DIAMETER_Emulation_CT vc_Gx; |
| 52 | port DIAMETER_PT Gx_UNIT; |
| 53 | port DIAMETEREM_PROC_PT Gx_PROC; |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 54 | /* emulated OCS */ |
| 55 | var DIAMETER_Emulation_CT vc_Gy; |
| 56 | port DIAMETER_PT Gy_UNIT; |
| 57 | port DIAMETEREM_PROC_PT Gy_PROC; |
Pau Espin Pedrol | 08880f1 | 2022-04-07 19:05:15 +0200 | [diff] [blame] | 58 | /* global test case guard timer (actual timeout value is set in f_init()) */ |
| 59 | timer T_guard; |
| 60 | } |
| 61 | |
| 62 | /* global altstep for global guard timer; */ |
| 63 | altstep as_Tguard() runs on PGW_Test_CT { |
| 64 | [] T_guard.timeout { |
| 65 | setverdict(fail, "Timeout of T_guard"); |
| 66 | mtc.stop; |
| 67 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 68 | } |
| 69 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 70 | type component DIAMETER_ConnHdlr_CT extends DIAMETER_ConnHdlr { |
| 71 | port DIAMETER_Conn_PT DIAMETER_CLIENT; |
| 72 | } |
| 73 | |
| 74 | function f_diam_connhldr_ct_main(hexstring imsi) runs on DIAMETER_ConnHdlr_CT { |
| 75 | var PDU_DIAMETER msg; |
| 76 | |
| 77 | if (DIAMETER_PROC.checkstate("Connected")) { |
Pau Espin Pedrol | db017f4 | 2023-08-25 19:22:25 +0200 | [diff] [blame] | 78 | f_diameter_expect_imsi(imsi); |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | while (true) { |
| 82 | alt { |
| 83 | [] DIAMETER_CLIENT.receive(PDU_DIAMETER:?) -> value msg { |
| 84 | DIAMETER.send(msg); |
| 85 | } |
| 86 | [] DIAMETER.receive(PDU_DIAMETER:?) -> value msg { |
| 87 | DIAMETER_CLIENT.send(msg); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 94 | /* per-session component; we typically have 1..N per testcase */ |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 95 | type component PGW_Session_CT extends GTP2_ConnHdlr { |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 96 | var SessionPars g_pars; |
| 97 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 98 | port DIAMETER_Conn_PT Gx; |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 99 | port DIAMETER_Conn_PT Gy; |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 100 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 101 | /* TEI (Data) local side */ |
| 102 | var OCT4 g_teid; |
| 103 | /* TEI (Control) local side */ |
| 104 | var OCT4 g_teic; |
| 105 | /* TEI (Data) remote side */ |
| 106 | var OCT4 g_teid_remote; |
| 107 | /* TEI (Control) remote side */ |
| 108 | var OCT4 g_teic_remote; |
| 109 | /* GTP-U IPv4 address remote sie */ |
| 110 | var OCT4 g_gtpu4_remote; |
| 111 | var OCT16 g_gtpu6_remote; |
| 112 | |
| 113 | /* Address allocation */ |
| 114 | var OCT4 g_ip4_addr; |
| 115 | var OCT16 g_ip6_addr; |
| 116 | var integer g_ip6_plen; |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 117 | |
| 118 | /* Store last received Gy message */ |
| 119 | var PDU_DIAMETER g_rx_gy; |
Pau Espin Pedrol | 967d871 | 2023-02-28 16:09:32 +0100 | [diff] [blame] | 120 | |
| 121 | /* number of programs started, used as identifier. */ |
| 122 | var integer g_start_prog_count := 0; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | /* configuration data for a given Session */ |
| 126 | type record SessionPars { |
| 127 | hexstring imsi, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 128 | hexstring msisdn optional, |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 129 | // serving network |
| 130 | integer rat_type, |
| 131 | // flags? |
| 132 | charstring apn, |
| 133 | /* Apn subscribed or non-subscribed */ |
| 134 | boolean selection_mode, |
| 135 | BIT3 pdn_type, |
| 136 | /* PAA */ |
| 137 | /* Max APN Restriction */ |
| 138 | /* APN-AMBR */ |
| 139 | octetstring pco optional, |
| 140 | octetstring epco optional, |
| 141 | /* Bearer Contexts to be created */ |
| 142 | |
| 143 | charstring tun_dev_name, |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 144 | charstring tun_netns_name optional, |
| 145 | |
| 146 | /* In seconds. 0 => disabled, !0 => grant over CC-Time period */ |
| 147 | integer gy_validity_time |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | template (value) SessionPars |
| 151 | t_SessionPars(hexstring imsi, charstring tundev, integer rat_type := 6, charstring apn := "internet", |
| 152 | boolean selection_mode := false, BIT3 pdn_type := '001'B) := { |
| 153 | imsi := imsi, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 154 | msisdn := '1234'H, |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 155 | rat_type := rat_type, |
| 156 | apn := apn, |
| 157 | selection_mode := selection_mode, |
| 158 | pdn_type := pdn_type, |
| 159 | pco := omit, |
| 160 | epco := omit, |
| 161 | tun_dev_name := tundev, |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 162 | tun_netns_name := tundev, |
| 163 | gy_validity_time := 0 |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | type record BearerConfig { |
| 167 | integer eps_bearer_id |
| 168 | } |
| 169 | |
| 170 | type function void_fn() runs on PGW_Session_CT; |
| 171 | |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 172 | friend function DiameterForwardUnitdataCallback(PDU_DIAMETER msg) |
| 173 | runs on DIAMETER_Emulation_CT return template PDU_DIAMETER { |
| 174 | DIAMETER_UNIT.send(msg); |
| 175 | return omit; |
| 176 | } |
| 177 | |
| 178 | friend function f_init_diameter(charstring id) runs on PGW_Test_CT { |
| 179 | var DIAMETEROps ops := { |
| 180 | create_cb := refers(DIAMETER_Emulation.ExpectedCreateCallback), |
Vadim Yanitskiy | b46f01e | 2021-12-06 03:23:13 +0300 | [diff] [blame] | 181 | unitdata_cb := refers(DiameterForwardUnitdataCallback), |
| 182 | raw := false /* handler mode (IMSI based routing) */ |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 183 | }; |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 184 | var DIAMETER_conn_parameters pars; |
| 185 | |
| 186 | /* Gx setup: */ |
| 187 | pars := { |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 188 | remote_ip := mp_pgw_hostname, |
| 189 | remote_sctp_port := -1, |
| 190 | local_ip := mp_pcrf_local_ip, |
| 191 | local_sctp_port := mp_pcrf_local_port, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 192 | origin_host := "pcrf." & mp_diam_realm, |
| 193 | origin_realm := mp_diam_realm, |
Pau Espin Pedrol | 33b4749 | 2022-03-08 17:43:01 +0100 | [diff] [blame] | 194 | auth_app_id := omit, |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 195 | vendor_app_id := c_DIAMETER_3GPP_Gx_AID |
| 196 | }; |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 197 | vc_Gx := DIAMETER_Emulation_CT.create(id); |
| 198 | map(vc_Gx:DIAMETER, system:DIAMETER_CODEC_PT); |
| 199 | connect(vc_Gx:DIAMETER_UNIT, self:Gx_UNIT); |
| 200 | connect(vc_Gx:DIAMETER_PROC, self:Gx_PROC); |
| 201 | vc_Gx.start(DIAMETER_Emulation.main(ops, pars, id)); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 202 | |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 203 | /* Gy setup: */ |
| 204 | pars := { |
| 205 | remote_ip := mp_pgw_hostname, |
| 206 | remote_sctp_port := -1, |
| 207 | local_ip := mp_ocs_local_ip, |
| 208 | local_sctp_port := mp_ocs_local_port, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 209 | origin_host := "ocs." & mp_diam_realm, |
| 210 | origin_realm := mp_diam_realm, |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 211 | auth_app_id := c_DIAMETER_CREDIT_CONTROL_AID, |
| 212 | vendor_app_id := omit |
| 213 | }; |
| 214 | vc_Gy := DIAMETER_Emulation_CT.create(id); |
| 215 | map(vc_Gy:DIAMETER, system:DIAMETER_CODEC_PT); |
| 216 | connect(vc_Gy:DIAMETER_UNIT, self:Gy_UNIT); |
| 217 | connect(vc_Gy:DIAMETER_PROC, self:Gy_PROC); |
| 218 | vc_Gy.start(DIAMETER_Emulation.main(ops, pars, id)); |
| 219 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 220 | f_diameter_wait_capability(Gx_UNIT); |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 221 | f_diameter_wait_capability(Gy_UNIT); |
Pau Espin Pedrol | bb5f45f | 2022-04-11 12:36:55 +0200 | [diff] [blame] | 222 | /* Give some time for our emulation to get out of SUSPECT list of SUT (3 watchdong ping-pongs): |
| 223 | * RFC6733 sec 5.1 |
| 224 | * RFC3539 sec 3.4.1 [5] |
| 225 | * https://github.com/freeDiameter/freeDiameter/blob/master/libfdcore/p_psm.c#L49 |
| 226 | */ |
| 227 | f_sleep(1.0); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 228 | } |
| 229 | |
Pau Espin Pedrol | 08880f1 | 2022-04-07 19:05:15 +0200 | [diff] [blame] | 230 | private function f_init(float guard_timeout := 60.0) runs on PGW_Test_CT { |
| 231 | T_guard.start(guard_timeout); |
| 232 | activate(as_Tguard()); |
| 233 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 234 | var Gtp2EmulationCfg cfg := { |
| 235 | gtpc_bind_ip := mp_local_hostname_c, |
| 236 | gtpc_bind_port := GTP2C_PORT, |
| 237 | gtpc_remote_ip := mp_pgw_hostname, |
| 238 | gtpc_remote_port := GTP2C_PORT, |
| 239 | sgw_role := true, |
| 240 | use_gtpu_daemon := true |
| 241 | }; |
| 242 | |
| 243 | vc_GTP2 := GTPv2_Emulation_CT.create("GTP2_EM"); |
| 244 | map(vc_GTP2:GTP2C, system:GTP2C); |
| 245 | connect(vc_GTP2:TEID0, self:TEID0); |
Pau Espin Pedrol | bddba3a | 2024-01-09 12:17:01 +0100 | [diff] [blame] | 246 | connect(vc_GTP2:CLIENT, self:GTP2); |
| 247 | connect(vc_GTP2:CLIENT_PROC, self:GTP2_PROC); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 248 | vc_GTP2.start(GTPv2_Emulation.main(cfg)); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 249 | |
| 250 | if (mp_pcrf_local_ip != "") { |
| 251 | f_init_diameter(testcasename()); |
| 252 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 253 | } |
| 254 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 255 | function f_start_handler(void_fn fn, template (omit) SessionPars pars_tmpl := omit) |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 256 | runs on PGW_Test_CT return PGW_Session_CT { |
| 257 | var charstring id := testcasename(); |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 258 | var DIAMETER_ConnHdlr_CT vc_conn_gx, vc_conn_gy; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 259 | var PGW_Session_CT vc_conn; |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 260 | var SessionPars pars; |
| 261 | |
| 262 | if (isvalue(pars_tmpl)) { |
| 263 | pars := valueof(pars_tmpl); |
| 264 | } else { |
| 265 | /*TODO: set default values */ |
| 266 | } |
| 267 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 268 | vc_conn := PGW_Session_CT.create(id); |
| 269 | connect(vc_conn:GTP2, vc_GTP2:CLIENT); |
| 270 | connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 271 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 272 | if (isbound(vc_Gx)) { |
| 273 | vc_conn_gx := DIAMETER_ConnHdlr_CT.create(id); |
| 274 | connect(vc_conn_gx:DIAMETER, vc_Gx:DIAMETER_CLIENT); |
| 275 | connect(vc_conn_gx:DIAMETER_PROC, vc_Gx:DIAMETER_PROC); |
| 276 | connect(vc_conn:Gx, vc_conn_gx:DIAMETER_CLIENT); |
| 277 | vc_conn_gx.start(f_diam_connhldr_ct_main(pars.imsi)); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 278 | } |
| 279 | |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 280 | if (isbound(vc_Gy)) { |
| 281 | vc_conn_gy := DIAMETER_ConnHdlr_CT.create(id); |
| 282 | connect(vc_conn_gy:DIAMETER, vc_Gy:DIAMETER_CLIENT); |
| 283 | connect(vc_conn_gy:DIAMETER_PROC, vc_Gy:DIAMETER_PROC); |
| 284 | connect(vc_conn:Gy, vc_conn_gy:DIAMETER_CLIENT); |
| 285 | vc_conn_gy.start(f_diam_connhldr_ct_main(pars.imsi)); |
| 286 | } |
| 287 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 288 | vc_conn.start(f_handler_init(fn, pars)); |
| 289 | return vc_conn; |
| 290 | } |
| 291 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 292 | private function f_handler_init(void_fn fn, SessionPars pars) |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 293 | runs on PGW_Session_CT { |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 294 | g_pars := valueof(pars); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 295 | fn.apply(); |
| 296 | } |
| 297 | |
Harald Welte | fe595e4 | 2020-04-21 22:56:47 +0200 | [diff] [blame] | 298 | private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { |
| 299 | var integer suffix_len := tot_len - lengthof(prefix); |
| 300 | var charstring suffix_ch := int2str(suffix); |
| 301 | var integer pad_len := suffix_len - lengthof(suffix_ch); |
| 302 | |
| 303 | return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); |
| 304 | } |
| 305 | |
| 306 | function f_gen_imei(integer suffix) return hexstring { |
| 307 | return f_concat_pad(14, '49999'H, suffix); |
| 308 | } |
| 309 | |
| 310 | function f_gen_imsi(integer suffix) return hexstring { |
| 311 | return f_concat_pad(15, '26242'H, suffix); |
| 312 | } |
| 313 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 314 | private altstep as_DIA_Gx_CCR(DCC_NONE_CC_Request_Type req_type) runs on PGW_Session_CT { |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 315 | var PDU_DIAMETER rx_dia; |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 316 | [] Gx.receive(tr_DIA_Gx_CCR(req_type := req_type)) -> value rx_dia { |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 317 | var template (omit) AVP avp; |
| 318 | var octetstring sess_id; |
| 319 | var AVP_Unsigned32 req_num; |
| 320 | |
| 321 | avp := f_DIAMETER_get_avp(rx_dia, c_AVP_Code_BASE_NONE_Session_Id); |
| 322 | sess_id := valueof(avp.avp_data.avp_BASE_NONE_Session_Id); |
| 323 | |
| 324 | avp := f_DIAMETER_get_avp(rx_dia, c_AVP_Code_DCC_NONE_CC_Request_Number); |
| 325 | req_num := valueof(avp.avp_data.avp_DCC_NONE_CC_Request_Number); |
| 326 | |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 327 | Gx.send(ts_DIA_Gx_CCA(rx_dia.hop_by_hop_id, rx_dia.end_to_end_id, sess_id, |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 328 | req_type, req_num)); |
| 329 | } |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 330 | [] Gx.receive(PDU_DIAMETER:?) -> value rx_dia { |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 331 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 332 | log2str("Received unexpected DIAMETER ", rx_dia)); |
| 333 | } |
| 334 | } |
| 335 | |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 336 | function f_tr_DIA_Gy_CCR(DCC_NONE_CC_Request_Type req_type) |
| 337 | runs on PGW_Session_CT return template (present) PDU_DIAMETER |
| 338 | { |
| 339 | var template (present) PDU_DIAMETER tpl; |
| 340 | var charstring smf_origin_host := "smf." & mp_diam_realm; |
| 341 | var template (present) octetstring imsi := ?; |
| 342 | var template (present) octetstring msisdn := ?; |
| 343 | var template (present) octetstring rat_type := ?; |
| 344 | var template (present) OCT4 charging_char := ?; |
| 345 | var template (present) OCT1 nsapi := ?; |
| 346 | imsi := char2oct(f_dec_TBCD(imsi_hex2oct(g_pars.imsi))); |
| 347 | //msisdn := char2oct(f_dec_TBCD(substr(ctx_val.msisdn, 1, lengthof(ctx_val.msisdn) -1))); |
| 348 | rat_type := int2oct(g_pars.rat_type, 1); |
| 349 | charging_char := char2oct(oct2str('0000'O)); // f_create_session() uses hardcoded chg_car := '0000'O |
| 350 | nsapi := '01'O; // f_create_session() uses hardcoded bearer_id := 1 |
| 351 | select (req_type) { |
| 352 | case (INITIAL_REQUEST) { |
| 353 | tpl := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| 354 | avps := superset( |
| 355 | tr_AVP_SessionId, |
| 356 | tr_AVP_OriginHost(smf_origin_host), |
| 357 | tr_AVP_OriginRealm(mp_diam_realm), |
| 358 | tr_AVP_DestinationRealm(mp_diam_realm), |
| 359 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 360 | tr_AVP_ServiceContextId, |
| 361 | tr_AVP_CcReqType(req_type), |
| 362 | tr_AVP_CcReqNum(?), |
| 363 | tr_AVP_EventTimestamp(?), |
| 364 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}), |
| 365 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}), |
| 366 | tr_AVP_RequestedAction(DIRECT_DEBITING), |
| 367 | tr_AVP_3GPP_AoCRequestType, |
| 368 | tr_AVP_MultipleServicesIndicator, |
| 369 | tr_AVP_Multiple_Services_Credit_Control(content := superset( |
| 370 | tr_AVP_Requested_Service_Unit, |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 371 | tr_AVP_PCC_3GPP_QoS_Information, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 372 | tr_AVP_GI_3GPP_RatType(rat_type) |
| 373 | )), |
| 374 | tr_AVP_3GPP_ServiceInformation(content := superset( |
| 375 | tr_AVP_3GPP_PSInformation(content := superset( |
| 376 | tr_AVP_3GPP_ChargingId, |
| 377 | tr_AVP_3GPP_PDPType((IPv4,IPv6,IPv4v6)), |
| 378 | tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)), |
| 379 | tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pcrf_local_ip))), |
| 380 | tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pgw_hostname))), |
| 381 | tr_AVP_3GPP_CalledStationId, |
| 382 | tr_AVP_3GPP_SelectionMode, |
| 383 | tr_AVP_3GPP_ChargingCharacteristics(charging_char), |
| 384 | tr_AVP_3GPP_SGSNMCCMNC, |
| 385 | tr_AVP_3GPP_NSAPI(nsapi), |
| 386 | /*We don't yet send MS_Tz in CreateSessionReq: |
| 387 | tr_AVP_3GPP_MS_TimeZone,*/ |
| 388 | tr_AVP_3GPP_ULI/*, |
| 389 | We don't yet send IMEI in CreateSessionReq: |
| 390 | tr_AVP_UserEquipmentInfo({ |
| 391 | tr_AVP_UserEquipmentInfoType(IMEISV), |
| 392 | tr_AVP_UserEquipmentInfoValue(imeisv) |
| 393 | })*/ |
| 394 | )) |
| 395 | )) |
| 396 | )); |
| 397 | } |
| 398 | case (UPDATE_REQUEST) { |
| 399 | tpl := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| 400 | avps := superset( |
| 401 | tr_AVP_SessionId, |
| 402 | tr_AVP_OriginHost(smf_origin_host), |
| 403 | tr_AVP_OriginRealm(mp_diam_realm), |
| 404 | tr_AVP_DestinationRealm(mp_diam_realm), |
| 405 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 406 | tr_AVP_ServiceContextId, |
| 407 | tr_AVP_CcReqType(req_type), |
| 408 | tr_AVP_CcReqNum(?), |
| 409 | tr_AVP_DestinationHost(?), |
| 410 | tr_AVP_EventTimestamp(?), |
| 411 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}), |
| 412 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}), |
| 413 | tr_AVP_RequestedAction(DIRECT_DEBITING), |
| 414 | tr_AVP_3GPP_AoCRequestType, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 415 | tr_AVP_Multiple_Services_Credit_Control(content := superset( |
| 416 | tr_AVP_Requested_Service_Unit, |
| 417 | tr_AVP_Used_Service_Unit, |
Pau Espin Pedrol | cba0f6d | 2022-05-24 13:49:46 +0200 | [diff] [blame] | 418 | /* tr_AVP_3GPP_Reporting_Reason, can be sometimes inside UsedServiceUnit */ |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 419 | tr_AVP_PCC_3GPP_QoS_Information, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 420 | tr_AVP_GI_3GPP_RatType(rat_type) |
| 421 | )), |
| 422 | tr_AVP_3GPP_ServiceInformation(content := superset( |
| 423 | tr_AVP_3GPP_PSInformation(content := superset( |
| 424 | tr_AVP_3GPP_ChargingId, |
| 425 | /* tr_AVP_3GPP_PDPType, Only in INIT */ |
| 426 | tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)), |
| 427 | tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pcrf_local_ip))), |
| 428 | tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pgw_hostname))), |
| 429 | tr_AVP_3GPP_CalledStationId, |
| 430 | tr_AVP_3GPP_SelectionMode, |
| 431 | tr_AVP_3GPP_ChargingCharacteristics(charging_char), |
| 432 | tr_AVP_3GPP_SGSNMCCMNC, |
| 433 | tr_AVP_3GPP_NSAPI(nsapi), |
| 434 | /*We don't yet send MS_Tz in CreateSessionReq: |
| 435 | tr_AVP_3GPP_MS_TimeZone,*/ |
| 436 | tr_AVP_3GPP_ULI/*, |
| 437 | We don't yet send IMEI in CreateSessionReq: |
| 438 | tr_AVP_UserEquipmentInfo({ |
| 439 | tr_AVP_UserEquipmentInfoType(IMEISV), |
| 440 | tr_AVP_UserEquipmentInfoValue(imeisv) |
| 441 | })*/ |
| 442 | )) |
| 443 | )) |
| 444 | )); |
| 445 | } |
| 446 | case (TERMINATION_REQUEST) { |
| 447 | tpl := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| 448 | avps := superset( |
| 449 | tr_AVP_SessionId, |
| 450 | tr_AVP_OriginHost(smf_origin_host), |
| 451 | tr_AVP_OriginRealm(mp_diam_realm), |
| 452 | tr_AVP_DestinationRealm(mp_diam_realm), |
| 453 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 454 | tr_AVP_ServiceContextId, |
| 455 | tr_AVP_CcReqType(req_type), |
| 456 | tr_AVP_CcReqNum(?), |
| 457 | tr_AVP_DestinationHost(?), |
| 458 | tr_AVP_EventTimestamp(?), |
| 459 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}), |
| 460 | tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}), |
| 461 | tr_AVP_TerminationCause(?), |
| 462 | tr_AVP_RequestedAction(DIRECT_DEBITING), |
| 463 | tr_AVP_3GPP_AoCRequestType, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 464 | tr_AVP_Multiple_Services_Credit_Control(content := superset( |
| 465 | /* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */ |
| 466 | tr_AVP_Used_Service_Unit, |
Pau Espin Pedrol | cba0f6d | 2022-05-24 13:49:46 +0200 | [diff] [blame] | 467 | tr_AVP_3GPP_Reporting_Reason(FINAL), |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 468 | tr_AVP_PCC_3GPP_QoS_Information, |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 469 | tr_AVP_GI_3GPP_RatType(rat_type) |
| 470 | )), |
| 471 | tr_AVP_3GPP_ServiceInformation(content := superset( |
| 472 | tr_AVP_3GPP_PSInformation(content := superset( |
| 473 | tr_AVP_3GPP_ChargingId, |
| 474 | /* tr_AVP_3GPP_PDPType, Only in INIT */ |
| 475 | tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)), |
| 476 | tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pcrf_local_ip))), |
| 477 | tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(mp_pgw_hostname))), |
| 478 | tr_AVP_3GPP_CalledStationId, |
| 479 | tr_AVP_3GPP_SelectionMode, |
| 480 | tr_AVP_3GPP_ChargingCharacteristics(charging_char), |
| 481 | tr_AVP_3GPP_SGSNMCCMNC, |
| 482 | tr_AVP_3GPP_NSAPI(nsapi), |
| 483 | /*We don't yet send MS_Tz in CreateSessionReq: |
| 484 | tr_AVP_3GPP_MS_TimeZone,*/ |
| 485 | tr_AVP_3GPP_ULI/*, |
| 486 | We don't yet send IMEI in CreateSessionReq: |
| 487 | tr_AVP_UserEquipmentInfo({ |
| 488 | tr_AVP_UserEquipmentInfoType(IMEISV), |
| 489 | tr_AVP_UserEquipmentInfoValue(imeisv) |
| 490 | })*/ |
| 491 | )) |
| 492 | )) |
| 493 | )); |
| 494 | } |
| 495 | } |
| 496 | return tpl; |
| 497 | } |
| 498 | |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 499 | private altstep as_DIA_Gy_CCR(DCC_NONE_CC_Request_Type req_type) |
| 500 | runs on PGW_Session_CT { |
| 501 | [] Gy.receive(f_tr_DIA_Gy_CCR(req_type := req_type)) -> value g_rx_gy { |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 502 | var template (value) PDU_DIAMETER tx_dia; |
| 503 | var template (omit) AVP avp; |
| 504 | var octetstring sess_id; |
| 505 | var AVP_Unsigned32 req_num; |
| 506 | |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 507 | avp := f_DIAMETER_get_avp(g_rx_gy, c_AVP_Code_BASE_NONE_Session_Id); |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 508 | sess_id := valueof(avp.avp_data.avp_BASE_NONE_Session_Id); |
| 509 | |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 510 | avp := f_DIAMETER_get_avp(g_rx_gy, c_AVP_Code_DCC_NONE_CC_Request_Number); |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 511 | req_num := valueof(avp.avp_data.avp_DCC_NONE_CC_Request_Number); |
| 512 | if (g_pars.gy_validity_time > 0) { |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 513 | tx_dia := ts_DIA_Gy_CCA_ValidityTime(g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id, sess_id, |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 514 | req_type, req_num, g_pars.gy_validity_time); |
| 515 | } else { |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 516 | tx_dia := ts_DIA_Gy_CCA(g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id, sess_id, |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 517 | req_type, req_num); |
| 518 | } |
| 519 | Gy.send(tx_dia); |
| 520 | } |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 521 | [] Gy.receive(PDU_DIAMETER:?) -> value g_rx_gy { |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 522 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 523 | log2str("Received unexpected DIAMETER Gy", g_rx_gy)); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 524 | } |
| 525 | } |
| 526 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 527 | |
| 528 | /* find TEID of given interface type (and optionally instance) */ |
| 529 | private function f_find_teid(FullyQualifiedTEID_List list, |
| 530 | template (present) integer if_type, |
| 531 | template (present) BIT4 instance := ?) |
| 532 | return template (omit) FullyQualifiedTEID |
| 533 | { |
| 534 | var integer i; |
| 535 | for (i := 0; i < lengthof(list); i := i+1) { |
| 536 | if (match(list[i].interfaceType, if_type) and |
| 537 | match(list[i].instance, instance)) { |
| 538 | return list[i]; |
| 539 | } |
| 540 | } |
| 541 | return omit; |
| 542 | } |
| 543 | |
| 544 | /* process one to-be-created bearer context */ |
| 545 | private function process_bctx_create(BearerContextGrouped bctx) runs on PGW_Session_CT |
| 546 | { |
| 547 | /* FIXME: EPS Bearer ID */ |
| 548 | /* FIXME: Cause */ |
| 549 | |
| 550 | /* find F-TEID of the P-GW U side */ |
| 551 | var FullyQualifiedTEID rx_fteid; |
| 552 | rx_fteid := valueof(f_find_teid(bctx.bearerContextIEs.fullyQualifiedTEID, 5, '0010'B)); |
| 553 | g_teid_remote := rx_fteid.tEID_GRE_Key; |
| 554 | if (rx_fteid.v4_Flag == '1'B) { |
| 555 | g_gtpu4_remote := rx_fteid.iPv4_Address; |
| 556 | } |
| 557 | if (rx_fteid.v6_Flag == '1'B) { |
| 558 | g_gtpu6_remote := rx_fteid.iPv6_Address; |
| 559 | } |
| 560 | |
| 561 | var UECUPS_CreateTun uecups_create := { |
| 562 | tx_teid := oct2int(g_teid_remote), |
| 563 | rx_teid := oct2int(g_teid), |
| 564 | user_addr_type := IPV4, |
| 565 | user_addr := '00000000'O, |
| 566 | local_gtp_ep := valueof(ts_UECUPS_SockAddr(f_inet_addr(mp_local_hostname_u))), |
| 567 | remote_gtp_ep := valueof(ts_UECUPS_SockAddr(g_gtpu4_remote)), |
| 568 | tun_dev_name := g_pars.tun_dev_name, |
| 569 | tun_netns_name := g_pars.tun_netns_name |
| 570 | }; |
| 571 | |
| 572 | /* create tunnel in daemon */ |
| 573 | if (isbound(g_ip4_addr)) { |
| 574 | uecups_create.user_addr := g_ip4_addr; |
| 575 | f_gtp2_create_tunnel(uecups_create); |
| 576 | } |
| 577 | if (isbound(g_ip6_addr)) { |
| 578 | uecups_create.user_addr_type := IPV6; |
| 579 | uecups_create.user_addr := g_ip6_addr; |
| 580 | f_gtp2_create_tunnel(uecups_create); |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | /* create a session on the PGW */ |
| 585 | private function f_create_session() runs on PGW_Session_CT { |
| 586 | var PDU_GTPCv2 rx; |
| 587 | |
| 588 | /* allocate + register TEID-C on local side */ |
| 589 | g_teic := f_gtp2_allocate_teid(); |
| 590 | g_teid := g_teic; |
| 591 | |
| 592 | var template (value) FullyQualifiedTEID fteid_c_ie, fteid_u_ie; |
| 593 | fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S5S8_SGW_GTPC, g_teic, 0, |
| 594 | f_inet_addr(mp_local_hostname_c), omit); |
| 595 | fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S5S8_SGW_GTPU, g_teid, 2, |
| 596 | f_inet_addr(mp_local_hostname_u), omit); |
| 597 | var template (value) PDU_GTPCv2 g2c := |
Pau Espin Pedrol | e343a88 | 2022-05-18 18:51:11 +0200 | [diff] [blame] | 598 | ts_GTP2C_CreateSessionReq(imsi := g_pars.imsi, msisdn := g_pars.msisdn, rat_type := 6, |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 599 | sender_fteid := fteid_c_ie, |
| 600 | apn := f_enc_dns_hostname(g_pars.apn), |
| 601 | pdn_type := g_pars.pdn_type, teid_list := { fteid_u_ie }, |
| 602 | chg_car := '0000'O, bearer_id := 1); |
| 603 | /* open5gs up to 1.2.3 won't accept it without ULI, despite not mandatory */ |
| 604 | var template (value) TAI tai := { '0'H, '0'H, '1'H, 'F'H, '0'H, '1'H, '0001'O }; |
| 605 | var template (value) ECGI ecgi := { '0'H, '0'H, '1'H, 'F'H, '0'H, '1'H, '0'H, 23 }; |
| 606 | g2c.gtpcv2_pdu.createSessionRequest.userLocationInfo := ts_GTP2C_UserLocInfo(tai := tai, ecgi := ecgi); |
Vadim Yanitskiy | bada3c9 | 2022-01-20 18:59:07 +0600 | [diff] [blame] | 607 | g2c.gtpcv2_pdu.createSessionRequest.servingNetwork := ts_GTP2C_ServingNetwork('001'H, '01F'H); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 608 | |
| 609 | GTP2.send(g2c); |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 610 | if (Gx.checkstate("Connected")) { |
| 611 | as_DIA_Gx_CCR(INITIAL_REQUEST); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 612 | } |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 613 | if (Gy.checkstate("Connected")) { |
| 614 | as_DIA_Gy_CCR(INITIAL_REQUEST); |
| 615 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 616 | alt { |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 617 | [] GTP2.receive(tr_GTP2C_CreateSessionResp(d_teid:=g_teic, cause:=Request_accepted)) -> value rx { |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 618 | /* extract TEIDs */ |
| 619 | var CreateSessionResponse resp := rx.gtpcv2_pdu.createSessionResponse; |
| 620 | g_teic_remote := resp.fullyQualifiedTEID[0].tEID_GRE_Key; |
| 621 | |
| 622 | /* extract allocated address[es] */ |
| 623 | var PDN_Address_and_Prefix paa := resp.pDN_AddressAllocation.pDN_Address_and_Prefix; |
| 624 | if (ischosen(paa.iPv4_Address)) { |
| 625 | g_ip4_addr := paa.iPv4_Address; |
| 626 | } else if (ischosen(paa.iPv6_Address)) { |
| 627 | g_ip6_addr := paa.iPv6_Address.iPv6_Address; |
| 628 | g_ip6_plen := paa.iPv6_Address.prefixLength; |
| 629 | } else if (ischosen(paa.iPv4_IPv6)) { |
| 630 | g_ip4_addr := paa.iPv4_IPv6.iPv4_Address; |
| 631 | g_ip6_addr := paa.iPv4_IPv6.iPv6_Address; |
| 632 | g_ip6_plen := paa.iPv4_IPv6.prefixLength; |
| 633 | } |
| 634 | var integer i; |
| 635 | for (i := 0; i < lengthof(resp.bearerContextGrouped); i := i+1) { |
| 636 | var BearerContextGrouped bctx := resp.bearerContextGrouped[i]; |
| 637 | select (bctx.instance) { |
| 638 | case ('0000'B) { // created |
| 639 | process_bctx_create(bctx); |
| 640 | } |
| 641 | case ('0001'B) { // removed |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 642 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 643 | "We don't expect removed bearer contexts yet"); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 644 | } |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | [] GTP2.receive(tr_GTP2C_CreateSessionResp(d_teid:=g_teic, cause:=?)) -> value rx { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 649 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 650 | log2str("Unexpected CreateSessionResp(cause=", |
| 651 | rx.gtpcv2_pdu.createSessionResponse.cause.causeValue, ")")); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 652 | } |
| 653 | [] GTP2.receive { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 654 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 655 | "Unexpected GTPv2 while waiting for CreateSessionResp"); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 656 | } |
| 657 | } |
| 658 | |
| 659 | } |
| 660 | |
| 661 | /* delete the session from the PGW */ |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 662 | private function f_delete_session(template (omit) GTP2C_Cause tx_cause := omit, |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 663 | template (present) OCT4 exp_teid, |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 664 | template (present) GTP2C_Cause exp_cause, |
Pau Espin Pedrol | 5b0327b | 2022-04-11 13:02:36 +0200 | [diff] [blame] | 665 | boolean expect_diameter := true) runs on PGW_Session_CT { |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 666 | var template (value) FullyQualifiedTEID fteid_c_ie |
| 667 | fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S5S8_SGW_GTPC, g_teic, 0, |
| 668 | f_inet_addr(mp_local_hostname_c), omit); |
| 669 | var template PDU_GTPCv2 g2c := |
| 670 | ts_GTP2C_DeleteSessionReq(d_teid := g_teic_remote, cause := tx_cause, |
| 671 | sender_fteid := fteid_c_ie, |
| 672 | teid_list := {}, bearer_id := 1); |
| 673 | |
| 674 | GTP2.send(g2c); |
Pau Espin Pedrol | 8b3123f | 2022-04-20 17:17:05 +0200 | [diff] [blame] | 675 | if (Gx.checkstate("Connected") and expect_diameter) { |
| 676 | as_DIA_Gx_CCR(TERMINATION_REQUEST); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 677 | } |
Pau Espin Pedrol | 251d064 | 2022-04-20 18:16:45 +0200 | [diff] [blame] | 678 | if (Gy.checkstate("Connected") and expect_diameter) { |
| 679 | as_DIA_Gy_CCR(TERMINATION_REQUEST); |
| 680 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 681 | alt { |
| 682 | [] GTP2.receive(tr_GTP2C_DeleteSessionResp(d_teid := exp_teid, cause := exp_cause)) { |
| 683 | setverdict(pass); |
| 684 | } |
| 685 | [] GTP2.receive(tr_GTP2C_DeleteSessionResp(?, ?)) { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 686 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 687 | "Unexpected DeleteSessionResp"); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 688 | } |
| 689 | [] GTP2.receive { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 690 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 691 | "Unexpected GTPv2 while waiting for DeleteSessionResp"); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 692 | } |
| 693 | } |
| 694 | |
| 695 | /* destroy tunnel in daemon */ |
| 696 | if (isbound(g_teid)) { |
| 697 | var UECUPS_DestroyTun uecups_destroy := { |
| 698 | local_gtp_ep := valueof(ts_UECUPS_SockAddr(f_inet_addr(mp_local_hostname_u))), |
| 699 | rx_teid := oct2int(g_teid) |
| 700 | }; |
| 701 | /* FIXME: what about IPv4/IPv6 differentiation? */ |
| 702 | f_gtp2_destroy_tunnel(uecups_destroy); |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | /* start a program on the user plane side; return its PID */ |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 707 | private function f_start_prog(charstring command, boolean redirect_output := true) |
| 708 | runs on PGW_Session_CT return integer |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 709 | { |
| 710 | var UECUPS_StartProgram sprog := { |
| 711 | command := command, |
| 712 | environment := {}, |
| 713 | run_as_user := mp_run_prog_as_user, |
| 714 | tun_netns_name := g_pars.tun_netns_name |
| 715 | }; |
Pau Espin Pedrol | 967d871 | 2023-02-28 16:09:32 +0100 | [diff] [blame] | 716 | g_start_prog_count := g_start_prog_count + 1; |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 717 | |
| 718 | /* Redirect stdout/stderr to the user-specified location */ |
| 719 | if (redirect_output) { |
Pau Espin Pedrol | 967d871 | 2023-02-28 16:09:32 +0100 | [diff] [blame] | 720 | var charstring id := testcasename() & "-" & hex2str(g_pars.imsi) & "-" & int2str(g_start_prog_count); |
| 721 | var charstring prefix := mp_run_prog_log_path & "/" & id; |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 722 | sprog.command := sprog.command & " 1>>" & prefix & ".prog.stdout"; |
| 723 | sprog.command := sprog.command & " 2>>" & prefix & ".prog.stderr"; |
| 724 | } |
| 725 | |
Vadim Yanitskiy | 36ab797 | 2022-02-01 20:46:05 +0600 | [diff] [blame] | 726 | log("Starting a program: ", command); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 727 | var UECUPS_StartProgramRes res := f_gtp2_start_program(sprog); |
| 728 | if (res.result != OK) { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 729 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 730 | log2str("Unable to start program '", command, "'")); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 731 | } |
Pau Espin Pedrol | 967d871 | 2023-02-28 16:09:32 +0100 | [diff] [blame] | 732 | log("Started program '", command, "' with PID ", res.pid); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 733 | return res.pid; |
| 734 | } |
| 735 | |
| 736 | /* wait for termination of a given PID with specified exit_code */ |
| 737 | private function f_wait_term(integer pid, template (present) integer exit_code := 0, |
| 738 | float tout := 10.0) runs on PGW_Session_CT |
| 739 | { |
Vadim Yanitskiy | 36ab797 | 2022-02-01 20:46:05 +0600 | [diff] [blame] | 740 | var UECUPS_ProgramTermInd pti; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 741 | timer T := tout; |
| 742 | |
| 743 | T.start; |
| 744 | alt { |
| 745 | [] GTP2.receive(UECUPS_ProgramTermInd:{pid := pid, exit_code := exit_code}) { |
| 746 | setverdict(pass); |
| 747 | } |
Vadim Yanitskiy | 36ab797 | 2022-02-01 20:46:05 +0600 | [diff] [blame] | 748 | [] GTP2.receive(UECUPS_ProgramTermInd:?) -> value pti { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 749 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 750 | log2str("Received unexpected ProgramTermInd := ", pti)); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 751 | } |
| 752 | [] T.timeout { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 753 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
Pau Espin Pedrol | 967d871 | 2023-02-28 16:09:32 +0100 | [diff] [blame] | 754 | log2str("timeout (", tout, " seconds) waiting for user-plane program PID ", pid, " termination")); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 755 | } |
| 756 | } |
| 757 | } |
| 758 | |
| 759 | /* execute a program and wait for result */ |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 760 | private function f_start_prog_wait(charstring command, |
| 761 | template integer exit_code := 0, |
| 762 | float tout := 10.0, |
| 763 | boolean redirect_output := true) |
| 764 | runs on PGW_Session_CT |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 765 | { |
Vadim Yanitskiy | 284c68e | 2022-02-02 22:30:37 +0600 | [diff] [blame] | 766 | var integer pid := f_start_prog(command, redirect_output); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 767 | f_wait_term(pid, exit_code, tout); |
| 768 | } |
| 769 | |
| 770 | /* execute ping command and wait for result */ |
| 771 | private function f_ping4(charstring host, integer interval := 1, integer count := 10) runs on PGW_Session_CT |
| 772 | { |
| 773 | var charstring ping :="ping -c " & int2str(count) & " -i " & int2str(interval); |
Pau Espin Pedrol | 55980c4 | 2023-02-28 12:40:52 +0100 | [diff] [blame] | 774 | |
| 775 | if (not isbound(g_ip4_addr)) { |
| 776 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_ping4(): g_ip4_addr is unset!"); |
| 777 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 778 | ping := ping & " -I " & f_inet_ntoa(g_ip4_addr); |
| 779 | ping := ping & " " & host; |
Harald Welte | 8cfdc7c | 2020-04-21 22:48:34 +0200 | [diff] [blame] | 780 | f_start_prog_wait(ping, tout := int2float(5 + interval*count)); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 781 | } |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | /* send echo request; expect response */ |
| 787 | testcase TC_tx_echo() runs on PGW_Test_CT { |
| 788 | timer T := 5.0; |
| 789 | |
| 790 | f_init(); |
| 791 | |
Pau Espin Pedrol | bddba3a | 2024-01-09 12:17:01 +0100 | [diff] [blame] | 792 | GTP2.send(ts_GTP2C_EchoReq(0)); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 793 | T.start; |
| 794 | alt { |
Pau Espin Pedrol | bddba3a | 2024-01-09 12:17:01 +0100 | [diff] [blame] | 795 | [] GTP2.receive(tr_GTP2C_EchoResp) { |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 796 | setverdict(pass); |
| 797 | } |
| 798 | [] T.timeout { |
Pau Espin Pedrol | f97f6e2 | 2023-02-28 14:13:42 +0100 | [diff] [blame] | 799 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "timeout waiting for Echo Response"); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 800 | } |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | /* create a session, expect it to succeed */ |
| 805 | private function f_TC_createSession() runs on PGW_Session_CT { |
| 806 | f_create_session(); |
| 807 | setverdict(pass); |
| 808 | } |
| 809 | testcase TC_createSession() runs on PGW_Test_CT { |
| 810 | var PGW_Session_CT vc_conn; |
| 811 | var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun22")); |
| 812 | f_init(); |
| 813 | vc_conn := f_start_handler(refers(f_TC_createSession), pars); |
| 814 | vc_conn.done; |
| 815 | } |
| 816 | |
| 817 | /* create a session, then execute a ping command on the user plane */ |
| 818 | private function f_TC_createSession_ping4() runs on PGW_Session_CT { |
| 819 | f_create_session(); |
| 820 | f_ping4(mp_ping_hostname); |
| 821 | setverdict(pass); |
| 822 | } |
| 823 | testcase TC_createSession_ping4() runs on PGW_Test_CT { |
| 824 | var PGW_Session_CT vc_conn; |
| 825 | var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun23")); |
| 826 | f_init(); |
| 827 | vc_conn := f_start_handler(refers(f_TC_createSession_ping4), pars); |
| 828 | vc_conn.done; |
| 829 | } |
Harald Welte | fe595e4 | 2020-04-21 22:56:47 +0200 | [diff] [blame] | 830 | testcase TC_createSession_ping4_256() runs on PGW_Test_CT { |
| 831 | var PGW_Session_CT vc_conn[256]; |
| 832 | var integer i; |
| 833 | |
| 834 | f_init(); |
| 835 | |
| 836 | for (i := 0; i < sizeof(vc_conn); i:=i+1) { |
| 837 | var charstring tundev := "ping" & int2str(i); |
| 838 | var SessionPars pars := valueof(t_SessionPars(f_gen_imsi(i), tundev)); |
| 839 | vc_conn[i] := f_start_handler(refers(f_TC_createSession_ping4), pars); |
| 840 | } |
| 841 | |
| 842 | for (i := 0; i < lengthof(vc_conn); i:=i+1) { |
| 843 | vc_conn[i].done; |
| 844 | } |
| 845 | } |
| 846 | |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 847 | |
| 848 | /* create a session, then delete it again */ |
| 849 | private function f_TC_createSession_deleteSession() runs on PGW_Session_CT { |
| 850 | f_create_session(); |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 851 | f_delete_session(omit, g_teic, Request_accepted); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 852 | setverdict(pass); |
| 853 | } |
| 854 | testcase TC_createSession_deleteSession() runs on PGW_Test_CT { |
| 855 | var PGW_Session_CT vc_conn; |
| 856 | var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun23")); |
| 857 | f_init(); |
| 858 | vc_conn := f_start_handler(refers(f_TC_createSession_deleteSession), pars); |
| 859 | vc_conn.done; |
| 860 | } |
| 861 | |
| 862 | /* send a DeleteSessionReq for an unknown/invalid TEID */ |
| 863 | private function f_TC_deleteSession_unknown() runs on PGW_Session_CT { |
| 864 | g_teic := f_gtp2_allocate_teid(); |
| 865 | g_teic_remote := f_rnd_octstring(4); |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 866 | f_delete_session(omit, '00000000'O, Context_Not_Found, false); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 867 | setverdict(pass); |
| 868 | } |
| 869 | testcase TC_deleteSession_unknown() runs on PGW_Test_CT { |
| 870 | var PGW_Session_CT vc_conn; |
| 871 | var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun23")); |
| 872 | f_init(); |
| 873 | vc_conn := f_start_handler(refers(f_TC_deleteSession_unknown), pars); |
| 874 | vc_conn.done; |
| 875 | } |
| 876 | |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 877 | /* Test charging over Gy interface. */ |
| 878 | private function f_TC_gy_charging_cc_time() runs on PGW_Session_CT { |
| 879 | var default d; |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 880 | |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 881 | f_create_session(); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 882 | |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 883 | /* We should receive an update even if no traffic is sent: */ |
| 884 | as_DIA_Gy_CCR(UPDATE_REQUEST); |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 885 | f_validate_gy_cc_report(g_rx_gy, VALIDITY_TIME, (3..4), 0, 0); |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 886 | |
| 887 | d := activate(as_DIA_Gy_CCR(UPDATE_REQUEST)); |
| 888 | f_ping4(mp_ping_hostname); |
| 889 | /* Let the CCA reach the GGSN */ |
| 890 | f_sleep(0.5); |
| 891 | deactivate(d); |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 892 | f_validate_gy_cc_report(g_rx_gy, VALIDITY_TIME, (3..4), (28..1000), (28..1000)); |
| 893 | |
| 894 | as_DIA_Gy_CCR(UPDATE_REQUEST); |
| 895 | f_validate_gy_cc_report(g_rx_gy, VALIDITY_TIME, (3..4), ?, ?); |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 896 | |
Pau Espin Pedrol | 1344e47 | 2023-10-23 19:54:29 +0200 | [diff] [blame] | 897 | f_delete_session(omit, g_teic, Request_accepted); |
Pau Espin Pedrol | 2fde1ef | 2022-05-20 18:53:09 +0200 | [diff] [blame] | 898 | f_validate_gy_cc_report(g_rx_gy, FINAL, (0..1), 0, 0); |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 899 | setverdict(pass); |
| 900 | } |
| 901 | testcase TC_gy_charging_cc_time() runs on PGW_Test_CT { |
| 902 | var PGW_Session_CT vc_conn; |
| 903 | var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun23")); |
| 904 | pars.gy_validity_time := 3; /* Grant access for 3 seconds, needs to be re-validated afterwards */ |
| 905 | f_init(); |
| 906 | vc_conn := f_start_handler(refers(f_TC_gy_charging_cc_time), pars); |
| 907 | vc_conn.done; |
| 908 | } |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 909 | |
| 910 | control { |
| 911 | execute( TC_tx_echo() ); |
| 912 | execute( TC_createSession() ); |
| 913 | execute( TC_createSession_ping4() ); |
Harald Welte | fe595e4 | 2020-04-21 22:56:47 +0200 | [diff] [blame] | 914 | execute( TC_createSession_ping4_256() ); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 915 | execute( TC_createSession_deleteSession() ); |
| 916 | execute( TC_deleteSession_unknown() ); |
Pau Espin Pedrol | 431f346 | 2022-04-20 18:45:35 +0200 | [diff] [blame] | 917 | execute( TC_gy_charging_cc_time() ); |
Harald Welte | 4526da9 | 2020-03-05 23:08:10 +0100 | [diff] [blame] | 918 | } |
| 919 | |
| 920 | |
| 921 | } |