com.h3c.of.lib

## Class OfPacketReader

- java.lang.Object
- - com.h3c.util.pkt.PacketReader
  - - com.h3c.of.lib.OfPacketReader

-     public class OfPacketReader
      extends PacketReader

  Extends the functionality of `PacketReader` to include the OpenFlow datatypes from `com.h3c.of.lib.dt`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OfPacketReader(byte[] bytes)` Constructs a packet reader backed by the specified byte buffer.
    `OfPacketReader(ByteBuffer bb)` Constructs a packet reader backed by the specified byte buffer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BufferId` | `readBufferId()` Reads a (u32) buffer id from the buffer.
    `DataPathId` | `readDataPathId()` Reads a (u32) datapath id from the buffer.
    `GroupId` | `readGroupId()` Reads a (u32) group id from the buffer.
    `MeterId` | `readMeterId()` Reads a (u32) meter id from the buffer.
    `QueueId` | `readQueueId()` Reads a (u32) queue id from the buffer.
    `TableId` | `readTableId()` Reads a (u8) table id from the buffer.
    `VId` | `readVId()` Reads a virtual identifier (u16) from the buffer.
    `int` | `startIndex()` Returns the annotated start index.
    `void` | `startIndex(int index)` Annotates this packet reader with the start index.
    `int` | `targetIndex()` Returns the annotated target index.
    `void` | `targetIndex(int index)` Annotates this packet reader with the target index.

    - ### Methods inherited from class com.h3c.util.pkt.PacketReader

      `array, limit, odometer, peek, peekU16, peekU16, peekU24, peekU24, peekU8, peekU8, readableBytes, readBigPortNumber, readByte, readBytes, readEthernetType, readIcmpv4Type, readIcmpv6Type, readInt, readIpProtocol, readIPv4Address, readIPv6Address, readLong, readMacAddress, readPortNumber, readString, readU16, readU24, readU32, readU8, resetIndex, resetOdometer, ri, ri, skip, toString`

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

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

- - ### Constructor Detail

    - #### OfPacketReader

          public OfPacketReader(ByteBuffer bb)

      Constructs a packet reader backed by the specified byte buffer.
      Parameters:
        `bb` - the byte buffer to read from

    - #### OfPacketReader

          public OfPacketReader(byte[] bytes)

      Constructs a packet reader backed by the specified byte buffer.
      Parameters:
        `bytes` - the bytes to wrap

  - ### Method Detail

    - #### startIndex

          public void startIndex(int index)

      Annotates this packet reader with the start index.
      Parameters:
        `index` - the start index

    - #### startIndex

          public int startIndex()

      Returns the annotated start index.
      Returns:
        the start index

    - #### targetIndex

          public void targetIndex(int index)

      Annotates this packet reader with the target index.
      Parameters:
        `index` - the target index

    - #### targetIndex

          public int targetIndex()

      Returns the annotated target index.
      Returns:
        the target index

    - #### readGroupId

          public GroupId readGroupId()

      Reads a (u32) group id from the buffer.
      Returns:
        a group id

    - #### readBufferId

          public BufferId readBufferId()

      Reads a (u32) buffer id from the buffer.
      Returns:
        a buffer id

    - #### readQueueId

          public QueueId readQueueId()

      Reads a (u32) queue id from the buffer.
      Returns:
        a queue id

    - #### readMeterId

          public MeterId readMeterId()

      Reads a (u32) meter id from the buffer.
      Returns:
        a meter id

    - #### readTableId

          public TableId readTableId()

      Reads a (u8) table id from the buffer.
      Returns:
        a table id

    - #### readVId

          public VId readVId()

      Reads a virtual identifier (u16) from the buffer.
      Returns:
        a virtual identifier

    - #### readDataPathId

          public DataPathId readDataPathId()

      Reads a (u32) datapath id from the buffer.
      Returns:
        a datapath id

Copyright © 2014. All Rights Reserved.