IcmpHeader¶
Namespace: inet
class IcmpHeader
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¶
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
class |
(no description) |
Known subclasses¶
Name |
Type |
Description |
|---|---|---|
class |
(no description) |
|
class |
(no description) |
|
class |
(no description) |
Fields¶
Name |
Type |
Description |
|---|---|---|
id |
int |
|
mutable |
bool |
|
complete |
bool |
|
correct |
bool |
|
properlyRepresented |
bool |
|
chunkLength |
||
rawBin |
string[] |
|
rawHex |
string[] |
|
regionTags |
||
chunkLength |
||
type |
1 byte |
|
code |
int |
1 byte |
chksum |
int |
2 bytes, RFC 1071 |
checksumMode |
Properties¶
Name |
Value |
Description |
|---|---|---|
beforeChange |
handleChange() |
|
descriptor |
readonly |
|
existingClass |
||
packetData |
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
ChecksumMode checksumMode = CHECKSUM_MODE_UNDEFINED;
}