Skip to content

morfoh/lua-netfilter_queue

Repository files navigation

lua-netfilter_queue - Lua bindings for libnetfilter_queue

Warning
The Lua bindings for libnetfilter_queue provided here are not complete and in a very early stage of development, thus do not use them in a production environment!

Build Dependencies

  • cmake

  • libnetfilter_queue

Installing

Install from git

Clone the git repository

git clone git://github.com/morfoh/lua-netfilter_queue.git
cd lua-netfilter_queue

Prepare a dedicated build directory

mkdir build
cd build

Generate Makefiles and related build infrastructure

cmake ../

Alternatively you can specify the path where to install the module

cmake ../ -DINSTALL_CMOD=/usr/local/lib/lua/5.1

Compile the module

make

Install the module

sudo make install

Install using lua-rocks

curl -O "https://github.com/morfoh/lua-netfilter_queue/raw/master/lua-netfilter_queue-scm-0.rockspec"
luarocks install lua-netfilter_queue-scm-0.rockspec

Simple Test

queue all incoming ICMP

iptables -A INPUT --protocol icmp -j NFQUEUE --queue-num 0

queue all outgoing ICMP

iptables -A OUTPUT --protocol icmp -j NFQUEUE --queue-num 0

run the test as superuser

sudo lua test.lua

If you are going to use ping to send ICMP echo packets to some host, you should see log output.

Development

Re-generating the bindings

By default CMake will use the pre-generated bindings that are include in the project.

To be able to re-generate the bindings, you will need to install LuaNativeObjects and set the CMake variable USE_PRE_GENERATED_BINDINGS to FALSE.

cmake ../ -DUSE_PRE_GENERATED_BINDINGS=FALSE

Mandantory for re-generating Lua bindings from *.nobj.lua files:

  • LuaNativeObjects, this is the bindings generator used to convert the *.nobj.lua files into a native Lua module.

Optional for re-generating documentation

To not re-generate documentation by luadocs when re-generating the bindings you have to to set the CMake variable GENERATE_LUADOCS to FALSE.

cmake ../ -DUSE_PRE_GENERATED_BINDINGS=FALSE -DGENERATE_LUADOCS=FALSE

About

Lua bindings for libnetfilter_queue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors