org.openflow.protocol
Class OFFlowMod

java.lang.Object
  extended by org.openflow.protocol.OFMessage
      extended by org.openflow.protocol.OFFlowMod
All Implemented Interfaces:
java.lang.Cloneable, OFInstructionFactoryAware

public class OFFlowMod
extends OFMessage
implements OFInstructionFactoryAware, java.lang.Cloneable

Represents an ofp_flow_mod message

Author:
David Erickson (daviderickson@cs.stanford.edu), Srini Seetharaman (srini.seetharaman@gmail.com)

Field Summary
protected  int bufferId
           
protected  byte command
           
protected  long cookie
           
protected  long cookieMask
           
protected  short flags
           
protected  short hardTimeout
           
protected  short idleTimeout
           
protected  OFInstructionFactory instructionFactory
           
protected  java.util.List<OFInstruction> instructions
           
protected  OFMatch match
           
static int MINIMUM_LENGTH
           
static byte OFPFC_ADD
           
static byte OFPFC_DELETE
           
static byte OFPFC_DELETE_STRICT
           
static byte OFPFC_MODIFY
           
static byte OFPFC_MODIFY_STRICT
           
static short OFPFF_CHECK_OVERLAP
           
static short OFPFF_NO_BYT_COUNTS
           
static short OFPFF_NO_PKT_COUNTS
           
static short OFPFF_RESET_COUNTS
           
static short OFPFF_SEND_FLOW_REM
           
protected  int outGroup
           
protected  int outPort
           
protected  short priority
           
protected  byte tableId
           
 
Fields inherited from class org.openflow.protocol.OFMessage
length, OFP_VERSION, type, version, xid
 
Constructor Summary
OFFlowMod()
           
 
Method Summary
 OFFlowMod clone()
           
 void computeLength()
          This method is called during the writeTo method for serialization and is expected to set the length of the message.
 boolean equals(java.lang.Object obj)
           
 int getBufferId()
          Get buffer_id
 byte getCommand()
          Get command
 long getCookie()
          Get cookie
 long getCookieMask()
          Get cookieMask
 short getFlags()
          Get flags, see OFPFF_* constants
 short getHardTimeout()
          Get hard_timeout
 short getIdleTimeout()
          Get idle_timeout
 java.util.List<OFInstruction> getInstructions()
          Returns read-only copies of the instructions contained in this Flow Mod
 OFMatch getMatch()
          Gets a copy of the OFMatch object for this FlowMod, changes to this object do not modify the FlowMod
 int getOutGroup()
          Get out_group
 int getOutPort()
          Get out_port
 short getPriority()
          Get priority
 byte getTableId()
          Get tableId
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
          Read this message off the wire from the specified ByteBuffer
 OFFlowMod setBufferId(int bufferId)
          Set buffer_id
 OFFlowMod setCommand(byte command)
          Set command
 OFFlowMod setCookie(long cookie)
          Set cookie
 OFFlowMod setCookieMask(long cookieMask)
          Set cookieMask
 OFFlowMod setFlags(short flags)
          Set flags, see OFPFF_* constants
 OFFlowMod setHardTimeout(short hardTimeout)
          Set hard_timeout
 OFFlowMod setIdleTimeout(short idleTimeout)
          Set idle_timeout
 void setInstructionFactory(OFInstructionFactory instructionFactory)
          Sets the OFInstructionFactory
 OFFlowMod setInstructions(java.util.List<OFInstruction> instructions)
          Sets the list of instructions this Flow Mod contains
 OFFlowMod setMatch(OFMatch match)
          Set match
 OFFlowMod setOutGroup(int outGroup)
          Set out_group
 OFFlowMod setOutGroup(OFGroup group)
          Set out_group
 OFFlowMod setOutPort(int outPort)
          Set out_port
 OFFlowMod setOutPort(OFPort port)
          Set out_port
 OFFlowMod setPriority(short priority)
          Set priority
 OFFlowMod setTableId(byte tableId)
          Set tableId
 java.lang.String toString()
          Returns a summary of the message
 void writeTo(java.nio.ByteBuffer data)
          Write this message's binary format to the specified ByteBuffer
 
Methods inherited from class org.openflow.protocol.OFMessage
getLength, getLengthU, getType, getVersion, getXid, setLength, setLengthU, setType, setVersion, setXid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

OFPFC_ADD

public static final byte OFPFC_ADD
See Also:
Constant Field Values

OFPFC_MODIFY

public static final byte OFPFC_MODIFY
See Also:
Constant Field Values

OFPFC_MODIFY_STRICT

public static final byte OFPFC_MODIFY_STRICT
See Also:
Constant Field Values

OFPFC_DELETE

public static final byte OFPFC_DELETE
See Also:
Constant Field Values

OFPFC_DELETE_STRICT

public static final byte OFPFC_DELETE_STRICT
See Also:
Constant Field Values

OFPFF_SEND_FLOW_REM

public static final short OFPFF_SEND_FLOW_REM
See Also:
Constant Field Values

OFPFF_CHECK_OVERLAP

public static final short OFPFF_CHECK_OVERLAP
See Also:
Constant Field Values

