Commit 3a24fb7b authored by tepelmann's avatar tepelmann
Browse files

New f_getDestinationUnreachableAfterUdpPacket.

New f_echoProcUp_withHopL255Len1500 - should be used instead of f_echoProcUp_withHopL255Len1280.
parent 066c7ffe
Loading
Loading
Loading
Loading
+105 −28
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_Rfc2463Icmpv6_Templates all;
	import from LibIpv6_Rfc2463Icmpv6_Templates all;
	import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all;
	import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all;
	import from LibIpv6_Rfc0768Udp_Functions all;
	
	
	/**
	/**
	 * @desc  	This sends an ICMPv6 echo request from an IPv6 node to 
	 * @desc  	This sends an ICMPv6 echo request from an IPv6 node to 
@@ -197,7 +198,7 @@
	 *			and waits for a Destination Unreachable message for a fixed amount of time. 
	 *			and waits for a Destination Unreachable message for a fixed amount of time. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_echoRequest Template of the Echo Request to be sent
	 * @param 	p_echoRequest Template of the Echo Request to be sent
	 * @param 	p_destUnreachable Template of the Packet Too Big message that is expected
	 * @param 	p_destUnreachable Template of the Destination Unreachable message that is expected
	 * @return 	execution status
	 * @return 	execution status
	*/
	*/
	function f_getDestinationUnreachableAfterEchoReq (
	function f_getDestinationUnreachableAfterEchoReq (
@@ -224,6 +225,37 @@


		} // end f_getDestinationUnreachableAfterEchoReq
		} // end f_getDestinationUnreachableAfterEchoReq


	/**
	 * @desc 	This sends an UDP packet from an IPv6 node to any NUT,
	 *			and waits for a Destination Unreachable message for a fixed amount of time. 
	 * @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	 * @param 	p_udpPacket Template of the UDP packet to be sent
	 * @param 	p_destUnreachable Template of the Destination Unreachable message that is expected
	 * @return 	execution status
	*/
	function f_getDestinationUnreachableAfterUdpPacket (
		template UdpPacket p_udpPacket,
		template DestinationUnreachable p_destUnreachable )
		runs on LibIpv6Node
		return FncRetCode {

			var FncRetCode v_ret;

			v_ret := f_sendUdpPacket ( p_udpPacket );

			if ( v_ret != e_success ) {return v_ret;}
			tc_ac.start;
			alt {
				[]	ipPort.receive ( p_destUnreachable )  {
						tc_ac.stop;	
						return e_success;
					}
				[]	tc_ac.timeout{
						return e_timeout;
					}		
			} // end alt

		} // end f_getDestinationUnreachableAfterEchoReq


	/**
	/**
	 * @desc 	This sends an ICMPv6 echo request from an IPv6 node to any
	 * @desc 	This sends an ICMPv6 echo request from an IPv6 node to any
@@ -436,8 +468,6 @@


	}//end f_getParameterProblemAfterEchoReq_ignoreEchoReply
	}//end f_getParameterProblemAfterEchoReq_ignoreEchoReply


	

	/**
	/**
	 * @desc 	This sends an ICMPv6 echo request from an IPv6 node to any
	 * @desc 	This sends an ICMPv6 echo request from an IPv6 node to any
	 *			NUT, and waits for a echo reply for a fixed amount of time.
	 *			NUT, and waits for a echo reply for a fixed amount of time.
@@ -484,6 +514,53 @@
		return v_ret;
		return v_ret;
	} // End function f_echoProcUp_withHopL255Len1280
	} // End function f_echoProcUp_withHopL255Len1280


	/**
	 * @desc 	This sends an ICMPv6 echo request with data of MTU size(1500)-headers from an IPv6 node to any
	 *			NUT, and waits for a echo reply for a fixed amount of time.
	 *          This function can be used to verify that the NUT is
	 *			up and running. Neighbor detection is handled here, rather than in
	 *			a default. Might be useful if NUT must perform neighbor detection.
	 * @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_echoProcUp_withHopL255Len1500(
							in  template Ipv6Address p_llaAddrTn,
							in  template Ipv6Address p_llaAddrNut)
	runs on LibIpv6Node	return FncRetCode {

		var FncRetCode v_ret;
		var octetstring v_icmpData := int2oct(0, 1500-40-8); //1500: default MTU size, 40: IPv6 header length, 8: ICMPv6EchoRequestHeader
		v_ret := f_sendEchoRequest (
			m_echoRequest_noExtHdr_data_hop (
				p_llaAddrTn,
				p_llaAddrNut,
				c_hopLimit255,
				c_defId,
				c_defSeqNo,
				v_icmpData) );
	
		if ( v_ret == e_success ) {
			tc_ac.start;
				alt {
					[]	ipPort.receive (
							mw_echoReply_noExtHdr_data_hop (
								p_llaAddrNut,
								p_llaAddrTn,
								c_hopLimit255,
								v_icmpData ) ) {
							tc_ac.stop;
							return e_success;
						}
					[]	tc_ac.timeout{
							return e_timeout;
					}
			} // end alt
		} // End If
		return v_ret;
	} // End function f_echoProcUp_withHopL255Len1500

	/**
	/**
	 * @desc  	This sends other ICMPv6 packet from an IPv6 node to 
	 * @desc  	This sends other ICMPv6 packet from an IPv6 node to 
	 *          any IUT. Prior it modifies IPv6 packet payload length 
	 *          any IUT. Prior it modifies IPv6 packet payload length 
+33 −0
Original line number Original line Diff line number Diff line
/**
 *	@author 	STF 276
 *  @version 	$Id: LibIpv6_Rfc0768Udp_Functions.ttcn3,v 1.1 2010/11/05 14:11:15 dte Exp $
 *	@desc		This module specifies common function definitions
 *			  to specify UDP payloads for IPv6 packets	
 */
 module LibIpv6_Rfc0768Udp_Functions {

	//LibCommon
	import from LibCommon_VerdictControl all;

	//LibIpv6
	import from LibIpv6_Interface_Functions all;
	import from LibIpv6_Interface_TypesAndValues all;

	function f_sendUdpPacket (in template UdpPacket p_udpPacket) 
	runs on LibIpv6Node
	return FncRetCode {
		var UdpPacket v_ipPkt;
		v_ipPkt := valueof(p_udpPacket);

		if(f_setExtensionHeaders(	v_ipPkt ) != e_success) {
			log(" **** f_sendUdp: Error when calculating length of extension headers ****");
			return e_error;
		}
		
		//send
		ipPort.send(v_ipPkt);
	
		return e_success;
	
	}//end f_sendUdp
} // end module LibIpv6_Rfc0768Udp_Functions