Constructor
new ICMP(data, opts)
Parameters:
PropertiesName | Type | Description |
---|---|---|
data | Buffer | | Input buffer or object with protocol fields |
opts | Object | Options for the layer |
Name | Type | Description |
---|---|---|
type | number | ICMP message type (see ICMPTypes) |
code | number | ICMP message code |
checksum | number | ICMP checksum |
- Implements
- Source
Members
isDestinationUnreachable
Check if this is a Destination Unreachable message
- Source
isEchoReply
Check if this is an Echo Reply message
- Source
isEchoRequest
Check if this is an Echo Request message
- Source
isParameterProblem
Check if this is a Parameter Problem message
- Source
isTimeExceeded
Check if this is a Time Exceeded message
- Source
isTimestampReply
Check if this is a Timestamp Reply message
- Source
isTimestampRequest
Check if this is a Timestamp Request message
- Source
length :number
Number of bytes occupied by the layer.
Type:
- number
- Implements
- Source
osi :OsiModelLayers
Respective protocol OSI layer.
Type:
- Implements
- Source
typeName
Get the name of the ICMP message type
- Source
Methods
calculateChecksum()
Calculates and updates the checksum for the IPv4 layer. This method mutates the object by setting the `checksum` property based on the current state of the `buffer`.
- Source
toObject() → {Object}
Returns an object with all protcol fields without owning the underlying buffer. Useful to read all the data and use it without having to deal with binary representation.
- Implements
- Source
Returns:
- All protocol fields
- Type:
- Object
(static) toAlloc(data) → {number}
Get the required allocation size based on ICMP message type
Parameters:
Name | Type | Description |
---|---|---|
data | Object | The data object containing type and other fields |
- Source
Returns:
Required allocation size
- Type:
- number