Loading ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_Functions.ttcn 0 → 100644 +430 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module specifies common MIPv6 messages interchanges (= operations) * for an Ipv6 test component. * Functions do not set a test component verdict but instead * use the function return value instead to notify the function * caller about the success of the operation. * */ module LibIpv6_Rfc3775Mipv6_Functions { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; import from LibCommon_VerdictControl { type FncRetCode }; import from LibCommon_Time all; //LibIpv6 import from LibIpv6_ExternalFunctions all; import from LibIpv6_Interface all ; import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues all; import from LibIpv6_Rfc2460Root_Functions all; import from LibIpv6_ModuleParameters all ; import from LibIpv6_Rfc2461NeighborDiscovery_Templates all; import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all; import from LibIpv6_Rfc2461NeighborDiscovery_Functions all; import from LibIpv6_Rfc2463Icmpv6_Functions all; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_MultiRfcs_Functions all; import from LibIpv6_Rfc3775Mipv6_TypesAndValues all; import from LibIpv6_Rfc3775Mipv6_Templates all; //AtsIpv6 import from AtsIpv6_TestSystem all; import from AtsIpv6_TestConfiguration_TypesAndValues all; import from AtsIpv6_ModuleParameters all ; group dhaadFns { /* * @desc This sends a MIPv6 HaAddrDreq for a test component * acting as any IPv6 node to the NUT. * Prior it modifies IPv6 packet payload ength and ICMPv6 * checksum to their correct values * @remark The template passed in must NOT contain any matching expressions! * @param p_haAddrDreq Ipv6 packet template with neighborhood advertisement to be sent * @return execution status */ function f_sendHaAddrDreq(in template HomeAgentAddressDiscoveryRequest p_haAddrDreq) runs on LibIpv6Node return FncRetCode { var Ipv6Packet v_ipPkt; var ExtensionHeader v_extHdr; v_ipPkt.homeAgentAddressDiscoveryRequest := valueof(p_haAddrDreq); //calc MipHeader length/checksum if present f_setExtensionHeaders(v_ipPkt.homeAgentAddressDiscoveryRequest.extHdrList); //calc payloadLen v_ipPkt.homeAgentAddressDiscoveryRequest.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt); //set checksum to zero v_ipPkt.homeAgentAddressDiscoveryRequest.checksum := c_2ZeroBytes; //calc checksum v_ipPkt.homeAgentAddressDiscoveryRequest.checksum := fx_icmpv6Checksum(v_ipPkt); //send ipPort.send(v_ipPkt.homeAgentAddressDiscoveryRequest); return e_success; } // end f_sendHaAddrDreq /* * @desc DHAADRequest message is sent, and DHAADResp is expected * The gla of HA is returned via inout variable. * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_haAcaNut Home Agent Anycast Address of test nodev * @param p_haGlasNut Home Agent Addresses of node under test */ function f_sendHaAddrDreqAndWaitForReply( in template Ipv6Address p_mnCoaTn, in Ipv6Address p_haAcaNut, out Ipv6AddressList p_haGlasNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; var HomeAgentAddressDiscoveryReply v_dhaadReply; v_ret := f_sendHaAddrDreq(m_dhaadReq(p_mnCoaTn, p_haAcaNut, c_defId )); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_dhaadRep(p_mnCoaTn, c_defId )) -> value v_dhaadReply { tc_ac.stop; p_haGlasNut := v_dhaadReply.homeAgentAddresses; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendHaAddrDreqAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendHaAddrDreqAndWaitForReply } // end group dhaadFns group bindingFns { /* * @desc primaryCareOfAddressRegistration * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_mnHoaTn Mobile Node Home Address of test node * @param p_haGlaNut Home Agent Address of node under test */ function f_registerMnToHa( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_mnHoaTn, in template Ipv6Address p_haGlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst(c_dstHdr, p_mnCoaTn, p_haGlaNut, m_extHdrList_elemNo2( m_extHdr_dstOptHeader( c_mipHdr, c_optLen16,//TODO check length m_dstOptList_elemNo2( m_dstOpt_padN(m_optPad4), m_dstOpt_homeAddr(p_mnHoaTn))), m_extHdr_mipHeader (c_noNextHdr, c_bindingUpdate, m_bindingUpdate(c_defSeqNo, c_aFlag1, c_hFlag1, c_lFlag1, c_kFlag1, c_zeroTimeUnits, m_mipOptList_elemNo1( m_mipOpt_padN(m_optPad4))))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_routeHdr, p_haGlaNut, p_mnCoaTn, m_extHdrList_elemNo2( mw_extHdr_routingHeader( c_mipHdr, c_routeHdrLen2, c_routeHdrType0, c_routeHdrSegmentsLeft0, m_routingHeaderData_ipv6AddressList_elemNo1(p_mnHoaTn)), mw_extHdr_mipHeader ( c_noNextHdr, c_bindingAck, mw_bindingAck(c_defSeqNo))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_registerMnToHa: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_registerMnToHa /* * @desc Mobile Node returns Home procedure * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_mnHoaTn Mobile Node Home Address of test node * @param p_mnLlaTn Mobile Node Link Local Address of test node * @param p_macUcaTn Mobile Node Mac Address of test node * @param p_haLlaNut Link Local Address of Node Under Test */ function f_mnReturnsHome( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_mnHoaTn, in template Ipv6Address p_mnLlaTn, in template Oct6to15 p_macUcaTn, in template Ipv6Address p_haGlaNut)//p_haLlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst(c_mipHdr, p_mnCoaTn, p_haGlaNut,//p_haLlaNut, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_bindingUpdate, m_bindingUpdate( c_defSeqNo, c_aFlag1, c_hFlag1, c_lFlag1, c_kFlag1, c_zeroTimeUnits, m_mipOptList_elemNo1( m_mipOpt_padN(m_optPad4))))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_mipHdr, p_haGlaNut, p_mnCoaTn, m_extHdrList_elemNo1( mw_extHdr_mipHeader ( c_noNextHdr, c_bindingAck, mw_bindingAck(c_defSeqNo))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ return e_timeout; log("**** f_mnReturnsHome: ERROR: tc_ac.timeout **** "); } } // end alt v_ret := f_sendNbrAdv (m_nbrAdv_noExtHdr( p_mnLlaTn, c_allNodesMca, c_rFlag0, c_sFlag0, c_oFlag1, p_mnHoaTn, m_nbrAdvOpt_tllaOpt(p_macUcaTn))) ; return v_ret; }//end f_mnReturnsHome }//end group bindingFns group homeTestFns { /* * @desc waitForHomeTestInitAndReply * @param p_glaCn Global Address of CN (test node 2) * @param p_mnHoa Mobile Node Home Address of test node 1 */ function f_waitForHomeTestInitAndReply( in template Ipv6Address p_glaCn, in template Ipv6Address p_mnHoa) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_mipHdr, p_mnHoa, p_glaCn, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_homeTestInit, mw_hoti)))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_waitForHomeTestInitAndReply: ERROR: tc_ac.timeout **** "); return v_ret; } } // end alt v_ret := f_sendIpv6ExtHdrs(mw_ipv6ExtHdrs_srcDst (c_mipHdr, p_glaCn, p_mnHoa, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_homeTest, m_hot)))); return v_ret; }//end f_waitForHomeTestInitAndReply /* * @desc sendHomeTestInitAndWaitForReply * @param p_mnCoa Mobile Node Care of Address of test node 1 * @param p_mnHoa Mobile Node Home Address of test node 1 * @param p_glaCn Global Address of CN (test node 2) * @param p_haGlaNut Home Agent Address of IUT */ function f_sendHomeTestInitAndWaitForReply( in template Ipv6Address p_mnCoa, in template Ipv6Address p_mnHoa, in template Ipv6Address p_glaCn, in template Ipv6Address p_haGlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst ( c_tunneledIpHdr, p_mnCoa, p_haGlaNut, m_extHdrList_elemNo2( m_extHdr_tunneledHeader(c_mipHdr, p_mnHoa, p_glaCn), m_extHdr_mipHeader (c_noNextHdr, c_homeTestInit, m_hoti)))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { //TODO move addr up behind c_tunneledIpHdr [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_tunneledIpHdr, p_haGlaNut, p_mnCoa, m_extHdrList_elemNo2( mw_extHdr_tunneledHeader(c_mipHdr, p_glaCn, p_mnHoa), mw_extHdr_mipHeader ( c_noNextHdr, c_homeTest, mw_hot)))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendHomeTestInitAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendHomeTestInitAndWaitForReply }//end group homeTestFns group mobilePrefixFns{ /* * @desc This sends a MIPv6 HaAddrDreq for a test component * acting as any IPv6 node to the NUT. * Prior it modifies IPv6 packet payload ength and ICMPv6 * checksum to their correct values * @remark The template passed in must NOT contain any matching expressions! * @param p_haAddrDreq Ipv6 packet template with neighborhood advertisement to be sent * @return execution status */ function f_sendMipPrefixSol(in template MobilePrefixSolicitation p_mipPrefixSol) runs on LibIpv6Node return FncRetCode { var Ipv6Packet v_ipPkt; var ExtensionHeader v_extHdr; v_ipPkt.mobilePrefixSolicitation := valueof(p_mipPrefixSol); //calc MipHeader length/checksum if present f_setExtensionHeaders(v_ipPkt.mobilePrefixSolicitation.extHdrList); //calc payloadLen v_ipPkt.mobilePrefixSolicitation.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt); //set checksum to zero v_ipPkt.mobilePrefixSolicitation.checksum := c_2ZeroBytes; //calc checksum v_ipPkt.mobilePrefixSolicitation.checksum := fx_icmpv6Checksum(v_ipPkt); //send ipPort.send(v_ipPkt.mobilePrefixSolicitation); return e_success; } // end f_sendMipPrefixSol /* * @desc DHAADReply messages is sent, and DHAADResp is expected * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_haAcaNut Home Agent Anycast Address of test nodev * @param p_haGlasNut Home Agent Addresses of node under test */ function f_sendMipPrefixSolAndWaitForReply( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_haGla, in template Ipv6Address p_mnHoaTn) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendMipPrefixSol(m_mipPrefixSol( c_dstHdr, p_mnCoaTn, p_haGla, m_extHdrList_elemNo1( m_extHdr_dstOptHeader( c_icmpHdr, c_optLen16,//TODO check length m_dstOptList_elemNo2( m_dstOpt_padN(m_optPad4), m_dstOpt_homeAddr(p_mnHoaTn)))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_mipPrefixAdv_extHdr( c_routeHdr, p_haGla, p_mnCoaTn, m_extHdrList_elemNo1( mw_extHdr_routingHeader( c_icmpHdr, c_routeHdrLen2, c_routeHdrType2, c_routeHdrSegmentsLeft1, m_routingHeaderData_ipv6AddressList_elemNo1(p_mnHoaTn))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendMipPrefixSolAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendMipPrefixSolAndWaitForReply }//end group mobilePrefixFns } // end module LibIpv6_Rfc3775Mipv6_Functions ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_Templates.ttcn 0 → 100644 +124 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module specifies common template definitions * to specify IPv6 packets for MIPv6 * */ module LibIpv6_Rfc3775Mipv6_Templates { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_ExternalFunctions all; import from LibIpv6_ModuleParameters all ; import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues all; import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all; import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all ; import from LibIpv6_Rfc3775Mipv6_TypesAndValues all; group dhaadRequestTemplates { template HomeAgentAddressDiscoveryRequest m_dhaadReq ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_identifier) := { ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst), extHdrList := omit, icmpType := c_mipIcmpHomeAgentAddressDiscoveryRequest, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := p_identifier, reserved := 0 } //todo exthdr param template HomeAgentAddressDiscoveryRequest m_dhaadReq_mipHdr ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt8 p_mobilityHeaderType, template MipMessage p_mipMessage) := { ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_mipHdr, p_src, p_dst), extHdrList := {m_extHdr_mipHeader(c_icmpHdr, p_mobilityHeaderType, p_mipMessage )}, icmpType := c_mipIcmpHomeAgentAddressDiscoveryRequest, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := 1, reserved := 0 } }//end group dhaadRequestTemplates group dhaadReplyTemplates{ template HomeAgentAddressDiscoveryReply mw_dhaadRep ( template Ipv6Address p_dst, UInt16 p_identifier) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, ?, p_dst), extHdrList := ?, icmpType := c_mipIcmpHomeAgentAddressDiscoveryReply, icmpCode := c_icmpCode0, checksum := ?, identifier := p_identifier, reserved := ?, homeAgentAddresses := ? } } //end group dhaadReplyTemplates group mobilePrefixSolicitationTemplates { template MobilePrefixSolicitation m_mipPrefixSol ( UInt8 p_nextHdr, template Ipv6Address p_src, template Ipv6Address p_dst, template ExtensionHeaderList p_extHdrList):= { ipv6Hdr := m_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst), extHdrList := p_extHdrList, icmpType := c_mipIcmpMobilePrefixSolicitation, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := 2, reserved := 0 } }//end group mobilePrefixSolicitationTemplates group mobilePrefixAdvertisementTemplates { template MobilePrefixAdvertisement mw_mipPrefixAdv := { ipv6Hdr := mw_ipHdr, extHdrList := ?, icmpType := c_mipIcmpMobilePrefixAdvertisement, icmpCode := ?, checksum := ?, identifier := ?, mFlag := ?, oFlag := ?, reserved := ?, mipPrefixInfoList := ? } template MobilePrefixAdvertisement mw_mipPrefixAdv_extHdr ( UInt8 p_nextHdr, template Ipv6Address p_src, template Ipv6Address p_dst, template ExtensionHeaderList p_extHdrList) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst), extHdrList := p_extHdrList, icmpType := c_mipIcmpMobilePrefixAdvertisement, icmpCode := ?, checksum := ?, identifier := ?, mFlag := ?, oFlag := ?, reserved := ?, mipPrefixInfoList := ? } }//end group mobilePrefixAdvertisementTemplates } // end module LibIpv6_Rfc3775Mipv6_Templates ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_TypesAndValues.ttcn 0 → 100644 +182 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module defines the structure mobile IPv6 header * based on an temporary MIpv6-24 RFC and using types from * the Common library. Also it provides some useful constant * definitions. * */ module LibIpv6_Rfc3775Mipv6_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues all ; import from LibIpv6_Rfc2460Root_TypesAndValues all ; group mipConstants { const UInt8 c_mipIcmpHomeAgentAddressDiscoveryRequest := 144; const UInt8 c_mipIcmpHomeAgentAddressDiscoveryReply := 145; const UInt8 c_mipIcmpMobilePrefixSolicitation := 146; const UInt8 c_mipIcmpMobilePrefixAdvertisement := 147; const UInt8 c_mipPrefixInfo:= 3; const UInt8 c_advertisementInterval:= 7; const UInt8 c_homeAgentInfo:= 8; const UInt8 c_mipRtAdv:=134; } // end mipConstants group icmpRFC3775Packets { /* * @desc Derived from RFC3775, clause 6.5 */ type record HomeAgentAddressDiscoveryRequest { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpHomeAgentAddressDiscoveryRequest), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 144)"; } /* * @desc Derived from RFC3775, clause 6.6 */ type record HomeAgentAddressDiscoveryReply { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpHomeAgentAddressDiscoveryReply), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved, Ipv6AddressList homeAgentAddresses } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 145)"; } /* * @desc Derived from RFC3775, clause 6.7 */ type record MobilePrefixSolicitation { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpMobilePrefixSolicitation), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 146)"; } /* * @desc Derived from RFC3775, clause 6.8 * @remark MipPrefixInfoList type is a modification * of PrefixAdvertisement specified in RFC2461! */ type record MobilePrefixAdvertisement { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpMobilePrefixAdvertisement), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt1 mFlag, UInt1 oFlag, UInt14 reserved, MipPrefixInfoList mipPrefixInfoList } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 147)"; } /* * @desc Derived from RFC3775, clause 7.1 * @remark MipRouterAdvertisement type is a modification * of RouterAdvertisement specified in RFC2461 clause 4.2! */ type record MipRouterAdvertisement { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipRtAdv), UInt8 icmpCode, Oct2 checksum, UInt8 curHopLimit, UInt1 mFlag, UInt1 oFlag, UInt1 hFlag, UInt5 reserved, UInt16 routerLifetime, UInt32 reachableTime, UInt32 retransTimer, MipRtAdvOptions mipRtAdvOptions optional } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)"; } /* * @remark At least one of these options shall be present * in any MipRtAdvOptions value! */ type set MipRtAdvOptions { //Imported SrcLinkLayerAddress mipSrcLinkLayerAddr optional, MtuOption mipMtuOption optional, //Not imported MipPrefixInfoList mipPrefixInfoList optional } // At least one of these options shall be present } //end icmpRFC3775Packets group icmpRFC3775Options { type set length (1..c_maxNrMipPrefixInfo) of MipPrefixInfo MipPrefixInfoList with { encode "elements=valueOf(getTag('hdrExtLen'));" } /* * @desc Derived from RFC3775, clause 7.2 * @remark MipPrefixInfo type is a modification * of PrefixInfo specified in RFC2461 clause 4.6.2! */ type record MipPrefixInfo { UInt8 icmpType(c_mipPrefixInfo), UInt8 optionLength, UInt8 prefixLength, UInt1 linkFlag, UInt1 aFlag, //autoConfigFlag, UInt1 rFlag, //routerAddress, added flag UInt5 reserved1, UInt32 validLifetime, UInt32 preferredLifetime, UInt32 reserved2, Ipv6Address addrPrefix } } // end icmpRFC3775Options } // end module LibIpv6_Rfc3775Mipv6_TypesAndValues Loading
ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_Functions.ttcn 0 → 100644 +430 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module specifies common MIPv6 messages interchanges (= operations) * for an Ipv6 test component. * Functions do not set a test component verdict but instead * use the function return value instead to notify the function * caller about the success of the operation. * */ module LibIpv6_Rfc3775Mipv6_Functions { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; import from LibCommon_VerdictControl { type FncRetCode }; import from LibCommon_Time all; //LibIpv6 import from LibIpv6_ExternalFunctions all; import from LibIpv6_Interface all ; import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues all; import from LibIpv6_Rfc2460Root_Functions all; import from LibIpv6_ModuleParameters all ; import from LibIpv6_Rfc2461NeighborDiscovery_Templates all; import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all; import from LibIpv6_Rfc2461NeighborDiscovery_Functions all; import from LibIpv6_Rfc2463Icmpv6_Functions all; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_MultiRfcs_Functions all; import from LibIpv6_Rfc3775Mipv6_TypesAndValues all; import from LibIpv6_Rfc3775Mipv6_Templates all; //AtsIpv6 import from AtsIpv6_TestSystem all; import from AtsIpv6_TestConfiguration_TypesAndValues all; import from AtsIpv6_ModuleParameters all ; group dhaadFns { /* * @desc This sends a MIPv6 HaAddrDreq for a test component * acting as any IPv6 node to the NUT. * Prior it modifies IPv6 packet payload ength and ICMPv6 * checksum to their correct values * @remark The template passed in must NOT contain any matching expressions! * @param p_haAddrDreq Ipv6 packet template with neighborhood advertisement to be sent * @return execution status */ function f_sendHaAddrDreq(in template HomeAgentAddressDiscoveryRequest p_haAddrDreq) runs on LibIpv6Node return FncRetCode { var Ipv6Packet v_ipPkt; var ExtensionHeader v_extHdr; v_ipPkt.homeAgentAddressDiscoveryRequest := valueof(p_haAddrDreq); //calc MipHeader length/checksum if present f_setExtensionHeaders(v_ipPkt.homeAgentAddressDiscoveryRequest.extHdrList); //calc payloadLen v_ipPkt.homeAgentAddressDiscoveryRequest.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt); //set checksum to zero v_ipPkt.homeAgentAddressDiscoveryRequest.checksum := c_2ZeroBytes; //calc checksum v_ipPkt.homeAgentAddressDiscoveryRequest.checksum := fx_icmpv6Checksum(v_ipPkt); //send ipPort.send(v_ipPkt.homeAgentAddressDiscoveryRequest); return e_success; } // end f_sendHaAddrDreq /* * @desc DHAADRequest message is sent, and DHAADResp is expected * The gla of HA is returned via inout variable. * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_haAcaNut Home Agent Anycast Address of test nodev * @param p_haGlasNut Home Agent Addresses of node under test */ function f_sendHaAddrDreqAndWaitForReply( in template Ipv6Address p_mnCoaTn, in Ipv6Address p_haAcaNut, out Ipv6AddressList p_haGlasNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; var HomeAgentAddressDiscoveryReply v_dhaadReply; v_ret := f_sendHaAddrDreq(m_dhaadReq(p_mnCoaTn, p_haAcaNut, c_defId )); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_dhaadRep(p_mnCoaTn, c_defId )) -> value v_dhaadReply { tc_ac.stop; p_haGlasNut := v_dhaadReply.homeAgentAddresses; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendHaAddrDreqAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendHaAddrDreqAndWaitForReply } // end group dhaadFns group bindingFns { /* * @desc primaryCareOfAddressRegistration * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_mnHoaTn Mobile Node Home Address of test node * @param p_haGlaNut Home Agent Address of node under test */ function f_registerMnToHa( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_mnHoaTn, in template Ipv6Address p_haGlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst(c_dstHdr, p_mnCoaTn, p_haGlaNut, m_extHdrList_elemNo2( m_extHdr_dstOptHeader( c_mipHdr, c_optLen16,//TODO check length m_dstOptList_elemNo2( m_dstOpt_padN(m_optPad4), m_dstOpt_homeAddr(p_mnHoaTn))), m_extHdr_mipHeader (c_noNextHdr, c_bindingUpdate, m_bindingUpdate(c_defSeqNo, c_aFlag1, c_hFlag1, c_lFlag1, c_kFlag1, c_zeroTimeUnits, m_mipOptList_elemNo1( m_mipOpt_padN(m_optPad4))))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_routeHdr, p_haGlaNut, p_mnCoaTn, m_extHdrList_elemNo2( mw_extHdr_routingHeader( c_mipHdr, c_routeHdrLen2, c_routeHdrType0, c_routeHdrSegmentsLeft0, m_routingHeaderData_ipv6AddressList_elemNo1(p_mnHoaTn)), mw_extHdr_mipHeader ( c_noNextHdr, c_bindingAck, mw_bindingAck(c_defSeqNo))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_registerMnToHa: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_registerMnToHa /* * @desc Mobile Node returns Home procedure * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_mnHoaTn Mobile Node Home Address of test node * @param p_mnLlaTn Mobile Node Link Local Address of test node * @param p_macUcaTn Mobile Node Mac Address of test node * @param p_haLlaNut Link Local Address of Node Under Test */ function f_mnReturnsHome( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_mnHoaTn, in template Ipv6Address p_mnLlaTn, in template Oct6to15 p_macUcaTn, in template Ipv6Address p_haGlaNut)//p_haLlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst(c_mipHdr, p_mnCoaTn, p_haGlaNut,//p_haLlaNut, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_bindingUpdate, m_bindingUpdate( c_defSeqNo, c_aFlag1, c_hFlag1, c_lFlag1, c_kFlag1, c_zeroTimeUnits, m_mipOptList_elemNo1( m_mipOpt_padN(m_optPad4))))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_mipHdr, p_haGlaNut, p_mnCoaTn, m_extHdrList_elemNo1( mw_extHdr_mipHeader ( c_noNextHdr, c_bindingAck, mw_bindingAck(c_defSeqNo))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ return e_timeout; log("**** f_mnReturnsHome: ERROR: tc_ac.timeout **** "); } } // end alt v_ret := f_sendNbrAdv (m_nbrAdv_noExtHdr( p_mnLlaTn, c_allNodesMca, c_rFlag0, c_sFlag0, c_oFlag1, p_mnHoaTn, m_nbrAdvOpt_tllaOpt(p_macUcaTn))) ; return v_ret; }//end f_mnReturnsHome }//end group bindingFns group homeTestFns { /* * @desc waitForHomeTestInitAndReply * @param p_glaCn Global Address of CN (test node 2) * @param p_mnHoa Mobile Node Home Address of test node 1 */ function f_waitForHomeTestInitAndReply( in template Ipv6Address p_glaCn, in template Ipv6Address p_mnHoa) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; tc_ac.start; alt { [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_mipHdr, p_mnHoa, p_glaCn, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_homeTestInit, mw_hoti)))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_waitForHomeTestInitAndReply: ERROR: tc_ac.timeout **** "); return v_ret; } } // end alt v_ret := f_sendIpv6ExtHdrs(mw_ipv6ExtHdrs_srcDst (c_mipHdr, p_glaCn, p_mnHoa, m_extHdrList_elemNo1( m_extHdr_mipHeader ( c_noNextHdr, c_homeTest, m_hot)))); return v_ret; }//end f_waitForHomeTestInitAndReply /* * @desc sendHomeTestInitAndWaitForReply * @param p_mnCoa Mobile Node Care of Address of test node 1 * @param p_mnHoa Mobile Node Home Address of test node 1 * @param p_glaCn Global Address of CN (test node 2) * @param p_haGlaNut Home Agent Address of IUT */ function f_sendHomeTestInitAndWaitForReply( in template Ipv6Address p_mnCoa, in template Ipv6Address p_mnHoa, in template Ipv6Address p_glaCn, in template Ipv6Address p_haGlaNut) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendIpv6ExtHdrs(m_ipv6ExtHdrs_srcDst ( c_tunneledIpHdr, p_mnCoa, p_haGlaNut, m_extHdrList_elemNo2( m_extHdr_tunneledHeader(c_mipHdr, p_mnHoa, p_glaCn), m_extHdr_mipHeader (c_noNextHdr, c_homeTestInit, m_hoti)))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { //TODO move addr up behind c_tunneledIpHdr [] ipPort.receive(mw_ipv6ExtHdrs_srcDst( c_tunneledIpHdr, p_haGlaNut, p_mnCoa, m_extHdrList_elemNo2( mw_extHdr_tunneledHeader(c_mipHdr, p_glaCn, p_mnHoa), mw_extHdr_mipHeader ( c_noNextHdr, c_homeTest, mw_hot)))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendHomeTestInitAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendHomeTestInitAndWaitForReply }//end group homeTestFns group mobilePrefixFns{ /* * @desc This sends a MIPv6 HaAddrDreq for a test component * acting as any IPv6 node to the NUT. * Prior it modifies IPv6 packet payload ength and ICMPv6 * checksum to their correct values * @remark The template passed in must NOT contain any matching expressions! * @param p_haAddrDreq Ipv6 packet template with neighborhood advertisement to be sent * @return execution status */ function f_sendMipPrefixSol(in template MobilePrefixSolicitation p_mipPrefixSol) runs on LibIpv6Node return FncRetCode { var Ipv6Packet v_ipPkt; var ExtensionHeader v_extHdr; v_ipPkt.mobilePrefixSolicitation := valueof(p_mipPrefixSol); //calc MipHeader length/checksum if present f_setExtensionHeaders(v_ipPkt.mobilePrefixSolicitation.extHdrList); //calc payloadLen v_ipPkt.mobilePrefixSolicitation.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt); //set checksum to zero v_ipPkt.mobilePrefixSolicitation.checksum := c_2ZeroBytes; //calc checksum v_ipPkt.mobilePrefixSolicitation.checksum := fx_icmpv6Checksum(v_ipPkt); //send ipPort.send(v_ipPkt.mobilePrefixSolicitation); return e_success; } // end f_sendMipPrefixSol /* * @desc DHAADReply messages is sent, and DHAADResp is expected * @param p_mnCoaTn Mobile Node Care Of Address of test node * @param p_haAcaNut Home Agent Anycast Address of test nodev * @param p_haGlasNut Home Agent Addresses of node under test */ function f_sendMipPrefixSolAndWaitForReply( in template Ipv6Address p_mnCoaTn, in template Ipv6Address p_haGla, in template Ipv6Address p_mnHoaTn) runs on Ipv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendMipPrefixSol(m_mipPrefixSol( c_dstHdr, p_mnCoaTn, p_haGla, m_extHdrList_elemNo1( m_extHdr_dstOptHeader( c_icmpHdr, c_optLen16,//TODO check length m_dstOptList_elemNo2( m_dstOpt_padN(m_optPad4), m_dstOpt_homeAddr(p_mnHoaTn)))))); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive(mw_mipPrefixAdv_extHdr( c_routeHdr, p_haGla, p_mnCoaTn, m_extHdrList_elemNo1( mw_extHdr_routingHeader( c_icmpHdr, c_routeHdrLen2, c_routeHdrType2, c_routeHdrSegmentsLeft1, m_routingHeaderData_ipv6AddressList_elemNo1(p_mnHoaTn))))) { tc_ac.stop; v_ret := e_success ; } [] tc_ac.timeout{ v_ret := e_timeout; log("**** f_sendMipPrefixSolAndWaitForReply: ERROR: tc_ac.timeout **** "); } } // end alt return v_ret; }//end f_sendMipPrefixSolAndWaitForReply }//end group mobilePrefixFns } // end module LibIpv6_Rfc3775Mipv6_Functions
ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_Templates.ttcn 0 → 100644 +124 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module specifies common template definitions * to specify IPv6 packets for MIPv6 * */ module LibIpv6_Rfc3775Mipv6_Templates { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_ExternalFunctions all; import from LibIpv6_ModuleParameters all ; import from LibIpv6_Rfc2460Root_Templates all; import from LibIpv6_MultiRfcs_TypesAndValues all; import from LibIpv6_MultiRfcs_Templates all; import from LibIpv6_Rfc2460Root_TypesAndValues all; import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all; import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all ; import from LibIpv6_Rfc3775Mipv6_TypesAndValues all; group dhaadRequestTemplates { template HomeAgentAddressDiscoveryRequest m_dhaadReq ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_identifier) := { ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst), extHdrList := omit, icmpType := c_mipIcmpHomeAgentAddressDiscoveryRequest, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := p_identifier, reserved := 0 } //todo exthdr param template HomeAgentAddressDiscoveryRequest m_dhaadReq_mipHdr ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt8 p_mobilityHeaderType, template MipMessage p_mipMessage) := { ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_mipHdr, p_src, p_dst), extHdrList := {m_extHdr_mipHeader(c_icmpHdr, p_mobilityHeaderType, p_mipMessage )}, icmpType := c_mipIcmpHomeAgentAddressDiscoveryRequest, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := 1, reserved := 0 } }//end group dhaadRequestTemplates group dhaadReplyTemplates{ template HomeAgentAddressDiscoveryReply mw_dhaadRep ( template Ipv6Address p_dst, UInt16 p_identifier) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, ?, p_dst), extHdrList := ?, icmpType := c_mipIcmpHomeAgentAddressDiscoveryReply, icmpCode := c_icmpCode0, checksum := ?, identifier := p_identifier, reserved := ?, homeAgentAddresses := ? } } //end group dhaadReplyTemplates group mobilePrefixSolicitationTemplates { template MobilePrefixSolicitation m_mipPrefixSol ( UInt8 p_nextHdr, template Ipv6Address p_src, template Ipv6Address p_dst, template ExtensionHeaderList p_extHdrList):= { ipv6Hdr := m_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst), extHdrList := p_extHdrList, icmpType := c_mipIcmpMobilePrefixSolicitation, icmpCode := c_icmpCode0, checksum := c_2ZeroBytes, identifier := 2, reserved := 0 } }//end group mobilePrefixSolicitationTemplates group mobilePrefixAdvertisementTemplates { template MobilePrefixAdvertisement mw_mipPrefixAdv := { ipv6Hdr := mw_ipHdr, extHdrList := ?, icmpType := c_mipIcmpMobilePrefixAdvertisement, icmpCode := ?, checksum := ?, identifier := ?, mFlag := ?, oFlag := ?, reserved := ?, mipPrefixInfoList := ? } template MobilePrefixAdvertisement mw_mipPrefixAdv_extHdr ( UInt8 p_nextHdr, template Ipv6Address p_src, template Ipv6Address p_dst, template ExtensionHeaderList p_extHdrList) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst), extHdrList := p_extHdrList, icmpType := c_mipIcmpMobilePrefixAdvertisement, icmpCode := ?, checksum := ?, identifier := ?, mFlag := ?, oFlag := ?, reserved := ?, mipPrefixInfoList := ? } }//end group mobilePrefixAdvertisementTemplates } // end module LibIpv6_Rfc3775Mipv6_Templates
ttcn3/EtsiLibrary/LibIpv6/LibMobility/LibIpv6_Rfc3775Mipv6_TypesAndValues.ttcn 0 → 100644 +182 −0 Original line number Diff line number Diff line /* * @author STF 276 * @version $Id$ * @desc This module defines the structure mobile IPv6 header * based on an temporary MIpv6-24 RFC and using types from * the Common library. Also it provides some useful constant * definitions. * */ module LibIpv6_Rfc3775Mipv6_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_MultiRfcs_TypesAndValues all ; import from LibIpv6_Rfc2460Root_TypesAndValues all ; group mipConstants { const UInt8 c_mipIcmpHomeAgentAddressDiscoveryRequest := 144; const UInt8 c_mipIcmpHomeAgentAddressDiscoveryReply := 145; const UInt8 c_mipIcmpMobilePrefixSolicitation := 146; const UInt8 c_mipIcmpMobilePrefixAdvertisement := 147; const UInt8 c_mipPrefixInfo:= 3; const UInt8 c_advertisementInterval:= 7; const UInt8 c_homeAgentInfo:= 8; const UInt8 c_mipRtAdv:=134; } // end mipConstants group icmpRFC3775Packets { /* * @desc Derived from RFC3775, clause 6.5 */ type record HomeAgentAddressDiscoveryRequest { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpHomeAgentAddressDiscoveryRequest), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 144)"; } /* * @desc Derived from RFC3775, clause 6.6 */ type record HomeAgentAddressDiscoveryReply { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpHomeAgentAddressDiscoveryReply), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved, Ipv6AddressList homeAgentAddresses } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 145)"; } /* * @desc Derived from RFC3775, clause 6.7 */ type record MobilePrefixSolicitation { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpMobilePrefixSolicitation), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 reserved } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 146)"; } /* * @desc Derived from RFC3775, clause 6.8 * @remark MipPrefixInfoList type is a modification * of PrefixAdvertisement specified in RFC2461! */ type record MobilePrefixAdvertisement { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipIcmpMobilePrefixAdvertisement), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt1 mFlag, UInt1 oFlag, UInt14 reserved, MipPrefixInfoList mipPrefixInfoList } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 147)"; } /* * @desc Derived from RFC3775, clause 7.1 * @remark MipRouterAdvertisement type is a modification * of RouterAdvertisement specified in RFC2461 clause 4.2! */ type record MipRouterAdvertisement { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, UInt8 icmpType(c_mipRtAdv), UInt8 icmpCode, Oct2 checksum, UInt8 curHopLimit, UInt1 mFlag, UInt1 oFlag, UInt1 hFlag, UInt5 reserved, UInt16 routerLifetime, UInt32 reachableTime, UInt32 retransTimer, MipRtAdvOptions mipRtAdvOptions optional } with { encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)"; } /* * @remark At least one of these options shall be present * in any MipRtAdvOptions value! */ type set MipRtAdvOptions { //Imported SrcLinkLayerAddress mipSrcLinkLayerAddr optional, MtuOption mipMtuOption optional, //Not imported MipPrefixInfoList mipPrefixInfoList optional } // At least one of these options shall be present } //end icmpRFC3775Packets group icmpRFC3775Options { type set length (1..c_maxNrMipPrefixInfo) of MipPrefixInfo MipPrefixInfoList with { encode "elements=valueOf(getTag('hdrExtLen'));" } /* * @desc Derived from RFC3775, clause 7.2 * @remark MipPrefixInfo type is a modification * of PrefixInfo specified in RFC2461 clause 4.6.2! */ type record MipPrefixInfo { UInt8 icmpType(c_mipPrefixInfo), UInt8 optionLength, UInt8 prefixLength, UInt1 linkFlag, UInt1 aFlag, //autoConfigFlag, UInt1 rFlag, //routerAddress, added flag UInt5 reserved1, UInt32 validLifetime, UInt32 preferredLifetime, UInt32 reserved2, Ipv6Address addrPrefix } } // end icmpRFC3775Options } // end module LibIpv6_Rfc3775Mipv6_TypesAndValues