Giter Site home page Giter Site logo

node-nfqueue's Introduction

node-nfqueue

This is a node.js binding to the linux netfilter NFQUEUE. It allows to filter packets thought a javascript program. This is done asynchronously using libuv poll.

Example

This small example allow one packet every two, and display IP header informations using the pcap binding to decode the payload (payload is provided as a javascript Buffer object by the wrapper, and this is what pcap library handle too)

var nfq = require('nfqueue');
var IPv4 = require('pcap/decode/ipv4');
var counter = 0;

nfq.createQueueHandler(1, function(nfpacket) {
  console.log("-- packet received --");
  console.log(JSON.stringify(nfpacket.info, null, 2));

  // Decode the raw payload using pcap library
  var packet = new IPv4().decode(nfpacket.payload, 0);
  // Protocol numbers, for example: 1 - ICMP, 6 - TCP, 17 - UDP
  console.log(
    "src=" + packet.saddr + ", dst=" + packet.daddr
    + ", proto=" + packet.protocol
  );

  // Set packet verdict. Second parameter set the packet mark.
  nfpacket.setVerdict((counter++ % 2) ? nfq.NF_DROP : nfq.NF_ACCEPT);

  // Or modify packet and set updated payload
  // nfpacket.setVerdict(nfq.NF_ACCEPT, null, nfpacket.payload);
});

For an icmp packet, and a nfqueuing in INPUT chain of filter table, it'll output something looking like :

packet received
{
  "len": 84,
  "id": 3,
  "nfmark": 0,
  "indev": 2,
  "physindev": 0,
  "outdev": 0,
  "physoutdev": 0,
  "indev_name": "eth0",
  "physintdev_name": "*",
  "outdev_name": "*",
  "physoutdev_name": "*"
}
src=10.33.15.1, dst=10.0.2.15, proto=1

Be careful, you must be root to open nfqueue handles. Here is an iptables command example to add a rule sending icmp to nfqueue #1 :

sudo iptables -I INPUT 1 -p icmp -j NFQUEUE --queue-num 1

Requirements

  • Linux kernel >= 2.6.30

Troubleshooting

Performance and ENOBUFS (No buffer space available)

With a large number of packets in the queue happens that the queue is destroyed due to a read error from the socket

recvfrom(20, 0x7fffab1d5b70, 65535, 0, 0, 0) = -1 ENOBUFS (No buffer space available)

recv() may return -1 and errno is set to ENOBUFS in case that your application is not fast enough to retrieve the packets from the kernel.

By default to avoid queue destroy we use socket option NETLINK_NO_ENOBUFS, it allows ignore packets instead destroy socket with error. https://patchwork.ozlabs.org/patch/24919/

To avoid packet loss you may increase default socket buffer size up to your need when create queue.

nfq.createQueueHandler(1, 67108864, function() {});

Default socket buffer size: 65535.

To improve your libnetfilter_queue application in terms of performance, you may consider the following tweaks:

  • increase the default socket buffer size. set nice value of your process to -20 (maximum priority).
  • set the CPU affinity of your process to a spare core that is not used to handle NIC interruptions.
  • use --queue-balance option in NFQUEUE target for multi-threaded apps (it requires Linux kernel >= 2.6.31).

http://www.netfilter.org/projects/libnetfilter_queue/doxygen/index.html

Author and license

Copyright (C) 2014 Anthony Hinsinger

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

node-nfqueue's People

Contributors

atoy40 avatar automation-stack avatar miegl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-nfqueue's Issues

Won't build on node v10

installing / rebuilding does not work since Node.JS 10 (10.9.0).
It works fine using the latest Node.JS 9.x version (9.11.2).

Here is the compile error:

../src/node_nfqueue.cpp:93:56: error: no matching function for call to ‘v8::Function::NewInstance(int, NULL)’
     info.GetReturnValue().Set(cons->NewInstance(0, NULL));
                                                        ^

Here is the full build log

