Class Packets


  • public final class Packets
    extends java.lang.Object
    A utility class for operating on packets.
    Since:
    pcap4j 1.7.2
    Author:
    Kaito Yamada
    • Method Detail

      • 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.