net.floodlightcontroller.packet
Class BSN

java.lang.Object
  extended by net.floodlightcontroller.packet.BasePacket
      extended by net.floodlightcontroller.packet.BSN
All Implemented Interfaces:
IPacket

public class BSN
extends BasePacket

Author:
Shudong Zhou (shudong.zhou@bigswitch.com)

Field Summary
static int BSN_MAGIC
           
static short BSN_TYPE_BDDP
           
static short BSN_TYPE_PROBE
           
static short BSN_VERSION_CURRENT
           
protected  short type
           
static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> typeClassMap
           
protected  short version
           
 
Fields inherited from class net.floodlightcontroller.packet.BasePacket
log, parent, payload
 
Constructor Summary
BSN()
           
BSN(short type)
           
 
Method Summary
 IPacket deserialize(byte[] data, int offset, int length)
          Deserializes this packet layer and all possible payloads
 boolean equals(java.lang.Object obj)
           
 short getType()
           
 short getVersion()
           
 int hashCode()
           
 byte[] serialize()
          Sets all payloads parent packet if applicable, then serializes this packet and all payloads
 BSN setType(short type)
           
 BSN setVersion(short version)
           
 java.lang.String toString()
           
 
Methods inherited from class net.floodlightcontroller.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BSN_MAGIC

public static final int BSN_MAGIC
See Also:
Constant Field Values

BSN_VERSION_CURRENT

public static final short BSN_VERSION_CURRENT
See Also:
Constant Field Values

BSN_TYPE_PROBE

public static final short BSN_TYPE_PROBE
See Also:
Constant Field Values

BSN_TYPE_BDDP

public static final short BSN_TYPE_BDDP
See Also:
Constant Field Values

typeClassMap

public static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> typeClassMap

type

protected short type

version

protected short version
Constructor Detail

BSN

public BSN()

BSN

public BSN(short type)
Method Detail

getType

public short getType()

setType

public BSN setType(short type)

getVersion

public short getVersion()

setVersion

public BSN setVersion(short version)

serialize

public byte[] serialize()
Description copied from interface: IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads

Returns:
a byte[] containing this packet and payloads

deserialize

public IPacket deserialize(byte[] data,
                           int offset,
                           int length)
                    throws PacketParsingException
Description copied from interface: IPacket
Deserializes this packet layer and all possible payloads

offset - offset to start deserializing from
length - length of the data to deserialize
Returns:
the deserialized data
Throws:
PacketParsingException

hashCode

public int hashCode()
Overrides:
hashCode in class BasePacket

equals

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object