ethernet
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ethernet

Build Status codecov

Decodes Ethernet headers

Supports:

  • Plain Ethernet (destination, source, ethertype, payload)
  • 802.1Q tag (above properties, plus tag)
  • 802.1ad and QinQ double tag (stag and ctag)

Usage

Install:

npm install --save ethernet

Use (ES6 or TypeScript):

import decode from "ethernet";
 
let rawData = getRawFrameSomehow();
let headers = decode(rawData);
 
console.log(headers);
 
// { 
//   destination: '010203040506',
//   source: '0a0b0c0d0e0f',
//   tag: { tpid: 33024, tci: { pcp: 0, dei: 0, vid: 16 } }
//   ethertype: 2048,
//   payload: ...,
// }

Notes

Bugs? Please, file an issue, or submit a pull request!

License: PDDL-1.0

Readme

Keywords

Package Sidebar

Install

npm i ethernet

Weekly Downloads

2

Version

1.0.1

License

PDDL-1.0

Last publish

Collaborators

  • dancasey