Class: Trema::FlowStatsReply

Inherits:
StatsHelper show all
Defined in:
ruby/trema/flow-stats-reply.rb

Constant Summary collapse

FIELDS =
%w(length table_id match duration_sec duration_nsec) +
%w(priority idle_timeout hard_timeout cookie packet_count byte_count actions)

Instance Method Summary collapse

Methods inherited from StatsHelper

#to_s

Constructor Details

#initialize(options = {}) ⇒ FlowStatsReply

Flow counters for one or more matched flows. A user would not explicitly instantiate a Trema::FlowStatsReply object but would be created as a result of parsing the OFPT_STATS_REPLY(OFPST_FLOW) message.

Returns an object that encapsulates the OFPST_STATS_REPLY(OFPST_FLOW) OpenFlow message.

Examples:

FlowStatsReply.new(
  :length => 96,
  :table_id => 0,
  :match => Match.new
  :duration_sec => 10,
  :duration_nsec => 106000000,
  :priority => 0,
  :idle_timeout => 0,
  :hard_timeout => 0,
  :cookie => 0xabcd,
  :packet_count => 1,
  :byte_count => 1,
  :actions => [ ActionOutput.new ]
)

Parameters:

  • options (Hash) (defaults to: {})

    the options to create this instance with.

Options Hash (options):

  • :length (Number)

    the length of this packet.

  • :table_id (Number)

    set to zero.

  • :match (Match)

    Match object describing flow fields.

  • :duration_sec (Number)

    the time in seconds the flow been active.

  • :duration_nsec (Number)

    the time in nanosecs the flow been active.

  • :priority (Number)

    the priority of the flow.

  • :idle_timeout (Number)

    an inactivity time in seconds before the flow is deleted. Zero means no deletion.

  • :hard_timeout (Number)

    a fixed time interval before the flow is deleted. Zero means no deletion.

  • :cookie (Number)

    an opaque identifier used as a unique key to match flow entries.

  • :packet_count (Number)

    count of the number of packets matched the flow.

  • :byte_count (Number)

    count of the number of bytes matched the flow.

  • :actions (Array)

    an array of action objects for the flow.



96
97
98
# File 'ruby/trema/flow-stats-reply.rb', line 96

def initialize options
  super FIELDS, options
end