pcapdpi icon indicating copy to clipboard operation
pcapdpi copied to clipboard

nDPI 2.3.0 compile error

Open hichul opened this issue 7 years ago • 0 comments

Hi I have using pcapdpi and it work great in nDPI 1.7.1 now I am trying to upgrade to nDPI 2.3.0 but I am getting error when I try to compile

I have copy all the nDPI/src/include/*.h to the /usr/local/include/libndpi-2.3.0/libndpi/

my Makefile is

INC=-I/usr/local/include/libndpi-2.3.0/libndpi/ LIB=-L$(LIBRARY_PATH)

all: pcapDPI

pcapDPI: pcapReader.c gcc -g pcapReader.c -o pcapDPI $(INC) -lpcap -lndpi

clean: /bin/rm -f pcapDPI


and this is my error message

gcc -g pcapReader.c -o pcapDPI -I/usr/local/include/libndpi-2.3.0/libndpi/ -lpcap -lndpi In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:119:8: error: redefinition of ‘struct ndpi_ethhdr’ struct ndpi_ethhdr ^~~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:46:8: note: originally defined here struct ndpi_ethhdr { ^~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:189:8: error: redefinition of ‘struct ndpi_iphdr’ struct ndpi_iphdr { ^~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:57:8: note: originally defined here struct ndpi_iphdr { ^~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:211:8: error: redefinition of ‘struct ndpi_in6_addr’ struct ndpi_in6_addr { ^~~~~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:138:8: note: originally defined here struct ndpi_in6_addr { ^~~~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:219:8: error: redefinition of ‘struct ndpi_ip6_hdrctl’ struct ndpi_ip6_hdrctl { ^~~~~~~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:148:12: note: originally defined here struct ndpi_ip6_hdrctl { ^~~~~~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:236:8: error: redefinition of ‘struct ndpi_tcphdr’ struct ndpi_tcphdr ^~~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:160:8: note: originally defined here struct ndpi_tcphdr { ^~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_typedefs.h:257:8: error: redefinition of ‘struct ndpi_udphdr’ struct ndpi_udphdr ^~~~~~~~~~~ In file included from pcapReader.c:33:0: linux_compat.h:177:8: note: originally defined here struct ndpi_udphdr { ^~~~~~~~~~~ pcapReader.c: In function ‘setupDetection’: pcapReader.c:476:17: error: too many arguments to function ‘ndpi_init_detection_module’ ndpi_struct = ndpi_init_detection_module(detection_tick_resolution, malloc_wrapper, free_wrapper, debug_printf); ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:32:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_api.h:146:40: note: declared here struct ndpi_detection_module_struct *ndpi_init_detection_module(void); ^~~~~~~~~~~~~~~~~~~~~~~~~~ pcapReader.c: In function ‘terminateDetection’: pcapReader.c:518:3: error: too many arguments to function ‘ndpi_exit_detection_module’ ndpi_exit_detection_module(ndpi_struct, free_wrapper); ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/libndpi-2.3.0/libndpi/ndpi_main.h:32:0, from pcapReader.c:34: /usr/local/include/libndpi-2.3.0/libndpi/ndpi_api.h:175:8: note: declared here void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct); ^~~~~~~~~~~~~~~~~~~~~~~~~~ pcapReader.c: In function ‘packet_processing’: pcapReader.c:536:5: warning: ‘return’ with no value, in function returning non-void return; ^~~~~~ pcapReader.c:521:21: note: declared here static unsigned int packet_processing(const u_int64_t time, const struct pcap_pkthdr *header, ^~~~~~~~~~~~~~~~~ pcapReader.c:541:33: warning: ‘return’ with no value, in function returning non-void if(flow->detection_completed) return; ^~~~~~ pcapReader.c:521:21: note: declared here static unsigned int packet_processing(const u_int64_t time, const struct pcap_pkthdr *header, ^~~~~~~~~~~~~~~~~ Makefile:9: recipe for target 'pcapDPI' failed make: *** [pcapDPI] Error 1

hichul avatar Apr 11 '18 02:04 hichul