aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/kcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/kcp.c')
-rw-r--r--src/lib/protocols/kcp.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/protocols/kcp.c b/src/lib/protocols/kcp.c
index 906737179..0e01eaa2b 100644
--- a/src/lib/protocols/kcp.c
+++ b/src/lib/protocols/kcp.c
@@ -66,7 +66,7 @@ static void ndpi_search_kcp(struct ndpi_detection_module_struct *ndpi_struct,
if (packet->payload_packet_len < sizeof(*kcp_header))
{
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
@@ -78,30 +78,24 @@ static void ndpi_search_kcp(struct ndpi_detection_module_struct *ndpi_struct,
case IKCP_CMD_WINS:
break;
default:
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
uint32_t const kcp_pdu_length = le32toh(kcp_header->length);
if (kcp_pdu_length + sizeof(*kcp_header) != packet->payload_packet_len)
{
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
ndpi_int_kcp_add_connection(ndpi_struct, flow);
}
-void init_kcp_dissector(struct ndpi_detection_module_struct *ndpi_struct,
- u_int32_t *id)
+void init_kcp_dissector(struct ndpi_detection_module_struct *ndpi_struct)
{
- ndpi_set_bitmask_protocol_detection("KCP", ndpi_struct, *id,
- NDPI_PROTOCOL_KCP,
- ndpi_search_kcp,
- NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
- SAVE_DETECTION_BITMASK_AS_UNKNOWN,
- ADD_TO_DETECTION_BITMASK
- );
-
- *id += 1;
+ register_dissector("KCP", ndpi_struct,
+ ndpi_search_kcp,
+ NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
+ 1, NDPI_PROTOCOL_KCP);
}