ARP

ARP protocol layer

Constructor

new ARP(data, opts)

Parameters:
NameTypeDescription
dataBuffer | ObjectInput buffer or object with protocol fields.
optsLayerOptionsOptions for the layer.
Properties
NameTypeDescription
hardwareTypenumberHardware type (HTYPE)
protocolTypenumberProtocol type (PTYPE)
hardwareSizenumberHardware address length (HLEN)
protocolSizenumberProtocol length (PLEN)
opcode'who-has' | 'is-at'Specifies the operation that the sender is performing: 1 (::ARP_REQUEST) for request, 2 (::ARP_REPLY) for reply
hardwareSrcstringSender hardware address (SHA)
protocolSrcstringSender protocol address (SPA)
hardwareDststringTarget hardware address (THA)
protocolDststringTarget protocol address (TPA)
Implements

Members

hardwareDst :string

The destination mac address in human-readable format.
Type:
  • string

hardwareSrc :string

The source mac address in human-readable format.
Type:
  • string

opcode

osi :OsiModelLayers

Respective protocol OSI layer.
Implements

protocolDst :string

The destination internet address in human-readable format.
Type:
  • string

protocolSrc :string

The source internet address in human-readable format.
Type:
  • string

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
Returns:
- All protocol fields
Type: 
Object