net.clackrouter.protocol.data
Class VNSHWInfo

java.lang.Object
  extended by net.clackrouter.protocol.data.VNSData
      extended by net.clackrouter.protocol.data.VNSHWInfo

public class VNSHWInfo
extends VNSData

Encapsulates hardware information sent from the server.


Nested Class Summary
 class VNSHWInfo.HWEntry
          Class representing an individual hardware entry.
 class VNSHWInfo.InterfaceEntry
          Encapsulates interface information.
 
Field Summary
static int KEY_ETHERNET
          Key indicating that a value following it is a interface hardware address.
static int KEY_FIXED_IP
          Key indicating that a value following it is a host IP address and it's fixed in the topology.
static int KEY_IN_USE
          This key is deprecated and should not be used.
static int KEY_INTERFACE
          Key indicating that a value following it is an interface name.
static int KEY_IP
          Key indicating that a value following it is an interface IP address.
static int KEY_LEN
          Length of the key field in the (key, value) tuple that arrives from the server inside the hardware info command.
static int KEY_MASK
          Key indicating that a value following it is an interface subnet mask.
static int KEY_SPEED
          Key indicating that a value following it is an interface speed.
static int KEY_SUBNET
          Key indicating that a value following it is a subnet IP address.
static int VALUE_LEN
          Length of the value field in the (key, value) tuple that arrives from the server inside the hardware info command.
 
Constructor Summary
VNSHWInfo(java.nio.ByteBuffer hwInfoByteBuffer)
          Constructs hardware info from the supplied byte buffer.
 
Method Summary
 VNSHWInfo.HWEntry getHWEntryAt(int index)
          Returns the raw hardware entry at the specified index.
 VNSHWInfo.InterfaceEntry getInterfaceEntryAt(int index)
          Returns an interface entry at the supplied index.
 int getNumberOfHWEntries()
          Returns the number of raw hardware entries for this router.
 int getNumberOfInterfaces()
          Returns number of interfaces on the router.
 boolean isHWInfo()
           
 java.lang.String toString()
          Represent harddware info in a readable format, by field.
 
Methods inherited from class net.clackrouter.protocol.data.VNSData
isBanner, isClose, isPacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_LEN

public static final int KEY_LEN
Length of the key field in the (key, value) tuple that arrives from the server inside the hardware info command.

See Also:
Constant Field Values

VALUE_LEN

public static final int VALUE_LEN
Length of the value field in the (key, value) tuple that arrives from the server inside the hardware info command.

See Also:
Constant Field Values

KEY_INTERFACE

public static final int KEY_INTERFACE
Key indicating that a value following it is an interface name.

See Also:
Constant Field Values

KEY_SPEED

public static final int KEY_SPEED
Key indicating that a value following it is an interface speed.

See Also:
Constant Field Values

KEY_SUBNET

public static final int KEY_SUBNET
Key indicating that a value following it is a subnet IP address.

See Also:
Constant Field Values

KEY_IN_USE

public static final int KEY_IN_USE
This key is deprecated and should not be used.

See Also:
Constant Field Values

KEY_FIXED_IP

public static final int KEY_FIXED_IP
Key indicating that a value following it is a host IP address and it's fixed in the topology.

See Also:
Constant Field Values

KEY_ETHERNET

public static final int KEY_ETHERNET
Key indicating that a value following it is a interface hardware address.

See Also:
Constant Field Values

KEY_IP

public static final int KEY_IP
Key indicating that a value following it is an interface IP address.

See Also:
Constant Field Values

KEY_MASK

public static final int KEY_MASK
Key indicating that a value following it is an interface subnet mask.

See Also:
Constant Field Values
Constructor Detail

VNSHWInfo

public VNSHWInfo(java.nio.ByteBuffer hwInfoByteBuffer)
          throws java.lang.Exception
Constructs hardware info from the supplied byte buffer.

Parameters:
hwInfoByteBuffer - Byte buffer containing hardware info
Throws:
java.lang.Exception
Method Detail

isHWInfo

public boolean isHWInfo()
Overrides:
isHWInfo in class VNSData

toString

public java.lang.String toString()
Represent harddware info in a readable format, by field.

Overrides:
toString in class java.lang.Object
Returns:
Hardware info

getNumberOfHWEntries

public int getNumberOfHWEntries()
Returns the number of raw hardware entries for this router.

Returns:
Number of raw hardware entries for this router
See Also:
getNumberOfInterfaces()

getHWEntryAt

public VNSHWInfo.HWEntry getHWEntryAt(int index)
Returns the raw hardware entry at the specified index.

Parameters:
index - Index of the raw hardware entry
Returns:
Hardware entry at the specified index

getNumberOfInterfaces

public int getNumberOfInterfaces()
Returns number of interfaces on the router.

Returns:
Number of interfaces on this router
See Also:
getInterfaceEntryAt(int)

getInterfaceEntryAt

public VNSHWInfo.InterfaceEntry getInterfaceEntryAt(int index)
Returns an interface entry at the supplied index.

Parameters:
index - Index of the interface
Returns:
Interface entry
See Also:
getNumberOfInterfaces()