net.sourceforge.jpcap.net
Class UDPPacket

java.lang.Object
  |
  +--net.sourceforge.jpcap.net.Packet
        |
        +--net.sourceforge.jpcap.net.EthernetPacket
              |
              +--net.sourceforge.jpcap.net.IPPacket
                    |
                    +--net.sourceforge.jpcap.net.UDPPacket

public class UDPPacket
extends IPPacket

A UDP packet.

Extends an IP packet, adding a UDP header and UDP data payload.


Constructor Summary
UDPPacket(int lLen, byte[] bytes, java.lang.String macSourceAddress, java.lang.String macDestinationAddress, java.lang.String sourceAddress, int sourcePort, java.lang.String destinationAddress, int destinationPort, int ipProtocol)
          Create a new UDP packet.
 
Method Summary
 byte[] getData()
          Fetch data portion of the udp header.
 int getDestinationPort()
           
 byte[] getHeader()
          Fetch the udp header, excluding udp data payload.
 int getSourcePort()
           
 java.lang.String toString()
          Convert this UDP packet to a readable string.
 
Methods inherited from class net.sourceforge.jpcap.net.IPPacket
getDestinationAddress, getProtocol, getSourceAddress
 
Methods inherited from class net.sourceforge.jpcap.net.EthernetPacket
getDestinationHwAddress, getSourceHwAddress, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UDPPacket

public UDPPacket(int lLen,
                 byte[] bytes,
                 java.lang.String macSourceAddress,
                 java.lang.String macDestinationAddress,
                 java.lang.String sourceAddress,
                 int sourcePort,
                 java.lang.String destinationAddress,
                 int destinationPort,
                 int ipProtocol)
Create a new UDP packet.
Method Detail

getSourcePort

public int getSourcePort()

getDestinationPort

public int getDestinationPort()

getHeader

public byte[] getHeader()
Fetch the udp header, excluding udp data payload.
Overrides:
getHeader in class IPPacket

getData

public byte[] getData()
Fetch data portion of the udp header.
Overrides:
getData in class IPPacket

toString

public java.lang.String toString()
Convert this UDP packet to a readable string.
Overrides:
toString in class IPPacket