aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/netbios.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
committerLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
commit1076455c01bfcfa51b24ff8d681e65fd00047dbd (patch)
tree1ffe59c0ae57a55499cece7a2131431bdcf6eea2 /src/lib/protocols/netbios.c
parent2d486aeed8e6450cc8034d6244848297bdefc31e (diff)
Added ndpi_set_detection_preferences() APi call
Diffstat (limited to 'src/lib/protocols/netbios.c')
-rw-r--r--src/lib/protocols/netbios.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c
index d10a33b1a..634284121 100644
--- a/src/lib/protocols/netbios.c
+++ b/src/lib/protocols/netbios.c
@@ -119,9 +119,12 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc
NDPI_LOG_INFO(ndpi_struct, "found netbios with questions = 1 and answers = 0, authority = 0 and broadcast \n");
- if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
- snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
-
+ if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0) {
+ if(!ndpi_struct->disable_metadata_export) {
+ snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
+ }
+ }
+
ndpi_int_netbios_add_connection(ndpi_struct, flow);
return;
}
@@ -336,9 +339,12 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc
if(ntohl(get_u_int32_t(packet->payload, 4)) == ntohl(packet->iph->saddr)) {
NDPI_LOG_INFO(ndpi_struct, "found netbios with checked ip-address\n");
- if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
- snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
-
+ if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0) {
+ if(!ndpi_struct->disable_metadata_export) {
+ snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
+ }
+ }
+
ndpi_int_netbios_add_connection(ndpi_struct, flow);
return;
}