diff options
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 4dd3f3632..576f6a4f3 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -2218,9 +2218,17 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) { if(_protoFilePath != NULL) ndpi_load_protocols_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _protoFilePath); - if(_customCategoryFilePath) - ndpi_load_categories_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _customCategoryFilePath); + if(_customCategoryFilePath) { + char *label = strrchr(_customCategoryFilePath, '/'); + if(label != NULL) + label = &label[1]; + else + label = _customCategoryFilePath; + + ndpi_load_categories_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _customCategoryFilePath, label); + } + if(_riskyDomainFilePath) ndpi_load_risk_domain_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _riskyDomainFilePath); |