Sha256: 7f1f9bd36738affdf756401aea84a690a33a4b7ef7989ecc896d943153d33cfe
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
require 'bindata' module Pio module OpenFlow13 # Actions not yet implemented. class UnsupportedAction < BinData::Record endian :big uint16 :action_type uint16 :action_length string :body, length: -> { action_length - 4 } def to_binary to_binary_s end end # Actions list of actions-apply instruction. class Actions13 < BinData::Primitive mandatory_parameter :length endian :big string :binary, read_length: :length def set(actions) self.binary = Array(actions).map(&:to_binary).join end # rubocop:disable MethodLength def get actions = [] tmp = binary until tmp.empty? action = case BinData::Uint16be.read(tmp) when 0 OpenFlow13::SendOutPort.read(tmp) else UnsupportedAction.read(tmp) end tmp = tmp[action.action_length..-1] actions << action end actions end # rubocop:enable MethodLength end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pio-0.30.1 | lib/pio/open_flow13/actions.rb |