diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/ndpi_private.h | 2 | ||||
-rw-r--r-- | src/lib/ndpi_main.c | 2 | ||||
-rw-r--r-- | src/lib/protocols/ssdp.c | 13 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h index 007038023..afd2f48ac 100644 --- a/src/include/ndpi_private.h +++ b/src/include/ndpi_private.h @@ -304,6 +304,8 @@ struct ndpi_detection_module_config_struct { int bittorrent_hash_enabled; + int ssdp_metadata_enabled; + int dns_subclassification_enabled; int dns_parse_response_enabled; diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 1831b7ecf..86d9e02f1 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -11776,6 +11776,8 @@ static const struct cfg_param { { "bittorrent", "metadata.hash", "enable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(bittorrent_hash_enabled), NULL }, + { "ssdp", "metadata", "enable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(ssdp_metadata_enabled), NULL }, + { "dns", "subclassification", "disable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(dns_subclassification_enabled), NULL }, { "dns", "process_response", "enable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(dns_parse_response_enabled), NULL }, diff --git a/src/lib/protocols/ssdp.c b/src/lib/protocols/ssdp.c index bd9f857ba..9216bc97a 100644 --- a/src/lib/protocols/ssdp.c +++ b/src/lib/protocols/ssdp.c @@ -213,7 +213,8 @@ static void ssdp_parse_lines(struct ndpi_detection_module_struct static void ndpi_int_ssdp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ssdp_parse_lines(ndpi_struct, flow); + if(ndpi_struct->cfg.ssdp_metadata_enabled) + ssdp_parse_lines(ndpi_struct, flow); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SSDP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI); } @@ -228,10 +229,12 @@ static void ndpi_search_ssdp(struct ndpi_detection_module_struct *ndpi_struct, s if (packet->payload_packet_len >= 19) { for (unsigned int i=0; i < sizeof(SSDP_METHODS)/sizeof(SSDP_METHODS[0]); i++) { if(memcmp(packet->payload, SSDP_METHODS[i].detection_line, strlen(SSDP_METHODS[i].detection_line)) == 0) { - flow->protos.ssdp.method = ndpi_malloc(strlen(SSDP_METHODS[i].detection_line) + 1); - if (flow->protos.ssdp.method) { - memcpy(flow->protos.ssdp.method, SSDP_METHODS[i].method, strlen(SSDP_METHODS[i].method)); - flow->protos.ssdp.method[strlen(SSDP_METHODS[i].method)] = '\0'; + if(ndpi_struct->cfg.ssdp_metadata_enabled) { + flow->protos.ssdp.method = ndpi_malloc(strlen(SSDP_METHODS[i].detection_line) + 1); + if (flow->protos.ssdp.method) { + memcpy(flow->protos.ssdp.method, SSDP_METHODS[i].method, strlen(SSDP_METHODS[i].method)); + flow->protos.ssdp.method[strlen(SSDP_METHODS[i].method)] = '\0'; + } } NDPI_LOG_INFO(ndpi_struct, "found ssdp\n"); ndpi_int_ssdp_add_connection(ndpi_struct, flow); |