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
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)
});