net.clackrouter.packets
Class VNSARPPacket

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

public class VNSARPPacket
extends VNSPacket

Encapsulates Address Resolution Protocol packet.


Field Summary
static int HLEN_LEN
          Length of the harware address length field, in bytes.
static int HW_ADDR_LEN
          Length of the harware address field, in bytes.
static short HW_TYPE_ETHERNET
          Value of the hardware type field of Ethernet.
static int HW_TYPE_LEN
          Length of the harware type field, in bytes.
static int OPERATION_LEN
          Length of the operation field, in bytes.
static short OPERATION_REPLY
          Value of the operation fieled of ARP reply.
static short OPERATION_REQUEST
          Value of the operation fieled of ARP request.
static short OPERATION_REVERSE_REPLY
          Value of the operation fieled of RARP reply.
static short OPERATION_REVERSE_REQUEST
          Value of the operation fieled of RARP request.
static int PLEN_LEN
          Length of the protocol address length field, in bytes.
static int PROTOCOL_ADDR_LEN
          Length of the protocol address field, in bytes.
static short PROTOCOL_TYPE_IP
          Value of the protocol type field of IP.
static int PROTOCOL_TYPE_LEN
          Length of the protocol type field, in bytes.
static int TOTAL_LEN
          Total length of the ARP packet, in bytes.
 
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
VNSARPPacket(java.nio.ByteBuffer packetByteBuffer)
          Constructs ARP packet from the supplied bytes.
VNSARPPacket(short hwType, short protocolType, byte hLen, byte pLen, short operation, java.nio.ByteBuffer sourceHWAddress, java.nio.ByteBuffer sourceProtocolAddress, java.nio.ByteBuffer destinationHWAddress, java.nio.ByteBuffer destinationProtocolAddress)
          Creates ARP packet from the supplied parameters.
 
Method Summary
 java.nio.ByteBuffer getDestinationHWAddress()
          Returns destination hardware address.
 java.nio.ByteBuffer getDestinationProtocolAddress()
          Returns destination protocol address.
 byte getHWAddressLength()
          Returns hardware address length.
 short getHWType()
          Returns hardware type.
 short getOperation()
          Returns operation (Request, Reply, etc.)
 byte getProtocolAddressLength()
          Returns protocol address length.
 short getProtocolType()
          Returns protocol type.
 java.nio.ByteBuffer getSourceHWAddress()
          Returns source hardware address.
 java.nio.ByteBuffer getSourceProtocolAddress()
          Returns source protocol address.
 java.lang.String toString()
          Presents ARP packet in a readable format, by field.
 
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
 
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

HW_TYPE_LEN

public static final int HW_TYPE_LEN
Length of the harware type field, in bytes.

See Also:
Constant Field Values

PROTOCOL_TYPE_LEN

public static final int PROTOCOL_TYPE_LEN
Length of the protocol type field, in bytes.

See Also:
Constant Field Values

HLEN_LEN

public static final int HLEN_LEN
Length of the harware address length field, in bytes.

See Also:
Constant Field Values

PLEN_LEN

public static final int PLEN_LEN
Length of the protocol address length field, in bytes.

See Also:
Constant Field Values

OPERATION_LEN

public static final int OPERATION_LEN
Length of the operation field, in bytes.

See Also:
Constant Field Values

HW_ADDR_LEN

public static final int HW_ADDR_LEN
Length of the harware address field, in bytes.

See Also:
Constant Field Values

PROTOCOL_ADDR_LEN

public static final int PROTOCOL_ADDR_LEN
Length of the protocol address field, in bytes.

See Also:
Constant Field Values

TOTAL_LEN

public static final int TOTAL_LEN
Total length of the ARP packet, in bytes.

See Also:
Constant Field Values

OPERATION_REQUEST

public static final short OPERATION_REQUEST
Value of the operation fieled of ARP request.

See Also:
Constant Field Values

OPERATION_REPLY

public static final short OPERATION_REPLY
Value of the operation fieled of ARP reply.

See Also:
Constant Field Values

OPERATION_REVERSE_REQUEST

public static final short OPERATION_REVERSE_REQUEST
Value of the operation fieled of RARP request.

See Also:
Constant Field Values

OPERATION_REVERSE_REPLY

public static final short OPERATION_REVERSE_REPLY
Value of the operation fieled of RARP reply.

See Also:
Constant Field Values

HW_TYPE_ETHERNET

public static final short HW_TYPE_ETHERNET
Value of the hardware type field of Ethernet.

See Also:
Constant Field Values

PROTOCOL_TYPE_IP

public static final short PROTOCOL_TYPE_IP
Value of the protocol type field of IP.

See Also:
Constant Field Values
Constructor Detail

VNSARPPacket

public VNSARPPacket(java.nio.ByteBuffer packetByteBuffer)
Constructs ARP packet from the supplied bytes.

Parameters:
packetByteBuffer - Buffer containing packet's bytes

VNSARPPacket

public VNSARPPacket(short hwType,
                    short protocolType,
                    byte hLen,
                    byte pLen,
                    short operation,
                    java.nio.ByteBuffer sourceHWAddress,
                    java.nio.ByteBuffer sourceProtocolAddress,
                    java.nio.ByteBuffer destinationHWAddress,
                    java.nio.ByteBuffer destinationProtocolAddress)
Creates ARP packet from the supplied parameters.

Parameters:
hwType - Hardware type
protocolType - Protocol type
hLen - Hardware address length
pLen - Protocol address length
operation - Operation (e.g. Request)
sourceHWAddress - Hardware address of the source host
sourceProtocolAddress - Protocol address of the source host (e.g. IP address)
destinationHWAddress - Harware address of the destination host
destinationProtocolAddress - Protocol address of the destination host
Method Detail

toString

public java.lang.String toString()
Presents ARP packet in a readable format, by field.

Overrides:
toString in class VNSPacket
Returns:
Fields of the ARP packet

getHWType

public short getHWType()
Returns hardware type.

Returns:
Hardware type

getProtocolType

public short getProtocolType()
Returns protocol type.

Returns:
Protocol type

getHWAddressLength

public byte getHWAddressLength()
Returns hardware address length.

Returns:
Hardware address length

getProtocolAddressLength

public byte getProtocolAddressLength()
Returns protocol address length.

Returns:
Protocol address length

getOperation

public short getOperation()
Returns operation (Request, Reply, etc.)

Returns:
Operation

getSourceProtocolAddress

public java.nio.ByteBuffer getSourceProtocolAddress()
Returns source protocol address.

Returns:
Source protocol address

getDestinationProtocolAddress

public java.nio.ByteBuffer getDestinationProtocolAddress()
Returns destination protocol address.

Returns:
Destination protocol address

getSourceHWAddress

public java.nio.ByteBuffer getSourceHWAddress()
Returns source hardware address.

Returns:
Source hardware address

getDestinationHWAddress

public java.nio.ByteBuffer getDestinationHWAddress()
Returns destination hardware address.

Returns:
Destination hardware address