]> git.tdb.fi Git - netvis.git/blobdiff - source/netvis.h
Handle addresses in a more generic way
[netvis.git] / source / netvis.h
index 68eed052f3649255d4d9ee74655e624a89327968..a59b65061f37141f30bacb88cf0145cf61b21d19 100644 (file)
@@ -23,6 +23,7 @@ Distributed unter the GPL
 #include <msp/gl/color.h>
 #include <msp/gl/font.h>
 #include <msp/time/timestamp.h>
+#include "address.h"
 
 class History;
 class Host;
@@ -48,16 +49,15 @@ private:
        std::string iface;
        pcap_t *pcap;
        Resolver *resolver;
-       unsigned localnet;
-       unsigned localnet_mask;
+       Address localnet;
 
        Msp::Graphics::SimpleGLWindow *wnd;
        Msp::GL::Font *font;
 
        unsigned max_hosts;
        unsigned max_visible_hosts;
-       std::map<unsigned, Host *> hosts;
-       std::map<unsigned, Host *> disabled_hosts;
+       std::map<Address, Host *> hosts;
+       std::map<Address, Host *> disabled_hosts;
        std::list<Packet *> packets;
        std::map<unsigned, Port *> ports;
        History *history;
@@ -72,12 +72,12 @@ public:
        ~NetVis();
 
        const Msp::GL::Font &get_font() const { return *font; }
-       const std::map<unsigned, Host *> &get_hosts() const { return hosts; }
+       const std::map<Address, Host *> &get_hosts() const { return hosts; }
        const std::map<unsigned, Port *> &get_ports() const { return ports; }
 private:
        virtual void tick();
        void render();
-       Host &get_host(unsigned);
+       Host &get_host(const Address &);
        Msp::GL::Color generate_color(bool) const;
        Port &get_port(unsigned);
        void create_history_texture();