aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-03-07 13:48:19 +0100
committerGitHub <noreply@github.com>2024-03-07 13:48:19 +0100
commit56ce228a8b172d67eaad9cbf5dc7df66a8591d54 (patch)
tree454e24c93b39581d35ccc71ec469ab1fb4dfc17b /src
parentc09b4dacdf179e5f69f2fd72a97b9095881fcc75 (diff)
Add a specific protocol id for audio/video calls made using Google apps (#2341)
Same logic already used for Signal/Whatsapp/Line/Facebook/...
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_protocol_ids.h1
-rw-r--r--src/lib/ndpi_main.c6
-rw-r--r--src/lib/protocols/stun.c8
3 files changed, 10 insertions, 5 deletions
diff --git a/src/include/ndpi_protocol_ids.h b/src/include/ndpi_protocol_ids.h
index 71fe8403b..7ee45bc0c 100644
--- a/src/include/ndpi_protocol_ids.h
+++ b/src/include/ndpi_protocol_ids.h
@@ -432,6 +432,7 @@ typedef enum {
NDPI_PROTOCOL_BFD = 401,
NDPI_PROTOCOL_NETEASE_GAMES = 402,
NDPI_PROTOCOL_PATHOFEXILE = 403,
+ NDPI_PROTOCOL_GOOGLE_CALL = 404, /* Voip/audio/video calls from Google Chat/Meet/... */
#ifdef CUSTOM_NDPI_PROTOCOLS
#include "../../../nDPI-custom/custom_ndpi_protocol_ids.h"
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 878b7ab87..488ee323e 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1740,7 +1740,11 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0), /* TCP */
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */
ndpi_set_proto_defaults(ndpi_str, 0 /* encrypted */, 1 /* app proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_GOOGLE_MEET,
- "GoogleMeet", NDPI_PROTOCOL_CATEGORY_VOIP,
+ "GoogleMeet", NDPI_PROTOCOL_CATEGORY_CHAT,
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
+ ndpi_set_proto_defaults(ndpi_str, 0 /* encrypted */, 1 /* app proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_GOOGLE_CALL,
+ "GoogleCall", NDPI_PROTOCOL_CATEGORY_VOIP,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, 0 /* nw proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_BJNP,
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 5680600ae..fc215d448 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -274,7 +274,7 @@ int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG(ndpi_struct, "Realm [%s]\n", flow->host_server_name);
if(strstr(flow->host_server_name, "google.com") != NULL) {
- *app_proto = NDPI_PROTOCOL_GOOGLE_MEET;
+ *app_proto = NDPI_PROTOCOL_GOOGLE_CALL;
return 1;
} else if(strstr(flow->host_server_name, "whispersystems.org") != NULL ||
strstr(flow->host_server_name, "signal.org") != NULL) {
@@ -307,7 +307,7 @@ int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
return 1;
case 0xFF03:
- *app_proto = NDPI_PROTOCOL_GOOGLE_MEET;
+ *app_proto = NDPI_PROTOCOL_GOOGLE_CALL;
return 1;
case 0x0013:
@@ -578,7 +578,7 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
memcmp(flow->c_address.v6, &pref2, sizeof(pref2)) == 0 ||
memcmp(flow->s_address.v6, &pref1, sizeof(pref1)) == 0 ||
memcmp(flow->s_address.v6, &pref2, sizeof(pref2)) == 0) {
- app_proto = NDPI_PROTOCOL_GOOGLE_MEET;
+ app_proto = NDPI_PROTOCOL_GOOGLE_CALL;
}
} else {
u_int32_t c_address, s_address;
@@ -589,7 +589,7 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
(c_address & 0xFFFFFF00) == 0x8efa5200 || /* 142.250.82.0/24 */
(s_address & 0xFFFFFF00) == 0x4a7dfa00 ||
(s_address & 0xFFFFFF00) == 0x8efa5200) {
- app_proto = NDPI_PROTOCOL_GOOGLE_MEET;
+ app_proto = NDPI_PROTOCOL_GOOGLE_CALL;
}
}
}