/// ICMP with IPv4 payload and 64 bits IPv4 payload is valid if the datagram's length is OK, the checksum is correct, the code is in the expected range,
/// the IPv4 payload contains at least an IPv4 header and the IPv4's payload is in the expected size.
/// The pointer identifies the octet of the original datagram's header where the error was detected (it may be in the middle of an option).
/// For example, 1 indicates something is wrong with the Type of Service, and (if there are options present) 20 indicates something is wrong with the type code of the first option.
/// </summary>
publicbytePointer{get;set;}
/// <summary>
/// The value of this field determines the format of the remaining data.
/// </summary>
publicoverrideIcmpMessageTypeMessageType
{
get{returnIcmpMessageType.ParameterProblem;}
}
protectedoverrideuintValue
/// <summary>
/// A value that should be interpreted according to the specific message.
/// A sub-type of the message. Specific method of this message type.
/// </summary>
publicIcmpCodeRedirectCode{get;set;}
publicIpV4AddressGatewayInternetAddress{get;set;}
/// <summary>
/// Address of the gateway to which traffic for the network specified in the internet destination network field of the original datagram's data should be sent.
/// </summary>
publicIpV4AddressGatewayInternetAddress{get;set;}
/// <summary>
/// The value of this field determines the format of the remaining data.
/// </summary>
publicoverrideIcmpMessageTypeMessageType
{
get{returnIcmpMessageType.Redirect;}
}
/// <summary>
/// A sub-type of the message. Specific method of this message type.
/// </summary>
publicoverridebyteCodeValue
{
get
{
return(byte)Code;
}
get{return(byte)Code;}
}
protectedoverrideuintValue
/// <summary>
/// A value that should be interpreted according to the specific message.
/// Creates an instance using the given router address and preference.
/// </summary>
/// <param name="routerAddress">The sending router's IP address(es) on the interface from which this message is sent.</param>
/// <param name="routerAddressPreference">The preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. A signed, twos-complement value; higher values mean more preferable.</param>
/// The sending router's IP address(es) on the interface from which this message is sent.
/// </summary>
publicIpV4AddressRouterAddress
{
get{return_routerAddress;}
}
/// <summary>
/// The preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. A signed, twos-complement value; higher values mean more preferable.
/// </summary>
publicintRouterAddressPreference
{
get{return_routerAddressPreference;}
}
/// <summary>
/// Two entries are equal if they have the same router address and preference.
/// The Return Hop Count as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent.
/// </summary>
publicushortReturnHopCount{get;set;}
/// <summary>
/// The speed, in OCTETS per second, of the link over which the Outbound/Return Packet will be sent.
/// Since it will not be long before network speeds exceed 4.3Gb/s, and since some machines deal poorly with fields longer than 32 bits, octets per second was chosen over bits per second.
/// If this value cannot be determined, the field should be set to zero.
/// </summary>
publicuintOutputLinkSpeed{get;set;}
/// <summary>
/// The MTU, in bytes, of the link over which the Outbound/Return Packet will be sent.
/// MTU refers to the data portion (includes IP header; excludes datalink header/trailer) of the packet.
/// If this value cannot be determined, the field should be set to zero.
/// Represents an IGMP layer that contains a Group Address.
/// <seealso cref="IgmpDatagram"/>
/// </summary>
publicinterfaceIIgmpLayerWithGroupAddress
{
/// <summary>
/// The Group Address field is set to zero when sending a General Query,
/// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
/// In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left.
/// In a Membership Report of version 3 this field is meaningless.
/// The Group Address field is set to zero when sending a General Query,
/// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
/// In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left.
/// In a Membership Report of version 3 this field is meaningless.
/// When set to one, the S Flag indicates to any receiving multicast routers that they are to suppress the normal timer updates they perform upon hearing a Query.
/// It does not, however, suppress the querier election or the normal "host-side" processing of a Query
/// that a router may be required to perform as a consequence of itself being a group member.
/// If non-zero, the QRV field contains the [Robustness Variable] value used by the querier, i.e., the sender of the Query.
/// If the querier's [Robustness Variable] exceeds 7, the maximum value of the QRV field, the QRV is set to zero.
/// Routers adopt the QRV value from the most recently received Query as their own [Robustness Variable] value,
/// unless that most recently received QRV was zero, in which case the receivers use the default [Robustness Variable] value or a statically configured value.
/// </summary>
publicbyteQueryRobustnessVariable{get;set;}
/// <summary>
/// The actual interval, called the Querier's Query Interval (QQI).
/// </summary>
publicTimeSpanQueryInterval{get;set;}
/// <summary>
/// The Source Address [i] fields are a vector of n IP unicast addresses,
/// where n is the value in the Number of Sources (N) field.
/// Creates an instance with the given group records.
/// </summary>
/// <param name="groupRecords">
/// Each Group Record is a block of fields containing information pertaining to the sender's membership in a single multicast group on the interface from which the Report is sent.
/// Each Group Record is a block of fields containing information pertaining to the sender's membership in a single multicast group on the interface from which the Report is sent.
/// The Group Address field is set to zero when sending a General Query,
/// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
/// In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left.
/// In a Membership Report of version 3 this field is meaningless.
/// </summary>
publicIpV4AddressGroupAddress{get;set;}
/// <summary>
/// The number of bytes this layer will take.
/// </summary>
publicoverrideintLength
{
get{returnIgmpDatagram.HeaderLength;}
}
/// <summary>
/// Writes the layer to the buffer.
/// This method ignores the payload length, and the previous and next layers.
/// </summary>
/// <param name="buffer">The buffer to write the layer to.</param>
/// <param name="offset">The offset in the buffer to start writing the layer at.</param>
/// This class is used to build different packets.
/// Packets are built from layers.
/// This class can be used using static Build methods by giving the Packet's timestamp and layers.
/// This class can be instantiated with different layers and then use the Build method by only giving the Packet's timestamp.
/// If a layer that an instance of this class holds is modified, the PacketBuilder instance will create different packets.
/// <example>This sample shows how to create ICMP Echo Request packets to different servers with different IP ID and ICMP sequence numbers and identifiers.
/// <code>
/// EthernetLayer ethernetLayer = new EthernetLayer
/// {
/// Source = new MacAddress("00:01:02:03:04:05"),
/// Destination = new MacAddress("A0:A1:A2:A3:A4:A5")
/// };
///
/// IpV4Layer ipV4Layer = new IpV4Layer
/// {
/// Source = new IpV4Address("1.2.3.4"),
/// Ttl = 128,
/// };
///
/// IcmpEchoLayer icmpLayer = new IcmpEchoLayer();
///
/// PacketBuilder builder = new PacketBuilder(ethernetLayer, ipV4Layer, icmpLayer);
///
/// List<Packet> packets = new List<Packet>();
///
/// for (int i = 0; i != 100; ++i)
/// {
/// ipV4Layer.Destination = new IpV4Address("2.3.4." + i);