IcmpHeader

IcmpHeader

class

ICMP message class

Note: receiver MUST NOT decapsulate the datagram from ICMP error messages, because their contents is conceptually truncated. decapsulate() would result in a "length became negative" error; use getEncapsulatedMsg() instead.

TODO: add originator id and sequence number and create an ICMPControlInfo

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
FieldsChunk class (no description)

Known subclasses

Name Type Description
IcmpEchoReply class (no description)
IcmpEchoRequest class (no description)

Fields

Name Type Description
chunkLength b
type IcmpType

1 byte

code int

1 byte

chksum int

2 bytes, RFC 1071

crcMode CrcMode
mutable bool
complete bool
correct bool
properlyRepresented bool
rawBin string[]
rawHex string[]
tags RegionTagSet::cObjectRegionTag[]

Source code

//
// ICMP message class
//
// Note: receiver MUST NOT decapsulate the datagram from ICMP error messages,
// because their contents is conceptually truncated. decapsulate() would result
// in a "length became negative" error; use getEncapsulatedMsg() instead.
//
// TODO: add originator id and sequence number and create an ICMPControlInfo
class IcmpHeader extends FieldsChunk
{
    chunkLength = B(8);
    IcmpType type;   // 1 byte
    int code = -1;                   // 1 byte
    int chksum = 0;                 // 2 bytes, RFC 1071
    CrcMode crcMode = CRC_MODE_UNDEFINED;
}

File: src/inet/networklayer/ipv4/IcmpHeader.msg