com.h3c.of.lib.msg

## Enum PortState

- java.lang.Object
- - java.lang.Enum<PortState>
  - - com.h3c.of.lib.msg.PortState

- All Implemented Interfaces:
    OfpBitmapEnum, OfpEnum, Serializable, Comparable<PortState>

      public enum PortState
      extends Enum<PortState>
      implements OfpBitmapEnum

  Describes a port's internal state.

  All port state flags are read-only and cannot be changed by the controller. When the port flags are changed, the switch sends a `PORT_STATUS` message to notify the controller of the change.

  From version 1.1 onwards, the spanning tree state flags (`STP_*` constants) were dropped. modified by s03140 for 201401060108

  Author:
    Simon Hunt

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ABNORMAL` Abnormal for link remove
    `BLOCKED` Port is blocked; Since 1.1.
    `LINK_DOWN` No physical link present; Since 1.0.
    `LIVE` Live for Fast Failover Group; Since 1.1.
    `STP_BLOCK` Not part of spanning tree; Since 1.0; Removed at 1.1.
    `STP_FORWARD` Learning and relaying frames; Since 1.0; Removed at 1.1.
    `STP_LEARN` Learning but not relaying frames; Since 1.0; Removed at 1.1.
    `STP_LISTEN` Not learning or relaying frames; Since 1.0; Removed at 1.1.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBit(ProtocolVersion pv)` Returns the bit value for the constant, under the given protocol version.
    `String` | `toDisplayString()` Returns a string representation of this constant suitable for display.
    `String` | `toString()`
    `static PortState` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static PortState[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### LINK_DOWN

          public static final PortState LINK_DOWN

      No physical link present; Since 1.0.

    - #### BLOCKED

          public static final PortState BLOCKED

      Port is blocked; Since 1.1.

      Indicates that a switch protocol outside of OpenFlow, such as 802.1D Spanning Tree, is preventing the use of that port with `Port.FLOOD`.

    - #### LIVE

          public static final PortState LIVE

      Live for Fast Failover Group; Since 1.1.

    - #### ABNORMAL

          public static final PortState ABNORMAL

      Abnormal for link remove

    - #### STP_LISTEN

          public static final PortState STP_LISTEN

      Not learning or relaying frames; Since 1.0; Removed at 1.1.

    - #### STP_LEARN

          public static final PortState STP_LEARN

      Learning but not relaying frames; Since 1.0; Removed at 1.1.

    - #### STP_FORWARD

          public static final PortState STP_FORWARD

      Learning and relaying frames; Since 1.0; Removed at 1.1.

    - #### STP_BLOCK

          public static final PortState STP_BLOCK

      Not part of spanning tree; Since 1.0; Removed at 1.1.

  - ### Method Detail

    - #### values

          public static PortState[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (PortState c : PortState.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static PortState valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getBit

          public int getBit(ProtocolVersion pv)

      Description copied from interface: `OfpBitmapEnum`
      Returns the bit value for the constant, under the given protocol version.
      Specified by:
        `getBit` in interface `OfpBitmapEnum`
      Parameters:
        `pv` - the protocol version
      Returns:
        the bit value for the constant

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Enum<PortState>`

    - #### toDisplayString

          public String toDisplayString()

      Returns a string representation of this constant suitable for display. For example, `STP_LISTEN.toDisplayString()` returns:

             "STP Listen"

      Specified by:
        `toDisplayString` in interface `OfpBitmapEnum`
      Returns:
        the display string

Copyright © 2014. All Rights Reserved.