Class UdpPacket

    • Method Detail

      • getHeader

        public UdpPacket.UdpHeader getHeader()
        Description copied from class: AbstractPacket
        Returns the Header object representing this packet's header. This subclass have to override this method if the packet represented by the subclass has a header.
        Specified by:
        getHeader in interface Packet
        Specified by:
        getHeader in interface TransportPacket
        Overrides:
        getHeader in class AbstractPacket
        Returns:
        the Header object representing this packet's header. May be null if the header doesn't exist
      • getPayload

        public Packet getPayload()
        Description copied from class: AbstractPacket
        Returns the Packet object representing this packet's payload. This subclass have to override this method if the packet represented by the subclass has a payload.
        Specified by:
        getPayload in interface Packet
        Overrides:
        getPayload in class AbstractPacket
        Returns:
        the Packet object representing this packet's payload. May be null if the payload doesn't exist
      • hasValidChecksum

        public boolean hasValidChecksum​(java.net.InetAddress srcAddr,
                                        java.net.InetAddress dstAddr,
                                        boolean acceptZero)
        checksum verification is necessary for IPv6(i.e. acceptZero must be false)
        Parameters:
        srcAddr - srcAddr
        dstAddr - dstAddr
        acceptZero - acceptZero
        Returns:
        true if the packet represented by this object has a valid checksum; false otherwise.
      • getBuilder

        public UdpPacket.Builder getBuilder()
        Description copied from interface: Packet
        Returns a new Builder object populated with this object's fields' values.
        Specified by:
        getBuilder in interface Packet
        Specified by:
        getBuilder in class AbstractPacket
        Returns:
        a new Builder object populated with this object's fields values