0.2.0 • Published 11 years ago

ether-frame v0.2.0

Weekly downloads
59
License
-
Repository
github
Last release
11 years ago

ether-frame

Node module to manipulate ethernet frame headers.

Build Status

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();