pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34874?usp=email )
Change subject: Introduce DIAMETER_rfc5447_Templates.ttcn ......................................................................
Introduce DIAMETER_rfc5447_Templates.ttcn
Add templates for RFC 5447 MIP6-Feature-Vector. This AVP is a bitmask which as only a few bits defined in RFC 5447, with other interfaces using this AVP adding interface-specific bits in the spec of each interface.
The templates are added in a new separate file with the aim of start splitting the tons of AVPs originating from different specs in order to be able to quickly identify them and avoid confusion.
Change-Id: I0fc646e5354d78283a2f3e1b9bb9c4688cf744a1 --- M epdg/gen_links.sh A library/DIAMETER_rfc5447_Templates.ttcn M library/DIAMETER_ts29_273_Templates.ttcn 3 files changed, 67 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/34874/1
diff --git a/epdg/gen_links.sh b/epdg/gen_links.sh index b464203..bc9d90e 100755 --- a/epdg/gen_links.sh +++ b/epdg/gen_links.sh @@ -42,7 +42,7 @@ FILES+="Osmocom_CTRL_Types.ttcn " FILES+="L3_Common.ttcn " FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " -FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_273_Templates.ttcn " +FILES+="DIAMETER_Templates.ttcn DIAMETER_rfc5447_Templates.ttcn DIAMETER_ts29_273_Templates.ttcn " FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp " FILES+="GSUP_Types.ttcn GSUP_Emulation.ttcn " diff --git a/library/DIAMETER_rfc5447_Templates.ttcn b/library/DIAMETER_rfc5447_Templates.ttcn new file mode 100644 index 0000000..4c119c7 --- /dev/null +++ b/library/DIAMETER_rfc5447_Templates.ttcn @@ -0,0 +1,41 @@ +module DIAMETER_rfc5447_Templates { + +/* (C) 2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +import from General_Types all; +import from DIAMETER_Types all; +import from DIAMETER_Templates all; +import from Osmocom_Types all; +import from Misc_Helpers all; + +/* 4.2.5. MIP6-Feature-Vector AVP */ +const uint64_t DIA_RFC5447_MIP6_Feature_Vector_MIP6_INTEGRATED := hex2int('0000000000000001'H); +const uint64_t DIA_RFC5447_MIP6_Feature_Vector_LOCAL_HOME_AGENT_ASSIGNMENT := hex2int('0000000000000002'H); + + +/* 4.2.5. MIP6-Feature-Vector AVP */ +template (value) GenericAVP ts_AVP_MIP6FeatureVector(template (value) MIPv6_NONE_MIP6_Feature_Vector inp) := { + avp := { + avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_MIP6_Feature_Vector), + avp_data := { + avp_MIPv6_NONE_MIP6_Feature_Vector := inp + } + } +} +template (present) GenericAVP tr_AVP_MIP6FeatureVector(template (present) MIPv6_NONE_MIP6_Feature_Vector inp := ?) := { + avp := { + avp_header := tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_MIP6_Feature_Vector), + avp_data := { + avp_MIPv6_NONE_MIP6_Feature_Vector := inp + } + } +} + +} \ No newline at end of file diff --git a/library/DIAMETER_ts29_273_Templates.ttcn b/library/DIAMETER_ts29_273_Templates.ttcn index 5df1cf1..ee0cd89 100644 --- a/library/DIAMETER_ts29_273_Templates.ttcn +++ b/library/DIAMETER_ts29_273_Templates.ttcn @@ -14,6 +14,7 @@ import from General_Types all; import from DIAMETER_Types all; import from DIAMETER_Templates all; +import from DIAMETER_rfc5447_Templates all; import from Osmocom_Types all; import from Misc_Helpers all;
@@ -22,6 +23,9 @@ /* 3GPP TS 29.273 Section 9 */ const uint32_t c_DIAMETER_3GPP_S6b_AID := 16777272;
+/* 5.2.3.3 MIP6-Feature-Vector bits */ +const uint64_t MIP6_INTEGRATED := '0000000000000001'H; + /******************************* * SWx 3GPP TS 29.273 section 8 *******************************/ @@ -198,6 +202,7 @@ /* TS 29.273 9.2.2.5.1 AA-Request (AAR) */ template (value) PDU_DIAMETER ts_DIA_S6b_AAR(template (value) hexstring imsi, + template (value) MIPv6_NONE_MIP6_Feature_Vector feat_vec, template (value) octetstring sess_id := c_def_sess_id, template (value) charstring orig_host := "pgw.localdomain", template (value) charstring orig_realm := "localdomain", @@ -217,7 +222,8 @@ ts_AVP_OriginRealm(orig_realm), ts_AVP_DestinationRealm(dest_realm), ts_AVP_AuthRequestType(AUTHORIZE_ONLY), - ts_AVP_UserNameImsi(valueof(imsi)) + ts_AVP_UserNameImsi(valueof(imsi)), + ts_AVP_MIP6FeatureVector() /* TODO: Lots other optional */ });