X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetvis.h;h=a205d0564af72b89e340173b212614cc54a5c404;hb=afeb198dfbe4929c8d95487bca64a84ec3b92148;hp=35d9952ac826e3aed295da08405da580c1ce20d1;hpb=8814de48529f0b5b828372e471a7523b5f2bb6de;p=netvis.git diff --git a/source/netvis.h b/source/netvis.h index 35d9952..a205d05 100644 --- a/source/netvis.h +++ b/source/netvis.h @@ -15,13 +15,15 @@ Distributed unter the GPL #include #include #include -#include +#include #include #include #include +class History; class Host; class Packet; +class Port; class Resolver; class NetVis: public Msp::Application @@ -29,37 +31,40 @@ class NetVis: public Msp::Application private: std::string iface; pcap_t *pcap; - std::list packets; + Resolver *resolver; + unsigned localnet; + unsigned localnet_mask; + + Msp::Graphics::SimpleGLWindow *wnd; + Msp::GL::Font *font; + unsigned max_hosts; unsigned max_visible_hosts; std::map hosts; std::map disabled_hosts; - Msp::Graphics::Display *dpy; - Msp::Graphics::Window *wnd; - Msp::Graphics::GLContext *glc; + std::list packets; + std::map ports; + History *history; + Msp::Time::TimeStamp tick_t; - std::map port_colors; - Msp::GL::Font *font; - Msp::Debug::Profiler profiler; - bool draw_labels; - bool blend; - Resolver *resolver; - unsigned localnet; - unsigned localnet_mask; Msp::Time::TimeStamp fps_t; unsigned frames; float fps; public: NetVis(int, char **); - int main(); + ~NetVis(); + const Msp::GL::Font &get_font() const { return *font; } const std::map &get_hosts() const { return hosts; } + const std::map &get_ports() const { return ports; } private: virtual void tick(); + void render(); Host &get_host(unsigned); - Msp::GL::Color &get_port_color(unsigned); - void key_press(unsigned, unsigned, wchar_t); + Msp::GL::Color generate_color(bool) const; + Port &get_port(unsigned); + void create_history_texture(); static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *);