com.h3c.of.lib.msg

## Class OfmMutablePacketIn

- java.lang.Object
- - com.h3c.nbio.AbstractMessage
  - - com.h3c.of.lib.msg.OpenflowMessage
    - - com.h3c.of.lib.msg.OfmPacketIn
      - - com.h3c.of.lib.msg.OfmMutablePacketIn

- All Implemented Interfaces:
    Message, MutableMessage, MutableObject, Structure

      public class OfmMutablePacketIn
      extends OfmPacketIn
      implements MutableMessage

  Mutable subclass of `OfmPacketIn`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.h3c.of.lib.msg.OpenflowMessage

      `OpenflowMessage.Header`

  - ### Field Summary

    - ### Fields inherited from class com.h3c.nbio.AbstractMessage

      `length`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `OfmMutablePacketIn` | `bufferId(BufferId bufferId)` Sets the buffer id; Since 1.0.
    `void` | `clearXid()` Clears the transaction ID field of this message (sets it to 0).
    `OfmMutablePacketIn` | `cookie(long cookie)` Sets the cookie value; Since 1.3.
    `OfmMutablePacketIn` | `data(byte[] data)` Sets the packet frame data; Since 1.0.
    `OfmMutablePacketIn` | `inPort(BigPortNumber inPort)` Sets the ingress port; Since 1.0.
    `OfmMutablePacketIn` | `match(Match match)` Sets the match (frame meta data); Since 1.2.
    `OfmMutablePacketIn` | `reason(PacketInReason reason)` Sets the reason for the packet-in message; Since 1.0.
    `OfmMutablePacketIn` | `tableId(TableId tableId)` Sets the table ID; Since 1.1.
    `OpenflowMessage` | `toImmutable()` Returns an immutable instance of this message.
    `String` | `toString()`
    `OfmMutablePacketIn` | `totalLen(int totalLen)` Sets the frame total length value; Since 1.0.
    `boolean` | `writable()` Returns true if this mutable object is still writable.

    - ### Methods inherited from class com.h3c.of.lib.msg.OfmPacketIn

      `getBufferId, getCookie, getData, getInPhyPort, getInPort, getMatch, getReason, getTableId, getTotalLen, toDebugString, validate`

    - ### Methods inherited from class com.h3c.of.lib.msg.OpenflowMessage

      `decodeHeader, getType, getVersion, getXid, hex, hex, length`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.h3c.of.lib.msg.Message

      `getType, getXid`

    - ### Methods inherited from interface com.h3c.of.lib.Structure

      `getVersion, toDebugString`

- - ### Method Detail

    - #### clearXid

          public void clearXid()

      Description copied from interface: `MutableMessage`
      Clears the transaction ID field of this message (sets it to 0).
      Specified by:
        `clearXid` in interface `MutableMessage`

    - #### toImmutable

          public OpenflowMessage toImmutable()

      Description copied from interface: `MutableMessage`
      Returns an immutable instance of this message. In essence, converts this message to be read-only.

      It is expected that the reference to this mutable message will be dropped. Note that all method calls invoked on a `MutableMessage` after `toImmutable()` has been invoked will result in an `InvalidMutableException` being thrown.

      Specified by:
        `toImmutable` in interface `MutableMessage`
      Returns:
        an immutable instance of this message.

    - #### writable

          public boolean writable()

      Description copied from interface: `MutableObject`
      Returns true if this mutable object is still writable. That is, the `#toImmutable()` method (defined on a sub-interface) has not yet been invoked.
      Specified by:
        `writable` in interface `MutableObject`
      Returns:
        true if this mutable object is still writable

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OfmPacketIn`

    - #### bufferId

          public OfmMutablePacketIn bufferId(BufferId bufferId)

      Sets the buffer id; Since 1.0.
      Parameters:
        `bufferId` - the buffer id
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if bufferId is null

    - #### inPort

          public OfmMutablePacketIn inPort(BigPortNumber inPort)

      Sets the ingress port; Since 1.0.

      Note that in 1.0, port numbers are u16.

      Parameters:
        `inPort` - the ingress port
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is > 1.1
        `NullPointerException` - if inPort is null
        `IllegalArgumentException` - if the port number is invalid

    - #### totalLen

          public OfmMutablePacketIn totalLen(int totalLen)

      Sets the frame total length value; Since 1.0.
      Parameters:
        `totalLen` - the total length value
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### reason

          public OfmMutablePacketIn reason(PacketInReason reason)

      Sets the reason for the packet-in message; Since 1.0.
      Parameters:
        `reason` - the reason
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if reason is null

    - #### tableId

          public OfmMutablePacketIn tableId(TableId tableId)

      Sets the table ID; Since 1.1.

      This should be set to the ID of the table that was looked up.

      Parameters:
        `tableId` - the table id
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.1
        `NullPointerException` - if reason is null

    - #### cookie

          public OfmMutablePacketIn cookie(long cookie)

      Sets the cookie value; Since 1.3.

      This should be set to the cookie of the flow entry that was looked up.

      Parameters:
        `cookie` - the cookie
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.3

    - #### match

          public OfmMutablePacketIn match(Match match)

      Sets the match (frame meta data); Since 1.2.

      The match field reflects the packet's headers and context when the event that triggers the packet-in message occurred and contains a set of OXM TLVs. This context includes any changes applied to the packet in previous processing, including actions already executed, if any, but not any changes in the action set.

      The OXM TLVs must include context fields, that is, fields whose values cannot be determined from the packet data. The standard context fields are `IN_PORT`, `IN_PHY_PORT`, `METADATA` and `TUNNEL_ID`. Fields whose values are all-bits-zero should be omitted.

      Optionally, the OXM TLVs may also include packet header fields that were previously extracted from the packet, including any modifications of those in the course of processing.

      When a packet is received directly on a physical port and not processed by a logical port, `IN_PORT` and `IN_PHY_PORT` have the same value - the OpenFlow port number of this physical port - in this case `IN_PHY_PORT` should be omitted.

      Parameters:
        `match` - the match
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.2
        `NullPointerException` - if match is null
        `IllegalArgumentException` - if match is mutable

    - #### data

          public OfmMutablePacketIn data(byte[] data)

      Sets the packet frame data; Since 1.0.
      Parameters:
        `data` - the frame data
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if data is null

Copyright © 2014. All Rights Reserved.