net.sourceforge.jpcap.net
Class UDPEncoding

java.lang.Object
  |
  +--net.sourceforge.jpcap.net.UDPEncoding

public class UDPEncoding
extends java.lang.Object

UDP protocol encoding information.


Field Summary
static int HEADER_LEN
          Length in bytes of a UDP header.
 
Constructor Summary
UDPEncoding()
           
 
Method Summary
static UDPPacket create(int lLen, byte[] bytes)
          UDPPacket factory.
static int extractUDPDstPort(int lLen, byte[] packetBytes)
          Extract the destination port from a udp packet.
static int extractUDPSrcPort(int lLen, byte[] packetBytes)
          Extract the source port from a udp packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_LEN

public static final int HEADER_LEN
Length in bytes of a UDP header.
Constructor Detail

UDPEncoding

public UDPEncoding()
Method Detail

create

public static UDPPacket create(int lLen,
                               byte[] bytes)
UDPPacket factory.

extractUDPSrcPort

public static int extractUDPSrcPort(int lLen,
                                    byte[] packetBytes)
Extract the source port from a udp packet.
Parameters:
llen - the length of the link-level header.
packetBytes - packet bytes, including the link-layer and IP headers.

extractUDPDstPort

public static int extractUDPDstPort(int lLen,
                                    byte[] packetBytes)
Extract the destination port from a udp packet.
Parameters:
llen - the length of the link-level header.
packetBytes - packet bytes, including the link-layer and IP headers.