From 2c565c77c9ffe5d39360b43c7f941a97e9776c21 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sat, 26 Aug 2023 00:24:33 +0200 Subject: Added ndpi_domain_classify_XXX(0 API --- example/ndpiReader.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'example/ndpiReader.c') 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(); -- cgit v1.2.3