Sha256: 430588723cf7b2d460dc5e89a7aa6cd558b16b0041c3337df05738edb6925b0b
Contents?: true
Size: 889 Bytes
Versions: 1
Compression:
Stored size: 889 Bytes
Contents
require 'forwardable' require 'pio/open_flow/instruction' # Base module. module Pio module OpenFlow13 # Apply meter (rate limiter) class Meter < OpenFlow::Instruction # OpenFlow 1.3.4 OFPIT_METER instruction format class Format < BinData::Record endian :big uint16 :instruction_type, value: 6 uint16 :instruction_length, value: 8 uint32 :meter_id end def self.read(raw_data) allocate.tap do |meter| meter.instance_variable_set :@format, Format.read(raw_data) end end extend Forwardable def_delegators :@format, :instruction_type def_delegators :@format, :instruction_length def_delegators :@format, :meter_id def_delegators :@format, :to_binary_s def initialize(meter_id) @format = Format.new(meter_id: meter_id) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pio-0.30.1 | lib/pio/open_flow13/meter.rb |