1
0
Fork 0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-05-04 02:36:17 +02:00

Reformat code with clang-format

This commit is contained in:
Pavel Odintsov 2023-03-13 14:43:24 +00:00
parent 96c08b37bd
commit 784479731f
6 changed files with 14 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -17,4 +17,3 @@ extern log4cpp::Category& logger;
// Access to inaccurate but fast time
extern time_t current_inaccurate_time;

View File

@ -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;

View File

@ -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;