Constructor
new Ethernet(data, opts)
Parameters:
PropertiesName | Type | Description |
---|---|---|
data | Buffer | | Input buffer or object with protocol fields. |
opts | Object | Options for the layer. |
Name | Type | Description |
---|---|---|
src | string | Source MAC address. |
dst | string | Destination MAC address. |
type | number | Protocol type. |
- Implements
- Source
Members
dst :string
The destination mac address in human-readable format.
Type:
- string
- Source
osi :OsiModelLayers
Respective protocol OSI layer.
Type:
- Implements
- Source
src :string
The source mac 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