aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-08-26 19:47:50 +0200
committerLuca Deri <deri@ntop.org>2023-08-26 19:47:50 +0200
commit34986de297676c6d1493009c59eedfec157ddd21 (patch)
treeaa5ec7e6aca9b34a34434648378958fb2648568c /example/ndpiReader.c
parenteeeee46b1e7828587d4570d754360a40350302e8 (diff)
Search fixes
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index d9169e523..86452cbe1 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -5421,20 +5421,28 @@ void sketchUnitTest() {
void domainSearchUnitTest() {
ndpi_domain_classify *sc = ndpi_domain_classify_alloc();
- const char *fname = NDPI_BASE_DIR "/lists/gambling.list";
char *domain = "ntop.org";
- u_int32_t num_domains;
assert(sc);
+ ndpi_domain_classify_add(sc, NDPI_PROTOCOL_NTOP, ".ntop.org");
ndpi_domain_classify_add(sc, NDPI_PROTOCOL_NTOP, domain);
assert(ndpi_domain_classify_contains(sc, domain));
- num_domains = ndpi_domain_classify_add_domains(sc, NDPI_PROTOCOL_GAMBLING, (char*)fname);
- assert(num_domains == 35370);
+#if 0
+ {
+ const char *fname = NDPI_BASE_DIR "/lists/gambling.list";
+ u_int32_t num_domains;
+
+ num_domains = ndpi_domain_classify_add_domains(sc, NDPI_PROTOCOL_GAMBLING, (char*)fname);
+ assert(num_domains == 35370);
+
+ assert(ndpi_domain_classify_contains(sc, "0grand-casino.com") == NDPI_PROTOCOL_GAMBLING);
+ }
+#endif
+
/* Subdomain check */
assert(ndpi_domain_classify_contains(sc, "blog.ntop.org") == NDPI_PROTOCOL_NTOP);
- assert(ndpi_domain_classify_contains(sc, "0grand-casino.com") == NDPI_PROTOCOL_GAMBLING);
#ifdef DEBUG_TRACE
struct stat st;