aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2024-09-19 13:18:26 +0200
committerLuca Deri <deri@ntop.org>2024-09-19 13:18:26 +0200
commit191694f797639fc0b56adcf050bc9cfa8dc02f3d (patch)
tree58c51d7bfe0e346192a0296cf942aae2590da1eb /example/ndpiReader.c
parent456bc2a52c06c16e12e01c5ec8426bc8783961c1 (diff)
Implemented ndpi_strrstr()
Fixed bug in ndpi_get_host_domain
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 8a59b77e3..0d3a42791 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -6258,6 +6258,9 @@ void domainsUnitTest() {
assert(ndpi_load_domain_suffixes(ndpi_str, (char*)lists_path) == 0);
+ assert(strcmp(ndpi_get_host_domain(ndpi_str, "extension.femetrics.grammarly.io"), "grammarly.io") == 0);
+ assert(strcmp(ndpi_get_host_domain(ndpi_str, "www.ovh.commander1.com"), "commander1.com") == 0);
+
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_str, "www.chosei.chiba.jp", &suffix_id), "chosei.chiba.jp") == 0);
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_str, "www.unipi.it", &suffix_id), "it") == 0);
assert(strcmp(ndpi_get_host_domain_suffix(ndpi_str, "mail.apple.com", &suffix_id), "com") == 0);