diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-05-13 16:17:48 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-05-13 17:41:15 +0200 |
commit | 38968e9ba99a08ad48b44bc30aed15f51472ff84 (patch) | |
tree | 1c01df7a500650e9e8288930ea98e443b95684d7 | |
parent | 0e127870fb791101195ab9569e3d3f82a3029749 (diff) |
ggsn: Append IMEISV IE to CreatePdpCtxReq
Change-Id: I00975328e94afd116e59c88fd96c5b0154810a1e
-rw-r--r-- | ggsn_tests/GGSN_Tests.ttcn | 17 | ||||
-rw-r--r-- | library/GTP_Templates.ttcn | 31 |
2 files changed, 39 insertions, 9 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index e3d93411..c1ef7fbb 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -99,7 +99,8 @@ module GGSN_Tests { OCT4 teic_remote, OCT1 ratType optional, UserLocationInformation uli optional, - OCT2 charging_char optional + OCT2 charging_char optional, + OCT8 imeisv optional } type component GT_CT { @@ -332,6 +333,11 @@ module GGSN_Tests { return int2oct(f_rnd_int(4294967296), 4); } + /* return random IMEI(SV) */ + function f_rnd_imeisv() return OCT8 { + return hex2oct(f_rnd_hexstring(16, 10)); + } + /* define an (internal) representation of a PDP context */ template PdpContext t_DefinePDP(hexstring imsi, octetstring msisdn, octetstring apn, EndUserAddress eua, OCT1 ratType := '02'O /* GERAN */) := { @@ -352,7 +358,8 @@ module GGSN_Tests { geographicLocationCGI := ts_GeographicLocationCGI('262'H, '42F'H, '0001'O, '0002'O) } }, - charging_char := '0000'O + charging_char := '0000'O, + imeisv := f_rnd_imeisv() } /* send GTP-C for a given context and increment sequence number */ @@ -513,7 +520,7 @@ module GGSN_Tests { f_send_gtpc(ts_GTPC_CreatePDP(g_peer_c, g_c_seq_nr, ctx.imsi, g_restart_ctr, ctx.teid, ctx.teic, ctx.nsapi, ctx.eua, ctx.apn, g_sgsn_ip_c, g_sgsn_ip_u, ctx.msisdn, ctx.pco_req, ctx.ratType, - ctx.uli, ctx.charging_char)); + ctx.uli, ctx.charging_char, ctx.imeisv)); T_default.start; d := activate(pingpong()); if (Gx_PROC.checkstate("Connected")) { @@ -2009,7 +2016,7 @@ module GGSN_Tests { ctx[next_req_ctx].teid, ctx[next_req_ctx].teic, ctx[next_req_ctx].nsapi, ctx[next_req_ctx].eua, ctx[next_req_ctx].apn, g_sgsn_ip_c, g_sgsn_ip_u, ctx[next_req_ctx].msisdn, ctx[next_req_ctx].pco_req, ctx[next_req_ctx].ratType, - ctx[next_req_ctx].uli, ctx[next_req_ctx].charging_char)); + ctx[next_req_ctx].uli, ctx[next_req_ctx].charging_char, ctx[next_req_ctx].imeisv)); next_req_ctx := next_req_ctx + 1; if (next_req_ctx < num_ctx) { T_next.start; @@ -2123,7 +2130,7 @@ module GGSN_Tests { ctx.teid, ctx.teic, ctx.nsapi, ctx.eua, ctx.apn, g_sgsn_ip_c, g_sgsn_ip_u, ctx.msisdn, ctx.pco_req, ctx.ratType, - ctx.uli, ctx.charging_char)); + ctx.uli, ctx.charging_char, ctx.imeisv)); next_req_ctx := next_req_ctx + 1; } T_next.start; diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 0c5c0033..22d8632f 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -119,6 +119,26 @@ module GTP_Templates { restartCounter := restart_counter } + /* IMEI(SV) IE TS 29.060 7.7.53 */ + template IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { + type_gtpc := '9A'O, + lengthf := 8, + imeisv := imeisv + } + private function f_ts_IMEISV(template (omit) OCT8 imeisv) + return template (omit) IMEISV_gtpc { + if (istemplatekind(imeisv, "omit")) { + return omit; + } + return ts_IMEISV(imeisv); + } + + template IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { + type_gtpc := '9A'O, + lengthf := 8, + imeisv := imeisv + } + /* Charging Characteristics IE TS 29.060 7.7.23 */ template ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { type_gtpc := '1A'O, @@ -379,7 +399,8 @@ module GTP_Templates { octetstring msisdn, template ProtConfigOptions pco := omit, template (omit) OCT1 ratType := omit, template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit) := { + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit) := { createPDPContextRequest := { imsi := ts_Imsi(imsi), rai := omit, @@ -421,7 +442,7 @@ module GTP_Templates { ratType := f_ts_RATType(ratType), userLocationInformation := uli, mS_TimeZone := omit, - imeisv := omit, + imeisv := f_ts_IMEISV(imeisv), camelChargingInformationContainer := omit, additionalTraceInfo := omit, correlationID := omit, @@ -443,12 +464,14 @@ module GTP_Templates { template ProtConfigOptions pco := omit, template (omit) OCT1 ratType := omit, template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit) := { + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextRequest, '00000000'O, valueof(ts_CreatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, nsapi, eua, apn, sgsn_ip_sign, - sgsn_ip_data, msisdn, pco, ratType, uli, charging_char)), seq) + sgsn_ip_data, msisdn, pco, ratType, uli, + charging_char, imeisv)), seq) } |