LibIpv6_Rfc2463Icmpv6_Templates.ttcn 35.1 KB
Newer Older
vouffofeudji's avatar
vouffofeudji committed
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := p_icmpCode,
					checksum := c_2ZeroBytes,
					pointer := p_pointer,
					data := p_data }
			}
peter's avatar
peter committed
		}

		/*
		 *	@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
		 *	@param  p_data data in ICMPv6 Destination Unreachable message.
		*/
		template ParameterProblem m_parameterProblem_noExtHdr(
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			UInt8 p_icmpCode,
			octetstring p_data) := {
			ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := p_icmpCode,
					checksum := c_2ZeroBytes,
					pointer := c_icmpPointer24, //arbitrary pointer value
					data := p_data }
			}
		}

alex's avatar
alex committed
		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		*/
vouffofeudji's avatar
vouffofeudji committed
		template ParameterProblem mw_parameterProblem(
alex's avatar
alex committed
			template Ipv6Address p_src,
vouffofeudji's avatar
vouffofeudji committed
			template Ipv6Address p_dst) := {
peter's avatar
peter committed
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(?, p_src, p_dst),
vouffofeudji's avatar
vouffofeudji committed
			extHdrList := *,
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := ?,
					checksum := ?,
					pointer := ?,
					data := * }
			}
alex's avatar
alex committed
		}

schmitting's avatar
schmitting committed
		/*
		 *	@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 := * }
			}
		}

alex's avatar
alex committed
		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
peter's avatar
peter committed
		 *	@param  p_icmpCode ICMPv6 code to be used
		 *	@param  p_pointer ICMPv6 pointer to be used
alex's avatar
alex committed
		*/
vouffofeudji's avatar
vouffofeudji committed
		template ParameterProblem mw_parameterProblem_code_pointer(
alex's avatar
alex committed
			template Ipv6Address p_src,
peter's avatar
peter committed
			template Ipv6Address p_dst,
			UInt8 p_icmpCode,
vouffofeudji's avatar
vouffofeudji committed
			UInt32 p_pointer) := {
peter's avatar
peter committed
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(?, p_src, p_dst),
vouffofeudji's avatar
vouffofeudji committed
			extHdrList := *,
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := p_icmpCode,
					checksum := ?,
					pointer := p_pointer,
					data := * }
			}
alex's avatar
alex committed
		}

schmitting's avatar
schmitting committed
		/*
		 *	@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 := * }
			}
		}

berge's avatar
berge committed
		/*
		 *  @param  p_nextHeader
		 *	@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_extHdrList
		 *	@param  p_pointer ICMPv6 pointer to be used
		*/
vouffofeudji's avatar
vouffofeudji committed
		template ParameterProblem mw_parameterProblem_code_pointer_extHdr(
berge's avatar
berge committed
			UInt8 p_nextHeader,
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			template ExtensionHeaderList p_extHdrList,
			UInt8 p_icmpCode,
vouffofeudji's avatar
vouffofeudji committed
			UInt32 p_pointer) := {
berge's avatar
berge committed
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(p_nextHeader, p_src, p_dst),
			extHdrList := p_extHdrList,
vouffofeudji's avatar
vouffofeudji committed
			ipv6Payload := {
				parameterProblemMsg := {
					icmpType := c_parameterProblemMsg,
					icmpCode := p_icmpCode,
					checksum := ?,
					pointer := p_pointer,
					data := * }
			}
berge's avatar
berge committed
		}
alex's avatar
alex committed
	} // end group ICMPv6_Parameter_Problem
	group ICMPv6_Time_Exceeded {
peter's avatar
peter committed
		/*
		 *	@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
		*/
vouffofeudji's avatar
vouffofeudji committed
		template TimeExceeded m_timeExceeded_noExtHdr_hop(
peter's avatar
peter committed
			template Ipv6Address p_src,
vouffofeudji's avatar
vouffofeudji committed
			template Ipv6Address p_dst,
peter's avatar
peter committed
			UInt8 p_hopLimit,
validator's avatar
""  
validator committed
			UInt8 p_icmpCode,
vouffofeudji's avatar
vouffofeudji committed
			octetstring p_data) := {
			ipv6Hdr :=
				m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hopLimit, p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				timeExceededMsg := {
					icmpType := c_timeExceededMsg,
					icmpCode := p_icmpCode,
					checksum := c_2ZeroBytes,
					unused := 0,
					data := p_data }
			}
peter's avatar
peter committed
		}

		/*
		 *	@param  p_src Binary IPv6 address associated with the
		 *          test component.
		 *	@param  p_dst Binary IPv6 address associated with NUT.
		 *	@param  p_data data in ICMPv6 Destination Unreachable message.
		*/
		template TimeExceeded m_timeExceeded_noExtHdr(
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			octetstring p_data) := {
			ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
			extHdrList := omit,
			ipv6Payload := {
				timeExceededMsg := {
					icmpType := c_timeExceededMsg,
					icmpCode := c_icmpCode0,
					checksum := c_2ZeroBytes,
					unused := 0,
					data := p_data }
			}
		}

alex's avatar
alex committed
		/*
		 *	@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
		*/
vouffofeudji's avatar
vouffofeudji committed
		template TimeExceeded mw_timeExceeded_noExtHdr(
			template Ipv6Address p_src,
			template Ipv6Address p_dst,
			template UInt8 p_icmpCode) := {
peter's avatar
peter committed
			ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
vouffofeudji's avatar
vouffofeudji committed
			extHdrList := omit,
			ipv6Payload := {
				timeExceededMsg := {
					icmpType := c_timeExceededMsg,
					icmpCode := p_icmpCode,
					checksum := ?,
					unused := ?,
					data := * }
			}
alex's avatar
alex committed
		}
	} // end group ICMPv6_Time_Exceeded
} // end module LibIpv6_Rfc2463Icmpv6_Templates