ether-frame
v0.2.0
Published
Manipulate ethernet frame headers
Downloads
513
Readme
ether-frame
Node module to manipulate ethernet frame headers.
Work in progress. Example below is more API planning than actual support at this point. My current target is a simplistic implementation aiming at a simple IP payload without any fanciness like VLAN tagging, etc.
Example
var EtherFrame = require('ether-frame');
var ef = EtherFrame.fromBuffer(buf);
ef.src === '12:34:56:78'; // true
ef.dst === '98:76:54:32': // true
ef.type === 'ip'; // true
ef.bytes === 14; // true
var payload = buf.slice(ef.bytes);
var buf = ef.toBuffer();