Minor cleanup
This commit is contained in:
@@ -123,28 +123,6 @@ case "$host" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnl> https://github.com/json-c/json-c
|
|
||||||
AC_ARG_ENABLE([json-c],
|
|
||||||
AS_HELP_STRING([--disable-json-c], [Disable json-c support]))
|
|
||||||
|
|
||||||
AS_IF([test "x$enable_json_c" != "xno"], [
|
|
||||||
PKG_CHECK_MODULES([JSONC],[json-c],
|
|
||||||
[
|
|
||||||
CFLAGS="$CFLAGS $JSONC_CFLAGS"
|
|
||||||
LDFLAGS="$LDFLAGS $JSONC_LIBS"
|
|
||||||
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
|
|
||||||
],
|
|
||||||
[
|
|
||||||
JSONC_HOME="$HOME/json-c"
|
|
||||||
if test -d "$JSONC_HOME"; then :
|
|
||||||
CFLAGS="$CFLAGS -I $JSONC_HOME"
|
|
||||||
LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a"
|
|
||||||
AC_MSG_RESULT([Found json-c in $JSONC_HOME])
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([debug-messages],
|
AC_ARG_ENABLE([debug-messages],
|
||||||
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
||||||
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
||||||
|
|||||||
+6
-3
@@ -1,8 +1,11 @@
|
|||||||
CC=@CC@
|
CC=@CC@
|
||||||
CXX=@CXX@
|
CXX=@CXX@
|
||||||
CFLAGS=-g -I../src/include @CFLAGS@
|
SRCHOME=../src
|
||||||
LIBNDPI=../src/lib/libndpi.a
|
CFLAGS=-g -I$(SRCHOME)/include @CFLAGS@
|
||||||
|
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
||||||
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@
|
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@
|
||||||
|
HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
||||||
|
$(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
|
||||||
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
||||||
PREFIX?=@prefix@
|
PREFIX?=@prefix@
|
||||||
|
|
||||||
@@ -27,7 +30,7 @@ dpdk:
|
|||||||
make -f Makefile.dpdk
|
make -f Makefile.dpdk
|
||||||
|
|
||||||
check:
|
check:
|
||||||
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I../src/include *.c
|
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I$(SRCHOME)/include *.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o ndpiReader ndpiReader.dpdk
|
/bin/rm -f *.o ndpiReader ndpiReader.dpdk
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ typedef struct ndpi_flow_info {
|
|||||||
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
|
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
|
||||||
*pktlen_c_to_s, *pktlen_s_to_c;
|
*pktlen_c_to_s, *pktlen_s_to_c;
|
||||||
|
|
||||||
char info[96];
|
char info[160];
|
||||||
char host_server_name[256];
|
char host_server_name[256];
|
||||||
char bittorent_hash[41];
|
char bittorent_hash[41];
|
||||||
char dhcp_fingerprint[48];
|
char dhcp_fingerprint[48];
|
||||||
|
|||||||
@@ -625,7 +625,7 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct,
|
static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int8_t handshake_type;
|
// u_int8_t handshake_type;
|
||||||
u_int32_t handshake_len;
|
u_int32_t handshake_len;
|
||||||
u_int16_t p_len;
|
u_int16_t p_len;
|
||||||
const u_int8_t *p;
|
const u_int8_t *p;
|
||||||
@@ -651,7 +651,7 @@ static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
return(0); /* Giveup */
|
return(0); /* Giveup */
|
||||||
}
|
}
|
||||||
|
|
||||||
handshake_type = packet->payload[13];
|
// handshake_type = packet->payload[13];
|
||||||
handshake_len = (packet->payload[14] << 16) + (packet->payload[15] << 8) + packet->payload[16];
|
handshake_len = (packet->payload[14] << 16) + (packet->payload[15] << 8) + packet->payload[16];
|
||||||
|
|
||||||
if((handshake_len+25) != packet->payload_packet_len)
|
if((handshake_len+25) != packet->payload_packet_len)
|
||||||
|
|||||||
Reference in New Issue
Block a user