Commit 4d0d9fa6 authored by schmitting's avatar schmitting
Browse files

First half og RFC2765 donme

parent 839711bd
Loading
Loading
Loading
Loading
+112 −2
Original line number Original line Diff line number Diff line
@@ -1400,7 +1400,7 @@ module LibIpv6_Interface_Templates {
		group ipv4HeaderTemplates {
		group ipv4HeaderTemplates {


			/*
			/*
			 *	@param  p_nextHdr Next header identifier value to be used.
			 *	@param  p_protocol Protocol value to be used.
			 *	@param  p_src Binary IPv6 address associated with the
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
@@ -1428,7 +1428,64 @@ module LibIpv6_Interface_Templates {
			}
			}


			/*
			/*
			 *	@param  p_nextHdr Next header identifier value to be used.
			 *	@param  p_protocol Protocol value to be used.
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			*/
			template Ipv4Header m_ipv4Hdr_protocol_srcDst_df(
				UInt1 p_doNotFragFlag,
				UInt8 p_protocol,
				template Ipv4Address p_src,
				template Ipv4Address p_dst			
			) := {
				version := c_ipv4Version,
				headerLength := c_defaultIhsLength,
				typeOfService := c_defaultTos,
				totalLength := c_uInt16Zero,
				identification := c_defaultIdentification,
				reserved := c_uInt1Zero,
				doNotFragFlag := p_doNotFragFlag,
				moreFragsFlag := c_moreFragsFlag0,
				fragmentOffset := c_uInt13Zero,
				timeToLive := c_ttl255,
				protocol := p_protocol,
				hcs := c_2ZeroBytes,
				sourceAddress := p_src,
				destinationAddress := p_dst,
				ipv4HdrOptions := omit
			}

			/*
			 *	@param  p_protocol Protocol value to be used.
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			*/
			template Ipv4Header m_ipv4Hdr_protocol_srcDst_option(
				UInt8 p_protocol,
				template Ipv4Address p_src,
				template Ipv4Address p_dst
			) := {
				version := c_ipv4Version,
				headerLength := 6,
				typeOfService := c_defaultTos,
				totalLength := c_uInt16Zero,
				identification := c_defaultIdentification,
				reserved := c_uInt1Zero,
				doNotFragFlag := c_doNotFragFlag1,
				moreFragsFlag := c_moreFragsFlag0,
				fragmentOffset := c_uInt13Zero,
				timeToLive := c_ttl255,
				protocol := p_protocol,
				hcs := c_2ZeroBytes,
				sourceAddress := p_src,
				destinationAddress := p_dst,
				ipv4HdrOptions := '88040123'O // abritrary Stream Identifier option, header length = 6 * 32 bit)
			}

			/*
			 *	@param  p_protocol Protocol value to be used.
			 *	@param  p_src Binary IPv6 address associated with the
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
@@ -1498,4 +1555,57 @@ module LibIpv6_Interface_Templates {
		
		
	}//end rfc791Templates
	}//end rfc791Templates


	group rfc2765Templates {

			/*
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			*/
			template Ipv6Header mw_ipHdr_nextHdr_fragment(
				template Ipv6Address p_src,
				template Ipv6Address p_dst) := {
				version := c_ipv6Version,
				trafficClass := ?,
				flowLabel := c_flowLabel0,
				payloadLength := ?,
				nextHeader := c_fragHdr,
				hopLimit := c_hopLimit255,
				sourceAddress := p_src,
				destinationAddress := p_dst
			}

			/*
			 *	@param  p_src Binary IPv6 address associated with the
			 *          test component.
			 *	@param  p_dst Binary IPv6 address associated with NUT.
			*/
			template Ipv6Header mw_ipHdr_nextHdr_noFragment(
				template Ipv6Address p_src,
				template Ipv6Address p_dst) := {
				version := c_ipv6Version,
				trafficClass := ?,
				flowLabel := c_flowLabel0,
				payloadLength := ?,
				nextHeader := c_icmpHdr,
				hopLimit := c_hopLimit255,
				sourceAddress := p_src,
				destinationAddress := p_dst
			}

			/*
			 *	@param  p_moreFlag indicates whether there are more segment or not
			*/
			template ExtensionHeader mw_extHdr_fragmentHeader(
				UInt1 p_moreFlag) := {
				fragmentHeader := {
					nextHeader := c_icmpHdr,
					reserved1 := ?,
					fragmentOffset := ?,
					reserved2 := ?,
					moreFlag := p_moreFlag,
					identification := ? }
			}

	}//end rfc2765Templates
} // end module LibIpv6_Interface_Templates
} // end module LibIpv6_Interface_Templates
+88 −6
Original line number Original line Diff line number Diff line
@@ -1175,6 +1175,76 @@ group ipv4Definitions {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,0)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,0)";
		}
		}


		type Ipv4Packet Ipv4InformationRequest
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,F)";
		}

		type Ipv4Packet Ipv4InformationReply
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,2,10)";
		}

		type Ipv4Packet Ipv4TimestampRequest
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,D)";
		}

		type Ipv4Packet Ipv4TimestampReply
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,E)";
		}

		type Ipv4Packet Ipv4MaskRequest
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,2,11)";
		}

		type Ipv4Packet Ipv4MaskReply
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,2,12)";
		}

		type Ipv4Packet Ipv4RouterAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,9)";
		}

		type Ipv4Packet Ipv4RouterSolicitation
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,A)";
		}

		type Ipv4Packet Ipv4Unknown
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,2,63)";
		}

		type Ipv4Packet Ipv4DestinationUnreachable
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,0)";
		}

		type Ipv4Packet Ipv4Redirect
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,5)";
		}

		type Ipv4Packet Ipv4SourceQuench
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,4)";
		}

		type Ipv4Packet Ipv4TimeExceeded
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,B)";
		}

		type Ipv4Packet Ipv4ParameterProblem
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,C)";
		}

	}//end ipv4Packets
	}//end ipv4Packets




