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.
This commit is contained in:
Ivan Nardi
2022-02-20 10:19:52 +01:00
committed by GitHub
parent 75a53ad064
commit 2f5f445f72
18 changed files with 797 additions and 99 deletions
+10
View File
@@ -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 */);