From 2f5f445f7229592c9a9a108e39fa5db3dc456dce Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sun, 20 Feb 2022 10:19:52 +0100 Subject: Add support for Google Cloud (#1447) Differentiate between Google its own apps/services and Google Cloud. We already do something similar for Amazon vs AWS and Microsoft vs Azure. --- src/lib/ndpi_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 82f24f4aa..33c291b96 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -61,6 +61,8 @@ #include "ndpi_ms_onedrive_match.c.inc" #include "ndpi_ms_outlook_match.c.inc" #include "ndpi_ms_skype_teams_match.c.inc" +#include "ndpi_google_match.c.inc" +#include "ndpi_google_cloud_match.c.inc" /* Third party libraries */ #include "third_party/include/ndpi_patricia.h" @@ -1821,6 +1823,10 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp "Azure", NDPI_PROTOCOL_CATEGORY_CLOUD, 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 */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_GOOGLE_CLOUD, + "GoogleCloud", NDPI_PROTOCOL_CATEGORY_CLOUD, + 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" @@ -2417,6 +2423,10 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_ms_outlook_protocol_list); ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_skype_teams_protocol_list); } + if(!(prefs & ndpi_dont_load_google_list)) + ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_google_protocol_list); + if(!(prefs & ndpi_dont_load_google_cloud_list)) + ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_google_cloud_protocol_list); } ndpi_str->ip_risk_mask_ptree = ndpi_patricia_new(32 /* IPv4 */); -- cgit v1.2.3