3 This file is part of NetVis
4 Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed unter the GPL
14 #include <msp/core/application.h>
15 #include <msp/debug/profiler.h>
16 #include <msp/gbase/display.h>
17 #include <msp/gbase/glcontext.h>
18 #include <msp/gbase/window.h>
19 #include <msp/gl/color.h>
20 #include <msp/gl/font.h>
21 #include <msp/time/timestamp.h>
27 class NetVis: public Msp::Application
32 std::list<Packet *> packets;
34 unsigned max_visible_hosts;
35 std::map<unsigned, Host *> hosts;
36 std::map<unsigned, Host *> disabled_hosts;
37 Msp::Graphics::Display *dpy;
38 Msp::Graphics::Window *wnd;
39 Msp::Graphics::GLContext *glc;
40 Msp::Time::TimeStamp tick_t;
41 std::map<unsigned, Msp::GL::Color> port_colors;
43 Msp::Debug::Profiler profiler;
48 unsigned localnet_mask;
49 Msp::Time::TimeStamp fps_t;
56 const Msp::GL::Font &get_font() const { return *font; }
57 const std::map<unsigned, Host *> &get_hosts() const { return hosts; }
60 Host &get_host(unsigned);
61 Msp::GL::Color &get_port_color(unsigned);
62 void key_press(unsigned, unsigned, wchar_t);
64 static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *);
68 static Application::RegApp<NetVis> reg;