From b04040768323a7666bcf588f2323054082883d75 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 23 Mar 2021 11:46:12 +0100 Subject: Refactored nDPI subprotocol handling and aimini protocol detection. (#1156) * Refactored and merged callback buffer routines for non-udp-tcp / udp / tcp / tcp-wo-payload. Signed-off-by: Toni Uhlig * Try to detect one subprotocol if a detected protocol can have one. * This adds a performance overhead due to much more protocol detection routine calls. See #1148 for more information. Signed-off-by: Toni Uhlig * Refactor subprotocol handling (1/2). Signed-off-by: Toni Uhlig * Refactor subprotocol handling (2/2). Signed-off-by: Toni Uhlig * Prevent some code duplication by using macros for ndpi_int_one_line_struct string comparision. Signed-off-by: Toni Uhlig * Refactored aimini HTTP detection parts (somehow related to #1148). Signed-off-by: Toni Uhlig * Added aimini client/server test pcap. Signed-off-by: Toni Uhlig * Removed master protocol as it was only used for STUN and via also removed API function ndpi_get_protocol_id_master_proto * Adjusted Python code to conform to the changes made during the refactoring process. Signed-off-by: Toni Uhlig --- src/lib/protocols/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/protocols/http.c') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 9cbd1df5c..36da51078 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -573,7 +573,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ **/ if(flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) { /* Avoid putting as subprotocol a "core" protocol such as SSL or DNS */ - if(ndpi_struct->proto_defaults[flow->guessed_protocol_id].can_have_a_subprotocol == 0) { + if(ndpi_struct->proto_defaults[flow->guessed_protocol_id].subprotocol_count == 0) { flow->detected_protocol_stack[1] = flow->guessed_protocol_id; if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) flow->detected_protocol_stack[0] = flow->guessed_host_protocol_id; -- cgit v1.2.3