Package jpcap.packet

Class UDPPacket

  • All Implemented Interfaces:
    java.io.Serializable

    public class UDPPacket
    extends IPPacket
    This class represents UDP packet.
    See Also:
    Serialized Form
    • Field Detail

      • src_port

        public int src_port
        Source port number
      • dst_port

        public int dst_port
        Destination port number
      • length

        public int length
        packet length
    • Constructor Detail

      • UDPPacket

        public UDPPacket​(int src_port,
                         int dst_port)
        Creates a UDP packet.
        Parameters:
        src_port - source port number
        dst_port - destination port number
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of this packet.

        Format: src_port > dst_port
        Overrides:
        toString in class IPPacket
        Returns:
        a string representation of this packet