diff options
author | Luca Deri <deri@ntop.org> | 2018-05-14 22:58:14 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2018-05-14 22:58:14 +0200 |
commit | 66b759ca690425aa94b88b05f5a23818dce0b4be (patch) | |
tree | ad4dd7439df3ed96057e9d9e1c7d36c036a4535d /example/ndpi_util.c | |
parent | 529492e81fa9866f0b4cd22227eb6a499ac5da68 (diff) |
Hidden ndpi_detection_module_struct definition
Diffstat (limited to 'example/ndpi_util.c')
-rw-r--r-- | example/ndpi_util.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/example/ndpi_util.c b/example/ndpi_util.c index d83f1fdca..9695558ae 100644 --- a/example/ndpi_util.c +++ b/example/ndpi_util.c @@ -113,14 +113,17 @@ static uint16_t ndpi_get_proto_id(struct ndpi_detection_module_struct *ndpi_mod, uint16_t proto_id; char *e; unsigned long p = strtol(name,&e,0); + ndpi_proto_defaults_t *proto_defaults = ndpi_get_proto_defaults(ndpi_mod); + if(e && !*e) { if(p < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS && - ndpi_mod->proto_defaults[p].protoName) return (uint16_t)p; + proto_defaults[p].protoName) return (uint16_t)p; return NDPI_PROTOCOL_UNKNOWN; } + for(proto_id=NDPI_PROTOCOL_UNKNOWN; proto_id < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS; proto_id++) { - if(ndpi_mod->proto_defaults[proto_id].protoName && - !strcasecmp(ndpi_mod->proto_defaults[proto_id].protoName,name)) + if(proto_defaults[proto_id].protoName && + !strcasecmp(proto_defaults[proto_id].protoName,name)) return proto_id; } return NDPI_PROTOCOL_UNKNOWN; @@ -181,7 +184,8 @@ struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * pref NDPI_LOG(0, NULL, NDPI_LOG_ERROR, "global structure initialization failed\n"); exit(-1); } - module->ndpi_log_level = nDPI_LogLevel; + + ndpi_set_log_level(module, nDPI_LogLevel); if(_debug_protocols != NULL && ! _debug_protocols_ok) { if(parse_debug_proto(module,_debug_protocols)) |