+/* $Id$
+
+This file is part of NetVis
+Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
+Distributed unter the GPL
+*/
+
#ifndef NETVIS_H_
#define NETVIS_H_
#include <map>
#include <pcap.h>
#include <msp/core/application.h>
+#include <msp/debug/profiler.h>
#include <msp/gbase/display.h>
#include <msp/gbase/glcontext.h>
#include <msp/gbase/window.h>
#include <msp/gl/font.h>
#include <msp/time/timestamp.h>
-class Packet;
class Host;
+class Packet;
+class Resolver;
class NetVis: public Msp::Application
{
std::string iface;
pcap_t *pcap;
std::list<Packet *> packets;
+ unsigned max_hosts;
+ unsigned max_visible_hosts;
std::map<unsigned, Host *> hosts;
+ std::map<unsigned, Host *> disabled_hosts;
Msp::Graphics::Display *dpy;
Msp::Graphics::Window *wnd;
Msp::Graphics::GLContext *glc;
- Msp::Time::TimeStamp last_tick;
+ Msp::Time::TimeStamp tick_t;
std::map<unsigned, Msp::GL::Color> port_colors;
Msp::GL::Font *font;
- Msp::GL::Texture2D *font_tex;
+ 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 **);
virtual void tick();
Host &get_host(unsigned);
Msp::GL::Color &get_port_color(unsigned);
+ void key_press(unsigned, unsigned, wchar_t);
static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *);
+ void sighandler(int);
+
static Application::RegApp<NetVis> reg;
};