pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36600?usp=email )

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: sgsn: TC_sgsn_context_req_in: match MM Context & GSN Address 
IEs
......................................................................

sgsn: TC_sgsn_context_req_in: match MM Context & GSN Address IEs

Change-Id: Ie68794c309e548279381d044a3e34dcdf405084f
Related: SYS#6603, OS#6294
---
M library/GTPv1C_Templates.ttcn
M sgsn/SGSN_Tests.ttcn
2 files changed, 55 insertions(+), 3 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn
index 0907c5e..2eb1d7e 100644
--- a/library/GTPv1C_Templates.ttcn
+++ b/library/GTPv1C_Templates.ttcn
@@ -341,7 +341,8 @@
        /* 7.7.28 MM Context */
        template (value) MM_Context ts_MM_ContextGSM(template (value) OCT8 kc,
                                                     template (value) BIT3 cksn 
:= '000'B,
-                                                    template (value) BIT3 gea 
:= '000'B) := {
+                                                    template (value) BIT3 gea 
:= '000'B,
+                                                    template (value) 
octetstring triplet := ''O) := {
                type_gtpc := '81'O,
                context := {
                        mmcontGSM := {
@@ -352,7 +353,7 @@
                                noofVectors := 0, /* overwritten */
                                security := '01'B, /* GSM key and triplets */
                                kc := kc,
-                               triplet := ''O,
+                               triplet := triplet,
                                drx_par := '0000'O,
                                msNetW_cap_length := 0, /* overwritten */
                                msNetw_cap := omit,
@@ -363,6 +364,32 @@
                        }
                }
        }
+       template (present) MM_Context tr_MM_ContextGSM(template (present) OCT8 
kc := ?,
+                                                      template (present) BIT3 
cksn := ?,
+                                                      template (present) BIT3 
gea := ?,
+                                                      template (present) 
octetstring triplet := ?) := {
+               type_gtpc := '81'O,
+               context := {
+                       mmcontGSM := {
+                               lengthf := ?,
+                               cksn := cksn,
+                               spare := ?,
+                               usedCipher := gea,
+                               noofVectors := ?,
+                               security := '01'B, /* GSM key and triplets */
+                               kc := kc,
+                               triplet := triplet,
+                               drx_par := ?,
+                               msNetW_cap_length := ?,
+                               msNetw_cap := *,
+                               containerLength := ?,
+                               container := *,
+                               access_restriction_data_length := ?,
+                               access_restriction_data := *
+                       }
+               }
+       }
+
        template (value) MM_Context ts_MM_ContextUMTS(template (value) OCT16 ck,
                                                      template (value) OCT16 
ik) := {
                type_gtpc := '81'O,
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 9029a9e..67e815b 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -3757,7 +3757,22 @@
        var template (present) GTPC_PDUs ctx_rsp;
        ctx_rsp := tr_SGSNContextRespPDU(cause := GTP_CAUSE_REQUEST_ACCEPTED,
                                         imsi := g_pars.imsi);
-       /* TODO: match MM/PDP Context, GSN Address */
+
+       /* SGSN Address for Control Plane */
+       var octetstring sgsn_addr := f_inet_addr(mp_sgsn_gtp_ip);
+       ctx_rsp.sgsn_ContextResponse.sgsn_addr_controlPlane := 
tr_GsnAddr(sgsn_addr);
+
+       /* Match MM Context */
+       if (ispresent(g_pars.vec)) {
+               /* XXX: this is only valid for GERAN */
+               var octetstring triplet := g_pars.vec.rand & g_pars.vec.sres & 
g_pars.vec.kc;
+               ctx_rsp.sgsn_ContextResponse.mm_Context := tr_MM_ContextGSM(kc 
:= g_pars.vec.kc,
+                                                                           
triplet := triplet);
+               /* TODO: 7.5.4 "The IMEISV shall, if available, be included in 
the MM Context".
+                * See also 3GPP TS 29.060, section 7.7.28 and Table 47A */
+       }
+
+       /* TODO: match PDP Context */

        T.start(2.0);
        alt {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36600?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie68794c309e548279381d044a3e34dcdf405084f
Gerrit-Change-Number: 36600
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to