Class: Nl::Linux::OvsPacket

Inherits:
Genl::Family show all
Defined in:
nl-linux/generated/nl/linux/ovs_packet.rb

Overview

OVS packet execution over generic netlink.

Only OVS_PACKET_CMD_EXECUTE is exposed as a genl operation. OVS_PACKET_CMD_MISS and OVS_PACKET_CMD_ACTION are kernel-to-userspace upcalls sent via genlmsg_unicast() to the vport's upcall_pid and have no associated genl_ops or multicast group.

Several attributes in the attribute set (userdata, egress-tun-key, len) exist for the upcall path and are not used by the EXECUTE operation. For EXECUTE, packet, key, and actions are mandatory (kernel returns -EINVAL without them).

Defined Under Namespace

Modules: AttributeSets, Messages, Notifications, Structs Classes: AsyncOperations

Constant Summary collapse

NAME =
"ovs_packet"
VERSION =
1

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Genl::Family

version

Class Method Details

.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ OvsPacket .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object

Overloads:

  • .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ OvsPacket

    Parameters:

    • resolver (#call) (defaults to: ::Nl::Linux::DEFAULT_RESOLVER)
    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Returns:

  • .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object

    Returns the result of the block.

    Parameters:

    • resolver (#call) (defaults to: ::Nl::Linux::DEFAULT_RESOLVER)
    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Yield Parameters:

    Returns:

    • (Object) —

      the result of the block



36
37
38
# File 'nl-linux/generated/nl/linux/ovs_packet.rb', line 36

def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
  super
end

Instance Method Details

#async(stream_capacity: nil) ⇒ AsyncOperations

Returns the asynchronous operation facade for this family.

Parameters:

  • stream_capacity (::Integer, nil) (defaults to: nil)

Returns:



447
448
449
450
# File 'nl-linux/generated/nl/linux/ovs_packet.rb', line 447

def async(stream_capacity: nil)
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
  build_async_facade(AsyncOperations, stream_capacity:)
end

#do_execute(**args) ⇒ void

This method returns an undefined value.

Apply actions to a packet.

Parameters:

  • args (Hash)

Options Hash (**args):

  • dp_ifindex (Integer)
  • packet (String) —

    Packet data, from the start of the Ethernet header.

  • key (String) —

    Nested OVS_KEY_ATTR_* attributes, extracted flow key. Defined as binary because the key attribute-set belongs to the ovs_flow family spec; cross-spec references are not supported.

  • actions (String) —

    Nested OVS_ACTION_ATTR_* attributes. Defined as binary for the same reason as key.

  • probe (Integer) —

    Packet operation is a feature probe, error logging suppressed.

  • mru (Integer) —

    Maximum received IP fragment size.

  • hash (Integer) —

    Packet hash, low 32 bits are skb hash, upper bits are flags.

  • upcall_pid (Integer) —

    Netlink PID to use for upcalls during EXECUTE processing.

See Also:



415
416
417
# File 'nl-linux/generated/nl/linux/ovs_packet.rb', line 415

def do_execute(**args)
  exchange_message(:"do", Messages::DoExecuteRequest, nil, args)
end