class ActionOutput

OpenFlow 'Output' action type

Attributes

length[R]

integer : When the ’port’ is the controller, this indicates the max number of bytes to send. A value of zero means no bytes of the packet should be sent. A value of OFPCML_NO_BUFFER (0xffff) means that the packet is not buffered and the complete packet is to be sent to the controller.

order[R]

integer : order

port[R]

integer : port to output

type[R]

string : type of action.

Public Class Methods

new(port: nil, length: nil, order: nil) click to toggle source

Parameters

  • port

    integer : the port to target for output

  • length

    integer : When the ’port’ is the controller, this indicates the max number of

bytes to send. A value of zero means no bytes of the packet should be sent. A value of OFPCML_NO_BUFFER (0xffff) means that the packet is not buffered and the complete packet is to be sent to the controller.

  • order

    integer : order

# File lib/openflowdev/action_output.rb, line 52
def initialize(port: nil, length: nil, order: nil)
  @type = 'output'
  @order = order
  @port = port
  @length = length
end

Public Instance Methods

to_s() click to toggle source
# File lib/openflowdev/action_output.rb, line 94
def to_s
  if @port && @length
    if @port == "CONTROLLER"
      "#{@port}:#{@length}"
    else
      "#{@type}:#{@port}"
    end
  else
    ""
  end
end
update(port: nil, length: nil, order: nil) click to toggle source

Return a list of YANG schemas for the node.

Parameters

  • port

    integer : the port to target for output

  • length

    integer : When the ’port’ is the controller, this indicates the max number of

bytes to send. A value of zero means no bytes of the packet should be sent. A value of OFPCML_NO_BUFFER (0xffff) means that the packet is not buffered and the complete packet is to be sent to the controller.

  • order

    integer : order

# File lib/openflowdev/action_output.rb, line 70
def update(port: nil, length: nil, order: nil)
  @order = order unless order.nil?
  @port = port unless port.nil?
  @length = length unless length.nil?
end
update_from_object(action_object) click to toggle source

Update from an existing Action .

Parameters

  • action_object

    Action : Update this action from an existing Action.

# File lib/openflowdev/action_output.rb, line 81
def update_from_object(action_object)
  @order = action_object['order']
  if action_object.has_key?('output-action')
    if action_object['output-action'].has_key?('output-node-connector')
      @port = action_object['output-action']['output-node-connector']
    end
    
    if action_object['output-action'].has_key?('max-length')
      @length = action_object['output-action']['max-length']
    end
  end
end