diff options
author | Luca Deri <deri@ntop.org> | 2023-08-26 00:24:33 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-08-26 00:24:33 +0200 |
commit | 2c565c77c9ffe5d39360b43c7f941a97e9776c21 (patch) | |
tree | f6c62212e27ff85b16fe7b30016855440ccfd37d /example/ndpiReader.c | |
parent | 42fcb011ad2132d941ac36e9645ee628ba84ff19 (diff) |
Added ndpi_domain_classify_XXX(0 API
Diffstat (limited to 'example/ndpiReader.c')
-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(); |