Package jpcap.packet

Class UDPPacket

All Implemented Interfaces:
Serializable

public class UDPPacket extends IPPacket
This class represents UDP packet.
See Also:
  • Field Details

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

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

    • toString

      public 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