aboutsummaryrefslogtreecommitdiff
path: root/src/include/ndpi_api.h
diff options
context:
space:
mode:
authorLuca <deri@ntop.org>2024-01-16 06:56:51 +0100
committerLuca <deri@ntop.org>2024-01-16 06:56:51 +0100
commit1637a991a4561a4ad16b1e0822065a273c60781f (patch)
tree77416ff5d9d3b0afd30d461284d9a9418d8d9084 /src/include/ndpi_api.h
parent111015b872c3535a69a2c5a475845adf94818276 (diff)
Added ndpi_get_host_domain() for returning the host domain
vs ndpi_get_host_domain_prefix() that instead returnd the host TLD
Diffstat (limited to 'src/include/ndpi_api.h')
-rw-r--r--src/include/ndpi_api.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index f4c2f6114..8bec8e3eb 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -2149,7 +2149,8 @@ extern "C" {
bool ndpi_domain_classify_finalize(ndpi_domain_classify *s);
const char* ndpi_domain_classify_longest_prefix(ndpi_domain_classify *s,
u_int8_t *class_id /* out */,
- const char *hostnname);
+ const char *hostnname,
+ bool return_subprefix);
bool ndpi_domain_classify_contains(ndpi_domain_classify *s,
u_int8_t *class_id /* out */,
const char *domain);
@@ -2222,12 +2223,27 @@ extern "C" {
* @par ndpi_str = the struct created for the protocol detection
* @par hostname = the hostname from which the domain name has to be extracted
*
- * @return The host domain name or the hostitself if not found.
+ * @return The host domain name suffic or the host itself if not found.
*
*/
const char* ndpi_get_host_domain_suffix(struct ndpi_detection_module_struct *ndpi_str,
const char *hostname);
+ /**
+ * Returns the domain (including the TLS) suffix out of the specified hostname.
+ * The returned pointer is an offset of the original hostname.
+ * Note that you need to call ndpi_load_domain_suffixes() before
+ * calling this function.
+ *
+ * @par ndpi_str = the struct created for the protocol detection
+ * @par hostname = the hostname from which the domain name has to be extracted
+ *
+ * @return The host domain name or the hosti tself if not found.
+ *
+ */
+ const char* ndpi_get_host_domain(struct ndpi_detection_module_struct *ndpi_str,
+ const char *hostname);
+
/* ******************************* */
/* Can't call libc functions from kernel space, define some stub instead */