Class Packets

java.lang.Object
org.pcap4j.util.Packets

public final class Packets extends Object
A utility class for operating on packets.
Since:
pcap4j 1.7.2
  • Constructor Details

    • Packets

      private Packets()
  • Method Details

    • containsTcpPacket

      public static boolean containsTcpPacket(Packet packet)
      Checks if the given packet contains a TCP packet (TcpPacket).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains a TCP packet; false otherwise.
    • containsUdpPacket

      public static boolean containsUdpPacket(Packet packet)
      Checks if the given packet contains a Udp packet (UdpPacket).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains a UDP packet; false otherwise.
    • containsIpV4Packet

      public static boolean containsIpV4Packet(Packet packet)
      Checks if the given packet contains an IPv4 packet (IpV4Packet).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains an IPv4 packet; false otherwise.
    • containsIpV6Packet

      public static boolean containsIpV6Packet(Packet packet)
      Checks if the given packet contains an IPv6 packet (IpV6Packet).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains an IPv6 packet; false otherwise.
    • containsIpPacket

      public static boolean containsIpPacket(Packet packet)
      Checks if the given packet contains an IP packet (IpPacket).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains an IP packet; false otherwise.
    • containsEthernetPacket

      public static boolean containsEthernetPacket(Packet packet)
      Checks if the given packet contains an Ethernet packet (EthernetPacket).
      Parameters:
      packet - packet
      Returns:
      true if the packet contains an Ethernet packet; false otherwise.