Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Templates: enrich existing ULR/ULA templates

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sun Dec 12 01:42:33 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26513 )


Change subject: library/DIAMETER_Templates: enrich existing ULR/ULA templates
......................................................................

library/DIAMETER_Templates: enrich existing ULR/ULA templates

Change-Id: I0585e306a87453c212c6b5ac5635181c47b34b4f
Related: SYS#5602
---
M library/DIAMETER_Templates.ttcn
M mme/MME_Tests.ttcn
2 files changed, 45 insertions(+), 28 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/26513/1

diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 920a30c..795148c 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -106,6 +106,7 @@
 const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252;
 const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308;
 
+const octetstring c_def_sess_id := char2oct("ttcn3.session");
 const UINT32 c_def_hbh_id := '00000000'O;
 const UINT32 c_def_ete_id := '00000000'O;
 
@@ -911,34 +912,50 @@
 
 /* TS 29.262 7.2.3 Update Location Request */
 template (present) PDU_DIAMETER
-tr_DIA_ULR(hexstring imsi) := tr_DIAMETER(flags:='11000000'B, cmd_code:=Update_Location,
-					  app_id:=int2oct(c_DIAMETER_3GPP_S6_AID, 4),
-	avps := superset(
-		tr_AVP_SessionId,
-		tr_AVP_AuthSessionState,
-		tr_AVP_OriginHost,
-		tr_AVP_OriginRealm,
-		tr_AVP_DestinationRealm,
-		tr_AVP_UserNameImsi(imsi),
-		tr_AVP_3GPP_RatType(EUTRAN),
-		tr_AVP_3GPP_UlrFlags,
-		tr_AVP_3GPP_VisitedPlmnId
+tr_DIA_ULR(/* template (present) */ hexstring imsi,
+	   template (present) octetstring sess_id := ?,
+	   template (present) charstring orig_host := ?,
+	   template (present) charstring orig_realm := ?,
+	   template (present) charstring dest_realm := ?,
+	   template (present) UINT32 hbh_id := ?,
+	   template (present) UINT32 ete_id := ?) :=
+	tr_DIAMETER(flags := '11000000'B,
+		    cmd_code := Update_Location,
+		    app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4),
+		    hbh_id := hbh_id,
+		    ete_id := ete_id,
+		    avps := superset(
+			tr_AVP_SessionId(sess_id),
+			tr_AVP_AuthSessionState,
+			tr_AVP_OriginHost(orig_host),
+			tr_AVP_OriginRealm(orig_realm),
+			tr_AVP_DestinationRealm(dest_realm),
+			tr_AVP_UserNameImsi(imsi),
+			tr_AVP_3GPP_RatType(EUTRAN),
+			tr_AVP_3GPP_UlrFlags,
+			tr_AVP_3GPP_VisitedPlmnId
 	));
 
 template (value) PDU_DIAMETER
-ts_DIA_ULA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
-	   template (value) octetstring sess_id,
-	   template (value) AVP_list sub_data_content)
-:= ts_DIAMETER(flags:='01000000'B, cmd_code:=Update_Location,
-		app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id,
-	avps := {
-		ts_AVP_SessionId(sess_id),
-		ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */
-		ts_AVP_AuthSessionState(NO_STATE_MAINTAINED),
-		ts_AVP_OriginHost("hss.localdomain"),
-		ts_AVP_OriginRealm("localdomain"),
-		ts_AVP_3GPP_UlaFlags('00000002'O),
-		ts_AVP_3GPP_SubscriptionData(sub_data_content)
+ts_DIA_ULA(template (value) AVP_list sub_data,
+	   template (value) octetstring sess_id := c_def_sess_id,
+	   template (value) charstring orig_host := "hss.localdomain",
+	   template (value) charstring orig_realm := "localdomain",
+	   template (value) UINT32 hbh_id := c_def_hbh_id,
+	   template (value) UINT32 ete_id := c_def_ete_id) :=
+	ts_DIAMETER(flags:='01000000'B,
+		    cmd_code := Update_Location,
+		    app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4),
+		    hbh_id := hbh_id,
+		    ete_id := ete_id,
+		    avps := {
+			ts_AVP_SessionId(sess_id),
+			ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */
+			ts_AVP_AuthSessionState(NO_STATE_MAINTAINED),
+			ts_AVP_OriginHost(orig_host),
+			ts_AVP_OriginRealm(orig_realm),
+			ts_AVP_3GPP_UlaFlags('00000002'O),
+			ts_AVP_3GPP_SubscriptionData(sub_data)
 	});
 
 
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index f9bcf6d..2140971 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -493,14 +493,12 @@
 	var PDU_DIAMETER rx_dia;
 	[] DIAMETER.receive(tr_DIA_ULR(g_pars.ue_pars.imsi)) -> value rx_dia {
 		var template (omit) AVP avp;
-		var octetstring sess_id;
 		var hexstring imsi;
 		var template (value) AVP_list sub_data;
 
 		/* retrieve input data */
 		imsi := valueof(f_DIAMETER_get_imsi(rx_dia));
 		avp := f_DIAMETER_get_avp(rx_dia, c_AVP_Code_BASE_NONE_Session_Id);
-		sess_id := valueof(avp.avp_data.avp_BASE_NONE_Session_Id);
 
 		sub_data := {
 			ts_AVP_3GPP_SubscriberStatus(SERVICE_GRANTED),
@@ -513,7 +511,9 @@
 			})
 			};
 
-		DIAMETER.send(ts_DIA_ULA(rx_dia.hop_by_hop_id, rx_dia.end_to_end_id, sess_id, sub_data));
+		DIAMETER.send(ts_DIA_ULA(sub_data, avp.avp_data.avp_BASE_NONE_Session_Id,
+					 hbh_id := rx_dia.hop_by_hop_id,
+					 ete_id := rx_dia.end_to_end_id));
 	}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26513
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: I0585e306a87453c212c6b5ac5635181c47b34b4f
Gerrit-Change-Number: 26513
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211212/78f09540/attachment.htm>


More information about the gerrit-log mailing list