Sha256: 5715c64c0abd3b9ecac82323139b8b780ced21a79e17b024c2bd162b0b1e52d8

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

require 'bindata'
require 'pio/monkey_patch/integer'

module Pio
  module OpenFlow
    # Datapath unique ID. The lower 48-bits are for a MAC address,
    # while the upper 16-bits are implementer-defined.
    class DatapathId < BinData::Primitive
      endian :big

      uint64 :datapath_id

      def set(value)
        unless value.unsigned_64bit?
          raise(ArgumentError,
                'Datapath ID should be an unsigned 64-bit integer.')
        end
        self.datapath_id = value
      end

      def get
        datapath_id.to_i
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pio-0.30.1 lib/pio/open_flow/datapath_id.rb