Commit d08e2a21 authored by peter's avatar peter
Browse files

No commit message

No commit message
parent 476808a7
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -540,6 +540,36 @@
			redirectOptions := p_redirectOptions
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_hopLimit Hop limit value to be used in the IPv6 header.
		 *	@param  p_targetAddr Binary IPv6 address to be used as target
		 *          in redirect.
		 *	@param  p_destinationAddr Binary IPv6 address to be used as
		 *          destination in redirect.
		 *  @param  p_redirectOptions Redirect option value or template.
	    */
		template Redirect mw_redirect_hopLimit (
			Ipv6Address p_src,
			Ipv6Address p_dst,
			UInt8 p_hopLimit,
			Ipv6Address p_targetAddr,
			Ipv6Address p_destinationAddr,
			template RedirectOptions p_redirectOptions
		) := {
			ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := *,
			icmpType := c_redirect,
			icmpCode := c_icmpCode0,
			checksum := ?,
			reserved := 0,
			targetAddr := p_targetAddr,
			destinationAddr := p_destinationAddr,
			redirectOptions := p_redirectOptions
		}

 	} // end group redirect

	group options {
+32 −0
Original line number Diff line number Diff line
@@ -193,6 +193,38 @@

		} // end f_getPacketTooBigAfterEchoReq

	/*
	** @desc 	This sends an ICMPv6 echo request 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_echoRequest Template of the Echo Request to be sent
	** @param 	p_destUnreachable Template of the Packet Too Big message that is expected
	** @return 	execution status
	*/
	function f_getDestinationUnreachableAfterEchoReq (
		template EchoRequest p_echoRequest,
		template DestinationUnreachable p_destUnreachable )
		runs on LibIpv6Node
		return FncRetCode {

			var FncRetCode v_ret;

			v_ret := f_sendEchoRequest ( p_echoRequest );

			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
+20 −0
Original line number Diff line number Diff line
@@ -516,6 +516,26 @@
			data := p_data
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_icmpCode ICMPv6 type to be used
		*/
		template DestinationUnreachable mw_destUnreachable_code (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			template UInt8 p_icmpCode
		) := {
			ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := *,
			icmpType:= c_destinationUnreachable,
			icmpCode:= p_icmpCode,
			checksum:= ?,
			unused := '00000000'O,
			data := *
		}

	} // end group Destination_Unreachable

	group Packet_Too_Big {