aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2015-11-12 10:43:32 +0100
committerCampus <campus@ntop.org>2015-11-12 10:43:32 +0100
commit349e0b6fd22f50426e37362a92683d0478352882 (patch)
treefed437f448feac26de72b06352f123c6f3aaa84d
parent78eceb43a16fab912f204a1684f7f228350a5e94 (diff)
other changes related to refactoring, including Makefile.am modifications
-rw-r--r--src/include/Makefile.am11
-rw-r--r--src/include/ndpi_define.h12
-rw-r--r--src/include/ndpi_typedefs.h40
-rw-r--r--src/lib/Makefile.am5
-rw-r--r--src/lib/ndpi_main.c4
5 files changed, 32 insertions, 40 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 71a507ae2..05266a106 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -1,9 +1,8 @@
-
library_includedir=$(includedir)/libndpi-1.4/libndpi
library_include_HEADERS = ndpi_api.h \
- ndpi_debug_functions.h \
- ndpi_define.h \
- ndpi_macros.h \
- ndpi_protocols_osdpi.h \
- ndpi_public_functions.h
+ ndpi_define.h \
+ ndpi_typedefs.h \
+ ndpi_main.h \
+ ndpi_protocol_ids.h \
+ ndpi_protocols.h
diff --git a/src/include/ndpi_define.h b/src/include/ndpi_define.h
index f938c8ffb..8d70bc337 100644
--- a/src/include/ndpi_define.h
+++ b/src/include/ndpi_define.h
@@ -59,13 +59,6 @@
#define __BIG_ENDIAN__
#endif
-/* Kernel modules */
-#if defined(__LITTLE_ENDIAN)
-#define __LITTLE_ENDIAN__
-#endif
-#if defined(__BIG_ENDIAN)
-#define __BIG_ENDIAN__
-#endif
/* Everything else */
#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
@@ -165,11 +158,6 @@
#define MAX_PACKET_COUNTER 65000
#define MAX_DEFAULT_PORTS 5
-/**********************
- * detection features *
- **********************/
-/* #define NDPI_SELECT_DETECTION_WITH_REAL_PROTOCOL ( 1 << 0 ) */
-
#define NDPI_DIRECTCONNECT_CONNECTION_IP_TICK_TIMEOUT 600
#define NDPI_IRC_CONNECTION_TIMEOUT 120
#define NDPI_GNUTELLA_CONNECTION_TIMEOUT 60
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 16e0b6d0b..47df3f0b2 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -29,6 +29,7 @@
#define BT_ANNOUNCE
#define _WS2TCPIP_H_ /* Avoid compilation problems */
+#define SNAP_EXT
/* NDPI_LOG_LEVEL */
@@ -127,7 +128,9 @@ struct ndpi_llc_header
u_int8_t dsap;
u_int8_t ssap;
u_int8_t ctrl;
+#ifdef SNAP_EXT
struct ndpi_snap_extension snap;
+#endif
} __attribute__((packed));
@@ -831,26 +834,34 @@ typedef struct ndpi_flow_struct {
u_int16_t guessed_protocol_id, guessed_host_proto_id;
u_int8_t protocol_id_already_guessed:1, host_already_guessed:1, init_finished:1, setup_packet_direction:1, packet_direction:1;
- /* if ndpi_struct->direction_detect_disable == 1 */
- /* tcp sequence number connection tracking */
+
+ /*
+ if ndpi_struct->direction_detect_disable == 1
+ tcp sequence number connection tracking
+ */
u_int32_t next_tcp_seq_nr[2];
- /* the tcp / udp / other l4 value union
- * this is used to reduce the number of bytes for tcp or udp protocol states
- * */
+ /*
+ the tcp / udp / other l4 value union
+ used to reduce the number of bytes for tcp or udp protocol states
+ */
union {
struct ndpi_flow_tcp_struct tcp;
struct ndpi_flow_udp_struct udp;
} l4;
- struct ndpi_id_struct *server_id; /*
- Pointer to src or dst
- that identifies the
- server of this connection
- */
- u_char host_server_name[256]; /* HTTP host or DNS query */
- u_char detected_os[32]; /* Via HTTP User-Agent */
- u_char nat_ip[24]; /* Via HTTP X-Forwarded-For */
+ /*
+ Pointer to src or dst
+ that identifies the
+ server of this connection
+ */
+ struct ndpi_id_struct *server_id;
+ /* HTTP host or DNS query */
+ u_char host_server_name[256];
+ /* Via HTTP User-Agent */
+ u_char detected_os[32];
+ /* Via HTTP X-Forwarded-For */
+ u_char nat_ip[24];
/*
This structure below will not not stay inside the protos
@@ -880,7 +891,8 @@ typedef struct ndpi_flow_struct {
char client_certificate[48], server_certificate[48];
} ssl;
} protos;
- /* ALL protocol specific 64 bit variables here */
+
+ /*** ALL protocol specific 64 bit variables here ***/
/* protocols which have marked a connection as this connection cannot be protocol XXX, multiple u_int64_t */
NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index ee395f5cd..be9a50526 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -7,14 +7,11 @@ libndpi_la_LDFLAGS = -version-info 1:0:0 -export-symbols $(top_srcdir)/libndpi.s
libndpi_la_includedir = $(includedir)/libndpi-@VERSION@/libndpi
libndpi_la_include_HEADERS = ../include/ndpi_api.h \
- ../include/linux_compat.h \
../include/ndpi_define.h \
../include/ndpi_main.h \
../include/ndpi_protocol_ids.h \
../include/ndpi_protocols.h \
- ../include/ndpi_typedefs.h \
- ../include/ndpi_unix.h \
- ../include/ndpi_win32.h
+ ../include/ndpi_typedefs.h
libndpi_la_SOURCES = ndpi_content_match.c.inc \
ndpi_main.c \
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 6ed7d5521..ef6f96387 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -38,10 +38,6 @@
#include "third_party/include/ndpi_patricia.h"
#include "third_party/src/ndpi_patricia.c"
-/* #ifndef strtok_r */
-/* #define strtok_r(a,b,c) strtok(a,b) */
-/* #endif */
-
/* ftp://ftp.cc.uoc.gr/mirrors/OpenBSD/src/lib/libc/stdlib/tsearch.c */
/* find or insert datum into search tree */
void *