Reworked https://github.com/ntop/nDPI/commit/8a4c15ecf5c5c1430e8047324a5e336db2f503f1 to avoid adding (un-needed) pcap dependency in nDPI core

This commit is contained in:
Luca Deri
2016-04-24 23:17:18 +02:00
parent 8cb6172e4b
commit e23446389c
4 changed files with 12 additions and 17 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ AM_CFLAGS = @PTHREAD_CFLAGS@
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
AM_LDFLAGS = -static
ndpiReader_SOURCES = ndpiReader.c
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c
ndpiReader.o: ndpiReader.c
+11 -15
View File
@@ -1,11 +1,7 @@
/*
* ndpi_util.h
*
* Copyright (C) 2011-15 - 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
* Copyright (C) 2011-16 - ntop.org
*
* 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
@@ -112,10 +108,10 @@ typedef struct ndpi_workflow {
/* 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,
pcap_t * pcap_handle,
void * (*malloc_wrapper)(size_t),
void (*free_wrapper)(void*),
ndpi_debug_function_ptr ndpi_debug_printf);
pcap_t * pcap_handle,
void * (*malloc_wrapper)(size_t),
void (*free_wrapper)(void*),
ndpi_debug_function_ptr ndpi_debug_printf);
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. */
void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
const struct pcap_pkthdr *header,
const u_char *packet);
const struct pcap_pkthdr *header,
const u_char *packet);
/* flow callbacks: ndpi_flow_info will be freed right after */
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow,
ndpi_workflow_callback_ptr callback,
void * udata) {
ndpi_workflow_callback_ptr callback,
void * udata) {
workflow->__flow_detected_callback = callback;
workflow->__flow_detected_udata = udata;
}
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow,
ndpi_workflow_callback_ptr callback,
void * udata) {
ndpi_workflow_callback_ptr callback,
void * udata) {
workflow->__flow_giveup_callback = callback;
workflow->__flow_giveup_udata = udata;
}
-1
View File
@@ -16,7 +16,6 @@ libndpi_la_include_HEADERS = ../include/ndpi_api.h \
libndpi_la_SOURCES = ndpi_content_match.c.inc \
ndpi_main.c \
ndpi_util.c \
protocols/afp.c \
protocols/aimini.c \
protocols/applejuice.c \