diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 11f6fc496..0202478c5 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -5419,6 +5419,28 @@ void sketchUnitTest() { /* *********************************************** */ +void domainSearchUnitTest() { + ndpi_domain_classify *sc = ndpi_domain_classify_alloc(); + char *domain = "ntop.org"; + + assert(sc); + + ndpi_domain_classify_add(sc, CUSTOM_CATEGORY_MALWARE, domain); + + assert(ndpi_domain_classify_contains(sc, domain)); + +#if 0 + printf("Added %u domains\n", + ndpi_domain_classify_add_domains(sc, NDPI_PROTOCOL_GAMBLING, + NDPI_BASE_DIR "/lists/gambling.list")); + printf("Size: %u\n", ndpi_domain_classify_size(sc)); +#endif + + ndpi_domain_classify_free(sc); +} + +/* *********************************************** */ + /** @brief MAIN FUNCTION **/ @@ -5458,6 +5480,7 @@ int main(int argc, char **argv) { exit(0); #endif + domainSearchUnitTest(); sketchUnitTest(); linearUnitTest(); zscoreUnitTest(); |