Added ability to store custom category file in patricia tree
This commit is contained in:
+10
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user