Sha256: 8592c567ddf561520af5d0f376d6d73b62979eccff8f2882f7b0e0439c98e48d

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

# encoding: utf-8

require 'bindata'

module Pio
  module Type
    # OpenFlow 1.0 format.
    module OpenFlow
      def openflow_header
        class_eval do
          uint8 :ofp_version, value: 1
          uint8 :message_type
          uint16 :message_length, initial_value: -> { 8 + body.length }
          uint32 :transaction_id, initial_value: 0
        end
      end

      # Description of a physical port
      class PhyPort < BinData::Record
        endian :big

        uint16 :port_no
        uint8 :hw_addr
        stringz :name, read_length: 16
        uint32 :config
        uint32 :state
        uint32 :curr
        uint32 :advertised
        uint32 :supported
        uint32 :peer
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pio-0.8.1 lib/pio/type/open_flow.rb
pio-0.8.0 lib/pio/type/open_flow.rb