diff options
Diffstat (limited to 'src/lib/protocols/ethersio.c')
-rw-r--r-- | src/lib/protocols/ethersio.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/lib/protocols/ethersio.c b/src/lib/protocols/ethersio.c index add804553..5350e045c 100644 --- a/src/lib/protocols/ethersio.c +++ b/src/lib/protocols/ethersio.c @@ -29,14 +29,6 @@ #include "ndpi_api.h" #include "ndpi_private.h" -static void ndpi_int_ethersio_add_connection(struct ndpi_detection_module_struct *ndpi_struct, - struct ndpi_flow_struct *flow) -{ - NDPI_LOG_INFO(ndpi_struct, "found EtherSIO\n"); - ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ETHERSIO, - NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI); -} - static void ndpi_search_ethersio(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { @@ -47,24 +39,22 @@ static void ndpi_search_ethersio(struct ndpi_detection_module_struct *ndpi_struc if (packet->payload_packet_len >= 20) { if ((memcmp(packet->payload, "ESIO", 4) == 0) && (packet->payload[4] == 0) && (packet->payload[5] <= 0x2) && - (packet->payload[6] == 0)) - { - ndpi_int_ethersio_add_connection(ndpi_struct, flow); + (packet->payload[6] == 0)) { + NDPI_LOG_INFO(ndpi_struct, "found EtherSIO\n"); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ETHERSIO, + NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI); + return; - } + } } - NDPI_EXCLUDE_PROTO(ndpi_struct, flow); + NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow); } -void init_ethersio_dissector(struct ndpi_detection_module_struct *ndpi_struct, - u_int32_t *id) -{ - ndpi_set_bitmask_protocol_detection("EtherSIO", ndpi_struct, *id, - NDPI_PROTOCOL_ETHERSIO, - ndpi_search_ethersio, - NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, - SAVE_DETECTION_BITMASK_AS_UNKNOWN, - ADD_TO_DETECTION_BITMASK); - *id += 1; +void init_ethersio_dissector(struct ndpi_detection_module_struct *ndpi_struct) +{ + register_dissector("EtherSIO", ndpi_struct, + ndpi_search_ethersio, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + 1, NDPI_PROTOCOL_ETHERSIO); } |