+void NetVis::handle_tcp(CaptureContext &ctx, const tcphdr *tcp, unsigned)
+{
+ ctx.src_port = &get_port(ntohs(tcp->source));
+ ctx.dst_port = &get_port(ntohs(tcp->dest));
+ handle_packet(ctx);
+}
+
+void NetVis::handle_udp(CaptureContext &ctx, const udphdr *udp, unsigned)
+{
+ ctx.src_port = &get_port(ntohs(udp->source));
+ ctx.dst_port = &get_port(ntohs(udp->dest));
+ handle_packet(ctx);
+}
+
+void NetVis::handle_packet(CaptureContext &ctx)
+{
+ Port *port = 0;
+ if(ctx.src_port && ctx.dst_port)
+ {
+ if(ctx.src_port->is_registered()!=ctx.dst_port->is_registered())