Commit 476808a7 authored by peter's avatar peter
Browse files

No commit message

No commit message
parent edd62317
Loading
Loading
Loading
Loading
+44 −1
Original line number Diff line number Diff line
@@ -121,6 +121,16 @@
		} // end alt
	} // end f_getIcmpAfterEchoReq
	
	/*
	** @desc 	This sends an ICMPv6 echo request from an IPv6 node to any NUT,
	**			and waits for a Time Exceeded message for a fixed amount of time. 
	** @remark  Time limit is defined by module parameter PX_TAC (see comp type)
	** @param 	p_hops Number of hops to be used in IPv6 header 
	** @param 	p_llaAddrTn Local link address of testing node which calls this function 
	** @param 	p_llaAddrNut Local link address of node under test 
	** @param 	p_llaAddrRut Local link address of router under test 
	** @return 	execution status
	*/
	function f_getTimeExceededAfterEchoReq( 	in  UInt8 			p_hops,
											in  Ipv6Address 	p_llaAddrTn,
											in  Ipv6Address 	p_llaAddrNut,
@@ -147,9 +157,42 @@
				[]	tc_ac.timeout{
						return e_timeout;
					}		
			} // end alt
			} // end al

		} // end f_getTimeExceedAfterEchoReq

	/*
	** @desc 	This sends an ICMPv6 echo request from an IPv6 node to any NUT,
	**			and waits for a Packet Too Big 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_packetTooBig Template of the Packet Too Big message that is expected
	** @return 	execution status
	*/
	function f_getPacketTooBigAfterEchoReq (
		template EchoRequest p_echoRequest,
		template PacketTooBig p_packetTooBig )
		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_packetTooBig )  {
						tc_ac.stop;	
						return e_success;
					}
				[]	tc_ac.timeout{
						return e_timeout;
					}		
			} // end alt

		} // end f_getPacketTooBigAfterEchoReq


	/*
	** @desc 	This sends an ICMPv6 echo request from an IPv6 node to any
+113 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
	
	/*
	** @desc  	This sends other ICMPv6 packet from an IPv6 node to 
	**          any NUT. Prior it modifies IPv6 packet payload length 
	**          any IUT. Prior it modifies IPv6 packet payload length 
	**			and ICMPv6 checksum to their correct values using external 
	**          functions.
	** @remark  The template passed in must NOT contain any matching expressions!
@@ -57,6 +57,118 @@
		
	} // end f_sendOtherIcmpv6

	/*
	** @desc  	This sends an ICMPv6 Destination Unreachable message to 
	**          any IUT. Prior it modifies IPv6 packet payload length 
	**			and ICMPv6 checksum to their correct values using external 
	**          functions.
	** @remark  The template passed in must NOT contain any matching expressions!
	** @param 	p_destUnreachable Ipv6 packet value or template with the Destination
	**			Unreachable message to be sent
	** @returns	execution status
	*/
	function f_sendDestUnreachable (in template DestinationUnreachable p_destUnreachable ) 
	runs on LibIpv6Node
	return FncRetCode {
		var Ipv6Packet v_ipPkt;
		v_ipPkt.destinationUnreachable := valueof(p_destUnreachable);
		//calc payloadLen
		v_ipPkt.destinationUnreachable.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt);
		//set checksum to zero
		v_ipPkt.destinationUnreachable.checksum := c_2ZeroBytes;
		//calc checksum
		v_ipPkt.destinationUnreachable.checksum := fx_icmpv6Checksum(v_ipPkt);
		//send
		ipPort.send(v_ipPkt.destinationUnreachable);
		
		return e_success;
		
	} // end f_sendDestUnreachable

	/*
	** @desc  	This sends an ICMPv6 Packet Too Big message to 
	**          any IUT. Prior it modifies IPv6 packet payload length 
	**			and ICMPv6 checksum to their correct values using external 
	**          functions.
	** @remark  The template passed in must NOT contain any matching expressions!
	** @param 	p_packetTooBig Ipv6 packet value or template with the Packet
	**			Too Big message to be sent
	** @returns	execution status
	*/
	function f_sendPacketTooBig (in template PacketTooBig p_packetTooBig ) 
	runs on LibIpv6Node
	return FncRetCode {
		var Ipv6Packet v_ipPkt;
		v_ipPkt.packetTooBig := valueof(p_packetTooBig);
		//calc payloadLen
		v_ipPkt.packetTooBig.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt);
		//set checksum to zero
		v_ipPkt.packetTooBig.checksum := c_2ZeroBytes;
		//calc checksum
		v_ipPkt.packetTooBig.checksum := fx_icmpv6Checksum(v_ipPkt);
		//send
		ipPort.send(v_ipPkt.packetTooBig);
		
		return e_success;
		
	} // end f_sendPacketTooBig

	/*
	** @desc  	This sends an ICMPv6 Packet Too Big message to 
	**          any IUT. Prior it modifies IPv6 packet payload length 
	**			and ICMPv6 checksum to their correct values using external 
	**          functions.
	** @remark  The template passed in must NOT contain any matching expressions!
	** @param 	p_timeExceeded Ipv6 packet value or template with the Time
	**			Exceeded message to be sent
	** @returns	execution status
	*/
	function f_sendTimeExceeded (in template TimeExceeded p_timeExceeded ) 
	runs on LibIpv6Node
	return FncRetCode {
		var Ipv6Packet v_ipPkt;
		v_ipPkt.timeExceeded := valueof(p_timeExceeded);
		//calc payloadLen
		v_ipPkt.timeExceeded.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt);
		//set checksum to zero
		v_ipPkt.timeExceeded.checksum := c_2ZeroBytes;
		//calc checksum
		v_ipPkt.timeExceeded.checksum := fx_icmpv6Checksum(v_ipPkt);
		//send
		ipPort.send(v_ipPkt.timeExceeded);
		
		return e_success;
		
	} // end f_sendTimeExceeded

	/*
	** @desc  	This sends an ICMPv6 Packet Too Big message to 
	**          any IUT. Prior it modifies IPv6 packet payload length 
	**			and ICMPv6 checksum to their correct values using external 
	**          functions.
	** @remark  The template passed in must NOT contain any matching expressions!
	** @param 	p_parameterProblem Ipv6 packet value or template with the Parameter
	**			Problem message to be sent
	** @returns	execution status
	*/
	function f_sendParameterProblem (in template ParameterProblem p_parameterProblem ) 
	runs on LibIpv6Node
	return FncRetCode {
		var Ipv6Packet v_ipPkt;
		v_ipPkt.parameterProblem := valueof(p_parameterProblem);
		//calc payloadLen
		v_ipPkt.parameterProblem.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt);
		//set checksum to zero
		v_ipPkt.parameterProblem.checksum := c_2ZeroBytes;
		//calc checksum
		v_ipPkt.parameterProblem.checksum := fx_icmpv6Checksum(v_ipPkt);
		//send
		ipPort.send(v_ipPkt.parameterProblem);
		
		return e_success;
		
	} // end f_sendParameterProblem

	/*
	** @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. 
+131 −4
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
	import from LibIpv6_Rfc2460Root_TypesAndValues all;
	import from LibIpv6_Rfc2460Root_Templates all;
	import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all;
	import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues_PK all;

	group ICMPv6_Echo_Request {

@@ -344,7 +345,7 @@
			extHdrList := omit,
			icmpType:= c_echoReply,
			icmpCode:= c_icmpCode0,
			checksum:= c_2ZeroBytes,
			checksum:= ?,
			identifier:= p_id,
			sequenceNumber:= p_seqNr,
			data:= p_data
@@ -373,6 +374,32 @@

	group ICMPv6_Parameter_Problem {

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_hopLimit Number of hops to be used in IPv6 header.
		 *	@param  p_icmpCode ICMPv6 type to be used
		 *	@param  p_pointer ICMPv6 pointer to be used
		 *	@param  p_data data in ICMPv6 Parameter Problem message.
		*/
		template ParameterProblem m_parameterProblem_hopLimit_noExtHdr (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_hopLimit,
			UInt8 p_icmpCode,
			UInt32 p_pointer,
			template octetstring p_data
		) := {
			ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_parameterProblem,
			icmpCode:= p_icmpCode,
			checksum:= c_2ZeroBytes,
			pointer := p_pointer,
			data := p_data
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
@@ -417,6 +444,30 @@

	group ICMPv6_Time_Exceeded {

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_hopLimit Number of hops to be used in IPv6 header.
		 *	@param  p_icmpCode ICMPv6 type to be used
		 *	@param  p_data data in ICMPv6 Time Exceeded message.
		*/
		template TimeExceeded m_timeExceeded_hopLimit_noExtHdr (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_hopLimit,
			UInt8 p_icmpCode,
			template octetstring p_data
		) := {
			ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_timeExceeded,
			icmpCode:= p_icmpCode,
			checksum:= c_2ZeroBytes,
			unused := 0,
			data := p_data
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
@@ -425,7 +476,7 @@
		*/
		template TimeExceeded mw_timeExceeded_noExtHdr (template Ipv6Address p_src,
														template Ipv6Address p_dst,
														UInt8 p_icmpCode ) := {
														template UInt8 p_icmpCode ) := {
			ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_timeExceeded,
@@ -439,13 +490,89 @@

// added by PK

	group ICMPv6_Other {
	group Destination_Unreachable {

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_hopLimit Number of hops to be used in IPv6 header.
		 *	@param  p_icmpCode ICMPv6 type to be used
		 *	@param  p_data data in ICMPv6 Destination Unreachable message.
		*/
		template DestinationUnreachable m_destUnreachable_hopLimit_noExtHdr (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_hopLimit,
			UInt8 p_icmpCode,
			template octetstring p_data
		) := {
			ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_destinationUnreachable,
			icmpCode:= p_icmpCode,
			checksum:= c_2ZeroBytes,
			unused := '00000000'O,
			data := p_data
		}

	} // end group Destination_Unreachable

	group Packet_Too_Big {

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_hopLimit Number of hops to be used in IPv6 header.
		 *	@param  p_data data in ICMPv6 Packet Too Big message.
		*/
		template PacketTooBig m_packetTooBig_hopLimit_noExtHdr (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_hopLimit,
			template octetstring p_data
		) := {
			ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_packetTooBig,
			icmpCode:= c_icmpCode0,
			checksum:= c_2ZeroBytes,
			mtu := c_mtu1280,
			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 Code value in the received message.
		*/
		template PacketTooBig mw_packetTooBig_noExtHdr_code (
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_icmpCode
		) := {
			ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			icmpType:= c_packetTooBig,
			icmpCode:= p_icmpCode,
			checksum:= ?,
			mtu := ?,
			data := *
		}

	} // end group Packet_Too_Big

// added by PK

	group ICMPv6_Other {

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_icmpType ICMPv6 type to be used
		 *	@param  p_icmpCode ICMPv6 code to be used
		*/
		template OtherIcmpv6Hdr m_otherIcmpv6Hdr_noExtHdr_noData (template Ipv6Address p_src,
+3 −3
Original line number Diff line number Diff line
@@ -43,10 +43,10 @@
		UInt32			reserved2,
		RrBody			rrBody optional
	}
	with {
		encode "isPDU=LibIpv6_Rfc2894RouterRenumbering_TypesAndValues;present=SupportFunctions.checkHeaderAndType(dec, 58, 138);import=com.testingtech.ttcn.tci.codec.helper.*;";
//	with {
//		encode "isPDU=LibIpv6_Rfc2894RouterRenumbering_TypesAndValues;present=SupportFunctions.checkHeaderAndType(dec, 58, 138);import=com.testingtech.ttcn.tci.codec.helper.*;";
//		encode (icmpCode) "tag=\"icmpCode\";";
	}
//	}
	


+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ module LibIpv6_MultiRfcs_TypesAndValues {
				padding := c_4ZeroBytes
			}
		}
	const octetstring c_genOptSize6_noTypeField := '01000102030405'O;
	const octetstring c_genOptSize6_noTypeField := '0400010203'O;

	} // end group commonConstants