From 77e5daf03e1ee7a8377a5a8906fe2c089c94ecf0 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 27 Sep 2023 17:05:12 +0200 Subject: Cleaned up mining datastructure --- example/ndpiReader.c | 2 +- example/reader_util.c | 8 +++++--- example/reader_util.h | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'example') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 711964695..2a7c3b232 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1787,7 +1787,7 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa if(flow->ssh_tls.tls_supported_versions) fprintf(out, "[TLS Supported Versions: %s]", flow->ssh_tls.tls_supported_versions); - if(flow->flow_extra_info[0] != '\0') fprintf(out, "[%s]", flow->flow_extra_info); + if(flow->mining.currency[0] != '\0') fprintf(out, "[currency: %s]", flow->mining.currency); if(flow->dns.geolocation_iata_code[0] != '\0') fprintf(out, "[GeoLocation: %s]", flow->dns.geolocation_iata_code); diff --git a/example/reader_util.c b/example/reader_util.c index 7f8408466..86c45b351 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1147,9 +1147,11 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl ndpi_snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s", flow->ndpi_flow->host_server_name); - ndpi_snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", - flow->ndpi_flow->flow_extra_info); - + if(is_ndpi_proto(flow, NDPI_PROTOCOL_MINING)) { + ndpi_snprintf(flow->mining.currency, sizeof(flow->mining.currency), "%s", + flow->ndpi_flow->protos.mining.currency); + } + flow->risk = flow->ndpi_flow->risk; if(is_ndpi_proto(flow, NDPI_PROTOCOL_DHCP)) { diff --git a/example/reader_util.h b/example/reader_util.h index fad25ca83..6466d9d90 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -257,12 +257,15 @@ typedef struct ndpi_flow_info { ndpi_serializer ndpi_flow_serializer; - char flow_extra_info[16]; char host_server_name[80]; /* Hostname/SNI */ char *bittorent_hash; char *dhcp_fingerprint; char *dhcp_class_ident; ndpi_risk risk; + + struct { + char currency[16]; + } mining; struct { u_int16_t ssl_version; -- cgit v1.2.3