mirror of
https://github.com/pavel-odintsov/fastnetmon
synced 2024-06-09 09:26:09 +02:00
Disable processin of IPv6 packets in counters code; Move total counter for IPv6 to main toolkit
This commit is contained in:
parent
5bfb39d627
commit
665295f89c
|
@ -1148,6 +1148,15 @@ void process_packet(simple_packet& current_packet) {
|
|||
logger << log4cpp::Priority::INFO << "Dump: " << print_simple_packet(current_packet);
|
||||
}
|
||||
|
||||
if (current_packet.ip_protocol_version == 6) {
|
||||
total_ipv6_packets++;
|
||||
}
|
||||
|
||||
// We do not process IPv6 at all on this mement
|
||||
if (current_packet.ip_protocol_version != 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Subnet for found IPs
|
||||
unsigned long subnet = 0;
|
||||
unsigned int subnet_cidr_mask = 0;
|
||||
|
|
|
@ -58,8 +58,6 @@ extern log4cpp::Category& logger;
|
|||
// Pass unparsed packets number to main programm
|
||||
extern uint64_t total_unparsed_packets;
|
||||
|
||||
extern uint64_t total_ipv6_packets;
|
||||
|
||||
// Global configuration map
|
||||
extern std::map<std::string, std::string> configuration_map;
|
||||
|
||||
|
@ -125,8 +123,6 @@ void consume_pkt(u_char* buffer, int len) {
|
|||
|
||||
memcpy(packet.src_ipv6.s6_addr, packet_header.extended_hdr.parsed_pkt.ip_src.v6.s6_addr, 16);
|
||||
memcpy(packet.dst_ipv6.s6_addr, packet_header.extended_hdr.parsed_pkt.ip_dst.v6.s6_addr, 16);
|
||||
|
||||
total_ipv6_packets++;
|
||||
}
|
||||
|
||||
packet.source_port = packet_header.extended_hdr.parsed_pkt.l4_src_port;
|
||||
|
|
|
@ -40,8 +40,6 @@ extern log4cpp::Category& logger;
|
|||
|
||||
extern uint64_t total_unparsed_packets;
|
||||
|
||||
extern uint64_t total_ipv6_packets;
|
||||
|
||||
// Global configuration map
|
||||
extern std::map<std::string, std::string> configuration_map;
|
||||
|
||||
|
@ -234,8 +232,6 @@ void parse_packet_pf_ring(const struct pfring_pkthdr* h, const u_char* p, const
|
|||
|
||||
memcpy(packet.src_ipv6.s6_addr, packet_header.extended_hdr.parsed_pkt.ip_src.v6.s6_addr, 16);
|
||||
memcpy(packet.dst_ipv6.s6_addr, packet_header.extended_hdr.parsed_pkt.ip_dst.v6.s6_addr, 16);
|
||||
|
||||
total_ipv6_packets++;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
uint64_t total_ipv6_packets = 0;
|
||||
uint64_t total_unparsed_packets = 0;
|
||||
|
||||
std::string log_file_path = "/tmp/fastnetmon_plugin_tester.log";
|
||||
|
|
Loading…
Reference in New Issue