font(0),
max_hosts(1000),
max_visible_hosts(30),
- draw_labels(true),
- blend(true),
frames(0)
{
if(argc<2)
wnd = new Graphics::SimpleGLWindow(1024, 768);
wnd->set_title("NetVis");
wnd->signal_close.connect(sigc::bind(sigc::mem_fun(this, &NetVis::exit), 0));
- wnd->signal_key_press.connect(sigc::mem_fun(this, &NetVis::key_press));
wnd->show();
GL::enable(GL::BLEND);
return *port;
}
-void NetVis::key_press(unsigned key, unsigned, wchar_t)
-{
- if(key==46)
- draw_labels = !draw_labels;
- else if(key==56)
- {
- blend = !blend;
- GL::set(GL_BLEND, blend);
- }
-}
-
void NetVis::capture_handler(unsigned char *user, const pcap_pkthdr *, const unsigned char *data)
{
NetVis *self = reinterpret_cast<NetVis *>(user);
std::map<unsigned, Host *> disabled_hosts;
std::list<Packet *> packets;
std::map<unsigned, Port *> ports;
- bool draw_labels;
- bool blend;
Msp::Time::TimeStamp tick_t;
Msp::Time::TimeStamp fps_t;
Host &get_host(unsigned);
Msp::GL::Color generate_color(bool) const;
const Port &get_port(unsigned);
- void key_press(unsigned, unsigned, wchar_t);
static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *);