Newer
Older
/*
* @author STF 276
* @version $Id$
* @desc This module specifies common template definitions
* to specify ICMPv6 packets
*
*/
module LibIpv6_Rfc2463Icmpv6_Templates {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIpv6
import from LibIpv6_ExternalFunctions all;
import from LibIpv6_ModuleParameters all ;
import from LibIpv6_MultiRfcs_TypesAndValues all;
import from LibIpv6_Rfc2460Root_TypesAndValues all;
import from LibIpv6_Rfc2460Root_Templates all;
import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all;
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_noExtHdr_hop (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
UInt8 p_icmpCode,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(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
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
template DestinationUnreachable mw_destUnreachable_code (
template Ipv6Address p_src,
template Ipv6Address p_dst,
template UInt8 p_icmpCode
) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
icmpType:= c_destinationUnreachable,
icmpCode:= p_icmpCode,
checksum:= ?,
unused := '00000000'O,
data := *
}
} // end group Destination_Unreachable
group ICMPv6_Echo_Reply {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply m_echoReply_noExtHdr_data ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
template octetstring p_data ) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoReply,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
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_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoReply m_echoReply_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
template EchoReply mw_echoReply ( template Ipv6Address p_src,
template Ipv6Address p_dst ) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := *,
icmpType:= c_echoReply,
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.
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(p_nextHeader, p_src, p_dst),
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply mw_echoReply_noExtHdr_data ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
template octetstring p_data ) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
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_hopLimit Number of hops to be used in IPv6 header.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply mw_echoReply_noExtHdr_data_hop (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
octetstring p_data
) := {
ipv6Hdr := mw_ipHdr_nextHdr_hop_srcDst ( c_icmpHdr, p_hopLimit, p_src, p_dst ),
extHdrList := *,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= ?,
sequenceNumber:= ?,
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_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoReply mw_echoReply_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
} // end group ICMPv6_Echo_Reply
group ICMPv6_Echo_Request {
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
ipv6Hdr := m_ipHdr_nextHdr_srcDst(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
}
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_hops Hop Limit value to be used.
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_extHdr_noData_hop (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hops,
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(p_nextHeader, p_hops, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data Data sent in the Echo Request packet.
*/
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
octetstring p_data
) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
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_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data Data sent in the Echo Request packet.
*/
template Ipv6Address p_src,
template Ipv6Address p_dst,
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hops, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
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_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_noExtHdr_noData_hop (
template Ipv6Address p_src,
template Ipv6Address p_dst,
in UInt8 p_hops,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hops, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
template EchoRequest mw_echoRequest ( template Ipv6Address p_src,
template Ipv6Address p_dst ) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= ?,
sequenceNumber:= ?,
data:= *
}
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest mw_echoRequest_extHdr_noData (
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest mw_echoRequest_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
} // end group ICMPv6_Echo_Request
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,
template Ipv6Address p_dst,
UInt8 p_icmpType,
UInt8 p_icmpCode ) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
} // end group ICMPv6_Other
group Packet_Too_Big {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
template PacketTooBig m_packetTooBig_noExtHdr_hop (
template Ipv6Address p_src,
template Ipv6Address p_dst,
) := {
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hopLimit, p_src, p_dst),
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_mtu MTU value to be sent.
*/
template PacketTooBig m_packetTooBig_noExtHdr_mtu_data (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt32 p_mtu,
octetstring p_data
) := {
ipv6Hdr := m_ipHdr_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
mtu := p_mtu,
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_nextHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
icmpCode:= p_icmpCode,
checksum:= ?,
mtu := ?,
data := *
/*
* @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
*/
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
UInt8 p_icmpCode,
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_parameterProblem,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
pointer := p_pointer,
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
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 to be used
* @param p_pointer ICMPv6 pointer to be used
template Ipv6Address p_dst,
UInt8 p_icmpCode,
UInt32 p_pointer
data := *
}
} // end group ICMPv6_Parameter_Problem
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
*/
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
ipv6Hdr := m_ipHdr_nextHdr_hop_srcDst(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_timeExceeded,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
unused := 0,
/*
* @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
*/
template TimeExceeded mw_timeExceeded_noExtHdr (template Ipv6Address p_src,
template Ipv6Address p_dst,