org.openflow.protocol
Class OFPacketIn

java.lang.Object
  extended by org.openflow.protocol.OFMessage
      extended by org.openflow.protocol.OFPacketIn

public class OFPacketIn
extends OFMessage

Represents an ofp_packet_in

Author:
David Erickson (daviderickson@cs.stanford.edu) - Feb 8, 2010

Nested Class Summary
static class OFPacketIn.OFPacketInReason
           
 
Field Summary
protected  int bufferId
           
protected  long cookie
           
protected  OFMatch match
           
static int MINIMUM_LENGTH
           
protected  byte[] packetData
           
protected  OFPacketIn.OFPacketInReason reason
           
protected  byte tableId
           
protected  short totalLength
           
 
Fields inherited from class org.openflow.protocol.OFMessage
length, OFP_VERSION, type, version, xid
 
Constructor Summary
OFPacketIn()
           
 
Method Summary
 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
 long getCookie()
          Get cookie
 int getInPort()
          Get in_port
 OFMatch getMatch()
          Get match
 byte[] getPacketData()
          Returns the packet data
 OFPacketIn.OFPacketInReason getReason()
          Get reason
 byte getTableId()
          Get tableId
 short getTotalLength()
          Get total_len
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
          Read this message off the wire from the specified ByteBuffer
 OFPacketIn setBufferId(int bufferId)
          Set buffer_id
 OFPacketIn setCookie(long cookie)
          Set cookie
 OFPacketIn setMatch(OFMatch match)
          Set match
 OFPacketIn setPacketData(byte[] packetData)
          Sets the packet data, and updates the length of this message
 OFPacketIn setReason(OFPacketIn.OFPacketInReason reason)
          Set reason
 OFPacketIn setTableId(byte tableId)
          Set tableId
 OFPacketIn setTotalLength(short totalLength)
          Set total_len
 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

bufferId

protected int bufferId

totalLength

protected short totalLength

reason

protected OFPacketIn.OFPacketInReason reason

tableId

protected byte tableId

cookie

protected long cookie

match

protected OFMatch match

packetData

protected byte[] packetData
Constructor Detail

OFPacketIn

public OFPacketIn()
Method Detail

getBufferId

public int getBufferId()
Get buffer_id

Returns:

setBufferId

public OFPacketIn setBufferId(int bufferId)
Set buffer_id

Parameters:
bufferId -

getCookie

public long getCookie()
Get cookie

Returns:

setCookie

public OFPacketIn setCookie(long cookie)
Set cookie

Parameters:
cookie -

getTableId

public byte getTableId()
Get tableId

Returns:

setTableId

public OFPacketIn setTableId(byte tableId)
Set tableId

Parameters:
tableId -

getMatch

public OFMatch getMatch()
Get match

Returns:

setMatch

public OFPacketIn setMatch(OFMatch match)
Set match

Parameters:
match -

getPacketData

public byte[] getPacketData()
Returns the packet data

Returns:

setPacketData

public OFPacketIn setPacketData(byte[] packetData)
Sets the packet data, and updates the length of this message

Parameters:
packetData -

getInPort

public int getInPort()
Get in_port

Returns:

getReason

public OFPacketIn.OFPacketInReason getReason()
Get reason

Returns:

setReason

public OFPacketIn setReason(OFPacketIn.OFPacketInReason reason)
Set reason

Parameters:
reason -

getTotalLength

public short getTotalLength()
Get total_len

Returns:

setTotalLength

public OFPacketIn setTotalLength(short totalLength)
Set total_len

Parameters:
totalLength -

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

hashCode

public int hashCode()
Overrides:
hashCode in class OFMessage

equals

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

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