betolj / ndpi-netfilter

GNU General Public License v2.0
126 stars 72 forks source link

Error compile ndpi-netfilter #10

Closed jerric12 closed 9 years ago

jerric12 commented 9 years ago

Hi, I've installed ntopng/ndpi on a Debian Jessie and it works fine. I need to associate with Netfilter. I tried to compile ndpi-netfilter with your instructions. I have these errors. Do you have an idea ? Can you help me please ? Thanks a lot

root@firewall:/usr/src/ndpi-netfilter# NDPI_PATH=/usr/src/ndpi-netfilter/nDPI make make -C ipt make[1]: Entering directory '/usr/src/ndpi-netfilter/ipt' if test -d ndpi_cpy; then \ cp /usr/src/ndpi-netfilter/nDPI/src/* ndpi_cpy -R; \ else \ mkdir ndpi_cpy; \ cp /usr/src/ndpi-netfilter/nDPI/src/* ndpi_cpy -R; \ fi make libxt_ndpi.so make[2]: Entering directory '/usr/src/ndpi-netfilter/ipt' cc -fPIC -Indpi_cpy/include -Indpi_cpy/lib -I../src -DOPENDPI_NETFILTER_MODULE -O2 -Wall -D_INIT=libxt_ndpi_init -c -o libxt_ndpi.o libxt_ndpi.c; libxt_ndpi.c:33:34: error: 'NDPI_PROTOCOL_LONG_STRING' undeclared here (not in a function) static char prot_long_str[] = { NDPI_PROTOCOL_LONG_STRING }; ^ libxt_ndpi.c:34:35: error: 'NDPI_PROTOCOL_SHORT_STRING' undeclared here (not in a function) static char _prot_short_str[] = { NDPI_PROTOCOL_SHORT_STRING }; ^ libxt_ndpi.c:34:1: error: initializer element is not constant static char prot_short_str[] = { NDPI_PROTOCOL_SHORT_STRING }; ^ libxt_ndpi.c:34:1: error: (near initialization for 'prot_short_str[0]') libxt_ndpi.c: In function 'ndpi_mt_init': libxt_ndpi.c:116:25: warning: unused variable 'info' [-Wunused-variable] struct xt_ndpi_mtinfo info = (void )match->data; ^ Makefile:19: recipe for target 'libxt_ndpi.o' failed make[2]: _ [libxt_ndpi.o] Error 1 make[2]: Leaving directory '/usr/src/ndpi-netfilter/ipt' Makefile:8: recipe for target 'all' failed make[1]: * [all] Error 2 make[1]: Leaving directory '/usr/src/ndpi-netfilter/ipt' Makefile:2: recipe for target 'all' failed make: * [all] Error 2

betolj commented 9 years ago

What is the nDPI library used in this compilation? This build was tested with "nDPI.tar.gz" included here in this project - you will have problems with newer nDPI versions.

jerric12 commented 9 years ago

First, thanks a lot for your answer ans sorry for my englis, i'm french ;-) I installed nDPI using "git clone https://github.com/ntop/nDPI.git" form http://www.ntop.org/get-started/download/. i think it's nDPI 1.6. It works with nf_conntrack_netlink, no ? I've built a new kernel (3.16) with nf_conntrack_netlink enabled. I tried a lot of solutions but without success

betolj commented 9 years ago

hi... I'm Brazilian, my native language is portuguese.

You can't build this ndpi-netfilter version with latest nDPI lib or source - and you did this with "git clone" command.

Follow this steps (using nDPI.tar.gz): https://github.com/betolj/ndpi-netfilter/blob/master/ndpi.install

This version works with nf_conntrack_netlink, so this doesn't require kernel patch.

jerric12 commented 9 years ago

Hi, You know what ? If you were near me, il would give you a big kiss LOL IT WORKS VERY WELL !!! Thanks a lot I was working on this project for 2 months with the ewildgoose's project. It doesn't work now. I found your project recently. The problem was the last version of nDPI. All was writen in your ndpi.install !!! In french, we said : "Je suis un imbécile" I tried too many solutions and finally i was lost. Thanks again for answered me so quickly. Have a very nice day Jérôme