aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2025-01-17 19:20:45 +0100
committerLuca Deri <deri@ntop.org>2025-01-17 19:20:45 +0100
commit1bda2a26507b0516a618c144546c310897d2b06b (patch)
treeaaa0d63ec714fd56faa7b066dad52363d2238432
parentf1c62ca720e1cd9697f7b56314f7040ec21df540 (diff)
Renamed ips_match to ndpi_ips_match
-rw-r--r--src/include/ndpi_private.h2
-rw-r--r--src/lib/ndpi_utils.c5
-rw-r--r--src/lib/protocols/starcraft.c10
3 files changed, 8 insertions, 9 deletions
diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h
index 0bf86b823..e1918495c 100644
--- a/src/include/ndpi_private.h
+++ b/src/include/ndpi_private.h
@@ -609,7 +609,7 @@ u_int8_t is_a_common_alpn(struct ndpi_detection_module_struct *ndpi_str,
int64_t asn1_ber_decode_length(const unsigned char *payload, int payload_len, u_int16_t *value_len);
-u_int8_t ips_match(u_int32_t src, u_int32_t dst,
+u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
u_int32_t net, u_int32_t num_bits);
u_int8_t ends_with(struct ndpi_detection_module_struct *ndpi_struct,
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 3ea01c457..4fcb5b26e 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -262,9 +262,8 @@ u_int8_t ndpi_net_match(u_int32_t ip_to_check,
return(((ip_to_check & mask) == (net & mask)) ? 1 : 0);
}
-u_int8_t ips_match(u_int32_t src, u_int32_t dst,
- u_int32_t net, u_int32_t num_bits)
-{
+u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
+ u_int32_t net, u_int32_t num_bits) {
return(ndpi_net_match(src, net, num_bits) || ndpi_net_match(dst, net, num_bits));
}
diff --git a/src/lib/protocols/starcraft.c b/src/lib/protocols/starcraft.c
index a4d130e8e..9e87ea2c8 100644
--- a/src/lib/protocols/starcraft.c
+++ b/src/lib/protocols/starcraft.c
@@ -35,11 +35,11 @@ static u_int8_t sc2_match_logon_ip(struct ndpi_packet_struct* packet)
u_int32_t source_ip = ntohl(packet->iph->saddr);
u_int32_t dest_ip = ntohl(packet->iph->daddr);
- return (ips_match(source_ip, dest_ip, 0xD5F87F82, 32) // EU 213.248.127.130
- || ips_match(source_ip, dest_ip, 0x0C81CE82, 32) // US 12.129.206.130
- || ips_match(source_ip, dest_ip, 0x79FEC882, 32) // KR 121.254.200.130
- || ips_match(source_ip, dest_ip, 0xCA09424C, 32) // SG 202.9.66.76
- || ips_match(source_ip, dest_ip, 0x0C81ECFE, 32)); // BETA 12.129.236.254
+ return (ndpi_ips_match(source_ip, dest_ip, 0xD5F87F82, 32) // EU 213.248.127.130
+ || ndpi_ips_match(source_ip, dest_ip, 0x0C81CE82, 32) // US 12.129.206.130
+ || ndpi_ips_match(source_ip, dest_ip, 0x79FEC882, 32) // KR 121.254.200.130
+ || ndpi_ips_match(source_ip, dest_ip, 0xCA09424C, 32) // SG 202.9.66.76
+ || ndpi_ips_match(source_ip, dest_ip, 0x0C81ECFE, 32)); // BETA 12.129.236.254
}
/*