Added ndpi_get_host_domain() for returning the host domain

vs ndpi_get_host_domain_prefix() that instead returnd the host TLD
This commit is contained in:
Luca
2024-01-16 06:56:51 +01:00
parent 111015b872
commit 1637a991a4
4 changed files with 45 additions and 8 deletions
+15 -1
View File
@@ -88,6 +88,20 @@ const char* ndpi_get_host_domain_suffix(struct ndpi_detection_module_struct *ndp
u_int8_t class_id;
return(ndpi_domain_classify_longest_prefix(ndpi_str->public_domain_suffixes,
&class_id, hostname));
&class_id, hostname, false));
}
}
/* ******************************* */
const char* ndpi_get_host_domain(struct ndpi_detection_module_struct *ndpi_str,
const char *hostname) {
if(ndpi_str->public_domain_suffixes == NULL)
return(hostname);
else {
u_int8_t class_id;
return(ndpi_domain_classify_longest_prefix(ndpi_str->public_domain_suffixes,
&class_id, hostname, true));
}
}