aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Makefile.in2
-rw-r--r--src/lib/ndpi_geoip.c1
-rw-r--r--src/lib/ndpi_main.c104
-rw-r--r--src/lib/ndpi_private.h359
-rw-r--r--src/lib/ndpi_utils.c1
-rw-r--r--src/lib/protocols/activision.c1
-rw-r--r--src/lib/protocols/afp.c1
-rw-r--r--src/lib/protocols/ajp.c1
-rw-r--r--src/lib/protocols/alicloud.c1
-rw-r--r--src/lib/protocols/amazon_video.c1
-rw-r--r--src/lib/protocols/among_us.c1
-rw-r--r--src/lib/protocols/amqp.c1
-rw-r--r--src/lib/protocols/apple_push.c1
-rw-r--r--src/lib/protocols/armagetron.c1
-rw-r--r--src/lib/protocols/avast.c1
-rw-r--r--src/lib/protocols/avast_securedns.c1
-rw-r--r--src/lib/protocols/bacnet.c1
-rw-r--r--src/lib/protocols/bgp.c1
-rw-r--r--src/lib/protocols/bitcoin.c1
-rw-r--r--src/lib/protocols/bittorrent.c5
-rw-r--r--src/lib/protocols/bjnp.c1
-rw-r--r--src/lib/protocols/can.c1
-rw-r--r--src/lib/protocols/capwap.c1
-rw-r--r--src/lib/protocols/cassandra.c1
-rw-r--r--src/lib/protocols/checkmk.c1
-rw-r--r--src/lib/protocols/ciscovpn.c1
-rw-r--r--src/lib/protocols/citrix.c1
-rw-r--r--src/lib/protocols/coap.c1
-rw-r--r--src/lib/protocols/collectd.c1
-rw-r--r--src/lib/protocols/corba.c1
-rw-r--r--src/lib/protocols/cpha.c1
-rw-r--r--src/lib/protocols/crossfire.c1
-rw-r--r--src/lib/protocols/crynet.c1
-rw-r--r--src/lib/protocols/csgo.c1
-rw-r--r--src/lib/protocols/dcerpc.c1
-rw-r--r--src/lib/protocols/dhcp.c1
-rw-r--r--src/lib/protocols/dhcpv6.c1
-rw-r--r--src/lib/protocols/diameter.c1
-rw-r--r--src/lib/protocols/discord.c1
-rw-r--r--src/lib/protocols/dnp3.c1
-rw-r--r--src/lib/protocols/dns.c5
-rw-r--r--src/lib/protocols/dnscrypt.c1
-rw-r--r--src/lib/protocols/dofus.c1
-rw-r--r--src/lib/protocols/drda.c1
-rw-r--r--src/lib/protocols/dropbox.c1
-rw-r--r--src/lib/protocols/eaq.c1
-rw-r--r--src/lib/protocols/edonkey.c1
-rw-r--r--src/lib/protocols/elastic_search.c1
-rw-r--r--src/lib/protocols/epicgames.c1
-rw-r--r--src/lib/protocols/ethereum.c1
-rw-r--r--src/lib/protocols/ethernet_ip.c1
-rw-r--r--src/lib/protocols/fastcgi.c1
-rw-r--r--src/lib/protocols/fix.c1
-rw-r--r--src/lib/protocols/ftp_control.c5
-rw-r--r--src/lib/protocols/ftp_data.c1
-rw-r--r--src/lib/protocols/genshin_impact.c1
-rw-r--r--src/lib/protocols/git.c1
-rw-r--r--src/lib/protocols/gnutella.c1
-rw-r--r--src/lib/protocols/gtp.c1
-rw-r--r--src/lib/protocols/guildwars.c1
-rw-r--r--src/lib/protocols/h323.c1
-rw-r--r--src/lib/protocols/halflife2_and_mods.c1
-rw-r--r--src/lib/protocols/haproxy.c1
-rw-r--r--src/lib/protocols/hots.c1
-rw-r--r--src/lib/protocols/hpvirtgrp.c1
-rw-r--r--src/lib/protocols/hsrp.c1
-rw-r--r--src/lib/protocols/http.c4
-rw-r--r--src/lib/protocols/http2.c1
-rw-r--r--src/lib/protocols/i3d.c1
-rw-r--r--src/lib/protocols/iax.c1
-rw-r--r--src/lib/protocols/icecast.c8
-rw-r--r--src/lib/protocols/iec60870-5-104.c1
-rw-r--r--src/lib/protocols/imo.c1
-rw-r--r--src/lib/protocols/ipp.c1
-rw-r--r--src/lib/protocols/ipsec.c1
-rw-r--r--src/lib/protocols/irc.c1
-rw-r--r--src/lib/protocols/jabber.c1
-rw-r--r--src/lib/protocols/kakaotalk_voice.c1
-rw-r--r--src/lib/protocols/kerberos.c1
-rw-r--r--src/lib/protocols/kismet.c1
-rw-r--r--src/lib/protocols/kontiki.c1
-rw-r--r--src/lib/protocols/ldap.c1
-rw-r--r--src/lib/protocols/line.c3
-rw-r--r--src/lib/protocols/lisp.c1
-rw-r--r--src/lib/protocols/lotus_notes.c1
-rw-r--r--src/lib/protocols/mail_imap.c4
-rw-r--r--src/lib/protocols/mail_pop.c4
-rw-r--r--src/lib/protocols/mail_smtp.c3
-rw-r--r--src/lib/protocols/maplestory.c1
-rw-r--r--src/lib/protocols/megaco.c1
-rw-r--r--src/lib/protocols/memcached.c1
-rw-r--r--src/lib/protocols/merakicloud.c1
-rw-r--r--src/lib/protocols/mgcp.c1
-rw-r--r--src/lib/protocols/mining.c1
-rw-r--r--src/lib/protocols/modbus.c1
-rw-r--r--src/lib/protocols/mongodb.c1
-rw-r--r--src/lib/protocols/mpegdash.c1
-rw-r--r--src/lib/protocols/mpegts.c1
-rw-r--r--src/lib/protocols/mqtt.c1
-rw-r--r--src/lib/protocols/mssql_tds.c1
-rw-r--r--src/lib/protocols/munin.c1
-rw-r--r--src/lib/protocols/mysql.c1
-rw-r--r--src/lib/protocols/natpmp.c1
-rw-r--r--src/lib/protocols/nats.c1
-rw-r--r--src/lib/protocols/nest_log_sink.c1
-rw-r--r--src/lib/protocols/netbios.c1
-rw-r--r--src/lib/protocols/netflow.c1
-rw-r--r--src/lib/protocols/nfs.c1
-rw-r--r--src/lib/protocols/nintendo.c1
-rw-r--r--src/lib/protocols/noe.c1
-rw-r--r--src/lib/protocols/non_tcp_udp.c1
-rw-r--r--src/lib/protocols/ntp.c1
-rw-r--r--src/lib/protocols/oicq.c1
-rw-r--r--src/lib/protocols/ookla.c1
-rw-r--r--src/lib/protocols/openvpn.c1
-rw-r--r--src/lib/protocols/oracle.c1
-rw-r--r--src/lib/protocols/postgres.c1
-rw-r--r--src/lib/protocols/ppstream.c1
-rw-r--r--src/lib/protocols/pptp.c1
-rw-r--r--src/lib/protocols/protobuf.c1
-rw-r--r--src/lib/protocols/qq.c1
-rw-r--r--src/lib/protocols/quic.c9
-rw-r--r--src/lib/protocols/radius.c1
-rw-r--r--src/lib/protocols/raknet.c1
-rw-r--r--src/lib/protocols/rdp.c1
-rw-r--r--src/lib/protocols/redis_net.c1
-rw-r--r--src/lib/protocols/riotgames.c1
-rw-r--r--src/lib/protocols/rmcp.c1
-rw-r--r--src/lib/protocols/rsh.c1
-rw-r--r--src/lib/protocols/rsync.c1
-rw-r--r--src/lib/protocols/rtcp.c1
-rw-r--r--src/lib/protocols/rtmp.c1
-rw-r--r--src/lib/protocols/rtp.c1
-rw-r--r--src/lib/protocols/rtsp.c1
-rw-r--r--src/lib/protocols/rx.c1
-rw-r--r--src/lib/protocols/s7comm.c1
-rw-r--r--src/lib/protocols/sd_rtn.c1
-rw-r--r--src/lib/protocols/sflow.c1
-rw-r--r--src/lib/protocols/sip.c1
-rw-r--r--src/lib/protocols/skinny.c1
-rw-r--r--src/lib/protocols/skype.c1
-rw-r--r--src/lib/protocols/slp.c1
-rw-r--r--src/lib/protocols/smb.c1
-rw-r--r--src/lib/protocols/smpp.c1
-rw-r--r--src/lib/protocols/snmp_proto.c1
-rw-r--r--src/lib/protocols/soap.c1
-rw-r--r--src/lib/protocols/socks45.c1
-rw-r--r--src/lib/protocols/softether.c1
-rw-r--r--src/lib/protocols/someip.c1
-rw-r--r--src/lib/protocols/source_engine.c1
-rw-r--r--src/lib/protocols/spotify.c1
-rw-r--r--src/lib/protocols/ssdp.c1
-rw-r--r--src/lib/protocols/ssh.c1
-rw-r--r--src/lib/protocols/starcraft.c1
-rw-r--r--src/lib/protocols/steam.c1
-rw-r--r--src/lib/protocols/stun.c8
-rw-r--r--src/lib/protocols/syncthing.c1
-rw-r--r--src/lib/protocols/syslog.c1
-rw-r--r--src/lib/protocols/tailscale.c1
-rw-r--r--src/lib/protocols/tcp_udp.c1
-rw-r--r--src/lib/protocols/teamspeak.c1
-rw-r--r--src/lib/protocols/teamviewer.c1
-rw-r--r--src/lib/protocols/telegram.c1
-rw-r--r--src/lib/protocols/telnet.c1
-rw-r--r--src/lib/protocols/teredo.c1
-rw-r--r--src/lib/protocols/tftp.c1
-rw-r--r--src/lib/protocols/threema.c1
-rw-r--r--src/lib/protocols/thrift.c1
-rw-r--r--src/lib/protocols/tinc.c1
-rw-r--r--src/lib/protocols/tivoconnect.c1
-rw-r--r--src/lib/protocols/tls.c14
-rw-r--r--src/lib/protocols/tocaboca.c1
-rw-r--r--src/lib/protocols/tplink_shp.c1
-rw-r--r--src/lib/protocols/tuya_lp.c1
-rw-r--r--src/lib/protocols/tvuplayer.c1
-rw-r--r--src/lib/protocols/ubntac2.c1
-rw-r--r--src/lib/protocols/ultrasurf.c1
-rw-r--r--src/lib/protocols/usenet.c1
-rw-r--r--src/lib/protocols/vhua.c1
-rw-r--r--src/lib/protocols/viber.c1
-rw-r--r--src/lib/protocols/vmware.c1
-rw-r--r--src/lib/protocols/vnc.c1
-rw-r--r--src/lib/protocols/vxlan.c1
-rw-r--r--src/lib/protocols/warcraft3.c1
-rw-r--r--src/lib/protocols/websocket.c1
-rw-r--r--src/lib/protocols/whatsapp.c1
-rw-r--r--src/lib/protocols/whoisdas.c1
-rw-r--r--src/lib/protocols/wireguard.c1
-rw-r--r--src/lib/protocols/world_of_kung_fu.c1
-rw-r--r--src/lib/protocols/world_of_warcraft.c1
-rw-r--r--src/lib/protocols/wsd.c1
-rw-r--r--src/lib/protocols/xbox.c1
-rw-r--r--src/lib/protocols/xdmcp.c1
-rw-r--r--src/lib/protocols/xiaomi.c1
-rw-r--r--src/lib/protocols/z3950.c1
-rw-r--r--src/lib/protocols/zabbix.c1
-rw-r--r--src/lib/protocols/zattoo.c1
-rw-r--r--src/lib/protocols/zeromq.c1
198 files changed, 608 insertions, 112 deletions
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 4cfb6283e..918547ad0 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -22,7 +22,7 @@ LDFLAGS += @NDPI_LDFLAGS@
LIBS = @ADDITIONAL_LIBS@ @LIBS@ @GPROF_LIBS@
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst third_party/src/hll/%.c, third_party/src/hll/%.o, $(wildcard third_party/src/hll/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
-HEADERS = $(wildcard ../include/*.h) $(wildcard ../include/*.h)
+HEADERS = $(wildcard ../include/*.h) $(wildcard *.h)
NDPI_VERSION_MAJOR = @NDPI_MAJOR@
NDPI_LIB_STATIC = libndpi.a
NDPI_LIB_SHARED_BASE = libndpi.so
diff --git a/src/lib/ndpi_geoip.c b/src/lib/ndpi_geoip.c
index c3308b48b..599eaf6e0 100644
--- a/src/lib/ndpi_geoip.c
+++ b/src/lib/ndpi_geoip.c
@@ -27,6 +27,7 @@
#include <stdint.h>
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include "ndpi_config.h"
#ifdef HAVE_MAXMINDDB
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index eaffe2056..c7110c802 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -33,6 +33,7 @@
#include "ndpi_config.h"
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include "ahocorasick.h"
#include "libcache.h"
@@ -208,21 +209,10 @@ _Static_assert(sizeof(ndpi_known_risks) / sizeof(ndpi_risk_info) == NDPI_MAX_RIS
/* ****************************************** */
-extern void ndpi_unset_risk(struct ndpi_detection_module_struct *ndpi_str,
- struct ndpi_flow_struct *flow, ndpi_risk_enum r);
-extern u_int32_t make_mining_key(struct ndpi_flow_struct *flow);
-extern u_int32_t make_bittorrent_host_key(struct ndpi_flow_struct *flow, int client, int offset);
-extern u_int32_t make_bittorrent_peers_key(struct ndpi_flow_struct *flow);
-extern int stun_search_into_zoom_cache(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
-extern void ookla_add_to_cache(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-extern int ookla_search_into_cache(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-
/* Forward */
static int addDefaultPort(struct ndpi_detection_module_struct *ndpi_str,
ndpi_port_range *range, ndpi_proto_defaults_t *def,
- u_int8_t customUserProto, ndpi_default_ports_tree_node_t **root,
+ u_int8_t customUserProto, default_ports_tree_node_t **root,
const char *_func, int _line);
static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet);
@@ -623,9 +613,9 @@ void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_str,
/* ******************************************************************** */
-static int ndpi_default_ports_tree_node_t_cmp(const void *a, const void *b) {
- ndpi_default_ports_tree_node_t *fa = (ndpi_default_ports_tree_node_t *) a;
- ndpi_default_ports_tree_node_t *fb = (ndpi_default_ports_tree_node_t *) b;
+static int default_ports_tree_node_t_cmp(const void *a, const void *b) {
+ default_ports_tree_node_t *fa = (default_ports_tree_node_t *) a;
+ default_ports_tree_node_t *fb = (default_ports_tree_node_t *) b;
//printf("[NDPI] %s(%d, %d)\n", __FUNCTION__, fa->default_port, fb->default_port);
@@ -638,15 +628,15 @@ static int addDefaultPort(struct ndpi_detection_module_struct *ndpi_str,
ndpi_port_range *range,
ndpi_proto_defaults_t *def,
u_int8_t customUserProto,
- ndpi_default_ports_tree_node_t **root,
+ default_ports_tree_node_t **root,
const char *_func,
int _line) {
u_int32_t port;
for(port = range->port_low; port <= range->port_high; port++) {
- ndpi_default_ports_tree_node_t *node =
- (ndpi_default_ports_tree_node_t *) ndpi_malloc(sizeof(ndpi_default_ports_tree_node_t));
- ndpi_default_ports_tree_node_t *ret;
+ default_ports_tree_node_t *node =
+ (default_ports_tree_node_t *) ndpi_malloc(sizeof(default_ports_tree_node_t));
+ default_ports_tree_node_t *ret;
if(!node) {
NDPI_LOG_ERR(ndpi_str, "%s:%d not enough memory\n", _func, _line);
@@ -654,9 +644,9 @@ static int addDefaultPort(struct ndpi_detection_module_struct *ndpi_str,
}
node->proto = def, node->default_port = port, node->customUserProto = customUserProto;
- ret = (ndpi_default_ports_tree_node_t *) ndpi_tsearch(node,
- (void *) root,
- ndpi_default_ports_tree_node_t_cmp); /* Add it to the tree */
+ ret = (default_ports_tree_node_t *) ndpi_tsearch(node,
+ (void *) root,
+ default_ports_tree_node_t_cmp); /* Add it to the tree */
if(ret == NULL) {
NDPI_LOG_DBG(ndpi_str, "[NDPI] %s:%d error searching for port %u\n", _func, _line, port);
@@ -3912,25 +3902,25 @@ void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_str) {
/* ****************************************************** */
-static ndpi_default_ports_tree_node_t *ndpi_get_guessed_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
- u_int8_t proto, u_int16_t sport, u_int16_t dport) {
- ndpi_default_ports_tree_node_t node;
+static default_ports_tree_node_t *ndpi_get_guessed_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
+ u_int8_t proto, u_int16_t sport, u_int16_t dport) {
+ default_ports_tree_node_t node;
if(sport && dport) {
const void *ret;
node.default_port = dport; /* Check server port first */
ret = ndpi_tfind(&node, (proto == IPPROTO_TCP) ? (void *) &ndpi_str->tcpRoot : (void *) &ndpi_str->udpRoot,
- ndpi_default_ports_tree_node_t_cmp);
+ default_ports_tree_node_t_cmp);
if(ret == NULL) {
node.default_port = sport;
ret = ndpi_tfind(&node, (proto == IPPROTO_TCP) ? (void *) &ndpi_str->tcpRoot : (void *) &ndpi_str->udpRoot,
- ndpi_default_ports_tree_node_t_cmp);
+ default_ports_tree_node_t_cmp);
}
if(ret)
- return(*(ndpi_default_ports_tree_node_t **) ret);
+ return(*(default_ports_tree_node_t **) ret);
}
return(NULL);
@@ -3962,7 +3952,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
*user_defined_proto = 0; /* Default */
if(sport && dport) {
- ndpi_default_ports_tree_node_t *found = ndpi_get_guessed_protocol_id(ndpi_str, proto, sport, dport);
+ default_ports_tree_node_t *found = ndpi_get_guessed_protocol_id(ndpi_str, proto, sport, dport);
if(found != NULL) {
u_int16_t guessed_proto = found->proto->protoId;
@@ -4977,12 +4967,12 @@ void ndpi_set_bitmask_protocol_detection(char *label, struct ndpi_detection_modu
static int ndpi_callback_init(struct ndpi_detection_module_struct *ndpi_str) {
NDPI_PROTOCOL_BITMASK *detection_bitmask = &ndpi_str->detection_bitmask;
- struct ndpi_call_function_struct *all_cb = NULL;
+ struct call_function_struct *all_cb = NULL;
u_int32_t a = 0;
if(ndpi_str->callback_buffer) return 0;
- ndpi_str->callback_buffer = ndpi_calloc(NDPI_MAX_SUPPORTED_PROTOCOLS+1,sizeof(struct ndpi_call_function_struct));
+ ndpi_str->callback_buffer = ndpi_calloc(NDPI_MAX_SUPPORTED_PROTOCOLS+1,sizeof(struct call_function_struct));
if(!ndpi_str->callback_buffer) return 1;
/* set this here to zero to be interrupt safe */
@@ -5575,9 +5565,9 @@ static int ndpi_callback_init(struct ndpi_detection_module_struct *ndpi_str) {
ndpi_str->callback_buffer_size = a;
/* Resize callback_buffer */
- all_cb = ndpi_calloc(a+1,sizeof(struct ndpi_call_function_struct));
+ all_cb = ndpi_calloc(a+1,sizeof(struct call_function_struct));
if(all_cb) {
- memcpy((char *)all_cb,(char *)ndpi_str->callback_buffer, (a+1) * sizeof(struct ndpi_call_function_struct));
+ memcpy((char *)all_cb,(char *)ndpi_str->callback_buffer, (a+1) * sizeof(struct call_function_struct));
ndpi_free(ndpi_str->callback_buffer);
ndpi_str->callback_buffer = all_cb;
}
@@ -5589,7 +5579,7 @@ static int ndpi_callback_init(struct ndpi_detection_module_struct *ndpi_str) {
ndpi_str->callback_buffer_size_tcp_no_payload +
ndpi_str->callback_buffer_size_udp +
ndpi_str->callback_buffer_size_non_tcp_udp,
- sizeof(struct ndpi_call_function_struct));
+ sizeof(struct call_function_struct));
if(!all_cb) return 1;
ndpi_str->callback_buffer_tcp_payload = all_cb;
@@ -5665,7 +5655,7 @@ static void ndpi_enabled_callbacks_init(struct ndpi_detection_module_struct *ndp
NDPI_LOG_DBG2(ndpi_str, "callback_buffer_tcp_payload, adding buffer %u as entry %u\n", a,
ndpi_str->callback_buffer_size_tcp_payload);
memcpy(&ndpi_str->callback_buffer_tcp_payload[ndpi_str->callback_buffer_size_tcp_payload],
- &ndpi_str->callback_buffer[a], sizeof(struct ndpi_call_function_struct));
+ &ndpi_str->callback_buffer[a], sizeof(struct call_function_struct));
}
ndpi_str->callback_buffer_size_tcp_payload++;
}
@@ -5676,7 +5666,7 @@ static void ndpi_enabled_callbacks_init(struct ndpi_detection_module_struct *ndp
NDPI_LOG_DBG2(ndpi_str,
"\tcallback_buffer_tcp_no_payload, additional adding buffer %u to no_payload process\n", a);
memcpy(&ndpi_str->callback_buffer_tcp_no_payload[ndpi_str->callback_buffer_size_tcp_no_payload],
- &ndpi_str->callback_buffer[a], sizeof(struct ndpi_call_function_struct));
+ &ndpi_str->callback_buffer[a], sizeof(struct call_function_struct));
}
ndpi_str->callback_buffer_size_tcp_no_payload++;
}
@@ -5689,7 +5679,7 @@ static void ndpi_enabled_callbacks_init(struct ndpi_detection_module_struct *ndp
NDPI_LOG_DBG2(ndpi_str, "callback_buffer_size_udp: adding buffer : %u\n", a);
memcpy(&ndpi_str->callback_buffer_udp[ndpi_str->callback_buffer_size_udp], &ndpi_str->callback_buffer[a],
- sizeof(struct ndpi_call_function_struct));
+ sizeof(struct call_function_struct));
}
ndpi_str->callback_buffer_size_udp++;
}
@@ -5702,7 +5692,7 @@ static void ndpi_enabled_callbacks_init(struct ndpi_detection_module_struct *ndp
NDPI_LOG_DBG2(ndpi_str, "callback_buffer_non_tcp_udp: adding buffer : %u\n", a);
memcpy(&ndpi_str->callback_buffer_non_tcp_udp[ndpi_str->callback_buffer_size_non_tcp_udp],
- &ndpi_str->callback_buffer[a], sizeof(struct ndpi_call_function_struct));
+ &ndpi_str->callback_buffer[a], sizeof(struct call_function_struct));
}
ndpi_str->callback_buffer_size_non_tcp_udp++;
}
@@ -5787,7 +5777,7 @@ int ndpi_handle_ipv6_extension_headers(u_int16_t l3len, const u_int8_t **l4ptr,
/* ******************************************************************** */
/* Used by dns.c */
-u_int8_t ndpi_iph_is_valid_and_not_fragmented(const struct ndpi_iphdr *iph, const u_int16_t ipsize) {
+u_int8_t iph_is_valid_and_not_fragmented(const struct ndpi_iphdr *iph, const u_int16_t ipsize) {
/*
returned value:
0: fragmented
@@ -5855,7 +5845,7 @@ static u_int8_t ndpi_detection_get_l4_internal(struct ndpi_detection_module_stru
}
/* 0: fragmented; 1: not fragmented */
- if(iph != NULL && ndpi_iph_is_valid_and_not_fragmented(iph, l3_len)) {
+ if(iph != NULL && iph_is_valid_and_not_fragmented(iph, l3_len)) {
u_int16_t len = ndpi_min(ntohs(iph->tot_len), l3_len);
u_int16_t hlen = (iph->ihl * 4);
@@ -6228,16 +6218,16 @@ static int fully_enc_heuristic(struct ndpi_detection_module_struct *ndpi_str,
/* ************************************************ */
-int ndpi_current_pkt_from_client_to_server(const struct ndpi_detection_module_struct *ndpi_str,
- const struct ndpi_flow_struct *flow)
+int current_pkt_from_client_to_server(const struct ndpi_detection_module_struct *ndpi_str,
+ const struct ndpi_flow_struct *flow)
{
return ndpi_str->packet.packet_direction == flow->client_packet_direction;
}
/* ******************************************************************** */
-int ndpi_current_pkt_from_server_to_client(const struct ndpi_detection_module_struct *ndpi_str,
- const struct ndpi_flow_struct *flow)
+int current_pkt_from_server_to_client(const struct ndpi_detection_module_struct *ndpi_str,
+ const struct ndpi_flow_struct *flow)
{
return ndpi_str->packet.packet_direction != flow->client_packet_direction;
}
@@ -6447,7 +6437,7 @@ void ndpi_connection_tracking(struct ndpi_detection_module_struct *ndpi_str,
}
}
- if(ndpi_current_pkt_from_client_to_server(ndpi_str, flow)) {
+ if(current_pkt_from_client_to_server(ndpi_str, flow)) {
if(flow->is_ipv6 == 0) {
flow->c_address.v4 = packet->iph->saddr;
flow->s_address.v4 = packet->iph->daddr;
@@ -6546,7 +6536,7 @@ static u_int32_t check_ndpi_subprotocols(struct ndpi_detection_module_struct * c
static u_int32_t check_ndpi_detection_func(struct ndpi_detection_module_struct * const ndpi_str,
struct ndpi_flow_struct * const flow,
NDPI_SELECTION_BITMASK_PROTOCOL_SIZE const ndpi_selection_packet,
- struct ndpi_call_function_struct const * const callback_buffer,
+ struct call_function_struct const * const callback_buffer,
uint32_t callback_buffer_size,
int is_tcp_without_payload)
{
@@ -6956,11 +6946,11 @@ u_int32_t ndpi_ip_port_hash_funct(u_int32_t ip, u_int16_t port) {
/* #define BITTORRENT_CACHE_DEBUG */
-int ndpi_search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow) {
+int search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow) {
#ifdef BITTORRENT_CACHE_DEBUG
- printf("[%s:%u] ndpi_search_into_bittorrent_cache(%u, %u) [bt_check_performed=%d]\n",
+ printf("[%s:%u] search_into_bittorrent_cache(%u, %u) [bt_check_performed=%d]\n",
__FILE__, __LINE__, ntohs(flow->c_port), ntohs(flow->s_port),
flow->bt_check_performed);
#endif
@@ -7109,7 +7099,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
/* Does it looks like BitTorrent? */
if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN &&
- ndpi_search_into_bittorrent_cache(ndpi_str, flow)) {
+ search_into_bittorrent_cache(ndpi_str, flow)) {
ndpi_set_detected_protocol(ndpi_str, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_PARTIAL_CACHE);
ret.app_protocol = flow->detected_protocol_stack[0];
}
@@ -7572,7 +7562,7 @@ static int ndpi_is_ntop_protocol(ndpi_protocol *ret) {
static int ndpi_check_protocol_port_mismatch_exceptions(struct ndpi_detection_module_struct *ndpi_str,
struct ndpi_flow_struct *flow,
- ndpi_default_ports_tree_node_t *expected_proto,
+ default_ports_tree_node_t *expected_proto,
ndpi_protocol *returned_proto) {
/*
For TLS (and other protocols) it is not simple to guess the exact protocol so before
@@ -7816,7 +7806,7 @@ static ndpi_protocol ndpi_internal_detection_process_packet(struct ndpi_detectio
if((!flow->risk_checked)
&& ((ret.master_protocol != NDPI_PROTOCOL_UNKNOWN) || (ret.app_protocol != NDPI_PROTOCOL_UNKNOWN))
) {
- ndpi_default_ports_tree_node_t *found;
+ default_ports_tree_node_t *found;
u_int16_t *default_ports;
if(packet->udp)
@@ -7855,8 +7845,8 @@ static ndpi_protocol ndpi_internal_detection_process_packet(struct ndpi_detectio
} /* for */
if(!found) {
- ndpi_default_ports_tree_node_t *r = ndpi_get_guessed_protocol_id(ndpi_str, packet->udp ? IPPROTO_UDP : IPPROTO_TCP,
- ntohs(flow->c_port), ntohs(flow->s_port));
+ default_ports_tree_node_t *r = ndpi_get_guessed_protocol_id(ndpi_str, packet->udp ? IPPROTO_UDP : IPPROTO_TCP,
+ ntohs(flow->c_port), ntohs(flow->s_port));
if((r == NULL)
|| ((r->proto->protoId != ret.app_protocol) && (r->proto->protoId != ret.master_protocol))) {
@@ -7904,8 +7894,8 @@ static ndpi_protocol ndpi_internal_detection_process_packet(struct ndpi_detectio
}
if(!found) {
- ndpi_default_ports_tree_node_t *r = ndpi_get_guessed_protocol_id(ndpi_str, packet->udp ? IPPROTO_UDP : IPPROTO_TCP,
- ntohs(flow->c_port), ntohs(flow->s_port));
+ default_ports_tree_node_t *r = ndpi_get_guessed_protocol_id(ndpi_str, packet->udp ? IPPROTO_UDP : IPPROTO_TCP,
+ ntohs(flow->c_port), ntohs(flow->s_port));
if((r == NULL)
|| ((r->proto->protoId != ret.app_protocol) && (r->proto->protoId != ret.master_protocol)))
@@ -8783,7 +8773,7 @@ static ndpi_protocol ndpi_internal_guess_undetected_protocol(struct ndpi_detecti
}
if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN &&
- ndpi_search_into_bittorrent_cache(ndpi_str, flow)) {
+ search_into_bittorrent_cache(ndpi_str, flow)) {
/* This looks like BitTorrent */
ret.app_protocol = NDPI_PROTOCOL_BITTORRENT;
}
diff --git a/src/lib/ndpi_private.h b/src/lib/ndpi_private.h
new file mode 100644
index 000000000..58260e6a1
--- /dev/null
+++ b/src/lib/ndpi_private.h
@@ -0,0 +1,359 @@
+#ifndef __NDPI_PRIVATE_H__
+#define __NDPI_PRIVATE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Not sure if we still need it.. keep it for the time being */
+#ifdef NDPI_LIB_COMPILATION
+
+/* Needed to have access to HAVE_* defines */
+#ifndef _NDPI_CONFIG_H_
+#include "ndpi_config.h"
+#define _NDPI_CONFIG_H_
+#endif
+
+struct call_function_struct {
+ NDPI_PROTOCOL_BITMASK detection_bitmask;
+ NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
+ void (*func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow);
+ NDPI_SELECTION_BITMASK_PROTOCOL_SIZE ndpi_selection_bitmask;
+ u_int16_t ndpi_protocol_id;
+ u_int8_t detection_feature;
+};
+
+struct subprotocol_conf_struct {
+ void (*func) (struct ndpi_detection_module_struct *, char *attr, char *value, int protocol_id);
+};
+
+typedef struct default_ports_tree_node {
+ ndpi_proto_defaults_t *proto;
+ u_int8_t customUserProto;
+ u_int16_t default_port;
+} default_ports_tree_node_t;
+
+
+#define LINE_EQUALS(ndpi_int_one_line_struct, string_to_compare) \
+ ((ndpi_int_one_line_struct).len == strlen(string_to_compare) && \
+ LINE_CMP(ndpi_int_one_line_struct, string_to_compare, strlen(string_to_compare)) == 1)
+
+#define LINE_STARTS(ndpi_int_one_line_struct, string_to_compare) \
+ ((ndpi_int_one_line_struct).len >= strlen(string_to_compare) && \
+ LINE_CMP(ndpi_int_one_line_struct, string_to_compare, strlen(string_to_compare)) == 1)
+
+#define LINE_ENDS(ndpi_int_one_line_struct, string_to_compare) \
+ ((ndpi_int_one_line_struct).len >= strlen(string_to_compare) && \
+ memcmp((ndpi_int_one_line_struct).ptr + \
+ ((ndpi_int_one_line_struct).len - strlen(string_to_compare)), \
+ string_to_compare, strlen(string_to_compare)) == 0)
+
+#define LINE_CMP(ndpi_int_one_line_struct, string_to_compare, string_to_compare_length) \
+ ((ndpi_int_one_line_struct).ptr != NULL && \
+ memcmp((ndpi_int_one_line_struct).ptr, string_to_compare, string_to_compare_length) == 0)
+
+struct ndpi_int_one_line_struct {
+ const u_int8_t *ptr;
+ u_int16_t len;
+};
+
+struct ndpi_packet_struct {
+ const struct ndpi_iphdr *iph;
+ const struct ndpi_ipv6hdr *iphv6;
+ const struct ndpi_tcphdr *tcp;
+ const struct ndpi_udphdr *udp;
+ const u_int8_t *generic_l4_ptr; /* is set only for non tcp-udp traffic */
+ const u_int8_t *payload;
+
+ u_int64_t current_time_ms;
+
+ struct ndpi_int_one_line_struct line[NDPI_MAX_PARSE_LINES_PER_PACKET];
+ /* HTTP headers */
+ struct ndpi_int_one_line_struct host_line;
+ struct ndpi_int_one_line_struct forwarded_line;
+ struct ndpi_int_one_line_struct referer_line;
+ struct ndpi_int_one_line_struct content_line;
+ struct ndpi_int_one_line_struct content_disposition_line;
+ struct ndpi_int_one_line_struct accept_line;
+ struct ndpi_int_one_line_struct authorization_line;
+ struct ndpi_int_one_line_struct user_agent_line;
+ struct ndpi_int_one_line_struct http_url_name;
+ struct ndpi_int_one_line_struct http_encoding;
+ struct ndpi_int_one_line_struct http_transfer_encoding;
+ struct ndpi_int_one_line_struct http_contentlen;
+ struct ndpi_int_one_line_struct http_cookie;
+ struct ndpi_int_one_line_struct http_origin;
+ struct ndpi_int_one_line_struct http_x_session_type;
+ struct ndpi_int_one_line_struct server_line;
+ struct ndpi_int_one_line_struct http_method;
+ struct ndpi_int_one_line_struct http_response; /* the first "word" in this pointer is the
+ response code in the packet (200, etc) */
+ u_int8_t http_num_headers; /* number of found (valid) header lines in HTTP request or response */
+
+ u_int16_t l3_packet_len;
+ u_int16_t payload_packet_len;
+ u_int16_t parsed_lines;
+ u_int16_t empty_line_position;
+ u_int8_t tcp_retransmission;
+
+ u_int8_t packet_lines_parsed_complete:1,
+ packet_direction:1, empty_line_position_set:1, http_check_content:1, pad:4;
+};
+
+typedef struct ndpi_list_struct {
+ char *value;
+ struct ndpi_list_struct *next;
+} ndpi_list;
+
+#ifdef HAVE_NBPF
+typedef struct {
+ void *tree; /* cast to nbpf_filter* */
+ u_int16_t l7_protocol;
+} nbpf_filter;
+#endif
+
+struct ndpi_detection_module_struct {
+ NDPI_PROTOCOL_BITMASK detection_bitmask;
+
+ u_int64_t current_ts;
+ u_int16_t max_packets_to_process;
+ u_int16_t num_tls_blocks_to_follow;
+ u_int8_t skip_tls_blocks_until_change_cipher:1, enable_ja3_plus:1, _notused:6;
+ u_int8_t tls_certificate_expire_in_x_days;
+
+ void *user_data;
+ char custom_category_labels[NUM_CUSTOM_CATEGORIES][CUSTOM_CATEGORY_LABEL_LEN];
+
+ /* callback function buffer */
+ struct call_function_struct *callback_buffer;
+ struct call_function_struct *callback_buffer_tcp_no_payload;
+ struct call_function_struct *callback_buffer_tcp_payload;
+ struct call_function_struct *callback_buffer_udp;
+ struct call_function_struct *callback_buffer_non_tcp_udp;
+ u_int32_t callback_buffer_size;
+ u_int32_t callback_buffer_size_tcp_no_payload;
+ u_int32_t callback_buffer_size_tcp_payload;
+ u_int32_t callback_buffer_size_udp;
+ u_int32_t callback_buffer_size_non_tcp_udp;
+
+ default_ports_tree_node_t *tcpRoot, *udpRoot;
+
+ ndpi_log_level_t ndpi_log_level; /* default error */
+
+#ifdef NDPI_ENABLE_DEBUG_MESSAGES
+ /* debug callback, only set when debug is used */
+ ndpi_debug_function_ptr ndpi_debug_printf;
+ const char *ndpi_debug_print_file;
+ const char *ndpi_debug_print_function;
+ u_int32_t ndpi_debug_print_line;
+ NDPI_PROTOCOL_BITMASK debug_bitmask;
+#endif
+
+ /* misc parameters */
+ u_int32_t tcp_max_retransmission_window_size;
+
+ /* subprotocol registration handler */
+ struct subprotocol_conf_struct subprotocol_conf[NDPI_MAX_SUPPORTED_PROTOCOLS + 1];
+
+ u_int ndpi_num_supported_protocols;
+ u_int ndpi_num_custom_protocols;
+
+ int ac_automa_finalized;
+ /* HTTP/DNS/HTTPS/QUIC host matching */
+ ndpi_automa host_automa, /* Used for DNS/HTTPS */
+ risky_domain_automa, tls_cert_subject_automa,
+ host_risk_mask_automa, common_alpns_automa;
+ /* IMPORTANT: please, whenever you add a new automa:
+ * update ndpi_finalize_initialization()
+ * update automa_type above
+ */
+
+ ndpi_str_hash *malicious_ja3_hashmap, *malicious_sha1_hashmap;
+
+ ndpi_list *trusted_issuer_dn;
+
+ /* Patricia trees */
+ ndpi_patricia_tree_t *ip_risk_mask_ptree;
+ ndpi_patricia_tree_t *ip_risk_mask_ptree6;
+ ndpi_patricia_tree_t *ip_risk_ptree;
+ ndpi_patricia_tree_t *ip_risk_ptree6;
+ ndpi_patricia_tree_t *protocols_ptree; /* IP-based protocol detection */
+ ndpi_patricia_tree_t *protocols_ptree6;
+
+ /* *** If you add a new Patricia tree, please update ptree_type above! *** */
+
+ struct {
+#ifdef USE_LEGACY_AHO_CORASICK
+ ndpi_automa hostnames, hostnames_shadow;
+#else
+ ndpi_domain_classify *sc_hostnames, *sc_hostnames_shadow;
+#endif
+ void *ipAddresses, *ipAddresses_shadow; /* Patricia */
+ void *ipAddresses6, *ipAddresses6_shadow; /* Patricia IPv6*/
+ u_int8_t categories_loaded;
+ } custom_categories;
+
+ u_int8_t ip_version_limit;
+
+ /* NDPI_PROTOCOL_TINC */
+ struct cache *tinc_cache;
+
+ /* NDPI_PROTOCOL_OOKLA */
+ struct ndpi_lru_cache *ookla_cache;
+ u_int32_t ookla_cache_num_entries;
+ u_int32_t ookla_cache_ttl;
+
+ /* NDPI_PROTOCOL_BITTORRENT */
+ struct ndpi_lru_cache *bittorrent_cache;
+ u_int32_t bittorrent_cache_num_entries;
+ u_int32_t bittorrent_cache_ttl;
+
+ /* NDPI_PROTOCOL_ZOOM */
+ struct ndpi_lru_cache *zoom_cache;
+ u_int32_t zoom_cache_num_entries;
+ u_int32_t zoom_cache_ttl;
+
+ /* NDPI_PROTOCOL_STUN and subprotocols */
+ struct ndpi_lru_cache *stun_cache;
+ u_int32_t stun_cache_num_entries;
+ u_int32_t stun_cache_ttl;
+ struct ndpi_lru_cache *stun_zoom_cache;
+ u_int32_t stun_zoom_cache_num_entries;
+ u_int32_t stun_zoom_cache_ttl;
+
+ /* NDPI_PROTOCOL_TLS and subprotocols */
+ struct ndpi_lru_cache *tls_cert_cache;
+ u_int32_t tls_cert_cache_num_entries;
+ int32_t tls_cert_cache_ttl;
+
+ /* NDPI_PROTOCOL_MINING and subprotocols */
+ struct ndpi_lru_cache *mining_cache;
+ u_int32_t mining_cache_num_entries;
+ u_int32_t mining_cache_ttl;
+
+ /* NDPI_PROTOCOL_MSTEAMS */
+ struct ndpi_lru_cache *msteams_cache;
+ u_int32_t msteams_cache_num_entries;
+ u_int32_t msteams_cache_ttl;
+
+ /* *** If you add a new LRU cache, please update lru_cache_type above! *** */
+
+ int opportunistic_tls_smtp_enabled;
+ int opportunistic_tls_imap_enabled;
+ int opportunistic_tls_pop_enabled;
+ int opportunistic_tls_ftp_enabled;
+ int opportunistic_tls_stun_enabled;
+
+ u_int32_t monitoring_stun_pkts_to_process;
+ u_int32_t monitoring_stun_flags;
+
+ u_int32_t aggressiveness_ookla;
+
+ int tcp_ack_paylod_heuristic;
+ int fully_encrypted_based_on_first_pkt_heuristic;
+
+ u_int16_t ndpi_to_user_proto_id[NDPI_MAX_NUM_CUSTOM_PROTOCOLS]; /* custom protocolId mapping */
+ ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
+
+ u_int8_t direction_detect_disable:1, /* disable internal detection of packet direction */ _pad:7;
+
+#ifdef CUSTOM_NDPI_PROTOCOLS
+ #include "../../../nDPI-custom/custom_ndpi_typedefs.h"
+#endif
+
+ /* GeoIP */
+ void *mmdb_city, *mmdb_as;
+ u_int8_t mmdb_city_loaded, mmdb_as_loaded;
+
+ /* Current packet */
+ struct ndpi_packet_struct packet;
+ const struct ndpi_flow_input_info *input_info;
+
+#ifdef HAVE_NBPF
+ u_int8_t num_nbpf_custom_proto;
+ nbpf_filter nbpf_custom_proto[MAX_NBPF_CUSTOM_PROTO];
+#endif
+
+ u_int16_t max_payload_track_len;
+};
+
+
+
+
+
+
+/* Generic */
+
+char *strptime(const char *s, const char *format, struct tm *tm);
+
+u_int8_t iph_is_valid_and_not_fragmented(const struct ndpi_iphdr *iph, const u_int16_t ipsize);
+
+int current_pkt_from_client_to_server(const struct ndpi_detection_module_struct *ndpi_str, const struct ndpi_flow_struct *flow);
+int current_pkt_from_server_to_client(const struct ndpi_detection_module_struct *ndpi_str, const struct ndpi_flow_struct *flow);
+
+/* TLS */
+int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow, uint32_t quic_version);
+void processCertificateElements(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ u_int16_t p_offset, u_int16_t certificate_len);
+void switch_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+int is_dtls(const u_int8_t *buf, u_int32_t buf_len, u_int32_t *block_len);
+void switch_extra_dissection_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+
+/* HTTP */
+void http_process_user_agent(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ const u_int8_t *ua_ptr, u_int16_t ua_ptr_len);
+
+/* OOKLA */
+int ookla_search_into_cache(struct ndpi_detection_module_struct* ndpi_struct,
+ struct ndpi_flow_struct* flow);
+void ookla_add_to_cache(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+
+/* QUIC */
+int quic_len(const uint8_t *buf, uint64_t *value);
+int quic_len_buffer_still_required(uint8_t value);
+int is_version_with_var_int_transport_params(uint32_t version);
+int is_version_with_tls(uint32_t version);
+void process_chlo(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ const u_int8_t *crypto_data, uint32_t crypto_data_len);
+void process_tls(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ const u_int8_t *crypto_data, uint32_t crypto_data_len);
+const uint8_t *get_crypto_data(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ u_int8_t *clear_payload, uint32_t clear_payload_len,
+ uint64_t *crypto_data_len);
+
+/* RTP */
+int is_valid_rtp_payload_type(uint8_t type);
+int is_rtp_or_rtcp(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+u_int8_t rtp_get_stream_type(u_int8_t payloadType, ndpi_multimedia_flow_type *s_type);
+
+/* Bittorrent */
+u_int32_t make_bittorrent_host_key(struct ndpi_flow_struct *flow, int client, int offset);
+u_int32_t make_bittorrent_peers_key(struct ndpi_flow_struct *flow);
+int search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+
+
+/* Mining */
+u_int32_t make_mining_key(struct ndpi_flow_struct *flow);
+
+/* Stun */
+int stun_search_into_zoom_cache(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index b41ec6706..041f9226e 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -34,6 +34,7 @@
#include "ndpi_api.h"
#include "ndpi_includes.h"
#include "ndpi_encryption.h"
+#include "ndpi_private.h"
#include "ahocorasick.h"
#include "libcache.h"
diff --git a/src/lib/protocols/activision.c b/src/lib/protocols/activision.c
index 22acd4694..ac24ee80f 100644
--- a/src/lib/protocols/activision.c
+++ b/src/lib/protocols/activision.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ACTIVISION
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_activision_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/afp.c b/src/lib/protocols/afp.c
index 685c8a103..5b420f422 100644
--- a/src/lib/protocols/afp.c
+++ b/src/lib/protocols/afp.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AFP
#include "ndpi_api.h"
+#include "ndpi_private.h"
struct afpHeader {
u_int8_t flags, command;
diff --git a/src/lib/protocols/ajp.c b/src/lib/protocols/ajp.c
index c25b95803..3d2317fb2 100644
--- a/src/lib/protocols/ajp.c
+++ b/src/lib/protocols/ajp.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AJP
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum ajp_direction {
AJP_SERVER_TO_CONTAINER = 0x1234,
diff --git a/src/lib/protocols/alicloud.c b/src/lib/protocols/alicloud.c
index 3966e7587..9ec87f3ec 100644
--- a/src/lib/protocols/alicloud.c
+++ b/src/lib/protocols/alicloud.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ALICLOUD
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_alicloud_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/amazon_video.c b/src/lib/protocols/amazon_video.c
index 62bcd834a..bbb446eb3 100644
--- a/src/lib/protocols/amazon_video.c
+++ b/src/lib/protocols/amazon_video.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMAZON_VIDEO
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_check_amazon_video(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/among_us.c b/src/lib/protocols/among_us.c
index f1e143e81..9cc90ac38 100644
--- a/src/lib/protocols/among_us.c
+++ b/src/lib/protocols/among_us.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMONG_US
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_among_us_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/amqp.c b/src/lib/protocols/amqp.c
index 2998cb357..61c8f02a9 100644
--- a/src/lib/protocols/amqp.c
+++ b/src/lib/protocols/amqp.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMQP
#include "ndpi_api.h"
+#include "ndpi_private.h"
PACK_ON
diff --git a/src/lib/protocols/apple_push.c b/src/lib/protocols/apple_push.c
index f44d457b4..6cc233f61 100644
--- a/src/lib/protocols/apple_push.c
+++ b/src/lib/protocols/apple_push.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APPLE_PUSH
#include "ndpi_api.h"
+#include "ndpi_private.h"
static int is_apple_push_addr(const struct ndpi_packet_struct *packet)
{
diff --git a/src/lib/protocols/armagetron.c b/src/lib/protocols/armagetron.c
index b021862bc..d9cdd1b20 100644
--- a/src/lib/protocols/armagetron.c
+++ b/src/lib/protocols/armagetron.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ARMAGETRON
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/avast.c b/src/lib/protocols/avast.c
index e133f8cf2..388538dea 100644
--- a/src/lib/protocols/avast.c
+++ b/src/lib/protocols/avast.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_avast_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/avast_securedns.c b/src/lib/protocols/avast_securedns.c
index 5eb9a430f..c42a39736 100644
--- a/src/lib/protocols/avast_securedns.c
+++ b/src/lib/protocols/avast_securedns.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_avast_securedns_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/bacnet.c b/src/lib/protocols/bacnet.c
index 907320e4f..b79455d1e 100644
--- a/src/lib/protocols/bacnet.c
+++ b/src/lib/protocols/bacnet.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BACNET
#include "ndpi_api.h"
+#include "ndpi_private.h"
// BVLC (BACnet Virtual Link Control) Annex is part of BVLL (BACnet Virtual Link Layer).
// See: https://www.ashrae.org/file%20library/technical%20resources/standards%20and%20guidelines/standards%20addenda/135-1995_addendum-a.pdf
diff --git a/src/lib/protocols/bgp.c b/src/lib/protocols/bgp.c
index dbc8e5fcc..956eef48d 100644
--- a/src/lib/protocols/bgp.c
+++ b/src/lib/protocols/bgp.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BGP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* this detection also works asymmetrically */
diff --git a/src/lib/protocols/bitcoin.c b/src/lib/protocols/bitcoin.c
index 2154e912a..e7ac4cffb 100644
--- a/src/lib/protocols/bitcoin.c
+++ b/src/lib/protocols/bitcoin.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BITCOIN
#include "ndpi_api.h"
+#include "ndpi_private.h"
/*https://en.bitcoin.it/wiki/Protocol_documentation*/
#define MAIN_NET_MAGIC 0xF9BEB4D9
diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c
index 9e195691b..b3838a8dd 100644
--- a/src/lib/protocols/bittorrent.c
+++ b/src/lib/protocols/bittorrent.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BITTORRENT
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define BITTORRENT_PROTO_STRING "BitTorrent protocol"
@@ -40,8 +41,6 @@ struct ndpi_utp_hdr {
u_int16_t sequence_nr, ack_nr;
};
-extern int ndpi_search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
/* Forward declaration */
static void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct,
@@ -467,7 +466,7 @@ static u_int8_t is_port(u_int16_t a, u_int16_t b, u_int16_t what) {
static void ndpi_skip_bittorrent(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
struct ndpi_packet_struct *packet) {
- if(ndpi_search_into_bittorrent_cache(ndpi_struct, flow))
+ if(search_into_bittorrent_cache(ndpi_struct, flow))
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 0, NDPI_CONFIDENCE_DPI_CACHE);
else
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
diff --git a/src/lib/protocols/bjnp.c b/src/lib/protocols/bjnp.c
index 97370ca92..bf7e24b75 100644
--- a/src/lib/protocols/bjnp.c
+++ b/src/lib/protocols/bjnp.c
@@ -3,6 +3,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BJNP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_bjnp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
diff --git a/src/lib/protocols/can.c b/src/lib/protocols/can.c
index 618464f70..fc12866a8 100644
--- a/src/lib/protocols/can.c
+++ b/src/lib/protocols/can.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CAN
#include "ndpi_api.h"
+#include "ndpi_private.h"
PACK_ON
struct can_hdr {
diff --git a/src/lib/protocols/capwap.c b/src/lib/protocols/capwap.c
index 11a394921..e42a3b6be 100644
--- a/src/lib/protocols/capwap.c
+++ b/src/lib/protocols/capwap.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CAPWAP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define NDPI_CAPWAP_CONTROL_PORT 5246
#define NDPI_CAPWAP_DATA_PORT 5247
diff --git a/src/lib/protocols/cassandra.c b/src/lib/protocols/cassandra.c
index 56c536bb1..9a066f26f 100644
--- a/src/lib/protocols/cassandra.c
+++ b/src/lib/protocols/cassandra.c
@@ -24,6 +24,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CASSANDRA
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define CASSANDRA_HEADER_LEN 9
#define CASSANDRA_MAX_BODY_SIZE 268435456 //256MB (256 * 1024^2)
diff --git a/src/lib/protocols/checkmk.c b/src/lib/protocols/checkmk.c
index 60aeefb43..c70e2a478 100644
--- a/src/lib/protocols/checkmk.c
+++ b/src/lib/protocols/checkmk.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CHECKMK
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_checkmk_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/ciscovpn.c b/src/lib/protocols/ciscovpn.c
index d3a63579d..e5bfd6a22 100644
--- a/src/lib/protocols/ciscovpn.c
+++ b/src/lib/protocols/ciscovpn.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CISCOVPN
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ****************************************************************** */
diff --git a/src/lib/protocols/citrix.c b/src/lib/protocols/citrix.c
index 9bfe58e63..0db341f02 100644
--- a/src/lib/protocols/citrix.c
+++ b/src/lib/protocols/citrix.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CITRIX
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ************************************ */
diff --git a/src/lib/protocols/coap.c b/src/lib/protocols/coap.c
index 8935aa22a..bf6e06924 100644
--- a/src/lib/protocols/coap.c
+++ b/src/lib/protocols/coap.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COAP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define CON 0
diff --git a/src/lib/protocols/collectd.c b/src/lib/protocols/collectd.c
index 990ff6108..500b9a3f3 100644
--- a/src/lib/protocols/collectd.c
+++ b/src/lib/protocols/collectd.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COLLECTD
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define COLLECTD_MIN_BLOCKS_REQUIRED 3
#define COLLECTD_MAX_BLOCKS_TO_DISSECT 5
diff --git a/src/lib/protocols/corba.c b/src/lib/protocols/corba.c
index f22905ea4..aaf3563e6 100644
--- a/src/lib/protocols/corba.c
+++ b/src/lib/protocols/corba.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CORBA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/cpha.c b/src/lib/protocols/cpha.c
index 97bad4262..b2967413f 100644
--- a/src/lib/protocols/cpha.c
+++ b/src/lib/protocols/cpha.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CPHA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_cpha(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/crossfire.c b/src/lib/protocols/crossfire.c
index 28cb3e5ca..547db2e8b 100644
--- a/src/lib/protocols/crossfire.c
+++ b/src/lib/protocols/crossfire.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CROSSFIRE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/crynet.c b/src/lib/protocols/crynet.c
index b018f0724..21cbe7607 100644
--- a/src/lib/protocols/crynet.c
+++ b/src/lib/protocols/crynet.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CRYNET
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_crynet_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/csgo.c b/src/lib/protocols/csgo.c
index 80002fc0a..d1a11950a 100644
--- a/src/lib/protocols/csgo.c
+++ b/src/lib/protocols/csgo.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CSGO
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct ndpi_flow_struct* flow) {
struct ndpi_packet_struct* packet = &ndpi_struct->packet;
diff --git a/src/lib/protocols/dcerpc.c b/src/lib/protocols/dcerpc.c
index 688123ce5..14736f033 100644
--- a/src/lib/protocols/dcerpc.c
+++ b/src/lib/protocols/dcerpc.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RPC
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include <stdbool.h>
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c
index a3971a521..820b57164 100644
--- a/src/lib/protocols/dhcp.c
+++ b/src/lib/protocols/dhcp.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* freeradius/src/lib/dhcp.c */
#define DHCP_CHADDR_LEN 6
diff --git a/src/lib/protocols/dhcpv6.c b/src/lib/protocols/dhcpv6.c
index 9d1e1f1a8..6afcd7a8c 100644
--- a/src/lib/protocols/dhcpv6.c
+++ b/src/lib/protocols/dhcpv6.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCPV6
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/diameter.c b/src/lib/protocols/diameter.c
index 82426a484..0d9a8382b 100644
--- a/src/lib/protocols/diameter.c
+++ b/src/lib/protocols/diameter.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIAMETER
#include "ndpi_api.h"
+#include "ndpi_private.h"
// Header Flags possibile values
diff --git a/src/lib/protocols/discord.c b/src/lib/protocols/discord.c
index e3e59a7e4..5256910db 100644
--- a/src/lib/protocols/discord.c
+++ b/src/lib/protocols/discord.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DISCORD
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_discord_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/dnp3.c b/src/lib/protocols/dnp3.c
index 9361d8bfd..99d23dad7 100644
--- a/src/lib/protocols/dnp3.c
+++ b/src/lib/protocols/dnp3.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DNP3
#include "ndpi_api.h"
+#include "ndpi_private.h"
/*
https://www.ixiacom.com/company/blog/scada-distributed-network-protocol-dnp3
diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c
index b518ba0f2..9a220024e 100644
--- a/src/lib/protocols/dns.c
+++ b/src/lib/protocols/dns.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DNS
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define FLAGS_MASK 0x8000
@@ -37,8 +38,6 @@
#define PKT_LEN_ALERT 512
-/* ndpi_main.c */
-extern u_int8_t ndpi_iph_is_valid_and_not_fragmented(const struct ndpi_iphdr *iph, const u_int16_t ipsize);
static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow);
@@ -869,7 +868,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
/* 0: fragmented; 1: not fragmented */
if((flags & 0x20)
- || (ndpi_iph_is_valid_and_not_fragmented(packet->iph, packet->l3_packet_len) == 0)) {
+ || (iph_is_valid_and_not_fragmented(packet->iph, packet->l3_packet_len) == 0)) {
ndpi_set_risk(ndpi_struct, flow, NDPI_DNS_FRAGMENTED, NULL);
}
} else if(packet->iphv6 != NULL) {
diff --git a/src/lib/protocols/dnscrypt.c b/src/lib/protocols/dnscrypt.c
index 69b827f3d..c4e28323d 100644
--- a/src/lib/protocols/dnscrypt.c
+++ b/src/lib/protocols/dnscrypt.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DNSCRYPT
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_dnscrypt_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/dofus.c b/src/lib/protocols/dofus.c
index 5357fc96f..37dbb2310 100644
--- a/src/lib/protocols/dofus.c
+++ b/src/lib/protocols/dofus.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DOFUS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/drda.c b/src/lib/protocols/drda.c
index dd39afdc6..a3b1a4143 100644
--- a/src/lib/protocols/drda.c
+++ b/src/lib/protocols/drda.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DRDA
#include "ndpi_api.h"
+#include "ndpi_private.h"
struct ndpi_drda_hdr {
u_int16_t length;
diff --git a/src/lib/protocols/dropbox.c b/src/lib/protocols/dropbox.c
index 27d2daf8b..eed06d4d5 100644
--- a/src/lib/protocols/dropbox.c
+++ b/src/lib/protocols/dropbox.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DROPBOX
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define DB_LSP_PORT 17500
diff --git a/src/lib/protocols/eaq.c b/src/lib/protocols/eaq.c
index ff97641ec..b0c191fe8 100644
--- a/src/lib/protocols/eaq.c
+++ b/src/lib/protocols/eaq.c
@@ -30,6 +30,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EAQ
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define EAQ_DEFAULT_PORT 6000
#define EAQ_DEFAULT_SIZE 16
diff --git a/src/lib/protocols/edonkey.c b/src/lib/protocols/edonkey.c
index bd870afb3..389ca587d 100644
--- a/src/lib/protocols/edonkey.c
+++ b/src/lib/protocols/edonkey.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EDONKEY
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/elastic_search.c b/src/lib/protocols/elastic_search.c
index f29b3fb4b..c1de3c86b 100644
--- a/src/lib/protocols/elastic_search.c
+++ b/src/lib/protocols/elastic_search.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ELASTICSEARCH
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_elasticsearch_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/epicgames.c b/src/lib/protocols/epicgames.c
index ea30783fd..040806740 100644
--- a/src/lib/protocols/epicgames.c
+++ b/src/lib/protocols/epicgames.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EPICGAMES
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_epicgames_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/ethereum.c b/src/lib/protocols/ethereum.c
index db7c0cb88..bf9da6bfb 100644
--- a/src/lib/protocols/ethereum.c
+++ b/src/lib/protocols/ethereum.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ETHEREUM
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ************************************************************************** */
diff --git a/src/lib/protocols/ethernet_ip.c b/src/lib/protocols/ethernet_ip.c
index 45ca05698..9a968ee94 100644
--- a/src/lib/protocols/ethernet_ip.c
+++ b/src/lib/protocols/ethernet_ip.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ETHERNET_IP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ethernet_ip_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/fastcgi.c b/src/lib/protocols/fastcgi.c
index f5b4eb0b1..e36311a8e 100644
--- a/src/lib/protocols/fastcgi.c
+++ b/src/lib/protocols/fastcgi.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FASTCGI
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* Reference: http://www.mit.edu/~yandros/doc/specs/fcgi-spec.html */
diff --git a/src/lib/protocols/fix.c b/src/lib/protocols/fix.c
index 0d0e71331..f0fed3360 100644
--- a/src/lib/protocols/fix.c
+++ b/src/lib/protocols/fix.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FIX
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/ftp_control.c b/src/lib/protocols/ftp_control.c
index 86e6491c2..40378a4c6 100644
--- a/src/lib/protocols/ftp_control.c
+++ b/src/lib/protocols/ftp_control.c
@@ -26,13 +26,10 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FTP_CONTROL
#include "ndpi_api.h"
+#include "ndpi_private.h"
// #define FTP_DEBUG
-extern void switch_extra_dissection_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-
-/* *************************************************************** */
static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/ftp_data.c b/src/lib/protocols/ftp_data.c
index ef924c5fa..567669e3d 100644
--- a/src/lib/protocols/ftp_data.c
+++ b/src/lib/protocols/ftp_data.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FTP_DATA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
diff --git a/src/lib/protocols/genshin_impact.c b/src/lib/protocols/genshin_impact.c
index e837747a4..abe15afb5 100644
--- a/src/lib/protocols/genshin_impact.c
+++ b/src/lib/protocols/genshin_impact.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GENSHIN_IMPACT
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_genshin_impact_add_connection(
diff --git a/src/lib/protocols/git.c b/src/lib/protocols/git.c
index 06038febd..a4db11363 100644
--- a/src/lib/protocols/git.c
+++ b/src/lib/protocols/git.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GIT
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define GIT_PORT 9418
diff --git a/src/lib/protocols/gnutella.c b/src/lib/protocols/gnutella.c
index 65415fcbb..94e1dc2ef 100644
--- a/src/lib/protocols/gnutella.c
+++ b/src/lib/protocols/gnutella.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GNUTELLA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/gtp.c b/src/lib/protocols/gtp.c
index a226d9ebf..b26247a9c 100644
--- a/src/lib/protocols/gtp.c
+++ b/src/lib/protocols/gtp.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* This code handles: GTP-U (port 2152), GTP-C (v1 and v2; port 2123) and GTP-PRIME
diff --git a/src/lib/protocols/guildwars.c b/src/lib/protocols/guildwars.c
index 86ca00a6d..202c425bd 100644
--- a/src/lib/protocols/guildwars.c
+++ b/src/lib/protocols/guildwars.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GUILDWARS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/h323.c b/src/lib/protocols/h323.c
index d0e4e8a20..d7041dfc0 100644
--- a/src/lib/protocols/h323.c
+++ b/src/lib/protocols/h323.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_H323
#include "ndpi_api.h"
+#include "ndpi_private.h"
struct tpkt {
diff --git a/src/lib/protocols/halflife2_and_mods.c b/src/lib/protocols/halflife2_and_mods.c
index b4c91dd19..e18434a95 100644
--- a/src/lib/protocols/halflife2_and_mods.c
+++ b/src/lib/protocols/halflife2_and_mods.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HALFLIFE2
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/haproxy.c b/src/lib/protocols/haproxy.c
index 8354df9db..8ceabf9eb 100644
--- a/src/lib/protocols/haproxy.c
+++ b/src/lib/protocols/haproxy.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HAPROXY
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_haproxy_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/hots.c b/src/lib/protocols/hots.c
index ac11f273b..38420ce3a 100644
--- a/src/lib/protocols/hots.c
+++ b/src/lib/protocols/hots.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HOTS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_hots_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/hpvirtgrp.c b/src/lib/protocols/hpvirtgrp.c
index df2da5faa..3e8e03ccc 100644
--- a/src/lib/protocols/hpvirtgrp.c
+++ b/src/lib/protocols/hpvirtgrp.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HPVIRTGRP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_hpvirtgrp_add_connection(
diff --git a/src/lib/protocols/hsrp.c b/src/lib/protocols/hsrp.c
index 3f177ebfb..de980344c 100644
--- a/src/lib/protocols/hsrp.c
+++ b/src/lib/protocols/hsrp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HSRP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define HSRP_PORT 1985
#define HSRP_PORT_V6 2029
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 2828202dd..ee0c61591 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HTTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static const char* binary_file_mimes_e[] = { "exe", NULL };
static const char* binary_file_mimes_j[] = { "java-vm", NULL };
@@ -46,9 +47,6 @@ static const char* binary_file_ext[] = {
NULL
};
-extern void ookla_add_to_cache(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-
static void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow);
static void ndpi_check_http_header(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/http2.c b/src/lib/protocols/http2.c
index cca341965..cde354a1e 100644
--- a/src/lib/protocols/http2.c
+++ b/src/lib/protocols/http2.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HTTP2
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_http2_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/i3d.c b/src/lib/protocols/i3d.c
index ba292c3d7..c0cd8e447 100644
--- a/src/lib/protocols/i3d.c
+++ b/src/lib/protocols/i3d.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_I3D
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_i3d_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/iax.c b/src/lib/protocols/iax.c
index d988fe772..45204229c 100644
--- a/src/lib/protocols/iax.c
+++ b/src/lib/protocols/iax.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IAX
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define NDPI_IAX_MAX_INFORMATION_ELEMENTS 15
diff --git a/src/lib/protocols/icecast.c b/src/lib/protocols/icecast.c
index d7baa261c..b910e2628 100644
--- a/src/lib/protocols/icecast.c
+++ b/src/lib/protocols/icecast.c
@@ -27,9 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ICECAST
#include "ndpi_api.h"
-
-extern int ndpi_current_pkt_from_client_to_server(const struct ndpi_detection_module_struct *ndpi_str, const struct ndpi_flow_struct *flow);
-extern int ndpi_current_pkt_from_server_to_client(const struct ndpi_detection_module_struct *ndpi_str, const struct ndpi_flow_struct *flow);
+#include "ndpi_private.h"
static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
@@ -63,12 +61,12 @@ static void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_st
}
}
- if(ndpi_current_pkt_from_client_to_server(ndpi_struct, flow)
+ if(current_pkt_from_client_to_server(ndpi_struct, flow)
&& (flow->packet_counter < 10)) {
return;
}
- if(ndpi_current_pkt_from_server_to_client(ndpi_struct, flow)) {
+ if(current_pkt_from_server_to_client(ndpi_struct, flow)) {
/* server answer, now test Server for Icecast */
ndpi_parse_packet_line_info(ndpi_struct, flow);
diff --git a/src/lib/protocols/iec60870-5-104.c b/src/lib/protocols/iec60870-5-104.c
index e03ea18d3..ed28313b2 100644
--- a/src/lib/protocols/iec60870-5-104.c
+++ b/src/lib/protocols/iec60870-5-104.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IEC60870
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_iec60870_tcp(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/imo.c b/src/lib/protocols/imo.c
index d73d8a6e1..68cb9fb1b 100644
--- a/src/lib/protocols/imo.c
+++ b/src/lib/protocols/imo.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IMO
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_imo_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/ipp.c b/src/lib/protocols/ipp.c
index 5ff17c756..13d10bed2 100644
--- a/src/lib/protocols/ipp.c
+++ b/src/lib/protocols/ipp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IPP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/ipsec.c b/src/lib/protocols/ipsec.c
index 1e49d6ef4..fdd08cb6f 100644
--- a/src/lib/protocols/ipsec.c
+++ b/src/lib/protocols/ipsec.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IPSEC
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum isakmp_type {
ISAKMP_INVALID = 0,
diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c
index db73553e2..354e27fd1 100644
--- a/src/lib/protocols/irc.c
+++ b/src/lib/protocols/irc.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IRC
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, ndpi_confidence_t confidence)
{
diff --git a/src/lib/protocols/jabber.c b/src/lib/protocols/jabber.c
index 770bfe9e9..552d2618f 100644
--- a/src/lib/protocols/jabber.c
+++ b/src/lib/protocols/jabber.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_JABBER
#include "ndpi_api.h"
+#include "ndpi_private.h"
struct jabber_string {
char *string;
diff --git a/src/lib/protocols/kakaotalk_voice.c b/src/lib/protocols/kakaotalk_voice.c
index dde13cde7..1913fe156 100644
--- a/src/lib/protocols/kakaotalk_voice.c
+++ b/src/lib/protocols/kakaotalk_voice.c
@@ -29,6 +29,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KAKAOTALK_VOICE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/kerberos.c b/src/lib/protocols/kerberos.c
index 9d5794ba5..1939a2e32 100644
--- a/src/lib/protocols/kerberos.c
+++ b/src/lib/protocols/kerberos.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KERBEROS
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* #define KERBEROS_DEBUG 1 */
diff --git a/src/lib/protocols/kismet.c b/src/lib/protocols/kismet.c
index 4d4f3dae4..9c292de54 100644
--- a/src/lib/protocols/kismet.c
+++ b/src/lib/protocols/kismet.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KISMET
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_kismet_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/kontiki.c b/src/lib/protocols/kontiki.c
index 2186bde40..5da07acc0 100644
--- a/src/lib/protocols/kontiki.c
+++ b/src/lib/protocols/kontiki.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KONTIKI
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/ldap.c b/src/lib/protocols/ldap.c
index a7c64807e..36f4c5686 100644
--- a/src/lib/protocols/ldap.c
+++ b/src/lib/protocols/ldap.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LDAP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/line.c b/src/lib/protocols/line.c
index 4ad249844..0de5e856e 100644
--- a/src/lib/protocols/line.c
+++ b/src/lib/protocols/line.c
@@ -24,8 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LINE_CALL
#include "ndpi_api.h"
-
-extern int is_valid_rtp_payload_type(uint8_t type);
+#include "ndpi_private.h"
static void ndpi_int_line_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/lisp.c b/src/lib/protocols/lisp.c
index 780a9cd9c..a124d6aee 100644
--- a/src/lib/protocols/lisp.c
+++ b/src/lib/protocols/lisp.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LISP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define LISP_PORT 4341 /* Only UDP */
#define LISP_PORT1 4342 /* TCP and UDP */
diff --git a/src/lib/protocols/lotus_notes.c b/src/lib/protocols/lotus_notes.c
index 5b6a79219..bb2ca18ad 100644
--- a/src/lib/protocols/lotus_notes.c
+++ b/src/lib/protocols/lotus_notes.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LOTUS_NOTES
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ************************************ */
diff --git a/src/lib/protocols/mail_imap.c b/src/lib/protocols/mail_imap.c
index d864c4f36..a9eeaf64f 100644
--- a/src/lib/protocols/mail_imap.c
+++ b/src/lib/protocols/mail_imap.c
@@ -27,12 +27,10 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MAIL_IMAP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* #define IMAP_DEBUG 1*/
-extern void switch_extra_dissection_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
u_int16_t protocol) {
flow->guessed_protocol_id = NDPI_PROTOCOL_UNKNOWN; /* Avoid IMAPS to be used s sub-protocol */
diff --git a/src/lib/protocols/mail_pop.c b/src/lib/protocols/mail_pop.c
index 0a1e7d8ee..045ff1c7c 100644
--- a/src/lib/protocols/mail_pop.c
+++ b/src/lib/protocols/mail_pop.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MAIL_POP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define POP_BIT_AUTH 0x0001
@@ -43,9 +44,6 @@
#define POP_BIT_STLS 0x0400
-extern void switch_extra_dissection_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-
static void ndpi_int_mail_pop_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow,
u_int16_t protocol) {
diff --git a/src/lib/protocols/mail_smtp.c b/src/lib/protocols/mail_smtp.c
index 95e24c86c..980ebb8c9 100644
--- a/src/lib/protocols/mail_smtp.c
+++ b/src/lib/protocols/mail_smtp.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MAIL_SMTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define SMTP_BIT_220 0x01
@@ -48,8 +49,6 @@
/* #define SMTP_DEBUG 1 */
-extern void switch_extra_dissection_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
static void ndpi_int_mail_smtp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/maplestory.c b/src/lib/protocols/maplestory.c
index f47002b98..aa5370082 100644
--- a/src/lib/protocols/maplestory.c
+++ b/src/lib/protocols/maplestory.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MAPLESTORY
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_maplestory_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/megaco.c b/src/lib/protocols/megaco.c
index 615382055..98d2d8e97 100644
--- a/src/lib/protocols/megaco.c
+++ b/src/lib/protocols/megaco.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MEGACO
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/memcached.c b/src/lib/protocols/memcached.c
index 5984ae896..0210a028a 100644
--- a/src/lib/protocols/memcached.c
+++ b/src/lib/protocols/memcached.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MEMCACHED
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define MCDC_SET "set "
#define MCDC_SET_LEN (sizeof(MCDC_SET) - 1)
diff --git a/src/lib/protocols/merakicloud.c b/src/lib/protocols/merakicloud.c
index 40fc1b5af..5a0f0991f 100644
--- a/src/lib/protocols/merakicloud.c
+++ b/src/lib/protocols/merakicloud.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MERAKI_CLOUD
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_merakicloud_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/mgcp.c b/src/lib/protocols/mgcp.c
index 876325bd3..02963e9cd 100644
--- a/src/lib/protocols/mgcp.c
+++ b/src/lib/protocols/mgcp.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MGCP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/mining.c b/src/lib/protocols/mining.c
index 060d20b74..9e4c8754d 100644
--- a/src/lib/protocols/mining.c
+++ b/src/lib/protocols/mining.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MINING
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ************************************************************************** */
diff --git a/src/lib/protocols/modbus.c b/src/lib/protocols/modbus.c
index 083740d9f..8eb0f8dae 100644
--- a/src/lib/protocols/modbus.c
+++ b/src/lib/protocols/modbus.c
@@ -26,6 +26,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MODBUS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_modbus_tcp(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/mongodb.c b/src/lib/protocols/mongodb.c
index 1bf77fd57..38cac1622 100644
--- a/src/lib/protocols/mongodb.c
+++ b/src/lib/protocols/mongodb.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MONGODB
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/ */
diff --git a/src/lib/protocols/mpegdash.c b/src/lib/protocols/mpegdash.c
index c94e60782..ee09dfefc 100644
--- a/src/lib/protocols/mpegdash.c
+++ b/src/lib/protocols/mpegdash.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MPEGDASH
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_mpegdash_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/mpegts.c b/src/lib/protocols/mpegts.c
index 82d8fe95d..27aa6d63d 100644
--- a/src/lib/protocols/mpegts.c
+++ b/src/lib/protocols/mpegts.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MPEGTS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/mqtt.c b/src/lib/protocols/mqtt.c
index 8338bfa90..b6eff8c4c 100644
--- a/src/lib/protocols/mqtt.c
+++ b/src/lib/protocols/mqtt.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MQTT
#include "ndpi_api.h"
+#include "ndpi_private.h"
/**
diff --git a/src/lib/protocols/mssql_tds.c b/src/lib/protocols/mssql_tds.c
index c48646f24..38efe578d 100644
--- a/src/lib/protocols/mssql_tds.c
+++ b/src/lib/protocols/mssql_tds.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MSSQL_TDS
#include "ndpi_api.h"
+#include "ndpi_private.h"
struct tds_packet_header {
diff --git a/src/lib/protocols/munin.c b/src/lib/protocols/munin.c
index e3fcf5bc0..47e9d6698 100644
--- a/src/lib/protocols/munin.c
+++ b/src/lib/protocols/munin.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MUNIN
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_munin_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/mysql.c b/src/lib/protocols/mysql.c
index 1a0402ca1..c3e04ef8b 100644
--- a/src/lib/protocols/mysql.c
+++ b/src/lib/protocols/mysql.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MYSQL
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
diff --git a/src/lib/protocols/natpmp.c b/src/lib/protocols/natpmp.c
index bfc91886e..4c259c91c 100644
--- a/src/lib/protocols/natpmp.c
+++ b/src/lib/protocols/natpmp.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NATPMP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define NATPMP_PORT 5351
diff --git a/src/lib/protocols/nats.c b/src/lib/protocols/nats.c
index da44e5d87..d7bb79bef 100644
--- a/src/lib/protocols/nats.c
+++ b/src/lib/protocols/nats.c
@@ -22,6 +22,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NATS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static const char* commands[] =
{
diff --git a/src/lib/protocols/nest_log_sink.c b/src/lib/protocols/nest_log_sink.c
index fd216ce72..d2a3f62d0 100644
--- a/src/lib/protocols/nest_log_sink.c
+++ b/src/lib/protocols/nest_log_sink.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NEST_LOG_SINK
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define NEST_LOG_SINK_PORT 11095
#define NEST_LOG_SINK_MIN_LEN 8
diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c
index a84333d5f..286d909e5 100644
--- a/src/lib/protocols/netbios.c
+++ b/src/lib/protocols/netbios.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NETBIOS
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* ****************************************************************** */
diff --git a/src/lib/protocols/netflow.c b/src/lib/protocols/netflow.c
index 97b8cef99..ccb5b2762 100644
--- a/src/lib/protocols/netflow.c
+++ b/src/lib/protocols/netflow.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NETFLOW
#include "ndpi_api.h"
+#include "ndpi_private.h"
#ifdef WIN32
diff --git a/src/lib/protocols/nfs.c b/src/lib/protocols/nfs.c
index 55db41f54..5fe9f78c3 100644
--- a/src/lib/protocols/nfs.c
+++ b/src/lib/protocols/nfs.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NFS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/nintendo.c b/src/lib/protocols/nintendo.c
index 18b961986..29cf1bbbf 100644
--- a/src/lib/protocols/nintendo.c
+++ b/src/lib/protocols/nintendo.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NINTENDO
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_nintendo_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
diff --git a/src/lib/protocols/noe.c b/src/lib/protocols/noe.c
index f72ddf8b2..37bfb8c71 100644
--- a/src/lib/protocols/noe.c
+++ b/src/lib/protocols/noe.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NOE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_noe_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/non_tcp_udp.c b/src/lib/protocols/non_tcp_udp.c
index 62ef9b02b..1aa993eb5 100644
--- a/src/lib/protocols/non_tcp_udp.c
+++ b/src/lib/protocols/non_tcp_udp.c
@@ -26,6 +26,7 @@
#include "ndpi_protocol_ids.h"
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define set_protocol_and_bmask(nprot) \
{ \
diff --git a/src/lib/protocols/ntp.c b/src/lib/protocols/ntp.c
index 7737bfa0e..8e08b391a 100644
--- a/src/lib/protocols/ntp.c
+++ b/src/lib/protocols/ntp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_NTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ntp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/oicq.c b/src/lib/protocols/oicq.c
index 6a1dd4894..50585fe9e 100644
--- a/src/lib/protocols/oicq.c
+++ b/src/lib/protocols/oicq.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_OICQ
#include "ndpi_api.h"
+#include "ndpi_private.h"
PACK_ON
struct oicq_hdr {
diff --git a/src/lib/protocols/ookla.c b/src/lib/protocols/ookla.c
index d7764e630..b5391234b 100644
--- a/src/lib/protocols/ookla.c
+++ b/src/lib/protocols/ookla.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_OOKLA
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* #define DEBUG_OOKLA_LRU */
diff --git a/src/lib/protocols/openvpn.c b/src/lib/protocols/openvpn.c
index 1154f9aff..127214ea1 100644
--- a/src/lib/protocols/openvpn.c
+++ b/src/lib/protocols/openvpn.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_OPENVPN
#include "ndpi_api.h"
+#include "ndpi_private.h"
/*
* OpenVPN TCP / UDP Detection - 128/160 hmac
diff --git a/src/lib/protocols/oracle.c b/src/lib/protocols/oracle.c
index 96012b31c..95f5d9161 100644
--- a/src/lib/protocols/oracle.c
+++ b/src/lib/protocols/oracle.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ORACLE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_oracle_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/postgres.c b/src/lib/protocols/postgres.c
index 3bc51d96d..56e215862 100644
--- a/src/lib/protocols/postgres.c
+++ b/src/lib/protocols/postgres.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_POSTGRES
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_postgres_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/ppstream.c b/src/lib/protocols/ppstream.c
index dad801ff4..83f3648a9 100644
--- a/src/lib/protocols/ppstream.c
+++ b/src/lib/protocols/ppstream.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_PPSTREAM
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define PPS_PORT 17788
diff --git a/src/lib/protocols/pptp.c b/src/lib/protocols/pptp.c
index 6cc41bd44..8951d091e 100644
--- a/src/lib/protocols/pptp.c
+++ b/src/lib/protocols/pptp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_PPTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_pptp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/protobuf.c b/src/lib/protocols/protobuf.c
index fe4778336..2ba63670d 100644
--- a/src/lib/protocols/protobuf.c
+++ b/src/lib/protocols/protobuf.c
@@ -32,6 +32,7 @@
#define PROTOBUF_MAX_PACKETS 8
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum protobuf_type {
PT_INVALID = -1,
diff --git a/src/lib/protocols/qq.c b/src/lib/protocols/qq.c
index c091457a2..3a9039874 100644
--- a/src/lib/protocols/qq.c
+++ b/src/lib/protocols/qq.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_QQ
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_qq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c
index 4b9474d7a..183d2e524 100644
--- a/src/lib/protocols/quic.c
+++ b/src/lib/protocols/quic.c
@@ -25,6 +25,8 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_QUIC
#include "ndpi_api.h"
+#include "ndpi_private.h"
+
#ifdef USE_HOST_LIBGCRYPT
#include <gcrypt.h>
@@ -43,13 +45,6 @@
* https://www.rfc-editor.org/rfc/rfc9369.txt [v2]
*/
-extern int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow, uint32_t quic_version);
-extern int http_process_user_agent(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow,
- const u_int8_t *ua_ptr, u_int16_t ua_ptr_len);
-extern int is_valid_rtp_payload_type(uint8_t type);
-
/* Versions */
#define V_2 0x6b3343cf
#define V_1 0x00000001
diff --git a/src/lib/protocols/radius.c b/src/lib/protocols/radius.c
index 0c48bb19c..97a6c14c9 100644
--- a/src/lib/protocols/radius.c
+++ b/src/lib/protocols/radius.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RADIUS
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define RADIUS_PORT 1812
#define RADIUS_PORT_ACC 1813
diff --git a/src/lib/protocols/raknet.c b/src/lib/protocols/raknet.c
index e134f3668..c7b52ad38 100644
--- a/src/lib/protocols/raknet.c
+++ b/src/lib/protocols/raknet.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RAKNET
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_raknet_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/rdp.c b/src/lib/protocols/rdp.c
index 363f48628..305c1c27f 100644
--- a/src/lib/protocols/rdp.c
+++ b/src/lib/protocols/rdp.c
@@ -30,6 +30,7 @@
#define RDP_PORT 3389
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_rdp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/redis_net.c b/src/lib/protocols/redis_net.c
index 17c43db04..a25d72f0c 100644
--- a/src/lib/protocols/redis_net.c
+++ b/src/lib/protocols/redis_net.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_REDIS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_redis_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/riotgames.c b/src/lib/protocols/riotgames.c
index 370b29f93..df20618d4 100644
--- a/src/lib/protocols/riotgames.c
+++ b/src/lib/protocols/riotgames.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RIOTGAMES
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_riotgames_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/rmcp.c b/src/lib/protocols/rmcp.c
index 442179bea..19402e5ba 100644
--- a/src/lib/protocols/rmcp.c
+++ b/src/lib/protocols/rmcp.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RMCP
#include "ndpi_api.h"
+#include "ndpi_private.h"
PACK_ON
struct rmcp_header {
diff --git a/src/lib/protocols/rsh.c b/src/lib/protocols/rsh.c
index f1ce95a84..6addb7404 100644
--- a/src/lib/protocols/rsh.c
+++ b/src/lib/protocols/rsh.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RSH
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define RSH_DEFAULT_PORT 514
diff --git a/src/lib/protocols/rsync.c b/src/lib/protocols/rsync.c
index 0daf25510..b2ab8e681 100644
--- a/src/lib/protocols/rsync.c
+++ b/src/lib/protocols/rsync.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RSYNC
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_rsync_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/rtcp.c b/src/lib/protocols/rtcp.c
index 9e22ad452..25910a602 100644
--- a/src/lib/protocols/rtcp.c
+++ b/src/lib/protocols/rtcp.c
@@ -9,6 +9,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RTCP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_rtcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/rtmp.c b/src/lib/protocols/rtmp.c
index 914e1bef8..c3799248d 100644
--- a/src/lib/protocols/rtmp.c
+++ b/src/lib/protocols/rtmp.c
@@ -29,6 +29,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RTMP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_rtmp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c
index 1cc112be4..078550c5b 100644
--- a/src/lib/protocols/rtp.c
+++ b/src/lib/protocols/rtp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define RTP_MIN_HEADER 12
#define RTCP_MIN_HEADER 8
diff --git a/src/lib/protocols/rtsp.c b/src/lib/protocols/rtsp.c
index 9b43d5259..014553b5b 100644
--- a/src/lib/protocols/rtsp.c
+++ b/src/lib/protocols/rtsp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RTSP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_rtsp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/rx.c b/src/lib/protocols/rx.c
index 3a2c9580a..dcb040534 100644
--- a/src/lib/protocols/rx.c
+++ b/src/lib/protocols/rx.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RX
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* See http://web.mit.edu/kolya/afs/rx/rx-spec for protocol description. */
diff --git a/src/lib/protocols/s7comm.c b/src/lib/protocols/s7comm.c
index c7488b104..ce3d47218 100644
--- a/src/lib/protocols/s7comm.c
+++ b/src/lib/protocols/s7comm.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_S7COMM
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_s7comm_tcp(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/sd_rtn.c b/src/lib/protocols/sd_rtn.c
index 212ac6e42..92e95b77a 100644
--- a/src/lib/protocols/sd_rtn.c
+++ b/src/lib/protocols/sd_rtn.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SD_RTN
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_sd_rtn_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/sflow.c b/src/lib/protocols/sflow.c
index a2d704f7f..d731f2146 100644
--- a/src/lib/protocols/sflow.c
+++ b/src/lib/protocols/sflow.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SFLOW
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_sflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/sip.c b/src/lib/protocols/sip.c
index 0b06c2dac..dd6b2a346 100644
--- a/src/lib/protocols/sip.c
+++ b/src/lib/protocols/sip.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SIP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_sip_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
diff --git a/src/lib/protocols/skinny.c b/src/lib/protocols/skinny.c
index c7c516d2a..b011684c7 100644
--- a/src/lib/protocols/skinny.c
+++ b/src/lib/protocols/skinny.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SKINNY
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* Reference: Wiresahrk: epan/dissectors/packet-skinny.c */
diff --git a/src/lib/protocols/skype.c b/src/lib/protocols/skype.c
index cfe102f99..e1a5583ff 100644
--- a/src/lib/protocols/skype.c
+++ b/src/lib/protocols/skype.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SKYPE_TEAMS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static int is_port(u_int16_t a, u_int16_t b, u_int16_t c) {
return(((a == c) || (b == c)) ? 1 : 0);
diff --git a/src/lib/protocols/slp.c b/src/lib/protocols/slp.c
index 02ee71f16..81c1cabd9 100644
--- a/src/lib/protocols/slp.c
+++ b/src/lib/protocols/slp.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SERVICE_LOCATION
#include "ndpi_api.h"
+#include "ndpi_private.h"
PACK_ON
struct slp_hdr_v1 {
diff --git a/src/lib/protocols/smb.c b/src/lib/protocols/smb.c
index 25cb2ee67..ead48f0a0 100644
--- a/src/lib/protocols/smb.c
+++ b/src/lib/protocols/smb.c
@@ -23,6 +23,7 @@
#include "ndpi_protocol_ids.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SMBV23
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/smpp.c b/src/lib/protocols/smpp.c
index 16628e709..a0f865f3d 100644
--- a/src/lib/protocols/smpp.c
+++ b/src/lib/protocols/smpp.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SMPP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_smpp_add_connection(struct ndpi_detection_module_struct* ndpi_struct,
diff --git a/src/lib/protocols/snmp_proto.c b/src/lib/protocols/snmp_proto.c
index f4678afce..66e415db3 100644
--- a/src/lib/protocols/snmp_proto.c
+++ b/src/lib/protocols/snmp_proto.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SNMP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* #define SNMP_DEBUG */
diff --git a/src/lib/protocols/soap.c b/src/lib/protocols/soap.c
index 18e636b57..96b1ead71 100644
--- a/src/lib/protocols/soap.c
+++ b/src/lib/protocols/soap.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SOAP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_soap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/socks45.c b/src/lib/protocols/socks45.c
index 6cdac93d1..742e0a6e6 100644
--- a/src/lib/protocols/socks45.c
+++ b/src/lib/protocols/socks45.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SOCKS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_socks_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/softether.c b/src/lib/protocols/softether.c
index 3c90b0da9..d0ad8b492 100644
--- a/src/lib/protocols/softether.c
+++ b/src/lib/protocols/softether.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SOFTETHER
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum softether_value_type {
VALUE_INT = 0u,
diff --git a/src/lib/protocols/someip.c b/src/lib/protocols/someip.c
index a256c82fb..c2e4ee330 100644
--- a/src/lib/protocols/someip.c
+++ b/src/lib/protocols/someip.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SOMEIP
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum SOMEIP_MESSAGE_TYPES {
SOMEIP_REQUEST = 0x00,
diff --git a/src/lib/protocols/source_engine.c b/src/lib/protocols/source_engine.c
index 5d6aa5399..8d92f537e 100644
--- a/src/lib/protocols/source_engine.c
+++ b/src/lib/protocols/source_engine.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SOURCE_ENGINE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_source_engine_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/spotify.c b/src/lib/protocols/spotify.c
index b27394245..4bb9ce452 100644
--- a/src/lib/protocols/spotify.c
+++ b/src/lib/protocols/spotify.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SPOTIFY
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_spotify_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/ssdp.c b/src/lib/protocols/ssdp.c
index 5d832367a..cede17d85 100644
--- a/src/lib/protocols/ssdp.c
+++ b/src/lib/protocols/ssdp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SSDP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ssdp_parse_lines(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/ssh.c b/src/lib/protocols/ssh.c
index 5e65f1d82..d950ede95 100644
--- a/src/lib/protocols/ssh.c
+++ b/src/lib/protocols/ssh.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SSH
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include "ndpi_md5.h"
#include <string.h>
diff --git a/src/lib/protocols/starcraft.c b/src/lib/protocols/starcraft.c
index b947e433e..8cf59bbbf 100644
--- a/src/lib/protocols/starcraft.c
+++ b/src/lib/protocols/starcraft.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_STARCRAFT
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* Sender or receiver are one of the known login portals? */
diff --git a/src/lib/protocols/steam.c b/src/lib/protocols/steam.c
index f58238479..4f5b88308 100644
--- a/src/lib/protocols/steam.c
+++ b/src/lib/protocols/steam.c
@@ -29,6 +29,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_STEAM
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_steam_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 0f3810b81..7cff65530 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -26,19 +26,13 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_STUN
#include "ndpi_api.h"
+#include "ndpi_private.h"
// #define DEBUG_LRU 1
// #define DEBUG_ZOOM_LRU 1
#define STUN_HDR_LEN 20 /* STUN message header length, Classic-STUN (RFC 3489) and STUN (RFC 8489) both */
-extern void switch_to_tls(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-extern int is_rtp_or_rtcp(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow);
-extern u_int8_t rtp_get_stream_type(u_int8_t payloadType, ndpi_multimedia_flow_type *s_type);
-extern int is_dtls(const u_int8_t *buf, u_int32_t buf_len, u_int32_t *block_len);
-
static u_int32_t get_stun_lru_key(struct ndpi_flow_struct *flow, u_int8_t rev);
static u_int32_t get_stun_lru_key_raw4(u_int32_t ip, u_int16_t port);
static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/syncthing.c b/src/lib/protocols/syncthing.c
index cdfc756c6..93039d9be 100644
--- a/src/lib/protocols/syncthing.c
+++ b/src/lib/protocols/syncthing.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SYNCTHING
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_syncthing_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/syslog.c b/src/lib/protocols/syslog.c
index 640ce21d8..ec349c519 100644
--- a/src/lib/protocols/syslog.c
+++ b/src/lib/protocols/syslog.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SYSLOG
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_syslog_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/tailscale.c b/src/lib/protocols/tailscale.c
index ca866d5ab..41de2f7cb 100644
--- a/src/lib/protocols/tailscale.c
+++ b/src/lib/protocols/tailscale.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TAILSCALE
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* https://github.com/tailscale/tailscale/blob/main/disco/disco.go
* https://tailscale.com/kb/1082/firewall-ports/
diff --git a/src/lib/protocols/tcp_udp.c b/src/lib/protocols/tcp_udp.c
index 473260adf..f6194c2f7 100644
--- a/src/lib/protocols/tcp_udp.c
+++ b/src/lib/protocols/tcp_udp.c
@@ -20,6 +20,7 @@
#include "ndpi_api.h"
+#include "ndpi_private.h"
u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/teamspeak.c b/src/lib/protocols/teamspeak.c
index 9184e16e5..60fb466e0 100644
--- a/src/lib/protocols/teamspeak.c
+++ b/src/lib/protocols/teamspeak.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TEAMSPEAK
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_teamspeak_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/teamviewer.c b/src/lib/protocols/teamviewer.c
index b9030d2fd..4c0df2e61 100644
--- a/src/lib/protocols/teamviewer.c
+++ b/src/lib/protocols/teamviewer.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TEAMVIEWER
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_teamview_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/telegram.c b/src/lib/protocols/telegram.c
index bab1d3336..6d457d45f 100644
--- a/src/lib/protocols/telegram.c
+++ b/src/lib/protocols/telegram.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TELEGRAM
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_telegram_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) {
diff --git a/src/lib/protocols/telnet.c b/src/lib/protocols/telnet.c
index a4dd107c6..d543c6efa 100644
--- a/src/lib/protocols/telnet.c
+++ b/src/lib/protocols/telnet.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TELNET
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* #define TELNET_DEBUG 1 */
diff --git a/src/lib/protocols/teredo.c b/src/lib/protocols/teredo.c
index f1d1f07af..9ecdff7d2 100644
--- a/src/lib/protocols/teredo.c
+++ b/src/lib/protocols/teredo.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TEREDO
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* https://en.wikipedia.org/wiki/Teredo_tunneling */
static void ndpi_search_teredo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/tftp.c b/src/lib/protocols/tftp.c
index 9c8d9b6d3..b44746f45 100644
--- a/src/lib/protocols/tftp.c
+++ b/src/lib/protocols/tftp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TFTP
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* see: https://datatracker.ietf.org/doc/html/rfc1350 */
diff --git a/src/lib/protocols/threema.c b/src/lib/protocols/threema.c
index eca410ad4..14d253961 100644
--- a/src/lib/protocols/threema.c
+++ b/src/lib/protocols/threema.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_THREEMA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_threema_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
diff --git a/src/lib/protocols/thrift.c b/src/lib/protocols/thrift.c
index 92f003781..1e1749b9f 100644
--- a/src/lib/protocols/thrift.c
+++ b/src/lib/protocols/thrift.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APACHE_THRIFT
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include <stdint.h>
diff --git a/src/lib/protocols/tinc.c b/src/lib/protocols/tinc.c
index 1451be68c..0e12d6270 100644
--- a/src/lib/protocols/tinc.c
+++ b/src/lib/protocols/tinc.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TINC
#include "ndpi_api.h"
+#include "ndpi_private.h"
#include "libcache.h"
PACK_ON struct tinc_cache_entry {
diff --git a/src/lib/protocols/tivoconnect.c b/src/lib/protocols/tivoconnect.c
index de0b78c25..4bfd041e9 100644
--- a/src/lib/protocols/tivoconnect.c
+++ b/src/lib/protocols/tivoconnect.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TIVOCONNECT
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_tivoconnect_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index 09e10858e..44c36cb6d 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -26,21 +26,11 @@
#include "ndpi_md5.h"
#include "ndpi_sha1.h"
#include "ndpi_encryption.h"
+#include "ndpi_private.h"
+
-extern char *strptime(const char *s, const char *format, struct tm *tm);
-extern int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow, uint32_t quic_version);
static void ndpi_search_tls_wrapper(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow);
-extern int http_process_user_agent(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow,
- const u_int8_t *ua_ptr, u_int16_t ua_ptr_len);
-extern int ookla_search_into_cache(struct ndpi_detection_module_struct* ndpi_struct,
- struct ndpi_flow_struct* flow);
-/* QUIC/GQUIC stuff */
-extern int quic_len(const uint8_t *buf, uint64_t *value);
-extern int quic_len_buffer_still_required(uint8_t value);
-extern int is_version_with_var_int_transport_params(uint32_t version);
// #define DEBUG_TLS_MEMORY 1
// #define DEBUG_TLS 1
diff --git a/src/lib/protocols/tocaboca.c b/src/lib/protocols/tocaboca.c
index 2de13f8f2..cf5c39af5 100644
--- a/src/lib/protocols/tocaboca.c
+++ b/src/lib/protocols/tocaboca.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TOCA_BOCA
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_toca_boca_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/tplink_shp.c b/src/lib/protocols/tplink_shp.c
index 6b75754dd..c4b68f71b 100644
--- a/src/lib/protocols/tplink_shp.c
+++ b/src/lib/protocols/tplink_shp.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TPLINK_SHP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define _TPLSHP_MIN_LEN 2
#define _TPLSHP_TCP_LEN_HDR 4
diff --git a/src/lib/protocols/tuya_lp.c b/src/lib/protocols/tuya_lp.c
index c62f979cc..d8488aa52 100644
--- a/src/lib/protocols/tuya_lp.c
+++ b/src/lib/protocols/tuya_lp.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TUYA_LP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_tuya_lp_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/tvuplayer.c b/src/lib/protocols/tvuplayer.c
index 4ea58edca..d400a86fc 100644
--- a/src/lib/protocols/tvuplayer.c
+++ b/src/lib/protocols/tvuplayer.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_TVUPLAYER
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_tvuplayer_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow/* , */
diff --git a/src/lib/protocols/ubntac2.c b/src/lib/protocols/ubntac2.c
index 48674ee5b..2b56c5aee 100644
--- a/src/lib/protocols/ubntac2.c
+++ b/src/lib/protocols/ubntac2.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_UBNTAC2
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ubntac2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/ultrasurf.c b/src/lib/protocols/ultrasurf.c
index be878ca14..05ba72764 100644
--- a/src/lib/protocols/ultrasurf.c
+++ b/src/lib/protocols/ultrasurf.c
@@ -24,6 +24,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ULTRASURF
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_ultrasurf_add_connection(struct ndpi_detection_module_struct * const ndpi_struct,
struct ndpi_flow_struct * const flow)
diff --git a/src/lib/protocols/usenet.c b/src/lib/protocols/usenet.c
index 7d1280ef8..467ed1b4f 100644
--- a/src/lib/protocols/usenet.c
+++ b/src/lib/protocols/usenet.c
@@ -28,6 +28,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_USENET
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_usenet_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/vhua.c b/src/lib/protocols/vhua.c
index e37bbb021..c6af07406 100644
--- a/src/lib/protocols/vhua.c
+++ b/src/lib/protocols/vhua.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_VHUA
#include "ndpi_api.h"
+#include "ndpi_private.h"
/*
http://www.vhua.com
diff --git a/src/lib/protocols/viber.c b/src/lib/protocols/viber.c
index 08d42426b..ae0689ce1 100644
--- a/src/lib/protocols/viber.c
+++ b/src/lib/protocols/viber.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_VIBER
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void viber_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/vmware.c b/src/lib/protocols/vmware.c
index e6602197f..31433e5e1 100644
--- a/src/lib/protocols/vmware.c
+++ b/src/lib/protocols/vmware.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_VMWARE
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/vnc.c b/src/lib/protocols/vnc.c
index b3d327215..52c644224 100644
--- a/src/lib/protocols/vnc.c
+++ b/src/lib/protocols/vnc.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_VNC
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_vnc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
diff --git a/src/lib/protocols/vxlan.c b/src/lib/protocols/vxlan.c
index 413030812..04b3b3fbc 100644
--- a/src/lib/protocols/vxlan.c
+++ b/src/lib/protocols/vxlan.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_VXLAN
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* This code handles VXLAN as per RFC 7348 */
diff --git a/src/lib/protocols/warcraft3.c b/src/lib/protocols/warcraft3.c
index 98888dbad..768c3da74 100644
--- a/src/lib/protocols/warcraft3.c
+++ b/src/lib/protocols/warcraft3.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WARCRAFT3
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_warcraft3_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/websocket.c b/src/lib/protocols/websocket.c
index 93e1fc7b8..b4cb3d1e3 100644
--- a/src/lib/protocols/websocket.c
+++ b/src/lib/protocols/websocket.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WEBSOCKET
#include "ndpi_api.h"
+#include "ndpi_private.h"
enum websocket_opcode
{
diff --git a/src/lib/protocols/whatsapp.c b/src/lib/protocols/whatsapp.c
index 0803ea8a0..0458025e9 100644
--- a/src/lib/protocols/whatsapp.c
+++ b/src/lib/protocols/whatsapp.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WHATSAPP
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define WA_SEQ(seq) { .sequence_size = NDPI_ARRAY_LENGTH(seq) - 1 /* '\0' */, \
.sequence = seq }
diff --git a/src/lib/protocols/whoisdas.c b/src/lib/protocols/whoisdas.c
index 942a73cc6..8a5f77951 100644
--- a/src/lib/protocols/whoisdas.c
+++ b/src/lib/protocols/whoisdas.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WHOIS_DAS
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_search_whois_das(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/wireguard.c b/src/lib/protocols/wireguard.c
index 5356a3fd8..16ef5aca4 100644
--- a/src/lib/protocols/wireguard.c
+++ b/src/lib/protocols/wireguard.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WIREGUARD
#include "ndpi_api.h"
+#include "ndpi_private.h"
/*
* See https://www.wireguard.com/protocol/ for protocol reference.
diff --git a/src/lib/protocols/world_of_kung_fu.c b/src/lib/protocols/world_of_kung_fu.c
index 999bcae7c..dc867ea5e 100644
--- a/src/lib/protocols/world_of_kung_fu.c
+++ b/src/lib/protocols/world_of_kung_fu.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WORLD_OF_KUNG_FU
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_world_of_kung_fu_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/world_of_warcraft.c b/src/lib/protocols/world_of_warcraft.c
index f41ef9c67..6c0ab8ee4 100644
--- a/src/lib/protocols/world_of_warcraft.c
+++ b/src/lib/protocols/world_of_warcraft.c
@@ -26,6 +26,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WORLDOFWARCRAFT
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_worldofwarcraft_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow/* , */
diff --git a/src/lib/protocols/wsd.c b/src/lib/protocols/wsd.c
index 1cf623abf..a15ff10d0 100644
--- a/src/lib/protocols/wsd.c
+++ b/src/lib/protocols/wsd.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_WSD
#include "ndpi_api.h"
+#include "ndpi_private.h"
#define WSD_PORT 3702
diff --git a/src/lib/protocols/xbox.c b/src/lib/protocols/xbox.c
index c701b0edb..e88cf39db 100644
--- a/src/lib/protocols/xbox.c
+++ b/src/lib/protocols/xbox.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_XBOX
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_xbox_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
diff --git a/src/lib/protocols/xdmcp.c b/src/lib/protocols/xdmcp.c
index 1840b95d7..f90877a38 100644
--- a/src/lib/protocols/xdmcp.c
+++ b/src/lib/protocols/xdmcp.c
@@ -27,6 +27,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_XDMCP
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_xdmcp_add_connection(struct ndpi_detection_module_struct
diff --git a/src/lib/protocols/xiaomi.c b/src/lib/protocols/xiaomi.c
index 1cdd79377..77e55ab4a 100644
--- a/src/lib/protocols/xiaomi.c
+++ b/src/lib/protocols/xiaomi.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_XIAOMI
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void xiaomi_dissect_metadata(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/protocols/z3950.c b/src/lib/protocols/z3950.c
index 279d8bf91..1d1028f4e 100644
--- a/src/lib/protocols/z3950.c
+++ b/src/lib/protocols/z3950.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_Z3950
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* https://github.com/wireshark/wireshark/blob/master/epan/dissectors/asn1/z3950/z3950.asn */
diff --git a/src/lib/protocols/zabbix.c b/src/lib/protocols/zabbix.c
index 528402927..0eb776307 100644
--- a/src/lib/protocols/zabbix.c
+++ b/src/lib/protocols/zabbix.c
@@ -23,6 +23,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ZABBIX
#include "ndpi_api.h"
+#include "ndpi_private.h"
/* *************************************************** */
diff --git a/src/lib/protocols/zattoo.c b/src/lib/protocols/zattoo.c
index cf67a82c5..66743aeec 100644
--- a/src/lib/protocols/zattoo.c
+++ b/src/lib/protocols/zattoo.c
@@ -25,6 +25,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ZATTOO
#include "ndpi_api.h"
+#include "ndpi_private.h"
#if !defined(WIN32)
static inline
diff --git a/src/lib/protocols/zeromq.c b/src/lib/protocols/zeromq.c
index 124bd4cc7..d8277f453 100644
--- a/src/lib/protocols/zeromq.c
+++ b/src/lib/protocols/zeromq.c
@@ -22,6 +22,7 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ZMQ
#include "ndpi_api.h"
+#include "ndpi_private.h"
static void ndpi_int_zmq_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ZMQ, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);