Constructor
new ARP(data, opts)
Parameters:
PropertiesName | Type | Description |
---|---|---|
data | Buffer | | Input buffer or object with protocol fields. |
opts | LayerOptions | Options for the layer. |
Name | Type | Description |
---|---|---|
hardwareType | number | Hardware type (HTYPE) |
protocolType | number | Protocol type (PTYPE) |
hardwareSize | number | Hardware address length (HLEN) |
protocolSize | number | Protocol length (PLEN) |
opcode | 'who-has' | | Specifies the operation that the sender is performing: 1 (::ARP_REQUEST) for request, 2 (::ARP_REPLY) for reply |
hardwareSrc | string | Sender hardware address (SHA) |
protocolSrc | string | Sender protocol address (SPA) |
hardwareDst | string | Target hardware address (THA) |
protocolDst | string | Target protocol address (TPA) |
- Implements
- Source
Members
hardwareDst :string
The destination mac address in human-readable format.
Type:
- string
- Source
hardwareSrc :string
The source mac address in human-readable format.
Type:
- string
- Source
opcode
- Source
osi :OsiModelLayers
Respective protocol OSI layer.
Type:
- Implements
- Source
protocolDst :string
The destination internet address in human-readable format.
Type:
- string
- Source
protocolSrc :string
The source internet address in human-readable format.
Type:
- string
- Source
Methods
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