diff options
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 4a187c9a9..5c016174b 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -691,6 +691,24 @@ static void destroy_hyperscan(struct ndpi_detection_module_struct *ndpi_str) { /* ******************************************************************** */ +/* Self check function to be called onli for testing purposes */ +void ndpi_self_check_host_match() { + u_int32_t i, j; + + for(i=0; host_match[i].string_to_match != NULL; i++) { + for(j=0; host_match[j].string_to_match != NULL; j++) { + if((i != j) && (strcmp(host_match[i].string_to_match, host_match[j].string_to_match) == 0)) { + printf("[INTERNAL ERROR]: Duplicate string detected '%s' [id: %u, id %u]\n", + host_match[i].string_to_match, i, j); + printf("\nPlease fix host_match[] in ndpi_content_match.c.inc\n"); + exit(0); + } + } + } +} + +/* ******************************************************************** */ + static void init_string_based_protocols(struct ndpi_detection_module_struct *ndpi_str) { int i; |