net.clackrouter.packets
Class VNSUDPPacket

java.lang.Object
  extended by net.clackrouter.protocol.data.VNSData
      extended by net.clackrouter.packets.VNSPacket
          extended by net.clackrouter.packets.VNSUDPPacket

public class VNSUDPPacket
extends VNSPacket

A User Datagram Protocol (UDP) Packet.


Field Summary
 int checksum
           
 int dst_port
           
 int length
           
protected  java.nio.ByteBuffer m_bodyBuffer
           
protected  java.net.InetAddress mDestAddress
           
protected  java.net.InetAddress mSrcAddress
           
 int src_port
           
static int UDP_HEADER_LEN
           
 
Fields inherited from class net.clackrouter.packets.VNSPacket
m_inputInterfaceName, m_length, m_level2Type, m_local_packet, m_nextHopIPAddr, m_nextHopMacAddr, m_outputInterfaceName, m_packetByteBuffer, mParentHeader
 
Constructor Summary
VNSUDPPacket(java.nio.ByteBuffer packetBuffer)
          Constructs an IMCP packet from the supplied byte buffer.
VNSUDPPacket(int sport, int dport, java.nio.ByteBuffer body)
           
 
Method Summary
 int calculateChecksum()
           
 java.nio.ByteBuffer getBodyBuffer()
           
 java.net.InetAddress getDestinationAddress()
           
 int getDestinationPort()
           
 java.net.InetAddress getSourceAddress()
           
 int getSourcePort()
           
 void pack()
           
 void setBodyBuffer(java.nio.ByteBuffer buf)
           
 void setDestinationAddress(java.net.InetAddress dest)
           
 void setSourceAddress(java.net.InetAddress source)
           
 
Methods inherited from class net.clackrouter.packets.VNSPacket
addToPath, get16bit, get32bit, getByteBuffer, getInputInterfaceName, getLength, getLevel2Type, getNextHopIPAddress, getNextHopMacAddress, getOutputInterfaceName, getParentHeader, getStringBuffer, isPacket, needsSourceAddress, setByteBuffer, setInputInterfaceName, setLevel2Type, setNeedsSourceAddress, setNextHopIPAddress, setNextHopMacAddress, setOutputInterfaceName, setParentHeader, toString
 
Methods inherited from class net.clackrouter.protocol.data.VNSData
isBanner, isClose, isHWInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UDP_HEADER_LEN

public static int UDP_HEADER_LEN

src_port

public int src_port

dst_port

public int dst_port

length

public int length

checksum

public int checksum

m_bodyBuffer

protected java.nio.ByteBuffer m_bodyBuffer

mDestAddress

protected java.net.InetAddress mDestAddress

mSrcAddress

protected java.net.InetAddress mSrcAddress
Constructor Detail

VNSUDPPacket

public VNSUDPPacket(int sport,
                    int dport,
                    java.nio.ByteBuffer body)

VNSUDPPacket

public VNSUDPPacket(java.nio.ByteBuffer packetBuffer)
Constructs an IMCP packet from the supplied byte buffer.

Parameters:
packetBuffer - Byte buffer containing an ICMP packet
Method Detail

getBodyBuffer

public java.nio.ByteBuffer getBodyBuffer()

setBodyBuffer

public void setBodyBuffer(java.nio.ByteBuffer buf)

pack

public void pack()

calculateChecksum

public int calculateChecksum()

getDestinationPort

public int getDestinationPort()

getSourcePort

public int getSourcePort()

setDestinationAddress

public void setDestinationAddress(java.net.InetAddress dest)

getDestinationAddress

public java.net.InetAddress getDestinationAddress()

setSourceAddress

public void setSourceAddress(java.net.InetAddress source)

getSourceAddress

public java.net.InetAddress getSourceAddress()