OFPFF_RESET_COUNTS

public static final short OFPFF_RESET_COUNTS
See Also:
Constant Field Values

OFPFF_NO_PKT_COUNTS

public static final short OFPFF_NO_PKT_COUNTS
See Also:
Constant Field Values

OFPFF_NO_BYT_COUNTS

public static final short OFPFF_NO_BYT_COUNTS
See Also:
Constant Field Values

instructionFactory

protected OFInstructionFactory instructionFactory

cookie

protected long cookie

cookieMask

protected long cookieMask

tableId

protected byte tableId

command

protected byte command

idleTimeout

protected short idleTimeout

hardTimeout

protected short hardTimeout

priority

protected short priority

bufferId

protected int bufferId

outPort

protected int outPort

outGroup

protected int outGroup

flags

protected short flags

match

protected OFMatch match

instructions

protected java.util.List<OFInstruction> instructions
Constructor Detail

OFFlowMod

public OFFlowMod()
Method Detail

getBufferId

public int getBufferId()
Get buffer_id

Returns:

setBufferId

public OFFlowMod setBufferId(int bufferId)
Set buffer_id

Parameters:
bufferId -

getCookie

public long getCookie()
Get cookie

Returns:

setCookie

public OFFlowMod setCookie(long cookie)
Set cookie

Parameters:
cookie -

getCookieMask

public long getCookieMask()
Get cookieMask

Returns:

setCookieMask

public OFFlowMod setCookieMask(long cookieMask)
Set cookieMask

Parameters:
cookieMask -

getTableId

public byte getTableId()
Get tableId

Returns:

setTableId

public OFFlowMod setTableId(byte tableId)
Set tableId

Parameters:
tableId -

getCommand

public byte getCommand()
Get command

Returns:

setCommand

public OFFlowMod setCommand(byte command)
Set command

Parameters:
command -

getFlags

public short getFlags()
Get flags, see OFPFF_* constants

Returns:

setFlags

public OFFlowMod setFlags(short flags)
Set flags, see OFPFF_* constants

Parameters:
flags -

getHardTimeout

public short getHardTimeout()
Get hard_timeout

Returns:

setHardTimeout

public OFFlowMod setHardTimeout(short hardTimeout)
Set hard_timeout

Parameters:
hardTimeout -

getIdleTimeout

public short getIdleTimeout()
Get idle_timeout

Returns:

setIdleTimeout

public OFFlowMod setIdleTimeout(short idleTimeout)
Set idle_timeout

Parameters:
idleTimeout -

getMatch

public OFMatch getMatch()
Gets a copy of the OFMatch object for this FlowMod, changes to this object do not modify the FlowMod

Returns:

setMatch

public OFFlowMod setMatch(OFMatch match)
Set match

Parameters:
match -

getOutPort

public int getOutPort()
Get out_port

Returns:

setOutPort

public OFFlowMod setOutPort(int outPort)
Set out_port

Parameters:
outPort -

setOutPort

public OFFlowMod setOutPort(OFPort port)
Set out_port

Parameters:
port -

getOutGroup

public int getOutGroup()
Get out_group

Returns:

setOutGroup

public OFFlowMod setOutGroup(int outGroup)
Set out_group

Parameters:
outGroup -

setOutGroup

public OFFlowMod setOutGroup(OFGroup group)
Set out_group

Parameters:
group - object

getPriority

public short getPriority()
Get priority

Returns:

setPriority

public OFFlowMod setPriority(short priority)
Set priority

Parameters:
priority -

getInstructions

public java.util.List<OFInstruction> getInstructions()
Returns read-only copies of the instructions contained in this Flow Mod

Returns:
a list of ordered OFInstruction objects

setInstructions

public OFFlowMod setInstructions(java.util.List<OFInstruction> instructions)
Sets the list of instructions this Flow Mod contains

Parameters:
instructions - a list of ordered OFInstruction objects

readFrom

public void readFrom(java.nio.ByteBuffer data)
Description copied from class: OFMessage
Read this message off the wire from the specified ByteBuffer

Overrides:
readFrom in class OFMessage

writeTo

public void writeTo(java.nio.ByteBuffer data)
Description copied from class: OFMessage
Write this message's binary format to the specified ByteBuffer

Overrides:
writeTo in class OFMessage

setInstructionFactory

public void setInstructionFactory(OFInstructionFactory instructionFactory)
Description copied from interface: OFInstructionFactoryAware
Sets the OFInstructionFactory

Specified by:
setInstructionFactory in interface OFInstructionFactoryAware

hashCode

public int hashCode()
Overrides:
hashCode in class OFMessage

equals

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

clone

public OFFlowMod clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Description copied from class: OFMessage
Returns a summary of the message

Overrides:
toString in class OFMessage
Returns:
"ofmsg=v=$version;t=$type:l=$len:xid=$xid"

computeLength

public void computeLength()
Description copied from class: OFMessage
This method is called during the writeTo method for serialization and is expected to set the length of the message. If your class manually sets the length you should override this to do nothing.

Overrides:
computeLength in class OFMessage