Example #1
0
  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);
  }
Example #2
0
 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);
 }