Minor cleanup

This commit is contained in:
Luca Deri 2020-01-05 18:42:36 +01:00
parent ef16591f3f
commit d1fb41a161
4 changed files with 9 additions and 28 deletions

View file

@ -123,28 +123,6 @@ case "$host" in
;;
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],
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])

View file

@ -1,8 +1,11 @@
CC=@CC@
CXX=@CXX@
CFLAGS=-g -I../src/include @CFLAGS@
LIBNDPI=../src/lib/libndpi.a
SRCHOME=../src
CFLAGS=-g -I$(SRCHOME)/include @CFLAGS@
LIBNDPI=$(SRCHOME)/lib/libndpi.a
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
PREFIX?=@prefix@
@ -27,7 +30,7 @@ dpdk:
make -f Makefile.dpdk
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:
/bin/rm -f *.o ndpiReader ndpiReader.dpdk

View file

@ -188,7 +188,7 @@ typedef struct ndpi_flow_info {
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
*pktlen_c_to_s, *pktlen_s_to_c;
char info[96];
char info[160];
char host_server_name[256];
char bittorent_hash[41];
char dhcp_fingerprint[48];

View file

@ -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,
struct ndpi_flow_struct *flow) {
struct ndpi_packet_struct *packet = &flow->packet;
u_int8_t handshake_type;
// u_int8_t handshake_type;
u_int32_t handshake_len;
u_int16_t p_len;
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 */
}
handshake_type = packet->payload[13];
// handshake_type = packet->payload[13];
handshake_len = (packet->payload[14] << 16) + (packet->payload[15] << 8) + packet->payload[16];
if((handshake_len+25) != packet->payload_packet_len)