GithubHelp home page GithubHelp logo

Comments (2)

tsarangi avatar tsarangi commented on July 30, 2024

I am using gcc-4.4.6 where BYTE_ORDER is not predefined. In ndpi_define.h, if __KERNEL__ is not defined, then there is no way to find out BYTE_ORDER for the machine. It doesn't include endian.h from /usr/include.

from ndpi-netfilter.

tsarangi avatar tsarangi commented on July 30, 2024

Here is a patch that works, but spews a bunch of __redefine warnings from the compiler.

--- a/nDPI-patch/src/include/ndpi_define.h      2016-06-18 15:29:59.000000000 +0000
+++ b/nDPI-patch/src/include/ndpi_define.h      2016-08-16 17:03:25.149127493 +0000
@@ -28,6 +28,7 @@
 /*
   gcc -E -dM - < /dev/null |grep ENDIAN
 */
+#include <endian.h>

 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 #include <machine/endian.h>
@@ -50,7 +51,6 @@
 #endif
 #endif

-#ifndef __KERNEL__
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #ifndef __LITTLE_ENDIAN__
 #define __LITTLE_ENDIAN__
@@ -60,7 +60,6 @@
 #define __BIG_ENDIAN__
 #endif
 #endif
-#endif

 #ifdef WIN32
 #ifndef __LITTLE_ENDIAN__
--- a/src/Makefile      2016-08-15 22:02:15.000000000 +0000
+++ b/src/Makefile      2016-08-16 17:05:36.009273450 +0000
@@ -3,6 +3,7 @@
 NDPI_PRO := ${NDPI_SRC}/lib/protocols

 ccflags-y += -I${src}/${NDPI_SRC}/include -I${src}/${NDPI_SRC}/lib -DOPENDPI_NETFILTER_MODULE -DNDPI_IPTABLES_EXT
+ccflags-y += -I/usr/include

 MODULES_DIR := /lib/modules/$(shell uname -r)
 KERNEL_DIR ?= ${MODULES_DIR}/build

from ndpi-netfilter.

Related Issues (20)

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.