パッケージ org.pcap4j.packet

インタフェース Packet

    • ネストされたクラスの概要

      ネストされたクラス 
      修飾子とタイプ インタフェース 説明
      static interface  Packet.Builder
      This interface is designed to be implemented by builder classes for packet objects.
      static interface  Packet.Header
      The interface representing a packet's header.
    • メソッドの詳細

      • getHeader

        Packet.Header getHeader()
        Returns the Header object representing this packet's header.
        戻り値:
        the Header object representing this packet's header. May be null if the header doesn't exist
      • getPayload

        Packet getPayload()
        Returns the Packet object representing this packet's payload.
        戻り値:
        the Packet object representing this packet's payload. May be null if the payload doesn't exist
      • length

        int length()
        Returns the packet length in bytes.
        戻り値:
        the length of the byte stream of the packet represented by this object in bytes
      • getRawData

        byte[] getRawData()
        Returns this packet's raw data.
        戻り値:
        this packet's raw data, namely the byte stream which is actually sent through real network
      • get

        <T extends Packet> T get​(Class<T> clazz)
        Traverses this packet and its payload to find an object of the specified packet class and returns the object. If there are more than one objects of the specified class in this object, this method returns the most outer one of them.
        型パラメータ:
        T - packet
        パラメータ:
        clazz - the packet class of the object to get
        戻り値:
        a packet object if found; otherwise null
      • getOuterOf

        Packet getOuterOf​(Class<? extends Packet> clazz)
        Returns the outer packet object of a packet object get(clazz) returns.
        パラメータ:
        clazz - the packet class of the object whose outer packet object is what you want to get
        戻り値:
        a packet object if found; otherwise null
      • contains

        <T extends Packet> boolean contains​(Class<T> clazz)
        Returns true if this packet is or its payload includes an object of specified packet class; false otherwise.
        型パラメータ:
        T - packet
        パラメータ:
        clazz - the packet class of the object to search for
        戻り値:
        true if this packet is or its payload includes an object of specified packet class; false otherwise
      • getBuilder

        Packet.Builder getBuilder()
        Returns a new Builder object populated with this object's fields' values.
        戻り値:
        a new Builder object populated with this object's fields values