From ef62391dba4814ab840539406f276685ba8535f1 Mon Sep 17 00:00:00 2001 From: Toni Date: Wed, 13 Dec 2023 19:55:18 +0100 Subject: Add Monero protocol classification. (#2196) Signed-off-by: Toni Uhlig --- src/lib/ndpi_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 75e6d5a33..9c327aa09 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2174,6 +2174,10 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp "Ether-S-Bus", NDPI_PROTOCOL_CATEGORY_IOT_SCADA, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_b, 5050, 0, 0, 0, 0) /* UDP */); + ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, 1 /* app proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_MONERO, + "Monero", NDPI_PROTOCOL_CATEGORY_CRYPTO_CURRENCY, + ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, + ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); #ifdef CUSTOM_NDPI_PROTOCOLS #include "../../../nDPI-custom/custom_ndpi_main.c" @@ -5659,6 +5663,9 @@ static int ndpi_callback_init(struct ndpi_detection_module_struct *ndpi_str) { /* Ether-S-Bus */ init_ethersbus_dissector(ndpi_str, &a); + /* Monero Protocol */ + init_monero_dissector(ndpi_str, &a); + #ifdef CUSTOM_NDPI_PROTOCOLS #include "../../../nDPI-custom/custom_ndpi_main_init.c" #endif @@ -7209,7 +7216,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st /* Does it looks like some Mining protocols? */ if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN && ndpi_str->mining_cache && - ndpi_lru_find_cache(ndpi_str->mining_cache, make_mining_key(flow), + ndpi_lru_find_cache(ndpi_str->mining_cache, mining_make_lru_cache_key(flow), &cached_proto, 0 /* Don't remove it as it can be used for other connections */, ndpi_get_current_time(flow))) { ndpi_set_detected_protocol(ndpi_str, flow, cached_proto, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_PARTIAL_CACHE); -- cgit v1.2.3