1
0
Fork 0
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:
Pavel Odintsov 2015-06-18 16:49:14 +03:00
parent 5bfb39d627
commit 665295f89c
4 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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