diff --git a/include/ParsedFlowCore.h b/include/ParsedFlowCore.h index 48b1499e9b0e..43a3e62a8150 100644 --- a/include/ParsedFlowCore.h +++ b/include/ParsedFlowCore.h @@ -35,6 +35,7 @@ class ParsedFlowCore { u_int8_t l4_proto; u_int32_t source_id; u_int32_t device_ip; + u_int32_t probe_ip; struct ndpi_in6_addr device_ipv6; u_int16_t src_port, dst_port; u_int32_t inIndex, outIndex; diff --git a/src/ParsedFlowCore.cpp b/src/ParsedFlowCore.cpp index cc2f17dddc10..3f98ed894750 100644 --- a/src/ParsedFlowCore.cpp +++ b/src/ParsedFlowCore.cpp @@ -33,6 +33,7 @@ ParsedFlowCore::ParsedFlowCore() { src_tos = dst_tos = 0; version = 0; device_ip = 0; + probe_ip = 0; src_port = dst_port = 0; inIndex = outIndex = 0; observationPointId = 0; @@ -58,6 +59,7 @@ ParsedFlowCore::ParsedFlowCore(const ParsedFlowCore &pfc) { memcpy(&device_ipv6, &pfc.device_ipv6, sizeof(device_ipv6)); version = pfc.version; device_ip = pfc.device_ip; + probe_ip = pfc.probe_ip; src_port = pfc.src_port, dst_port = pfc.dst_port; inIndex = pfc.inIndex, outIndex = pfc.outIndex; observationPointId = pfc.observationPointId; diff --git a/src/ParserInterface.cpp b/src/ParserInterface.cpp index 2f84c932da28..cb54508673f1 100644 --- a/src/ParserInterface.cpp +++ b/src/ParserInterface.cpp @@ -78,10 +78,10 @@ bool ParserInterface::processFlow(ParsedFlow *zflow) { */ if (!flow_interfaces_stats) flow_interfaces_stats = new (std::nothrow) FlowInterfacesStats(); - are_limits_okay = flow_interfaces_stats->checkExporters(zflow->device_ip, zflow->inIndex); + are_limits_okay = flow_interfaces_stats->checkExporters(zflow->device_ip, zflow->inIndex, zflow->probe_ip); if (are_limits_okay && (zflow->outIndex != zflow->inIndex)) - are_limits_okay = flow_interfaces_stats->checkExporters(zflow->device_ip, zflow->outIndex); + are_limits_okay = flow_interfaces_stats->checkExporters(zflow->device_ip, zflow->outIndex, zflow->probe_ip); if (!are_limits_okay) { diff --git a/src/ZCCollectorInterface.cpp b/src/ZCCollectorInterface.cpp index 94733f6e7bbd..8c19e3555031 100644 --- a/src/ZCCollectorInterface.cpp +++ b/src/ZCCollectorInterface.cpp @@ -92,7 +92,7 @@ void ZCCollectorInterface::collect_flows() { u_char *json = pfring_zc_pkt_buff_data(buffer, zq); const char *master = "{ \"if.name\""; - ntop->getTrace()->traceEvent(TRACE_INFO, "%s", json); + ntop->getTrace()->traceEvent(TRACE_NORMAL, "%s", json); // fprintf(stdout, "+"); fflush(stdout); if (strncmp((char *)json, master, strlen(master)) == 0) { diff --git a/src/ZMQParserInterface.cpp b/src/ZMQParserInterface.cpp index bfdefbe2e54c..850d0f37d059 100644 --- a/src/ZMQParserInterface.cpp +++ b/src/ZMQParserInterface.cpp @@ -1101,10 +1101,11 @@ bool ZMQParserInterface::parsePENNtopField(ParsedFlow *const flow, break; case NPROBE_IPV4_ADDRESS: - /* Do not override EXPORTER_IPV4_ADDRESS */ - if (value->string && flow->device_ip == 0 && - (flow->device_ip = ntohl(inet_addr(value->string)))) - return false; + if (value->string) { + flow->probe_ip = ntohl(inet_addr(value->string)); + if(flow->device_ip == 0 && (flow->device_ip = ntohl(inet_addr(value->string)))) + return false; + } break; case SRC_FRAGMENTS: @@ -1528,7 +1529,7 @@ bool ZMQParserInterface::matchPENNtopField(ParsedFlow *const flow, return false; case NPROBE_IPV4_ADDRESS: - return (flow->device_ip == ntohl(inet_addr(value->string))); + return (flow->probe_ip == ntohl(inet_addr(value->string))); case SMTP_MAIL_FROM: if (value->string && flow->getSMTPMailFrom())