Skip to content
Object stream transform that parses ethernet frame headers.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
package.json
stream.js

README.md

ether-stream

Object stream transform that parses ethernet frame headers.

Build Status

Example

var EtherStream = require('ether-stream');
var PcapStream = require('pcap-stream');

var pstream = new PcapStream(PCAP_FILE);
var estream = new EtherStream();

pstream.pipe(estream).on('readable', function() {
  var msg = estream.read();
  msg.ether.src === '12:34:56:65:43:21';  // ether frame available as .ether
  msg.ether.dst === '98:76:54:32:10:01';
  msg.ether.type === 'ip';
  var iph = new IpHeader(msg.data);       // extract payload available at .data
});
estream.read(0);
Something went wrong with that request. Please try again.