From 032e778a6dc1ee2173c4cdb2c671180c5b5df245 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Wed, 12 Apr 2023 14:39:10 +0200 Subject: Simplify `ndpi_internal_guess_undetected_protocol()` (#1941) `ndpi_guess_undetected_protocol()/ndpi_internal_guess_undetected_protocol()` is a strange function: * it is exported by the library and it is actively used by `ntopng` * it is intrinsecally ipv4-only * it returns basically something like "classification_by_ip"/"classification_by_port" (these information have already been calculated in `ndpi_do_guess()`...) * it access the bittorrent LRU caches (similarly to `ndpi_detection_giveup()` but without all the other caches...) So: * make the interface IPv4/6 agnostic * use the classifications already available This work will allow to make the Bittorrent caches IPV6-aware (see 81e1ea5). Handle Dropbox classification "by-port" in the "standard" way. --- src/include/ndpi_api.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/include/ndpi_api.h') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 2edcd69ad..16dc2014d 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -427,20 +427,12 @@ extern "C" { * @par ndpi_struct = the detection module * @par flow = the flow we're trying to guess, NULL if not available * @par proto = the l4 protocol number - * @par shost = source address in host byte order - * @par sport = source port number - * @par dhost = destination address in host byte order - * @par dport = destination port number * @return the struct ndpi_protocol that match the port base protocol * */ ndpi_protocol ndpi_guess_undetected_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, - u_int8_t proto, - u_int32_t shost, - u_int16_t sport, - u_int32_t dhost, - u_int16_t dport); + u_int8_t proto); /** * Check if the string passed match with a protocol * -- cgit v1.2.3