> [email protected] install node_modules/nfqueue
> node-gyp rebuild

make: Entering directory 'node_modules/nfqueue/build'
  CXX(target) Release/obj.target/nfqueue/src/node_nfqueue.o
In file included from ../src/node_nfqueue.cpp:21:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2200:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
../src/node_nfqueue.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE nfqueue::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/node_nfqueue.cpp:93:56: error: no matching function for call to ‘v8::Function::NewInstance(int, NULL)’
     info.GetReturnValue().Set(cons->NewInstance(0, NULL));
                                                        ^
In file included from /home/compilenix/.node-gyp/10.9.0/include/node/node.h:63,
                 from ../src/node_nfqueue.cpp:20:
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:3976:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^~~~~~~~~~~
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:3976:44: note:   candidate expects 3 arguments, 2 provided
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:3979:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^~~~~~~~~~~
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:3979:44: note:   candidate expects 1 argument, 2 provided
../src/node_nfqueue.cpp: In static member function ‘static int nfqueue::nf_callback(nfq_q_handle*, nfgenmsg*, nfq_data*, void*)’:
../src/node_nfqueue.cpp:217:50: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
   Local<Value> ret = queue->callback.Call(2, argv);
                                                  ^
In file included from ../src/node_nfqueue.cpp:21:
../../nan/nan.h:1647:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/node_nfqueue.cpp:20:
../src/node_nfqueue.cpp: At global scope:
/home/compilenix/.node-gyp/10.9.0/include/node/node.h:541:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/compilenix/.node-gyp/10.9.0/include/node/node.h:575:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/node_nfqueue.cpp:251:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(nfqueue, initAll)
 ^~~~~~~~~~~
In file included from /home/compilenix/.node-gyp/10.9.0/include/node/node.h:63,
                 from ../src/node_nfqueue.cpp:20:
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/compilenix/.node-gyp/10.9.0/include/node/node_object_wrap.h:85:78:   required from here
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:9483:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:66:61:   required from here
/home/compilenix/.node-gyp/10.9.0/include/node/v8.h:9483:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [nfqueue.target.mk:103: Release/obj.target/nfqueue/src/node_nfqueue.o] Error 1
make: Leaving directory 'node_modules/nfqueue/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/compilenix/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Linux 4.17.18-200.fc28.x86_64
gyp ERR! command "/home/compilenix/.nvm/versions/node/v10.9.0/bin/node" "/home/compilenix/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd node_modules/nfqueue
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/compilenix/.npm/_logs/2018-09-06T10_01_08_239Z-debug.log

Performance and other feedback

I am investigating this library as I require dynamic firewalling. It is most likely in the end I'll get away with an iptables wrapper (which is annoying because it's not native) but thought I would leave some pointers...

I don't know why but in the online documentation nfq is marked as depreciated. It is also potentially worth mentioning that the only way to get something such as REJECT might be to set a mark.

The biggest issue with using this for firewalling is going to be performance. Especially given this is single threaded, going through JS, can quick saturate buffers, etc.

The pcap implementation you suggest to use isn't big on performance. It is not lazy for example. It'll decode an entire Ipv4 packet and potentially the protocol beneath it. I am not sure if there is a better library out there but users should be aware if they are serious about performance they might want to roll their own protocol decoding which should be several times faster than using the pcap library. The pcap library also pulls in some things you wont need complicating your build.

Users could also get a very slight performance boast if they use the bindings directly.

One of the easiest ways to improve performance in the extension is to let the user specify how much of the payload they want to access from JS. The ability to peek. In my use case I would rarely want to touch anything but the IP and TCP header. The main reason for doing this outside of iptables this is because rules are highly dynamic. This implementation appears to copy the entire payload into JS. Chances are on average people are only going to want 10% of the payload and a fixed prefix. If people want deeper inspection in certain cases they would probably filter that to another specialised queue. A better option would be some kind of lazy of immutable buffer with one exception. If you don't have to send the whole packet back to netfilter then much of it could be discarded early.

