aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/edonkey.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-09-24 23:26:03 +0200
committerLuca Deri <deri@ntop.org>2020-09-24 23:26:03 +0200
commit044ed14b4f23708ec05f5b5c85ca29acbf4b59db (patch)
treea03aea7d48eb8ec6b5d83da71c7ab2c40fcbc10c /src/lib/protocols/edonkey.c
parent51e86346d31f270099d4169cd2ebcb0146e5e593 (diff)
Various optimizations to reduce not-necessary calls
Optimized various UDP dissectors Removed dead protocols such as pando and pplive
Diffstat (limited to 'src/lib/protocols/edonkey.c')
-rw-r--r--src/lib/protocols/edonkey.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/protocols/edonkey.c b/src/lib/protocols/edonkey.c
index ca5abebad..9f73592f8 100644
--- a/src/lib/protocols/edonkey.c
+++ b/src/lib/protocols/edonkey.c
@@ -165,8 +165,11 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
return;
}
- if(payload_len == 0) return;
-
+ if(payload_len == 0) {
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ return;
+ }
+
/* Check if we so far detected the protocol in the request or not. */
if(flow->edonkey_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage 0: \n");
@@ -176,7 +179,8 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
flow->edonkey_stage = packet->packet_direction + 1;
- }
+ } else
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
} else {
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage %u: \n", flow->edonkey_stage);
@@ -193,8 +197,10 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG2(ndpi_struct, "The reply did not seem to belong to EDONKEY, resetting the stage to 0\n");
flow->edonkey_stage = 0;
}
-
}
+
+ if(flow->packet_counter > 5)
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {