10 #include <tins/tins.h>
11 #include <boost/format.hpp>
13 #include "flow_collector.hpp"
14 #include "reader_writer_exclusion.hpp"
15 #include "webservice.hpp"
20 NetWhere(
const std::string interface, Tins::IPv4Range hosts_range)
21 : _interface(interface), _collector(hosts_range),
22 _last_stats(0), _last_prune(0) {}
26 bool handle_packet(
const Tins::PDU &pdu);
27 std::string handle_request(
const std::string& url);
30 const int _print_stats_interval = 60;
31 const int _prune_interval = 60*60;
32 const int _prune_older_than = 60*60*2;
36 const std::string _interface;
41 std::string host_flows(
const std::string& host_key);
42 void print_stats() { LOG(boost::format(
"%1% hosts, %2% flows") % _collector.hosts().size() % _collector.flows().size()); }
43 std::string get_hostname(
const Host& host);
Definition: flow_collector.hpp:13
a lock shared between multiple reader threads and a single writer thread
Definition: reader_writer_exclusion.hpp:21
IP and hardware address for a network host.
Definition: host.hpp:21
Definition: netwhere.hpp:18