Sha256: 3db6d4d54a91fab8972eaa13bc2989e5ad047269787e74b42563e0b220dfe72d

Contents?: true

Size: 605 Bytes

Versions: 1

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

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.2 lib/pio/open_flow/datapath_id.rb