From ca587f154c803b79f8c9ac5ad7353cefcdb97fa5 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 2 Feb 2022 10:42:01 +0100 Subject: [PATCH] ggsn: Submit User Location Information in CreatePDPContextReq According to TS 29.060, sec 7.3.1 Create PDP Context Request: """ The SGSN shall include the User Location Information IE in the PDP Context Activation procedure. The SGSN shall include the CGI or SAI in the "Geographic Location" field of the User Location Information IE depending on whether the MS is in a cell or a service area respectively. """ Change-Id: Iaea95e5779d4f878023ce3f160ac69f092452056 --- ggsn_tests/GGSN_Tests.ttcn | 15 ++++++++++++--- library/GTP_Templates.ttcn | 26 ++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 28e34e9e7..634534f2f 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -84,7 +84,8 @@ module GGSN_Tests { OCT4 teid_remote, /* TEI (Control) remote side */ OCT4 teic_remote, - OCT1 ratType optional + OCT1 ratType optional, + UserLocationInformation uli optional } type component GT_CT { @@ -246,7 +247,15 @@ module GGSN_Tests { eua := eua, teid := f_rnd_tei(), teic := f_rnd_tei(), - ratType := ratType + ratType := ratType, + uli := { + type_gtpc := '98'O, + lengthf := 0 /* filled in by encoder */, + geographicLocationType := '00'O /* CGI */, + geographicLocation := { + geographicLocationCGI := ts_GeographicLocationCGI('262'H, '42F'H, '0001'O, '0002'O) + } + } } /* send GTP-C for a given context and increment sequence number */ @@ -318,7 +327,7 @@ module GGSN_Tests { log("sending CreatePDP"); 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)); + g_sgsn_ip_c, g_sgsn_ip_u, ctx.msisdn, ctx.pco_req, ctx.ratType, ctx.uli)); T_default.start; d := activate(pingpong()); alt { diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 94f327e68..8f6098ac3 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -301,11 +301,28 @@ module GTP_Templates { return rt; } + template (value) GeographicLocationCGI + ts_GeographicLocationCGI(template (value) hexstring mcc, + template (value) hexstring mnc, + template (value) OCT2 lac, + template (value) OCT2 cI_value) := + { + mccDigit1 := mcc[0], + mccDigit2 := mcc[1], + mccDigit3 := mcc[2], + mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */ + mncDigit1 := mnc[0], + mncDigit2 := mnc[1], + lac := lac, + cI_value := cI_value + } + template GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, octetstring apn, octetstring sgsn_ip_sign, octetstring sgsn_ip_data, octetstring msisdn, template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit) := { + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit) := { createPDPContextRequest := { imsi := ts_Imsi(imsi), rai := omit, @@ -345,7 +362,7 @@ module GTP_Templates { commonFlags := omit, aPN_Restriction := omit, ratType := f_ts_RATType(ratType), - userLocationInformation := omit, + userLocationInformation := uli, mS_TimeZone := omit, imeisv := omit, camelChargingInformationContainer := omit, @@ -367,12 +384,13 @@ module GTP_Templates { octetstring apn, octetstring sgsn_ip_sign, octetstring sgsn_ip_data, octetstring msisdn, template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit) := { + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := 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)), seq) + sgsn_ip_data, msisdn, pco, ratType, uli)), seq) }