aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/irc.c')
-rw-r--r--src/lib/protocols/irc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c
index 2ef11edb5..033aed9e6 100644
--- a/src/lib/protocols/irc.c
+++ b/src/lib/protocols/irc.c
@@ -2,7 +2,7 @@
* irc.c
*
* Copyright (C) 2009-11 - ipoque GmbH
- * Copyright (C) 2011-22 - ntop.org
+ * Copyright (C) 2011-25 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
@@ -99,8 +99,7 @@ static void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct
NDPI_LOG_DBG(ndpi_struct, "search irc\n");
if((flow->detected_protocol_stack[0] != NDPI_PROTOCOL_IRC && (flow->packet_counter > 10))
|| (flow->packet_counter >= 10)) {
- NDPI_LOG_DBG(ndpi_struct, "exclude irc, packet_counter too high0\n");
- NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IRC);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
@@ -225,16 +224,11 @@ static void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct
}
}
-void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct,
- u_int32_t *id)
+void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct)
{
- ndpi_set_bitmask_protocol_detection("IRC", ndpi_struct, *id,
- NDPI_PROTOCOL_IRC,
- ndpi_search_irc_tcp,
- NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
- SAVE_DETECTION_BITMASK_AS_UNKNOWN,
- ADD_TO_DETECTION_BITMASK);
-
- *id += 1;
+ register_dissector("IRC", ndpi_struct,
+ ndpi_search_irc_tcp,
+ NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
+ 1, NDPI_PROTOCOL_IRC);
}