Reworked https://github.com/ntop/nDPI/commit/8a4c15ecf5c5c1430e8047324a5e336db2f503f1 to avoid adding (un-needed) pcap dependency in nDPI core
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ AM_CFLAGS = @PTHREAD_CFLAGS@
|
|||||||
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
|
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
|
||||||
AM_LDFLAGS = -static
|
AM_LDFLAGS = -static
|
||||||
|
|
||||||
ndpiReader_SOURCES = ndpiReader.c
|
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c
|
||||||
|
|
||||||
ndpiReader.o: ndpiReader.c
|
ndpiReader.o: ndpiReader.c
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_util.h
|
* ndpi_util.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-16 - ntop.org
|
||||||
* Copyright (C) 2009-11 - ipoque GmbH
|
|
||||||
*
|
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -112,10 +108,10 @@ typedef struct ndpi_workflow {
|
|||||||
|
|
||||||
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
|
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
|
||||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs,
|
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs,
|
||||||
pcap_t * pcap_handle,
|
pcap_t * pcap_handle,
|
||||||
void * (*malloc_wrapper)(size_t),
|
void * (*malloc_wrapper)(size_t),
|
||||||
void (*free_wrapper)(void*),
|
void (*free_wrapper)(void*),
|
||||||
ndpi_debug_function_ptr ndpi_debug_printf);
|
ndpi_debug_function_ptr ndpi_debug_printf);
|
||||||
|
|
||||||
void ndpi_workflow_free(struct ndpi_workflow * workflow);
|
void ndpi_workflow_free(struct ndpi_workflow * workflow);
|
||||||
|
|
||||||
@@ -127,20 +123,20 @@ void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
|
|||||||
|
|
||||||
/** Process a @packet and update the @workflow. */
|
/** Process a @packet and update the @workflow. */
|
||||||
void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
||||||
const struct pcap_pkthdr *header,
|
const struct pcap_pkthdr *header,
|
||||||
const u_char *packet);
|
const u_char *packet);
|
||||||
|
|
||||||
/* flow callbacks: ndpi_flow_info will be freed right after */
|
/* flow callbacks: ndpi_flow_info will be freed right after */
|
||||||
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow,
|
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow,
|
||||||
ndpi_workflow_callback_ptr callback,
|
ndpi_workflow_callback_ptr callback,
|
||||||
void * udata) {
|
void * udata) {
|
||||||
workflow->__flow_detected_callback = callback;
|
workflow->__flow_detected_callback = callback;
|
||||||
workflow->__flow_detected_udata = udata;
|
workflow->__flow_detected_udata = udata;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow,
|
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow,
|
||||||
ndpi_workflow_callback_ptr callback,
|
ndpi_workflow_callback_ptr callback,
|
||||||
void * udata) {
|
void * udata) {
|
||||||
workflow->__flow_giveup_callback = callback;
|
workflow->__flow_giveup_callback = callback;
|
||||||
workflow->__flow_giveup_udata = udata;
|
workflow->__flow_giveup_udata = udata;
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,6 @@ libndpi_la_include_HEADERS = ../include/ndpi_api.h \
|
|||||||
|
|
||||||
libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
||||||
ndpi_main.c \
|
ndpi_main.c \
|
||||||
ndpi_util.c \
|
|
||||||
protocols/afp.c \
|
protocols/afp.c \
|
||||||
protocols/aimini.c \
|
protocols/aimini.c \
|
||||||
protocols/applejuice.c \
|
protocols/applejuice.c \
|
||||||
|
|||||||
Reference in New Issue
Block a user