com.bigswitch.floodlight.vendor
Class OFBigSwitchVendorData

java.lang.Object
  extended by com.bigswitch.floodlight.vendor.OFBigSwitchVendorData
All Implemented Interfaces:
OFVendorData
Direct Known Subclasses:
OFBsnL2TableVendorData, OFBsnPktinSuppressionSetRequestVendorData, OFInterfaceIPReplyVendorData, OFInterfaceIPRequestVendorData, OFMirrorSetVendorData, OFNetmaskVendorData

public class OFBigSwitchVendorData
extends java.lang.Object
implements OFVendorData

Base class for vendor data corresponding to BigSwitch vendor extensions BigSwitch vendor data always starts with a 4-byte integer data type value

Author:
Munish Mehta (munish.mehta@bigswitch.com)

Field Summary
static int BSN_VENDOR_ID
           
protected  int dataType
          The value of the integer data type at the beginning of the vendor data
 
Constructor Summary
OFBigSwitchVendorData(int dataType)
          Construct BigSwitch vendor data with the specified data type
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getDataType()
          Get the data type value at the beginning of the vendor data
 int getLength()
          Get the length of the vendor data.
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data, int length)
          Read the vendor data from the ByteBuffer
 void setDataType(int dataType)
          Set the data type value
 void writeTo(java.nio.ByteBuffer data)
          Write the vendor data to the ByteBuffer
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BSN_VENDOR_ID

public static final int BSN_VENDOR_ID
See Also:
Constant Field Values

dataType

protected int dataType
The value of the integer data type at the beginning of the vendor data

Constructor Detail

OFBigSwitchVendorData

public OFBigSwitchVendorData(int dataType)
Construct BigSwitch vendor data with the specified data type

Parameters:
dataType - : the data type value at the beginning (opcode)
Method Detail

getDataType

public int getDataType()
Get the data type value at the beginning of the vendor data

Returns:

setDataType

public void setDataType(int dataType)
Set the data type value

Parameters:
dataType -

getLength

public int getLength()
Get the length of the vendor data. This implementation will normally be the superclass for another class that will override this to return the overall vendor data length. This implementation just returns the length of the part that includes the 4-byte integer data type value at the beginning of the vendor data

Specified by:
getLength in interface OFVendorData
Returns:
length of the data

readFrom

public void readFrom(java.nio.ByteBuffer data,
                     int length)
Read the vendor data from the ByteBuffer

Specified by:
readFrom in interface OFVendorData
Parameters:
data - the channel buffer from which we're deserializing
length - the length to the end of the enclosing message

writeTo

public void writeTo(java.nio.ByteBuffer data)
Write the vendor data to the ByteBuffer

Specified by:
writeTo in interface OFVendorData
Parameters:
data - the channel buffer to which we're serializing

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object