com.h3c.of.lib.msg

## Class OfmPacketIn

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

- All Implemented Interfaces:
    Message, Structure
  Direct Known Subclasses:
    OfmMutablePacketIn

      public class OfmPacketIn
      extends OpenflowMessage

  Represents an OpenFlow PACKET_IN message; Since 1.0.

- - ### 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`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OfmPacketIn(OpenflowMessage.Header header, BufferId bufferId, BigPortNumber inPort, BigPortNumber inPhyPort, int totalLen, PacketInReason reason, TableId tableId, long cookie, Match match, byte[] data)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BufferId` | `getBufferId()` ID assigned by datapath (BufferId.NO_BUFFER if none); since 1.0.
    `long` | `getCookie()` Returns the cookie of the flow entry that caused the packet to be sent to the controller; Since 1.3.
    `byte[]` | `getData()` Returns a copy of the packet data; Since 1.0.
    `BigPortNumber` | `getInPhyPort()` Returns the physical port on which the frame was received; Since 1.1.
    `BigPortNumber` | `getInPort()` Returns the port on which the frame was received; Since 1.0.
    `Match` | `getMatch()` Returns the packet metadata; Since 1.2.
    `PacketInReason` | `getReason()` Returns the reason the packet is being sent; Since 1.0.
    `TableId` | `getTableId()` Returns the ID of the table that was looked up; Since 1.1.
    `int` | `getTotalLen()` Returns the total length value from the in-port message header; Since 1.0.
    `String` | `toDebugString()` Returns a string representation useful for debugging.
    `String` | `toString()`
    `void` | `validate()` Validates this message for completeness and throws an exception if the message is considered "not complete".

    - ### 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`

- - ### Constructor Detail

    - #### OfmPacketIn

          public OfmPacketIn(OpenflowMessage.Header header,
                     BufferId bufferId,
                     BigPortNumber inPort,
                     BigPortNumber inPhyPort,
                     int totalLen,
                     PacketInReason reason,
                     TableId tableId,
                     long cookie,
                     Match match,
                     byte[] data)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OpenflowMessage`

    - #### toDebugString

          public String toDebugString()

      Description copied from class: `OpenflowMessage`
      Returns a string representation useful for debugging. This default implementation delegates to `OpenflowMessage.toString()`, but subclasses are free to override this behavior.
      Specified by:
        `toDebugString` in interface `Structure`
      Overrides:
        `toDebugString` in class `OpenflowMessage`
      Returns:
        a (possibly multi-line) string representation of this message

    - #### validate

          public void validate()
                        throws IncompleteMessageException

      Description copied from class: `OpenflowMessage`
      Validates this message for completeness and throws an exception if the message is considered "not complete".

      This default implementation does nothing, i.e. default behavior is that messages are considered complete.

      Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.

      Overrides:
        `validate` in class `OpenflowMessage`
      Throws:
        `IncompleteMessageException` - if the message is not complete

    - #### getBufferId

          public BufferId getBufferId()

      ID assigned by datapath (BufferId.NO_BUFFER if none); since 1.0.
      Returns:
        the buffer ID

    - #### getInPort

          public BigPortNumber getInPort()

      Returns the port on which the frame was received; Since 1.0.
      Returns:
        the ingress port

    - #### getInPhyPort

          public BigPortNumber getInPhyPort()

      Returns the physical port on which the frame was received; Since 1.1.
      Returns:
        the ingress physical port

    - #### getTotalLen

          public int getTotalLen()

      Returns the total length value from the in-port message header; Since 1.0.
      Returns:
        the total length value

    - #### getReason

          public PacketInReason getReason()

      Returns the reason the packet is being sent; Since 1.0.
      Returns:
        the reason

    - #### getTableId

          public TableId getTableId()

      Returns the ID of the table that was looked up; Since 1.1.
      Returns:
        the table ID

    - #### getCookie

          public long getCookie()

      Returns the cookie of the flow entry that caused the packet to be sent to the controller; Since 1.3.
      Returns:
        the cookie

    - #### getMatch

          public Match getMatch()

      Returns the packet metadata; Since 1.2. This match structure reflects the packet's headers and context when the event that triggers the PACKET_IN message occurred.
      Returns:
        the packet metadata

    - #### getData

          public byte[] getData()

      Returns a copy of the packet data; Since 1.0. Contains the packet itself, or a fraction of the packet if the packet is buffered.
      Returns:
        a copy of the packet data

Copyright © 2014. All Rights Reserved.