aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-04-19 01:46:07 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-04-19 17:34:18 +0700
commit74b12c759238edb7344a590d33ad4f20b4af29fe (patch)
tree81d677ed15b0d80965fdaaaf415331d0ca360dc2
parentacd0b39f794a1bf6e546aa769cee1a2be7a8058e (diff)
sgsn: TC_sgsn_context_req_in: match MM Context & GSN Address IEs
-rw-r--r--library/GTPv1C_Templates.ttcn31
-rw-r--r--sgsn/SGSN_Tests.ttcn17
2 files changed, 45 insertions, 3 deletions
diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn
index 0907c5e4..2eb1d7ea 100644
--- a/library/GTPv1C_Templates.ttcn
+++ b/library/GTPv1C_Templates.ttcn
@@ -341,7 +341,8 @@ module GTPv1C_Templates {
/* 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 @@ module GTPv1C_Templates {
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 @@ module GTPv1C_Templates {
}
}
}
+ 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 9029a9ef..67e815b7 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -3757,7 +3757,22 @@ private function f_TC_sgsn_context_req_in(charstring id) runs on BSSGP_ConnHdlr
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 {