public void packetArrived(Packet packet) { m_counter++; if (packet instanceof ICMPPacket) m_icmpCounter++; else System.err.println("Packet slipped thru filter: " + packet.getClass().getName()); System.out.println("Total Packets: " + m_counter + " ICMP Packets: " + m_icmpCounter); }
public int compareTo(Packet packet) { Timeval other = packet.getTimeval(); if (_timeval == null && other == null) return 0; if (_timeval == null && other != null) return -1; return _timeval.compareTo(other); }