Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Templates: prettify & enrich AIR/AIA 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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 15 14:22:02 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26515 )

Change subject: library/DIAMETER_Templates: prettify & enrich AIR/AIA templates
......................................................................

library/DIAMETER_Templates: prettify & enrich AIR/AIA templates

* Make both {hbh,ete}_id parameters last among the others;
* Use more elegant and consistent template formatting;
* Make DestinationRealm value configurable;
* Make SessionId value configurable.

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

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 45a4a99..256a4d4 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -877,43 +877,60 @@
 
 
 template (value) PDU_DIAMETER
-ts_DIA_AIR(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
-	   template (value) octetstring sess_id,
-	   template (value) charstring dest_realm, hexstring imsi)
-:= ts_DIAMETER(flags:='00000000'B, cmd_code:=Authentication_Information, hbh_id:=hbh_id, ete_id:=ete_id,
-	avps := {
-		ts_AVP_SessionId(sess_id),
-		ts_AVP_DestinationRealm(dest_realm),
-		ts_AVP_UserNameImsi(imsi),
-		/* Requested EUTRAN Auth Info */
-		ts_AVP_RequestedEutranAuthInfo,
-		ts_AVP_3GPP_VisitedPlmnId('11111F'O)
+ts_DIA_AIR(/* template (value) */ hexstring imsi,
+	   template (value) octetstring sess_id := c_def_sess_id,
+	   template (value) charstring dest_realm := "localdomain",
+	   template (value) UINT32 hbh_id := '00000000'O,
+	   template (value) UINT32 ete_id := '00000000'O) :=
+	ts_DIAMETER(flags := '00000000'B,
+		    cmd_code := Authentication_Information,
+		    hbh_id := hbh_id,
+		    ete_id := ete_id,
+		    avps := {
+			ts_AVP_SessionId(sess_id),
+			ts_AVP_DestinationRealm(dest_realm),
+			ts_AVP_UserNameImsi(imsi),
+			/* Requested EUTRAN Auth Info */
+			ts_AVP_RequestedEutranAuthInfo,
+			ts_AVP_3GPP_VisitedPlmnId('11111F'O)
 	});
-
 template (present) PDU_DIAMETER
-tr_DIA_AIR(hexstring imsi) := tr_DIAMETER(flags := '11000000'B, cmd_code:=Authentication_Information,
-					  app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4),
-	avps := superset(
-		tr_AVP_SessionId,
-		tr_AVP_DestinationRealm,
-		tr_AVP_UserNameImsi(imsi),
-		tr_AVP_3GPP_VisitedPlmnId
+tr_DIA_AIR(/* template (present) */ hexstring imsi,
+	   template (present) octetstring sess_id := ?,
+	   template (present) charstring dest_realm := ?,
+	   template (present) UINT32 hbh_id := ?,
+	   template (present) UINT32 ete_id := ?) :=
+	tr_DIAMETER(flags := '11000000'B,
+		    cmd_code := Authentication_Information,
+		    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_DestinationRealm(dest_realm),
+			tr_AVP_UserNameImsi(imsi),
+			tr_AVP_3GPP_VisitedPlmnId
 	));
 
 /* TS 29.262 5.2.3.1 + 7.2.6 Authentication Information Answer */
 template (value) PDU_DIAMETER
-ts_DIA_AIA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
-	   template (value) octetstring sess_id,
-	   template (value) AVP_list auth_info_contents)
-:= ts_DIAMETER(flags:='01000000'B, cmd_code:=Authentication_Information,
-		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),
-		ts_AVP_AuthSessionState(NO_STATE_MAINTAINED),
-		ts_AVP_OriginHost("hss.localdomain"),
-		ts_AVP_OriginRealm("localdomain"),
-		ts_AVP_3GPP_AuthInfo(auth_info_contents)
+ts_DIA_AIA(template (value) AVP_list auth_info_contents,
+	   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 := '00000000'O,
+	   template (value) UINT32 ete_id := '00000000'O) :=
+	ts_DIAMETER(flags := '01000000'B,
+		    cmd_code := Authentication_Information,
+		    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),
+			ts_AVP_AuthSessionState(NO_STATE_MAINTAINED),
+			ts_AVP_OriginHost(orig_host),
+			ts_AVP_OriginRealm(orig_realm),
+			ts_AVP_3GPP_AuthInfo(auth_info_contents)
 	});
 
 
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index 2140971..375a66a 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -483,8 +483,9 @@
 		/* compute tuple */
 		auth_info_content := { ts_AVP_EutranVec(1, '20080c3818183b522614162c07601d0d'O, '6a91970e838fd079'O, 'f11b89a2a8be00001f9c526f3d75d44c'O, '95AFAD9A0D29AFAA079A9451DF7161D7EE4CBF2AF9387F766D058BB6B44B905D'O) };
 
-		DIAMETER.send(ts_DIA_AIA(rx_dia.hop_by_hop_id, rx_dia.end_to_end_id,
-					 sess_id, auth_info_content));
+		DIAMETER.send(ts_DIA_AIA(auth_info_content, sess_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/+/26515
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: Iaf6472fecbadd58e86b78c59348d9924ab57f97d
Gerrit-Change-Number: 26515
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211215/84cd8f10/attachment.htm>


More information about the gerrit-log mailing list