The nfq library is not documented brilliantly at a glance. Do you need to send the whole packet back or just the id?

Users may also not want the info structure. Excluding it or making it lazy (wrap it) would likely offer a fair performance gain.

The nfq library also offers batch processing options and you can further add to this with batch processing on the JS interface (pass an array of queues). This could significantly reduce the overhead per packet processed. It sort of goes against the node.js way. Large batches mean significant blocking. However how much blocking is tolerable is really on the user so that could be tunable with something such as batch size. Relatively small batches, for example ten packets or a hundred packets with peek could significantly improve performance with little impact on blocking or latency. As batches grow larger the returns diminish.

What a batch of 50 potentially means is that another data source might trigger an event in JS 25 packets in it'll have to wait 25 packets before being able to run and those 25 packets will be processed with stale rules. In most use cases that wont be a problem. Perfect order is not always needed. I am also not sure if you don't get that effect anyway with libuv.

Won't build on newer node versions

I really wanted to try this, but it won't build on newer node versions as it doesn't use nan.

[root@mx1 nfqueue]# npm install nfqueue

> [email protected] install /root/nfqueue/node_modules/nfqueue
> node-gyp rebuild

make: Entering directory `/root/nfqueue/node_modules/nfqueue/build'
  CXX(target) Release/obj.target/nfqueue/src/node_nfqueue.o
../src/node_nfqueue.cpp:32:34: error: expected class-name before ‘{’ token
 class nfqueue : node::ObjectWrap {
                                  ^
../src/node_nfqueue.cpp:42:36: error: ‘Arguments’ does not name a type
     static Handle<Value> New(const Arguments& args);
                                    ^
../src/node_nfqueue.cpp:42:47: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
     static Handle<Value> New(const Arguments& args);
                                               ^
../src/node_nfqueue.cpp:43:37: error: ‘Arguments’ does not name a type
     static Handle<Value> Open(const Arguments& args);
                                     ^
../src/node_nfqueue.cpp:43:48: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
     static Handle<Value> Open(const Arguments& args);
                                                ^
../src/node_nfqueue.cpp:44:37: error: ‘Arguments’ does not name a type
     static Handle<Value> Read(const Arguments& args);
                                     ^
../src/node_nfqueue.cpp:44:48: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
     static Handle<Value> Read(const Arguments& args);
                                                ^
../src/node_nfqueue.cpp:45:40: error: ‘Arguments’ does not name a type
     static Handle<Value> Verdict(const Arguments& args);
                                        ^
../src/node_nfqueue.cpp:45:51: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
     static Handle<Value> Verdict(const Arguments& args);
                                                   ^
../src/node_nfqueue.cpp:47:27: error: ‘uv_poll_t’ has not been declared
     static void PollAsync(uv_poll_t* handle, int status, int events);
                           ^
../src/node_nfqueue.cpp:58:3: error: ‘uv_poll_t’ does not name a type
   uv_poll_t poll;
   ^
../src/node_nfqueue.cpp: In static member function ‘static void nfqueue::Init(v8::Handle<v8::Object>)’:
../src/node_nfqueue.cpp:66:58: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
   Local<FunctionTemplate> tpl = FunctionTemplate::New(New);
                                                          ^
../src/node_nfqueue.cpp:66:58: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/node_nfqueue.cpp:67:21: error: ‘NewSymbol’ is not a member of ‘v8::String’
   tpl->SetClassName(String::NewSymbol("NFQueue"));
                     ^
../src/node_nfqueue.cpp:70:33: error: ‘NewSymbol’ is not a member of ‘v8::String’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("open"), FunctionTemplate::New(Open)->GetFunction());
                                 ^
../src/node_nfqueue.cpp:70:86: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("open"), FunctionTemplate::New(Open)->GetFunction());
                                                                                      ^
../src/node_nfqueue.cpp:70:86: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/node_nfqueue.cpp:71:33: error: ‘NewSymbol’ is not a member of ‘v8::String’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("read"), FunctionTemplate::New(Read)->GetFunction());
                                 ^
../src/node_nfqueue.cpp:71:86: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("read"), FunctionTemplate::New(Read)->GetFunction());
                                                                                      ^
../src/node_nfqueue.cpp:71:86: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/node_nfqueue.cpp:72:33: error: ‘NewSymbol’ is not a member of ‘v8::String’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("setVerdict"), FunctionTemplate::New(Verdict)->GetFunction());
                                 ^
../src/node_nfqueue.cpp:72:95: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
   tpl->PrototypeTemplate()->Set(String::NewSymbol("setVerdict"), FunctionTemplate::New(Verdict)->GetFunction());
                                                                                               ^
../src/node_nfqueue.cpp:72:95: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:3842:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/node_nfqueue.cpp:74:61: error: no matching function for call to ‘v8::Persistent<v8::Function>::New(v8::Local<v8::Function>)’
   constructor = Persistent<Function>::New(tpl->GetFunction());
                                                             ^
../src/node_nfqueue.cpp:74:61: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:6481:4: note: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::Function]
 T* PersistentBase<T>::New(Isolate* isolate, T* that) {
    ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:6481:4: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:75:16: error: ‘NewSymbol’ is not a member of ‘v8::String’
   exports->Set(String::NewSymbol("NFQueue"), constructor);
                ^
../src/node_nfqueue.cpp: At global scope:
../src/node_nfqueue.cpp:78:34: error: ‘Arguments’ does not name a type
 Handle<Value> nfqueue::New(const Arguments& args) {
                                  ^
../src/node_nfqueue.cpp:78:45: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> nfqueue::New(const Arguments& args) {
                                             ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> nfqueue::New(const int&)’:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:879:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../src/node_nfqueue.cpp:79:15: error: within this context
   HandleScope scope;
               ^
../src/node_nfqueue.cpp:82:21: error: ‘class nfqueue’ has no member named ‘Wrap’
   nfqueue_instance->Wrap(args.This());
                     ^
../src/node_nfqueue.cpp:82:31: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
   nfqueue_instance->Wrap(args.This());
                               ^
../src/node_nfqueue.cpp:84:15: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
   return args.This();
               ^
../src/node_nfqueue.cpp: At global scope:
../src/node_nfqueue.cpp:87:35: error: ‘Arguments’ does not name a type
 Handle<Value> nfqueue::Open(const Arguments& args) {
                                   ^
../src/node_nfqueue.cpp:87:46: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> nfqueue::Open(const Arguments& args) {
                                              ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> nfqueue::Open(const int&)’:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:879:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../src/node_nfqueue.cpp:88:15: error: within this context
   HandleScope scope;
               ^
../src/node_nfqueue.cpp:90:18: error: ‘ObjectWrap’ has not been declared
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                  ^
../src/node_nfqueue.cpp:90:44: error: expected primary-expression before ‘>’ token
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                            ^
../src/node_nfqueue.cpp:90:51: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                                   ^
../src/node_nfqueue.cpp:92:14: error: invalid types ‘const int[int]’ for array subscript
   if (!args[0]->IsNumber()) {
              ^
../src/node_nfqueue.cpp:93:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Bad queue number")));
                                         ^
../src/node_nfqueue.cpp:93:73: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Bad queue number")));
                                                                         ^
../src/node_nfqueue.cpp:94:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:94:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:97:40: error: invalid types ‘const int[int]’ for array subscript
   if (!node::Buffer::HasInstance(args[1])) {
                                        ^
../src/node_nfqueue.cpp:98:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("2nd argument must be a Buffer instance")));
                                         ^
../src/node_nfqueue.cpp:98:95: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("2nd argument must be a Buffer instance")));
                                                                                               ^
../src/node_nfqueue.cpp:99:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:99:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:103:36: error: invalid types ‘const int[int]’ for array subscript
   Local<Object> buffer_obj = args[1]->ToObject();
                                    ^
../src/node_nfqueue.cpp:114:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Unable to open queue")));
                                         ^
../src/node_nfqueue.cpp:114:77: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Unable to open queue")));
                                                                             ^
../src/node_nfqueue.cpp:115:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:115:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:119:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Unable to unbind queue")));
                                         ^
../src/node_nfqueue.cpp:119:79: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Unable to unbind queue")));
                                                                               ^
../src/node_nfqueue.cpp:120:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:120:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:124:54: error: invalid types ‘const int[int]’ for array subscript
   obj->qhandle = nfq_create_queue(obj->handle, args[0]->Uint32Value(), &nf_callback, (void*)obj);
                                                      ^
../src/node_nfqueue.cpp:127:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Unable to create queue")));
                                         ^
../src/node_nfqueue.cpp:127:79: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Unable to create queue")));
                                                                               ^
../src/node_nfqueue.cpp:128:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:128:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:132:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Unable to set queue mode")));
                                         ^
../src/node_nfqueue.cpp:132:81: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Unable to set queue mode")));
                                                                                 ^
../src/node_nfqueue.cpp:133:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:133:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:139:41: error: ‘New’ is not a member of ‘v8::String’
     ThrowException(Exception::TypeError(String::New("Unable to open an interface table handle")));
                                         ^
../src/node_nfqueue.cpp:139:97: error: ‘ThrowException’ was not declared in this scope
     ThrowException(Exception::TypeError(String::New("Unable to open an interface table handle")));
                                                                                                 ^
../src/node_nfqueue.cpp:140:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/node_nfqueue.cpp:140:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp:144:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../src/node_nfqueue.cpp:144:32: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp: At global scope:
../src/node_nfqueue.cpp:147:35: error: ‘Arguments’ does not name a type
 Handle<Value> nfqueue::Read(const Arguments& args) {
                                   ^
../src/node_nfqueue.cpp:147:46: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> nfqueue::Read(const Arguments& args) {
                                              ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::Read(const int&)’:
../src/node_nfqueue.cpp:148:18: error: ‘ObjectWrap’ has not been declared
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                  ^
../src/node_nfqueue.cpp:148:44: error: expected primary-expression before ‘>’ token
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                            ^
../src/node_nfqueue.cpp:148:51: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                                   ^
../src/node_nfqueue.cpp:150:54: error: invalid types ‘const int[int]’ for array subscript
   Handle<Function> cb = Handle<Function>::Cast(args[0]);
                                                      ^
../src/node_nfqueue.cpp:151:47: error: no matching function for call to ‘v8::Persistent<v8::Function>::New(v8::Handle<v8::Function>&)’
   obj->callback = Persistent<Function>::New(cb);
                                               ^
../src/node_nfqueue.cpp:151:47: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:6481:4: note: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::Function]
 T* PersistentBase<T>::New(Isolate* isolate, T* that) {
    ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:6481:4: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:154:10: error: ‘struct RecvBaton’ has no member named ‘poll’
   baton->poll.data = baton;
          ^
../src/node_nfqueue.cpp:157:39: error: ‘uv_default_loop’ was not declared in this scope
   uv_poll_init_socket(uv_default_loop(), &baton->poll, nfq_fd(obj->handle));
                                       ^
../src/node_nfqueue.cpp:157:50: error: ‘struct RecvBaton’ has no member named ‘poll’
   uv_poll_init_socket(uv_default_loop(), &baton->poll, nfq_fd(obj->handle));
                                                  ^
../src/node_nfqueue.cpp:157:75: error: ‘uv_poll_init_socket’ was not declared in this scope
   uv_poll_init_socket(uv_default_loop(), &baton->poll, nfq_fd(obj->handle));
                                                                           ^
../src/node_nfqueue.cpp:158:25: error: ‘struct RecvBaton’ has no member named ‘poll’
   uv_poll_start(&baton->poll, UV_READABLE, PollAsync);
                         ^
../src/node_nfqueue.cpp:158:31: error: ‘UV_READABLE’ was not declared in this scope
   uv_poll_start(&baton->poll, UV_READABLE, PollAsync);
                               ^
../src/node_nfqueue.cpp:158:53: error: ‘uv_poll_start’ was not declared in this scope
   uv_poll_start(&baton->poll, UV_READABLE, PollAsync);
                                                     ^
../src/node_nfqueue.cpp:160:20: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
   return Undefined();
                    ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp: At global scope:
../src/node_nfqueue.cpp:163:25: error: variable or field ‘PollAsync’ declared void
 void nfqueue::PollAsync(uv_poll_t* handle, int status, int events) {
                         ^
../src/node_nfqueue.cpp:163:25: error: ‘uv_poll_t’ was not declared in this scope
../src/node_nfqueue.cpp:163:36: error: ‘handle’ was not declared in this scope
 void nfqueue::PollAsync(uv_poll_t* handle, int status, int events) {
                                    ^
../src/node_nfqueue.cpp:163:44: error: expected primary-expression before ‘int’
 void nfqueue::PollAsync(uv_poll_t* handle, int status, int events) {
                                            ^
../src/node_nfqueue.cpp:163:56: error: expected primary-expression before ‘int’
 void nfqueue::PollAsync(uv_poll_t* handle, int status, int events) {
                                                        ^
../src/node_nfqueue.cpp: In static member function ‘static int nfqueue::nf_callback(nfq_q_handle*, nfgenmsg*, nfq_data*, void*)’:
../src/node_nfqueue.cpp:195:33: error: no matching function for call to ‘v8::Object::New()’
   Local<Object> p = Object::New();
                                 ^
../src/node_nfqueue.cpp:195:33: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2710:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
   static Local<Object> New(Isolate* isolate);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2710:24: note:   candidate expects 1 argument, 0 provided
../src/node_nfqueue.cpp:196:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("len"), Number::New(payload_len));
          ^
../src/node_nfqueue.cpp:196:59: error: no matching function for call to ‘v8::Number::New(int&)’
   p->Set(String::NewSymbol("len"), Number::New(payload_len));
                                                           ^
../src/node_nfqueue.cpp:196:59: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:197:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("id"), Number::New(id));
          ^
../src/node_nfqueue.cpp:197:49: error: no matching function for call to ‘v8::Number::New(int&)’
   p->Set(String::NewSymbol("id"), Number::New(id));
                                                 ^
../src/node_nfqueue.cpp:197:49: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:198:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("nfmark"), Number::New(nfq_get_nfmark(nfad)));
          ^
../src/node_nfqueue.cpp:198:71: error: no matching function for call to ‘v8::Number::New(u_int32_t)’
   p->Set(String::NewSymbol("nfmark"), Number::New(nfq_get_nfmark(nfad)));
                                                                       ^
../src/node_nfqueue.cpp:198:71: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:200:12: error: ‘NewSymbol’ is not a member of ‘v8::String’
     p->Set(String::NewSymbol("timestamp"), Number::New(tv.tv_sec));
            ^
../src/node_nfqueue.cpp:200:65: error: no matching function for call to ‘v8::Number::New(__time_t&)’
     p->Set(String::NewSymbol("timestamp"), Number::New(tv.tv_sec));
                                                                 ^
../src/node_nfqueue.cpp:200:65: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:201:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("indev"), Number::New(nfq_get_indev(nfad)));
          ^
../src/node_nfqueue.cpp:201:69: error: no matching function for call to ‘v8::Number::New(u_int32_t)’
   p->Set(String::NewSymbol("indev"), Number::New(nfq_get_indev(nfad)));
                                                                     ^
../src/node_nfqueue.cpp:201:69: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:202:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physindev"), Number::New(nfq_get_physindev(nfad)));
          ^
../src/node_nfqueue.cpp:202:77: error: no matching function for call to ‘v8::Number::New(u_int32_t)’
   p->Set(String::NewSymbol("physindev"), Number::New(nfq_get_physindev(nfad)));
                                                                             ^
../src/node_nfqueue.cpp:202:77: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:203:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("outdev"), Number::New(nfq_get_outdev(nfad)));
          ^
../src/node_nfqueue.cpp:203:71: error: no matching function for call to ‘v8::Number::New(u_int32_t)’
   p->Set(String::NewSymbol("outdev"), Number::New(nfq_get_outdev(nfad)));
                                                                       ^
../src/node_nfqueue.cpp:203:71: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:204:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physoutdev"), Number::New(nfq_get_physoutdev(nfad)));
          ^
../src/node_nfqueue.cpp:204:79: error: no matching function for call to ‘v8::Number::New(u_int32_t)’
   p->Set(String::NewSymbol("physoutdev"), Number::New(nfq_get_physoutdev(nfad)));
                                                                               ^
../src/node_nfqueue.cpp:204:79: note: candidate is:
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:2310:24: note:   candidate expects 2 arguments, 1 provided
../src/node_nfqueue.cpp:206:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("indev_name"), String::New(devname));
          ^
../src/node_nfqueue.cpp:206:43: error: ‘New’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("indev_name"), String::New(devname));
                                           ^
../src/node_nfqueue.cpp:208:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physintdev_name"), String::New(devname));
          ^
../src/node_nfqueue.cpp:208:48: error: ‘New’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physintdev_name"), String::New(devname));
                                                ^
../src/node_nfqueue.cpp:210:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("outdev_name"), String::New(devname));
          ^
../src/node_nfqueue.cpp:210:44: error: ‘New’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("outdev_name"), String::New(devname));
                                            ^
../src/node_nfqueue.cpp:212:10: error: ‘NewSymbol’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physoutdev_name"), String::New(devname));
          ^
../src/node_nfqueue.cpp:212:48: error: ‘New’ is not a member of ‘v8::String’
   p->Set(String::NewSymbol("physoutdev_name"), String::New(devname));
                                                ^
../src/node_nfqueue.cpp:216:37: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
   Local<Value> ret = queue->callback->Call(Context::GetCurrent()->Global(), 1, argv);
                                     ^
../src/node_nfqueue.cpp:216:44: error: ‘GetCurrent’ is not a member of ‘v8::Context’
   Local<Value> ret = queue->callback->Call(Context::GetCurrent()->Global(), 1, argv);
                                            ^
../src/node_nfqueue.cpp: At global scope:
../src/node_nfqueue.cpp:221:38: error: ‘Arguments’ does not name a type
 Handle<Value> nfqueue::Verdict(const Arguments& args) {
                                      ^
../src/node_nfqueue.cpp:221:49: warning: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> nfqueue::Verdict(const Arguments& args) {
                                                 ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::Verdict(const int&)’:
../src/node_nfqueue.cpp:222:18: error: ‘ObjectWrap’ has not been declared
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                  ^
../src/node_nfqueue.cpp:222:44: error: expected primary-expression before ‘>’ token
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                            ^
../src/node_nfqueue.cpp:222:51: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
   nfqueue* obj = ObjectWrap::Unwrap<nfqueue>(args.This());
                                                   ^
../src/node_nfqueue.cpp:226:18: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (!args[args.Length() - 1]->IsNull()) {
                  ^
../src/node_nfqueue.cpp:227:40: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
     Local<Object> buff_obj = args[args.Length() - 1]->ToObject();
                                        ^
../src/node_nfqueue.cpp:235:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (args.Length() == 3) {
            ^
../src/node_nfqueue.cpp:236:41: error: invalid types ‘const int[int]’ for array subscript
     nfq_set_verdict(obj->qhandle, args[0]->Uint32Value(), args[1]->Uint32Value(), buff_length, buff_data);
                                         ^
../src/node_nfqueue.cpp:236:65: error: invalid types ‘const int[int]’ for array subscript
     nfq_set_verdict(obj->qhandle, args[0]->Uint32Value(), args[1]->Uint32Value(), buff_length, buff_data);
                                                                 ^
../src/node_nfqueue.cpp:237:19: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   } else if (args.Length() == 4) {
                   ^
../src/node_nfqueue.cpp:238:42: error: invalid types ‘const int[int]’ for array subscript
     nfq_set_verdict2(obj->qhandle, args[0]->Uint32Value(), args[1]->Uint32Value(), args[2]->Uint32Value(), buff_length, buff_data);
                                          ^
../src/node_nfqueue.cpp:238:66: error: invalid types ‘const int[int]’ for array subscript
     nfq_set_verdict2(obj->qhandle, args[0]->Uint32Value(), args[1]->Uint32Value(), args[2]->Uint32Value(), buff_length, buff_data);
                                                                  ^
../src/node_nfqueue.cpp:238:90: error: invalid types ‘const int[int]’ for array subscript
     nfq_set_verdict2(obj->qhandle, args[0]->Uint32Value(), args[1]->Uint32Value(), args[2]->Uint32Value(), buff_length, buff_data);
                                                                                          ^
../src/node_nfqueue.cpp:241:20: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
   return Undefined();
                    ^
In file included from /root/.node-gyp/1.8.4/src/node.h:42:0,
                 from ../src/node_nfqueue.cpp:20:
/root/.node-gyp/1.8.4/deps/v8/include/v8.h:324:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::New(const int&)’:
../src/node_nfqueue.cpp:85:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::Open(const int&)’:
../src/node_nfqueue.cpp:145:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::Read(const int&)’:
../src/node_nfqueue.cpp:161:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/node_nfqueue.cpp: In static member function ‘static v8::Handle<v8::Value> nfqueue::Verdict(const int&)’:
../src/node_nfqueue.cpp:242:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/nfqueue/src/node_nfqueue.o] Error 1
make: Leaving directory `/root/nfqueue/node_modules/nfqueue/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:169:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Linux 3.10.0-229.7.2.el7.x86_64
gyp ERR! command "/usr/bin/iojs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/nfqueue/node_modules/nfqueue
gyp ERR! node -v v1.8.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.10.0-229.7.2.el7.x86_64
npm ERR! argv "/usr/bin/iojs" "/usr/bin/npm" "install" "nfqueue"
npm ERR! node v1.8.4
npm ERR! npm  v2.9.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the nfqueue package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls nfqueue
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/nfqueue/npm-debug.log

