mtth / layer2 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello,
at first i might want to thank you for your work.
I was trying to live-capture some ethernet frames from the ethernet adapter attached to my MBP and log them, but i got nothing. Here is the code i've used:
var layer2 = require('layer2');
var capture = new layer2.capture.Live('en4');
var decoder = new layer2.Decoder({linkType: 'EN10MB'});
capture // Stream of buffers (frames' raw bytes).
.pipe(decoder) // Stream of objects (decoded frames).
.on('data', function (frame) { console.log(JSON.stringify(frame)); });
What did i do wrong?
Greets and thanks in advance,
Christian
In trying to install this package, I got the following error:
../src/cpp/pcap_wrapper.h:50:54: error: ‘Arguments’ in namespace ‘v8’ does not name a type
static v8::Handle<v8::Value> to_savefile(const v8::Arguments& args);
Sorry I couldn't check out the cause of this myself.
DId everything according to the instructions, twice.
After installing, I get this error when attempting to require('layer2')
:
return process.dlopen(module, path._makeLong(filename));
^
Error: libavrocpp.so.1.8.2.0: cannot open shared object file: No such file or di
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at /root/node_modules/layer2/lib/utils.js:26:10
at Object.<anonymous> (/root/node_modules/layer2/lib/utils.js:27:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
I'm running nodejs v8.11.3 on Debian 8.10.
Hi,
i have another question.
For the project i'm working on, i need tcpdump-style packet filtering. Here is the tcpdump-call what does the job:
$ tcpdump -i en4 ether proto 0x22f0
I something like this possible with the layer2 module?
I saw there is some filter related code in src/js/capture.js. When i naive tried to pass the filter as an option in the capture.Live constructor like this:
var capture = new layer2.capture.Live('en4', {filter: 'ether proto 0x22f0'});
all i got was an error:
> Error: link-layer multicast filters supported only on ethernet/FDDI/token ring/ARCNET/802.11/ATM LANE/Fibre Channel
Greets and thanks in advance,
Christian
Disclaimer: I do not use the package, this was found during automated npm packages downloading.
Your current package size is 20 MiB packed, 479 MiB unpacked. 475 MiB of that are inside the dat
dir and that space is taken mostly by *.pcap
files. I suspect that this probably got packed to the release by mistake.
If you don't want to pack that directory, add it to the .gitignore
and/or .npmingore
.
how install it to the windows platform?
eg :win8.1 x64
I install it onubuntu14.04 is ok!
I executed the installation instructions from the README and opted for the "npm run install-all" option. Everything installed correctly but, when I execute
var layer2 = require('layer2');
I receive the following error:
/export/home/cam/node_projects/mjpeg/node_modules/layer2/lib/sniffers.js:143
var wrapper = new utils.Wrapper().fromInterface(
^
Error: socket: Operation not permitted
at Error (native)
at Object.createInterfaceSniffer (/export/home/cam/node_projects/mjpeg/node_modules/layer2/lib/sniffers.js:143:37)
at Object. (/export/home/cam/node_projects/mjpeg/server.js:4:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
I looked through the code briefly but, nothing stood out to me. Any ideas ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.