aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
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 /example/ndpiReader.c
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 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 238cffdab..bea676427 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -5649,6 +5649,11 @@ void domainsUnitTest() {
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_info_mod, "www.unipi.it"), "it") == 0);
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_info_mod, "mail.apple.com"), "com") == 0);
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_info_mod, "www.bbc.co.uk"), "co.uk") == 0);
+
+ assert(strcmp(ndpi_get_host_domain(ndpi_info_mod, "www.chosei.chiba.jp"), "chosei.chiba.jp") == 0);
+ assert(strcmp(ndpi_get_host_domain(ndpi_info_mod, "www.unipi.it"), "unipi.it") == 0);
+ assert(strcmp(ndpi_get_host_domain(ndpi_info_mod, "mail.apple.com"), "apple.com") == 0);
+ assert(strcmp(ndpi_get_host_domain(ndpi_info_mod, "www.bbc.co.uk"), "bbc.co.uk") == 0);
}
ndpi_exit_detection_module(ndpi_info_mod);