Loading ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_MultiRfcs_Functions.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_Functions.ttcn +7 −44 Original line number Diff line number Diff line Loading @@ -2,10 +2,10 @@ * @author STF 276 * @version $Id$ * @desc This module specifies functions definitions * based on the common IPv6 message types only. * that can be used by any RCF function. * */ module LibIpv6_MultiRfcs_Functions { module LibIpv6_CommonRfcs_Functions { //LibCommon import from LibCommon_BasicTypesAndValues all; Loading @@ -15,10 +15,11 @@ import from LibIpv6_ExternalFunctions all; import from LibIpv6_Interface all ; import from LibIpv6_ModuleParameters all ; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_CommonRfcs_TypesAndValues all; import from LibIpv6_CommonRfcs_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues { type all; const all }; import from LibIpv6_Rfc2460Root_Templates all; //import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_Rfc3775Mipv6_ExtHdrFunctions all; group extHdrFns { Loading Loading @@ -172,45 +173,8 @@ group extHdrFns { }//end group calcPrefixFns group mipHdrFns { /* * @desc This goes through the Mip header and calculates length, checksum * and other specific functions of the different messages * @param p_msg ExtensionHeaderList to be treated * @return execution status */ function f_setMipHeader(in Ipv6Address p_srcAddr, in Ipv6Address p_dstAddr, inout MipHeader p_mipHeader) runs on LibIpv6Node return FncRetCode { var MipHeader v_mipHeader := valueof(p_mipHeader); var Ipv6Address v_homeAddress := c_16ZeroBytes ; if (ischosen(p_mipHeader.mipMessage.homeTestInit)) { //calc homeNonceIndex TODO //calc homeInitCookie TODO //calc homeKeygenToken TODO } else if (ischosen(p_mipHeader.mipMessage.homeTest)) { //calc homeNonceIndex TODO //calc homeInitCookie TODO //calc homeKeygenToken TODO } //calc mipHeaderLen p_mipHeader.headerLen := fx_mipHeaderLength(p_mipHeader); //set mipChecksum to zero p_mipHeader.checksum := c_2ZeroBytes; //calc mipChecksum p_mipHeader.checksum := fx_mipHeaderChecksum( p_srcAddr, p_dstAddr, p_mipHeader); return e_success; } /* * @desc This goes through the ExtensionHeaderList and * checks if a HomeAddressOption is present. Loading Loading @@ -355,10 +319,9 @@ group extHdrFns { return v_spi; }//end f_createSecurityParametersIndex }//end group mipHdrFns } // end module LibIpv6_MultiRfcs_Functions } // end module LibIpv6_CommonRfcs_Functions ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_MultiRfcs_Templates.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_Templates.ttcn +139 −0 Original line number Diff line number Diff line Loading @@ -6,13 +6,13 @@ * IPv6 header, or extension headers * */ module LibIpv6_MultiRfcs_Templates { module LibIpv6_CommonRfcs_Templates { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_CommonRfcs_TypesAndValues all; import from LibIpv6_ModuleParameters all; group link_Layer_Address { Loading Loading @@ -55,34 +55,7 @@ module LibIpv6_MultiRfcs_Templates { }//end group paddingTemplates group hop_By_Hop_Options { /* * @param p_hbhOpt First element in the Hop by hop option list */ template HopByHopOptionList m_hbhOptList_1Elem ( template HopByHopOption p_hbhOpt ) := { p_hbhOpt } /* * @param p_option Hop by hop option(s) encoded in octetstring */ template HopByHopOption m_hbhOpt_generalOption ( template octetstring p_option ) := { generalOptionString := p_option } /* * @param p_optJumboPayloadLength Length of the jumbogram in bytes */ template HopByHopOption m_hbhOpt_jumboPayloadOption ( UInt32 p_optJumboPayloadLength ) := { jumboPayload := { optType := c_optJumboPayload, optLen := c_optLen4, optJumboPayloadLength := p_optJumboPayloadLength } } } // end group hop_By_Hop_Options group destination_Options { Loading Loading @@ -162,169 +135,5 @@ module LibIpv6_MultiRfcs_Templates { }//end group nbrDiscOptions group mobilityHdrMessageTemplates { template MipMessage m_bindingUpdate( UInt16 p_seqNr, UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, UInt16 p_lifeTime, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := p_seqNr, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := p_lifeTime, mipOptions := p_mipOptions } } template MipMessage mw_bindingUpdate( UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := ?, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := ?, mipOptions := p_mipOptions } } template MipMessage mw_bindingUpdate_lifeTime( UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, UInt16 p_lifetime, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := ?, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := p_lifetime, mipOptions := p_mipOptions } } template MipMessage m_bindingAck(UInt16 p_seqNr, UInt16 p_lifetime, template MipOptionList p_mipOptions) := { bindingAck := { status := c_mipCodeBindingUpdateAccepted, kFlag := c_kFlag0, reserved := c_uInt7Zero, sequenceNumber := p_seqNr, lifeTime := p_lifetime, mipOptions := p_mipOptions } } template MipMessage mw_bindingAck(UInt16 p_seqNr) := { bindingAck := { status := c_mipCodeBindingUpdateAccepted, kFlag := ?, reserved := ?, sequenceNumber := p_seqNr, lifeTime := ?, mipOptions := ? } } template MipMessage mw_bindingError := { bindingError := { status := ?, reserved := ?, homeAddress := ?, mipOptions := * } } template MipMessage m_hot := { homeTest := { homeNonceIndex := c_uInt16Zero, homeInitCookie := c_64ZeroBits, homeKeygenToken := c_64ZeroBits, mipOptions := omit } } template MipMessage mw_hot := { homeTest := { homeNonceIndex := ?, homeInitCookie := ?, homeKeygenToken := ?, mipOptions := * } } template MipMessage m_hoti := { homeTestInit := { reserved := c_uInt16Zero, homeInitCookie := c_64ZeroBits, mipOptions := omit } } template MipMessage mw_hoti := { homeTestInit := { reserved := ?, homeInitCookie := ?, mipOptions := * } } }//end group mobilityHdrMessageTemplates group mobilityOptTemplates { /* * @param p_dstOpt First element in the Destination option list */ template MipOptionList m_mipOptList_1Elem ( template MipOption p_mipOpt ) := { p_mipOpt } /* * @param p_dstOpt First element in the Destination option list */ template MipOptionList m_mipOptList_2Elem ( template MipOption p_mipOpt1, template MipOption p_mipOpt2 ) := { p_mipOpt1, p_mipOpt2 } template MipOption m_mipOpt_altCoa(template MipOptAltCoA p_mipOptAltCoA) := { mipOptAltCoA := p_mipOptAltCoA } template MipOption m_mipOpt_padN(template OptPadN p_optPadN) := { optPadN := p_optPadN } template MipOptAltCoA m_mipOptAltCoA(in template Ipv6Address p_addr) := { mipOptType :=3, mipOptLen := 16, alternateCoA := p_addr } template MipOptAltCoA mw_mipOptAltCoA := { mipOptType :=3, mipOptLen := 16, alternateCoA := ? } }//end group mobilityOptTemplates } // end module LibIpv6_MultiRfcs_Templates } // end module LibIpv6_CommonRfcs_Templates ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_TypesAndValues.ttcn 0 → 100644 +309 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module defines types and constants for * information elements that are shared by more * than one RFC TTCN-3 module including IPv6 options, * addresses, and extension headers. * Types have been derived from various RFCs. */ module LibIpv6_CommonRfcs_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; import from LibCommon_TextStrings all; import from LibCommon_Time all ; group DefaultConstants { const UInt16 c_defId := 10; // for ICMP echo proc const UInt16 c_defSeqNo := 20; // for ICMP echo proc } group rfc3513AddressingArchitecture { type Oct16 Ipv6Address; type UInt8 PrefixLength ;//indicates nr of bits to be used as Prefix //Unspecified address const Ipv6Address c_unspecifiedAdd := c_16ZeroBytes; const UInt8 c_maxNrIpv6Address := 10; type record length(1 .. c_maxNrIpv6Address) of Ipv6Address Ipv6AddressList with { encode "present=isEOF()== false ;elements=valueOf(getTag('hdrExtLen'));" } }//end group rfc3513AddressingArchitecture group ipv6Options { const UInt8 c_optLen0 := 0; const UInt8 c_optLen1 := 1; const UInt8 c_optLen2 := 2; const UInt8 c_optLen4 := 4; const UInt8 c_optLen6 := 6; const UInt8 c_optLen16 := 16; group rfc2460Options { group paddingOptions { const UInt8 c_optPad1 := 0; const UInt8 c_optPadN := 1; const UInt8 c_optPadNLen0 := 0 ; const UInt8 c_optPadNLen2 := 2; const UInt8 c_optPadNLen4 := 4 ; type record OptPad1 { UInt8 optType(c_optPad1) } with { encode "present=bytes(0,1,0);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-1"; } type record OptPadN { UInt8 optType(c_optPadN), UInt8 optLen, octetstring padding optional } with { encode "present=bytes(0,1,1);"; encode (optLen) "tag='optLen';intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-value-2"; encode (padding) "length=valueOf(getTag('optLen'));fieldPresent=(valueOf(getTag('optLen'))>0)"; } }//end group paddingOptions group DestOptions { //2460 + MIPv6 const UInt8 c_maxNrDestOption := 10; /* @remark In a DestOptionList value either the pad1 or padN * option can appear only once! */ type set length (1..c_maxNrDestOption) of DestOption DestOptionList with { encode "elements=valueOf(getTag('hdrExtLen'));" } type union DestOption { OptPad1 pad1 , OptPadN padN , OptTunnelEncapLimit tunnelEncapLimit , OptHomeAddress homeAddressOption, octetstring generalOptionString } with { encode (generalOptionString) "length=valueOf(getTag('hdrExtLen'))-2;"; } }//end group DestOptions }//end group rfc2460Options group rfc2461Options { group slla { const UInt8 c_srcLinkLayerAddress := 1; /* * @desc Derived from RFC2461 clause4.6.1 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record SrcLinkLayerAddress { UInt8 icmpType(c_srcLinkLayerAddress), UInt8 optionLength, Oct6to15 linkLayerAddr } with { encode "present=bytes(0,1,1);"; encode (optionLength) "tag='SLA_optionLength';"; encode (linkLayerAddr) "length=valueOf(getTag('SLA_optionLength'))*8-2;"; } }//end group slla group tlla { const UInt8 c_tgtLinkLayerAddress := 2; /* * @desc Derived from RFC 2461 clause 4.6.1 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record TgtLinkLayerAddress { UInt8 icmpType(c_tgtLinkLayerAddress), UInt8 optionLength, Oct6to15 linkLayerAddr } with { encode "present=bytes(0,1,2);"; encode (optionLength) "tag='TLA_optionLength';"; encode (linkLayerAddr) "length=valueOf(getTag('TLA_optionLength'))*8-2;"; } }//end group tlla group mtu { const UInt8 c_mtuOption := 5; /* * @desc Derived from RFC 2461 clause 4.6.4 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record MtuOption { UInt8 icmpType(c_mtuOption), UInt8 optionLength, UInt16 reserved, UInt32 mtu } with { encode "present=bytes(0,1,5);" } }//end group mtu }//end group rfc2461Options group rfc2473Options { const UInt8 c_optTunnelEncapLimit := 4; /* * @desc Derived from RFC 2473 Section 4.1.1 * @url http://www.ietf.org/rfc/rfc2473.txt */ type record OptTunnelEncapLimit { UInt8 optType(c_optTunnelEncapLimit), UInt8 optLen (1), UInt8 optTunnelEncapLimitValue } with { encode "present=bytes(0,1,4);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-3"; } }//end group rfc2473Options group rfc2675Options { const UInt8 c_optJumboPayload := 194; const UInt32 c_jumboLen8 := 8; const UInt32 c_jumboLen128K := 131072; /* * @desc Derived from RFC 2675 Section 2 * @url http://www.ietf.org/rfc/rfc2675.txt */ type record OptJumboPayload { UInt8 optType(c_optJumboPayload), UInt8 optLen(4), UInt32 optJumboPayloadLength } with { encode "present=bytes(0,1,194);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-6"; } }//end group rfc2675Options group rfc2711Options { const UInt8 c_optRouterAlert := 5; /* * @desc Derived from RFC 2711 Section 2.1 * @url http://www.ietf.org/rfc/rfc2711.txt */ type record OptRouterAlert { UInt8 optType(c_optRouterAlert), UInt8 optLen(2), UInt16 optValue } with { encode "present=bytes(0,1,5);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-4"; } }//end group rfc2711Options group rfc3775Options { /* * @desc Extra ICMP option introduced by RFC3775, clause 7.3 */ type record AdvertisementInterval { //ND + MIPv6 UInt8 icmpType (c_advertisementInterval), UInt8 optionLength (1), UInt16 reserved, UInt32 advInterval } with { encode "present=bytes(1, 0x07)" } /* * @desc Extra ICMP option introduced by RFC3775, clause 7.4 */ type record HomeAgentInfo { //ND + MIPv6 UInt8 icmpType (c_homeAgentInfo), UInt8 optionLength (1), UInt16 reserved, UInt16 homeAgentPreference, UInt16 homeAgentLifetime } with { encode "present=bytes(1, 0x08)" } /* @desc Derived from RFCxxxx MIpv6, clause 6.2 * @remark This extension shall be inserted: * 1) After the routing header, if that header is present, * 2) Before the Fragment Header, if that header is present * 3) Before the AH Header or ESP Header, if either one of those headers is present */ type record OptHomeAddress { // as destination option UInt8 ipv6OptType(c_optHomeAddress), UInt8 ipv6OptLen(0..16), Oct16 homeAddress } with { encode "present=bytes(0,1,201);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-18"; } group mipOptionValues { const UInt8 c_bindingRefreshAdvice := 2; const UInt8 c_alternateCareofAddress := 3; const UInt8 c_nonceIndices := 4; const UInt8 c_authorizationData := 5; const UInt8 c_advertisementInterval := 7; const UInt8 c_homeAgentInfo := 8; }//end group mipOptionValues const UInt8 c_optHomeAddress := 201; }//end group rfc3775Options } // end ipv6Options group security { type enumerated CryptoFunction { e_null(0), e_sha1(1) } with { encode "use=com.testingtech.ttcn.tci.*;"; } } // end security } // end LibIpv6_CommonRfcs_TypesAndValues ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_ExternalFunctions.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_ExternalFunctions.ttcn +3 −1 Original line number Diff line number Diff line Loading @@ -13,10 +13,12 @@ import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues { type all }; import from LibIpv6_CommonRfcs_TypesAndValues { type all }; import from LibIpv6_Interface { type Ipv6Packet }; import from LibIpv6_Rfc2460Root_TypesAndValues {type all}; import from LibIpv6_Rfc3775Mipv6_ExtHdrTypesAndValues all; /* @desc This external function calculates the payload length * of a IPv6 packet Loading ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_Interface.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_Interface.ttcn +0 −0 File moved. View file Loading
ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_MultiRfcs_Functions.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_Functions.ttcn +7 −44 Original line number Diff line number Diff line Loading @@ -2,10 +2,10 @@ * @author STF 276 * @version $Id$ * @desc This module specifies functions definitions * based on the common IPv6 message types only. * that can be used by any RCF function. * */ module LibIpv6_MultiRfcs_Functions { module LibIpv6_CommonRfcs_Functions { //LibCommon import from LibCommon_BasicTypesAndValues all; Loading @@ -15,10 +15,11 @@ import from LibIpv6_ExternalFunctions all; import from LibIpv6_Interface all ; import from LibIpv6_ModuleParameters all ; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_CommonRfcs_TypesAndValues all; import from LibIpv6_CommonRfcs_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues { type all; const all }; import from LibIpv6_Rfc2460Root_Templates all; //import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_Rfc3775Mipv6_ExtHdrFunctions all; group extHdrFns { Loading Loading @@ -172,45 +173,8 @@ group extHdrFns { }//end group calcPrefixFns group mipHdrFns { /* * @desc This goes through the Mip header and calculates length, checksum * and other specific functions of the different messages * @param p_msg ExtensionHeaderList to be treated * @return execution status */ function f_setMipHeader(in Ipv6Address p_srcAddr, in Ipv6Address p_dstAddr, inout MipHeader p_mipHeader) runs on LibIpv6Node return FncRetCode { var MipHeader v_mipHeader := valueof(p_mipHeader); var Ipv6Address v_homeAddress := c_16ZeroBytes ; if (ischosen(p_mipHeader.mipMessage.homeTestInit)) { //calc homeNonceIndex TODO //calc homeInitCookie TODO //calc homeKeygenToken TODO } else if (ischosen(p_mipHeader.mipMessage.homeTest)) { //calc homeNonceIndex TODO //calc homeInitCookie TODO //calc homeKeygenToken TODO } //calc mipHeaderLen p_mipHeader.headerLen := fx_mipHeaderLength(p_mipHeader); //set mipChecksum to zero p_mipHeader.checksum := c_2ZeroBytes; //calc mipChecksum p_mipHeader.checksum := fx_mipHeaderChecksum( p_srcAddr, p_dstAddr, p_mipHeader); return e_success; } /* * @desc This goes through the ExtensionHeaderList and * checks if a HomeAddressOption is present. Loading Loading @@ -355,10 +319,9 @@ group extHdrFns { return v_spi; }//end f_createSecurityParametersIndex }//end group mipHdrFns } // end module LibIpv6_MultiRfcs_Functions } // end module LibIpv6_CommonRfcs_Functions
ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_MultiRfcs_Templates.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_Templates.ttcn +139 −0 Original line number Diff line number Diff line Loading @@ -6,13 +6,13 @@ * IPv6 header, or extension headers * */ module LibIpv6_MultiRfcs_Templates { module LibIpv6_CommonRfcs_Templates { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_CommonRfcs_TypesAndValues all; import from LibIpv6_ModuleParameters all; group link_Layer_Address { Loading Loading @@ -55,34 +55,7 @@ module LibIpv6_MultiRfcs_Templates { }//end group paddingTemplates group hop_By_Hop_Options { /* * @param p_hbhOpt First element in the Hop by hop option list */ template HopByHopOptionList m_hbhOptList_1Elem ( template HopByHopOption p_hbhOpt ) := { p_hbhOpt } /* * @param p_option Hop by hop option(s) encoded in octetstring */ template HopByHopOption m_hbhOpt_generalOption ( template octetstring p_option ) := { generalOptionString := p_option } /* * @param p_optJumboPayloadLength Length of the jumbogram in bytes */ template HopByHopOption m_hbhOpt_jumboPayloadOption ( UInt32 p_optJumboPayloadLength ) := { jumboPayload := { optType := c_optJumboPayload, optLen := c_optLen4, optJumboPayloadLength := p_optJumboPayloadLength } } } // end group hop_By_Hop_Options group destination_Options { Loading Loading @@ -162,169 +135,5 @@ module LibIpv6_MultiRfcs_Templates { }//end group nbrDiscOptions group mobilityHdrMessageTemplates { template MipMessage m_bindingUpdate( UInt16 p_seqNr, UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, UInt16 p_lifeTime, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := p_seqNr, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := p_lifeTime, mipOptions := p_mipOptions } } template MipMessage mw_bindingUpdate( UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := ?, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := ?, mipOptions := p_mipOptions } } template MipMessage mw_bindingUpdate_lifeTime( UInt1 p_aFlag, UInt1 p_hFlag, UInt1 p_lFlag, UInt1 p_kFlag, UInt16 p_lifetime, template MipOptionList p_mipOptions) := { bindingUpdate := { sequenceNumber := ?, aFlag := p_aFlag, hFlag := p_hFlag, lFlag := p_lFlag, kFlag := p_kFlag, reserved := c_uInt12Zero, lifeTime := p_lifetime, mipOptions := p_mipOptions } } template MipMessage m_bindingAck(UInt16 p_seqNr, UInt16 p_lifetime, template MipOptionList p_mipOptions) := { bindingAck := { status := c_mipCodeBindingUpdateAccepted, kFlag := c_kFlag0, reserved := c_uInt7Zero, sequenceNumber := p_seqNr, lifeTime := p_lifetime, mipOptions := p_mipOptions } } template MipMessage mw_bindingAck(UInt16 p_seqNr) := { bindingAck := { status := c_mipCodeBindingUpdateAccepted, kFlag := ?, reserved := ?, sequenceNumber := p_seqNr, lifeTime := ?, mipOptions := ? } } template MipMessage mw_bindingError := { bindingError := { status := ?, reserved := ?, homeAddress := ?, mipOptions := * } } template MipMessage m_hot := { homeTest := { homeNonceIndex := c_uInt16Zero, homeInitCookie := c_64ZeroBits, homeKeygenToken := c_64ZeroBits, mipOptions := omit } } template MipMessage mw_hot := { homeTest := { homeNonceIndex := ?, homeInitCookie := ?, homeKeygenToken := ?, mipOptions := * } } template MipMessage m_hoti := { homeTestInit := { reserved := c_uInt16Zero, homeInitCookie := c_64ZeroBits, mipOptions := omit } } template MipMessage mw_hoti := { homeTestInit := { reserved := ?, homeInitCookie := ?, mipOptions := * } } }//end group mobilityHdrMessageTemplates group mobilityOptTemplates { /* * @param p_dstOpt First element in the Destination option list */ template MipOptionList m_mipOptList_1Elem ( template MipOption p_mipOpt ) := { p_mipOpt } /* * @param p_dstOpt First element in the Destination option list */ template MipOptionList m_mipOptList_2Elem ( template MipOption p_mipOpt1, template MipOption p_mipOpt2 ) := { p_mipOpt1, p_mipOpt2 } template MipOption m_mipOpt_altCoa(template MipOptAltCoA p_mipOptAltCoA) := { mipOptAltCoA := p_mipOptAltCoA } template MipOption m_mipOpt_padN(template OptPadN p_optPadN) := { optPadN := p_optPadN } template MipOptAltCoA m_mipOptAltCoA(in template Ipv6Address p_addr) := { mipOptType :=3, mipOptLen := 16, alternateCoA := p_addr } template MipOptAltCoA mw_mipOptAltCoA := { mipOptType :=3, mipOptLen := 16, alternateCoA := ? } }//end group mobilityOptTemplates } // end module LibIpv6_MultiRfcs_Templates } // end module LibIpv6_CommonRfcs_Templates
ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_CommonRfcs_TypesAndValues.ttcn 0 → 100644 +309 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module defines types and constants for * information elements that are shared by more * than one RFC TTCN-3 module including IPv6 options, * addresses, and extension headers. * Types have been derived from various RFCs. */ module LibIpv6_CommonRfcs_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; import from LibCommon_TextStrings all; import from LibCommon_Time all ; group DefaultConstants { const UInt16 c_defId := 10; // for ICMP echo proc const UInt16 c_defSeqNo := 20; // for ICMP echo proc } group rfc3513AddressingArchitecture { type Oct16 Ipv6Address; type UInt8 PrefixLength ;//indicates nr of bits to be used as Prefix //Unspecified address const Ipv6Address c_unspecifiedAdd := c_16ZeroBytes; const UInt8 c_maxNrIpv6Address := 10; type record length(1 .. c_maxNrIpv6Address) of Ipv6Address Ipv6AddressList with { encode "present=isEOF()== false ;elements=valueOf(getTag('hdrExtLen'));" } }//end group rfc3513AddressingArchitecture group ipv6Options { const UInt8 c_optLen0 := 0; const UInt8 c_optLen1 := 1; const UInt8 c_optLen2 := 2; const UInt8 c_optLen4 := 4; const UInt8 c_optLen6 := 6; const UInt8 c_optLen16 := 16; group rfc2460Options { group paddingOptions { const UInt8 c_optPad1 := 0; const UInt8 c_optPadN := 1; const UInt8 c_optPadNLen0 := 0 ; const UInt8 c_optPadNLen2 := 2; const UInt8 c_optPadNLen4 := 4 ; type record OptPad1 { UInt8 optType(c_optPad1) } with { encode "present=bytes(0,1,0);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-1"; } type record OptPadN { UInt8 optType(c_optPadN), UInt8 optLen, octetstring padding optional } with { encode "present=bytes(0,1,1);"; encode (optLen) "tag='optLen';intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-value-2"; encode (padding) "length=valueOf(getTag('optLen'));fieldPresent=(valueOf(getTag('optLen'))>0)"; } }//end group paddingOptions group DestOptions { //2460 + MIPv6 const UInt8 c_maxNrDestOption := 10; /* @remark In a DestOptionList value either the pad1 or padN * option can appear only once! */ type set length (1..c_maxNrDestOption) of DestOption DestOptionList with { encode "elements=valueOf(getTag('hdrExtLen'));" } type union DestOption { OptPad1 pad1 , OptPadN padN , OptTunnelEncapLimit tunnelEncapLimit , OptHomeAddress homeAddressOption, octetstring generalOptionString } with { encode (generalOptionString) "length=valueOf(getTag('hdrExtLen'))-2;"; } }//end group DestOptions }//end group rfc2460Options group rfc2461Options { group slla { const UInt8 c_srcLinkLayerAddress := 1; /* * @desc Derived from RFC2461 clause4.6.1 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record SrcLinkLayerAddress { UInt8 icmpType(c_srcLinkLayerAddress), UInt8 optionLength, Oct6to15 linkLayerAddr } with { encode "present=bytes(0,1,1);"; encode (optionLength) "tag='SLA_optionLength';"; encode (linkLayerAddr) "length=valueOf(getTag('SLA_optionLength'))*8-2;"; } }//end group slla group tlla { const UInt8 c_tgtLinkLayerAddress := 2; /* * @desc Derived from RFC 2461 clause 4.6.1 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record TgtLinkLayerAddress { UInt8 icmpType(c_tgtLinkLayerAddress), UInt8 optionLength, Oct6to15 linkLayerAddr } with { encode "present=bytes(0,1,2);"; encode (optionLength) "tag='TLA_optionLength';"; encode (linkLayerAddr) "length=valueOf(getTag('TLA_optionLength'))*8-2;"; } }//end group tlla group mtu { const UInt8 c_mtuOption := 5; /* * @desc Derived from RFC 2461 clause 4.6.4 + MIPv6 * @url http://www.ietf.org/rfc/rfc2461.txt */ type record MtuOption { UInt8 icmpType(c_mtuOption), UInt8 optionLength, UInt16 reserved, UInt32 mtu } with { encode "present=bytes(0,1,5);" } }//end group mtu }//end group rfc2461Options group rfc2473Options { const UInt8 c_optTunnelEncapLimit := 4; /* * @desc Derived from RFC 2473 Section 4.1.1 * @url http://www.ietf.org/rfc/rfc2473.txt */ type record OptTunnelEncapLimit { UInt8 optType(c_optTunnelEncapLimit), UInt8 optLen (1), UInt8 optTunnelEncapLimitValue } with { encode "present=bytes(0,1,4);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-3"; } }//end group rfc2473Options group rfc2675Options { const UInt8 c_optJumboPayload := 194; const UInt32 c_jumboLen8 := 8; const UInt32 c_jumboLen128K := 131072; /* * @desc Derived from RFC 2675 Section 2 * @url http://www.ietf.org/rfc/rfc2675.txt */ type record OptJumboPayload { UInt8 optType(c_optJumboPayload), UInt8 optLen(4), UInt32 optJumboPayloadLength } with { encode "present=bytes(0,1,194);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-6"; } }//end group rfc2675Options group rfc2711Options { const UInt8 c_optRouterAlert := 5; /* * @desc Derived from RFC 2711 Section 2.1 * @url http://www.ietf.org/rfc/rfc2711.txt */ type record OptRouterAlert { UInt8 optType(c_optRouterAlert), UInt8 optLen(2), UInt16 optValue } with { encode "present=bytes(0,1,5);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-4"; } }//end group rfc2711Options group rfc3775Options { /* * @desc Extra ICMP option introduced by RFC3775, clause 7.3 */ type record AdvertisementInterval { //ND + MIPv6 UInt8 icmpType (c_advertisementInterval), UInt8 optionLength (1), UInt16 reserved, UInt32 advInterval } with { encode "present=bytes(1, 0x07)" } /* * @desc Extra ICMP option introduced by RFC3775, clause 7.4 */ type record HomeAgentInfo { //ND + MIPv6 UInt8 icmpType (c_homeAgentInfo), UInt8 optionLength (1), UInt16 reserved, UInt16 homeAgentPreference, UInt16 homeAgentLifetime } with { encode "present=bytes(1, 0x08)" } /* @desc Derived from RFCxxxx MIpv6, clause 6.2 * @remark This extension shall be inserted: * 1) After the routing header, if that header is present, * 2) Before the Fragment Header, if that header is present * 3) Before the AH Header or ESP Header, if either one of those headers is present */ type record OptHomeAddress { // as destination option UInt8 ipv6OptType(c_optHomeAddress), UInt8 ipv6OptLen(0..16), Oct16 homeAddress } with { encode "present=bytes(0,1,201);intTag='hdrExtIntLen',getIntTag('hdrExtIntLen')-18"; } group mipOptionValues { const UInt8 c_bindingRefreshAdvice := 2; const UInt8 c_alternateCareofAddress := 3; const UInt8 c_nonceIndices := 4; const UInt8 c_authorizationData := 5; const UInt8 c_advertisementInterval := 7; const UInt8 c_homeAgentInfo := 8; }//end group mipOptionValues const UInt8 c_optHomeAddress := 201; }//end group rfc3775Options } // end ipv6Options group security { type enumerated CryptoFunction { e_null(0), e_sha1(1) } with { encode "use=com.testingtech.ttcn.tci.*;"; } } // end security } // end LibIpv6_CommonRfcs_TypesAndValues
ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_ExternalFunctions.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_ExternalFunctions.ttcn +3 −1 Original line number Diff line number Diff line Loading @@ -13,10 +13,12 @@ import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues { type all }; import from LibIpv6_CommonRfcs_TypesAndValues { type all }; import from LibIpv6_Interface { type Ipv6Packet }; import from LibIpv6_Rfc2460Root_TypesAndValues {type all}; import from LibIpv6_Rfc3775Mipv6_ExtHdrTypesAndValues all; /* @desc This external function calculates the payload length * of a IPv6 packet Loading
ttcn3/EtsiLibrary/LibIpv6/LibMultiRfcs/LibIpv6_Interface.ttcn→ttcn3/EtsiLibrary/LibIpv6/LibCommonRfcs/LibIpv6_Interface.ttcn +0 −0 File moved. View file