Ethernet

Ethernet protocol layer

Constructor

new Ethernet(data, opts)

Parameters:
NameTypeDescription
dataBuffer | ObjectInput buffer or object with protocol fields.
optsObjectOptions for the layer.
Properties
NameTypeDescription
srcstringSource MAC address.
dststringDestination MAC address.
typenumberProtocol type.
Implements

Members

dst :string

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

osi :OsiModelLayers

Respective protocol OSI layer.
Implements

src :string

The source mac 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