mirror of
https://github.com/pavel-odintsov/fastnetmon.git
synced 2024-09-21 02:17:16 +00:00
Reformat code with clang-format
This commit is contained in:
parent
96c08b37bd
commit
784479731f
@ -17,3 +17,6 @@ fmt/format.h
|
||||
build
|
||||
traffic_data.pb.h
|
||||
traffic_data.pb.cc
|
||||
packaging/FreeBSD/files/patch-src_fast__endianless.hpp
|
||||
packaging/FreeBSD/files/patch-src_fast__library.cpp
|
||||
packaging/FreeBSD/files/patch-src_fastnetmon.cpp
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
// For be64toh and htobe64
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#include <sys/endian.h>
|
||||
#include <cstdint>
|
||||
#include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
// Linux standard functions for endian conversions are ugly because there are no checks about arguments length
|
||||
|
@ -1648,7 +1648,8 @@ void traffic_draw_ipv6_program() {
|
||||
sorter_type = attack_detection_threshold_type_t::packets_per_second;
|
||||
}
|
||||
|
||||
output_buffer << "FastNetMon " << fastnetmon_platform_configuration.fastnetmon_version << " Try Advanced edition: https://fastnetmon.com/product-overview/"
|
||||
output_buffer << "FastNetMon " << fastnetmon_platform_configuration.fastnetmon_version
|
||||
<< " Try Advanced edition: https://fastnetmon.com/product-overview/"
|
||||
<< "\n"
|
||||
<< "IPs ordered by: " << sort_parameter << "\n";
|
||||
|
||||
@ -1733,7 +1734,8 @@ void traffic_draw_ipv4_program() {
|
||||
sorter_type = attack_detection_threshold_type_t::packets_per_second;
|
||||
}
|
||||
|
||||
output_buffer << "FastNetMon " << fastnetmon_platform_configuration.fastnetmon_version << " Try Advanced edition: https://fastnetmon.com/product-overview/"
|
||||
output_buffer << "FastNetMon " << fastnetmon_platform_configuration.fastnetmon_version
|
||||
<< " Try Advanced edition: https://fastnetmon.com/product-overview/"
|
||||
<< "\n"
|
||||
<< "IPs ordered by: " << sort_parameter << "\n";
|
||||
|
||||
@ -3197,7 +3199,7 @@ bool get_statistics(std::vector<system_counter_t>& system_counters) {
|
||||
auto af_packet_counters = get_af_packet_stats();
|
||||
|
||||
system_counters.insert(system_counters.end(), af_packet_counters.begin(), af_packet_counters.end());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
|
@ -17,4 +17,3 @@ extern log4cpp::Category& logger;
|
||||
|
||||
// Access to inaccurate but fast time
|
||||
extern time_t current_inaccurate_time;
|
||||
|
||||
|
@ -1525,7 +1525,7 @@ void nf10_flowset_to_store(uint8_t* pkt,
|
||||
}
|
||||
|
||||
simple_packet_t packet;
|
||||
packet.source = NETFLOW;
|
||||
packet.source = NETFLOW;
|
||||
packet.arrival_time = current_inaccurate_time;
|
||||
|
||||
packet.agent_ip_address = client_ipv4_address;
|
||||
|
@ -225,12 +225,12 @@ void start_sflow_collector(std::string interface_for_binding, unsigned int sflow
|
||||
}
|
||||
|
||||
servaddr.sin_port = htons(sflow_port);
|
||||
|
||||
int bind_result = bind(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr));
|
||||
|
||||
int bind_result = bind(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr));
|
||||
|
||||
if (bind_result != 0) {
|
||||
logger << log4cpp::Priority::ERROR << plugin_log_prefix << "cannot bind on " << sflow_port << ":"
|
||||
<< interface_for_binding << " with errno: " << errno << " error: " << strerror(errno);
|
||||
<< interface_for_binding << " with errno: " << errno << " error: " << strerror(errno);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ bool process_sflow_flow_sample(uint8_t* data_pointer,
|
||||
}
|
||||
|
||||
simple_packet_t packet;
|
||||
packet.source = SFLOW;
|
||||
packet.source = SFLOW;
|
||||
packet.arrival_time = current_inaccurate_time;
|
||||
|
||||
packet.agent_ip_address = client_ipv4_address;
|
||||
|
Loading…
Reference in New Issue
Block a user