libnetfilter_queue/libnetfilter_queue.h no such file or directory

(Tried on Ubuntu 16.04.3)

When running npm install nfqueue on a fresh npm init I get the following error


> [email protected] install /home/ubuntu/Documents/NAT/node_modules/nfqueue
> node-gyp rebuild

make: Entering directory '/home/ubuntu/Documents/NAT/node_modules/nfqueue/build'
  CXX(target) Release/obj.target/nfqueue/src/node_nfqueue.o
../src/node_nfqueue.cpp:24:51: fatal error: libnetfilter_queue/libnetfilter_queue.h: No such file or directory
compilation terminated.
nfqueue.target.mk:92: recipe for target 'Release/obj.target/nfqueue/src/node_nfqueue.o' failed
make: *** [Release/obj.target/nfqueue/src/node_nfqueue.o] Error 1
make: Leaving directory '/home/ubuntu/Documents/NAT/node_modules/nfqueue/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.10.0-28-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ubuntu/Documents/NAT/node_modules/nfqueue
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
[email protected] /home/ubuntu/Documents/NAT
└── [email protected]  extraneous

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "nfqueue"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nfqueue package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs nfqueue
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls nfqueue
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/Documents/NAT/npm-debug.log

Is there any dependency that the lib is requiring ?

Thanks !

Adding raw packet data to the packet payload

Do you plan to add all raw packet data as-is it catched on user space in Buffer format?
If it possible, please add at least information from L2 headers - I am interested in MAC addresses and 802.1q fields.
Is it possible? Or I should do it by self in my fork?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.