@@ -1215,9 +1285,23 @@ group ipv4Definitions {
	group ipv4Payload {
	group ipv4Payload {
		
		
		type union Ipv4Payload  {
		type union Ipv4Payload  {
			//Imported from Rfc 792
			//Imported from RFC792
			Ipv4EchoRequestMsg	   	      ipv4EchoRequestMsg,
			Ipv4EchoRequestMsg	   	      ipv4EchoRequestMsg,
			Ipv4EchoReplyMsg	          ipv4EchoReplyMsg,
			Ipv4EchoReplyMsg	          ipv4EchoReplyMsg,
			Ipv4InformationRequestMsg     ipv4InformationRequestMsg,
			Ipv4InformationReplyMsg	      ipv4InformationReplyMsg,
			Ipv4TimestampRequestMsg	      ipv4TimestampRequestMsg,
			Ipv4TimestampReplyMsg	      ipv4TimestampReplyMsg,
			Ipv4MaskRequestMsg		      ipv4MaskRequestMsg,
			Ipv4MaskReplyMsg		      ipv4MaskReplyMsg,
			Ipv4RouterAdvertisementMsg    ipv4RouterAdvertisementMsg,
			Ipv4RouterSolicitationMsg     ipv4RouterSolicitationMsg,
			Ipv4UnknownMsg			      ipv4UnknownMsg,
			Ipv4DestinationUnreachableMsg ipv4DestinationUnreachableMsg,
			Ipv4RedirectMsg			      ipv4RedirectMsg,
			Ipv4SourceQuenchMsg		   	  ipv4SourceQuenchMsg,
			Ipv4TimeExceededMsg		      ipv4TimeExceededMsg,
			Ipv4ParameterProblemMsg		  ipv4ParameterProblemMsg,
			//Imported from RFC2463
			//Imported from RFC2463
			Ipv6Packet				      ipv6Packet
			Ipv6Packet				      ipv6Packet
		}
		}
@@ -1227,6 +1311,4 @@ group ipv4Definitions {
	
	
}//end ipv4Definitions
}//end ipv4Definitions




} // end module LibIpv6_Interface_TypesAndValues
} // end module LibIpv6_Interface_TypesAndValues
+90 −2
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ module LibIpv6_Rfc2463Icmpv6_Templates {
			template Ipv6Address p_dst,
			template Ipv6Address p_dst,
			template UInt8 p_icmpCode) := {
			template UInt8 p_icmpCode) := {
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := *,
			extHdrList := omit,
			ipv6Payload := {
			ipv6Payload := {
				destinationUnreachableMsg := {
				destinationUnreachableMsg := {
					icmpType := c_destinationUnreachableMsg,
					icmpType := c_destinationUnreachableMsg,
@@ -640,6 +640,51 @@ module LibIpv6_Rfc2463Icmpv6_Templates {
					data := omit }
					data := omit }
			}
			}
		}
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_moreFlag indicates whether there are more segment or not
		*/
		template EchoRequest mw_echoRequest_extHdr_fragment(
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt1 p_moreFlag) := {
			ipv6Hdr := mw_ipHdr_nextHdr_fragment(p_src, p_dst),
			extHdrList := mw_extHdrList_1Elem_superSet(mw_extHdr_fragmentHeader(p_moreFlag)),
			ipv6Payload := {
				echoRequestMsg := {
					icmpType := c_echoRequestMsg,
					icmpCode := c_icmpCode0,
					checksum := ?,
					identifier := ?,
					sequenceNumber := ?,
					data := ? }
			}
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		*/
		template EchoRequest mw_echoRequest_extHdr_noFragment(
			template Ipv6Address p_src,
			template Ipv6Address p_dst) := {
			ipv6Hdr := mw_ipHdr_nextHdr_noFragment(p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				echoRequestMsg := {
					icmpType := c_echoRequestMsg,
					icmpCode := c_icmpCode0,
					checksum := ?,
					identifier := ?,
					sequenceNumber := ?,
					data := omit }
			}
		}

} // end group ICMPv6_Echo_Request
} // end group ICMPv6_Echo_Request
	
	
	group ICMPv6_EchoReplyMsg {
	group ICMPv6_EchoReplyMsg {
@@ -912,6 +957,26 @@ module LibIpv6_Rfc2463Icmpv6_Templates {
			}
			}
		}
		}


		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		*/
		template ParameterProblem mw_parameterProblem_noExtHdr(
			template Ipv6Address p_src,
			template Ipv6Address p_dst) := {
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := ?,
					checksum := ?,
					pointer := ?,
					data := * }
			}
		}

		/*
		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *          test component.
@@ -936,6 +1001,29 @@ module LibIpv6_Rfc2463Icmpv6_Templates {
			}
			}
		}
		}


		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_icmpCode ICMPv6 code to be used
		 *	@param  p_pointer ICMPv6 pointer to be used
		*/
		template ParameterProblem mw_parameterProblem_code(
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_icmpCode) := {
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := p_icmpCode,
					checksum := ?,
					pointer := ?,
					data := * }
			}
		}

		/*
		/*
		 *  @param  p_nextHeader
		 *  @param  p_nextHeader
		 *	@param  p_src Binary IPv6 address associated with the
		 *	@param  p_src Binary IPv6 address associated with the
+463 −3
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
	import from LibIpv6_ExternalFunctions all;
	import from LibIpv6_ExternalFunctions all;
	import from LibIpv6_Rfc792Icmpv4_Templates all;
	import from LibIpv6_Rfc792Icmpv4_Templates all;
	import from LibIpv6_Rfc792Icmpv4_TypesAndValues all;
	import from LibIpv6_Rfc792Icmpv4_TypesAndValues all;
	import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all;
	import from LibIpv6_Rfc2463Icmpv6_Templates all;
	import from LibIpv6_Rfc2463Icmpv6_Templates all;
	import from LibIpv6_Rfc2461NeighborDiscovery_Templates {template all};
	import from LibIpv6_Rfc2461NeighborDiscovery_Templates {template all};
	import from LibIpv6_Rfc2461NeighborDiscovery_Functions all;
	import from LibIpv6_Rfc2461NeighborDiscovery_Functions all;
@@ -380,4 +381,463 @@


	}//end f_receiveNoEncapsulatedAnswer_4
	}//end f_receiveNoEncapsulatedAnswer_4
	
	
	/*
	 * @desc 	This checks that a translated and fragmented packet is received. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_llaAddrTn Local link address of testing node which calls this function 
	 * @param 	p_llaAddrNut Local link address of node under test
	 * @return 	execution status
	*/
	function f_waitFragmentedPacket_6(
								  in  template Ipv6Address 	p_llaAddrTn,
								  in  template Ipv6Address 	p_llaAddrNut)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;
		var boolean v_firstFrag := false;

		tc_ac.start;
		alt {
			[]	ipPort.receive(mw_echoRequest_extHdr_fragment ( p_llaAddrNut,
																p_llaAddrTn,
																c_moreFragments)) {
					
					v_firstFrag := true;
					repeat;
			}

			[]	ipPort.receive(mw_echoRequest_extHdr_fragment ( p_llaAddrNut,
																p_llaAddrTn,
																c_noMoreFragments)) {
					tc_ac.stop;
					if (v_firstFrag)
						{v_ret := e_success;}
					else
						{log("**** f_waitFragmentedPacket: First fragment was not received. ****");}

			}

			[]	tc_ac.timeout{
					log("**** f_waitFragmentedPacket: Timeout, no message received. ****");
					return e_timeout;
				}		
		} // end alt
		return v_ret;

	} // end f_waitFragmentedPacket

	/*
	 * @desc 	This checks that a translated and unfragmented packet is received, Fragment header present. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_llaAddrTn Local link address of testing node which calls this function 
	 * @param 	p_llaAddrNut Local link address of node under test
	 * @return 	execution status
	*/
	function f_waitTranslatedPacketFragmentHeader_6(
								  in  template Ipv6Address 	p_llaAddrTn,
								  in  template Ipv6Address 	p_llaAddrNut)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;
		var EchoRequest v_EchoRequest;

		tc_ac.start;
		alt {
			[]	ipPort.receive(mw_echoRequest_extHdr_fragment ( p_llaAddrNut,
																p_llaAddrTn,
																c_moreFragments)) -> value v_EchoRequest
			{
					tc_ac.stop;
					if (v_EchoRequest.ipv6Hdr.payloadLength == 96) 
					// 96 = IPv4 total length (108) + fragment header length (8) - IPv4 header length (20)
						{v_ret := e_success;}
					else
						{log("**** f_waitTranslatedPacketFragmentHeader: Message has incorrect length value. ****");}

			}

			[]	tc_ac.timeout{
					log("**** f_waitTranslatedPacketFragmentHeader: Timeout, no message received. ****");
					return e_timeout;
				}		
		} // end alt
		return v_ret;

	} // end f_waitTranslatedPacketFragmentHeader

	/*
	 * @desc 	This checks that a translated and unfragmented packet is received, Fragment header not present. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_llaAddrTn Local link address of testing node which calls this function 
	 * @param 	p_llaAddrNut Local link address of node under test
	 * @return 	execution status
	*/
	function f_waitTranslatedPacketNoFragmentHeader_6(
								  in  template Ipv6Address 	p_llaAddrTn,
								  in  template Ipv6Address 	p_llaAddrNut)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;
		var EchoRequest v_EchoRequest;

		tc_ac.start;
		alt {
			[]	ipPort.receive(mw_echoRequest_extHdr_noFragment ( p_llaAddrNut,
																  p_llaAddrTn)) -> value v_EchoRequest
			{
					tc_ac.stop;
					if (v_EchoRequest.ipv6Hdr.payloadLength == 88) 
					// 8 = IPv4 total length (108) - IPv4 header length (20)
						{v_ret := e_success;}
					else
						{log("**** f_waitTranslatedPacketNoFragmentHeader: Message has incorrect length value. ****");}

			}

			[]	tc_ac.timeout{
					log("**** f_waitTranslatedPacketNoFragmentHeader: Timeout, no message received. ****");
					return e_timeout;
				}		
		} // end alt
		return v_ret;

	} // end f_waitTranslatedPacketNoFragmentHeader

	/*
	 * @desc 	This checks that a translated packet is received. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_icmpType ICMPv6 packet to expect 
	 * @param 	p_llaAddrTn Local link address of testing node which calls this function 
	 * @param 	p_llaAddrNut Local link address of node under test
	 * @return 	execution status
	*/
	function f_waitTranslatedPacket_6(UInt8 p_icmpType,
								    template Ipv6Address 	p_llaAddrTn,
								  	template Ipv6Address 	p_llaAddrNut)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;

		tc_ac.start;
		alt {
			[p_icmpType == c_echoRequestMsg]	ipPort.receive(mw_echoRequest ( p_llaAddrNut,
												 			 					p_llaAddrTn))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[p_icmpType == c_echoReplyMsg]	ipPort.receive(mw_echoReply ( p_llaAddrNut,
												 			 			  p_llaAddrTn))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[p_icmpType == c_timeExceededMsg]	ipPort.receive(mw_timeExceeded_noExtHdr ( p_llaAddrNut,
												 			 			  				  p_llaAddrTn,
																						  ?))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[p_icmpType == c_parameterProblemMsg]	ipPort.receive(mw_parameterProblem_noExtHdr ( p_llaAddrNut,
												 			 							 		  p_llaAddrTn))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[]	tc_ac.timeout{
					log("**** f_waitTranslatedPacket: Timeout, no message received. ****");
					return e_timeout;
				}		
		} // end alt
		return v_ret;

	} // end f_waitTranslatedPacket

	/*
	 * @desc 	This checks that no packet is received. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @return 	execution status
	*/
	function f_discardPacket()
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;

		tc_ac.start;
		alt {
			[]	tc_ac.timeout{
					return e_success;
			}		
		} // end alt
		

	} // end f_discardPacket

	/*
	 * @desc 	An ICMPv4 packet with parametrized type is sent.
	 * @param	p_icmpType ICMPv4 packet to send
	 * @param	p_paramsRelayRt01 Address Information of Test Node 1
	 * @param	p_paramsHs02 Address Information of Test Node 2
	*/
	function f_sendPacketForTranslate_4(
		UInt8 p_icmpType,
		template Ipv6NodeParams p_paramsRelayRt01,
		template Ipv6NodeParams p_paramsHs02
	)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;

		if (p_icmpType == c_icmpType_ipv4EReq)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4EchoRequest_noData (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4ERep)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4EchoReply_noData (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4IReq)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4InformationRequest (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4IRep)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4InformationReply (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4TReq)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4TimestampRequest (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4TRep)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4TimestampReply (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4MReq)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4MaskRequest (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4MRep)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4MaskReply (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4RAdv)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4RouterAdvertisement (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4RSol)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4RouterSolicitation (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4Unkn)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4Unknown (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4Redi)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4Redirect (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4SQue)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4SourceQuench (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4TiEx)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4TimeExceeded (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if (p_icmpType == c_icmpType_ipv4PPro)
		{

			v_ret := f_sendIpv4Packet ( 
				m_ipv4ParameterProblem (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr)
			);
		}

		if(v_ret != e_success) {
			log("**** f_sendPacketForTranslate: Error:  Problem in f_sendIpv4Packet. ****");
		}

		return v_ret;

	}//end f_sendPacketForTranslate_4

	/*
	 * @desc 	This checks that a translated Destination Unreachable message is received. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_icmpCode ICMPv6 code to expect 
	 * @param 	p_llaAddrTn Local link address of testing node which calls this function 
	 * @param 	p_llaAddrNut Local link address of node under test
	 * @return 	execution status
	*/
	function f_waitTranslatedDestinationUnreachable_6(UInt8 p_icmpCode,
								    				  template Ipv6Address 	p_llaAddrTn,
								  					  template Ipv6Address 	p_llaAddrNut)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;
		var boolean v_codeOtherThan2Or5 := not ((p_icmpCode == c_ipv4IcmpCode2) or (p_icmpCode == c_ipv4IcmpCode5));

		tc_ac.start;
		alt {
			[v_codeOtherThan2Or5]	ipPort.receive(mw_destUnreachable_code ( p_llaAddrNut,
												 			 				 p_llaAddrTn,
																			 p_icmpCode))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[p_icmpCode == c_ipv4IcmpCode5]	ipPort.receive(mw_packetTooBig_noExtHdr_code ( p_llaAddrNut,
												 			 			  				   p_llaAddrTn,
																						   c_icmpCode0))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[p_icmpCode == c_ipv4IcmpCode2]	ipPort.receive(mw_parameterProblem_code ( p_llaAddrNut,
												 			 						  p_llaAddrTn,
																					  c_icmpCode1))
			{
					tc_ac.stop;
					v_ret:= e_success;
			}

			[]	tc_ac.timeout{
					log("**** f_waitTranslatedDestinationUnreachable: Timeout, no message received. ****");
					return e_timeout;
				}		
		} // end alt
		return v_ret;

	} // end f_waitTranslatedPacket

	/*
	 * @desc 	An ICMPv4 Destination Unreachable message with parametrized code is sent.
	 * @param	p_icmpCode ICMPv4 code to send
	 * @param	p_paramsRelayRt01 Address Information of Test Node 1
	 * @param	p_paramsHs02 Address Information of Test Node 2
	*/
	function f_sendDestinationUnreachableForTranslate_4(
		UInt8 p_icmpCode,
		template Ipv6NodeParams p_paramsRelayRt01,
		template Ipv6NodeParams p_paramsHs02
	)
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;

			v_ret := f_sendIpv4Packet ( 
				m_ipv4DestinationUnreachable (
					p_paramsRelayRt01.ipv4Addr,
					p_paramsHs02.ipv4Addr,
					p_icmpCode)
			);

		if(v_ret != e_success) {
			log("**** f_sendDestinationUnreachableForTranslate_4: Error:  Problem in f_sendIpv4Packet. ****");
		}

		return v_ret;

	}//end f_sendDestinationUnreachableForTranslate_4

} // end module LibIpv6_CommonTrans_Functions
} // end module LibIpv6_CommonTrans_Functions
+276 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading