Sha256: 1a9b05d9c8fa40d29866191a0c61bfa7970b95d3153136d2fb21f21b7b27d9ee

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

require 'bindata'
require 'pio/type/mac_address'

module Pio
  module Type
    module OpenFlow
      # Description of a physical port
      class PhyPort < BinData::Record
        extend Flags

        # enum ofp_port_config
        flags_32bit :port_config,
                    [:port_down,
                     :no_stp,
                     :no_recv,
                     :no_recv_stp,
                     :no_flood,
                     :no_fwd,
                     :no_packet_in]

        # enum ofp_port_state
        flags_32bit :port_state,
                    link_down: 1 << 0,
                    stp_listen: 0 << 8,
                    stp_learn: 1 << 8,
                    stp_forward: 2 << 8,
                    stp_block: 3 << 8

        # enum ofp_port_features
        flags_32bit :port_feature,
                    [:port_10mb_hd,
                     :port_10mb_fd,
                     :port_100mb_hd,
                     :port_100mb_fd,
                     :port_1gb_hd,
                     :port_1gb_fd,
                     :port_10gb_fd,
                     :port_copper,
                     :port_fiber,
                     :port_autoneg,
                     :port_pause,
                     :port_pause_asym]

        endian :big

        uint16 :port_no
        mac_address :hardware_address
        string :name, length: 16, trim_padding: true
        port_config :config
        port_state :state
        port_feature :curr
        port_feature :advertised
        port_feature :supported
        port_feature :peer

        def mac_address
          hardware_address
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pio-0.14.0 lib/pio/open_flow/phy_port.rb
pio-0.13.0 lib/pio/open_flow/phy_port.rb
pio-0.12.0 lib/pio/open_flow/phy_port.rb
pio-0.11.2 lib/pio/open_flow/phy_port.rb
pio-0.11.1 lib/pio/open_flow/phy_port.rb
pio-0.11.0 lib/pio/open_flow/phy_port.rb