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.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26513 ) Change subject: library/DIAMETER_Templates: rework existing ULR/ULA templates ...................................................................... library/DIAMETER_Templates: rework existing ULR/ULA templates * Make both {hbh,ete}_id parameters last among the others; * Use more elegant and consistent template formatting; * Make Origin{Host,Realm} values configurable; * Make DestinationRealm value configurable; * Make SessionId value configurable. Change-Id: I0585e306a87453c212c6b5ac5635181c47b34b4f Related: SYS#5602 --- M library/DIAMETER_Templates.ttcn M mme/MME_Tests.ttcn 2 files changed, 46 insertions(+), 28 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index fd4683e..4cd2b6b 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -106,6 +106,8 @@ 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"); + template (value) PDU_DIAMETER ts_DIAMETER(template (value) BIT8 flags, template (value) Command_Code cmd_code, @@ -908,34 +910,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 := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + 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: 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/8422e1a9/attachment.htm>