Class: Nl::Linux::RtLink

Inherits:
Raw::Family show all
Defined in:
nl-linux/generated/nl/linux/rt_link.rb

Overview

Link configuration over rtnetlink.

Defined Under Namespace

Modules: AttributeSets, Enums, Flags, Messages, Notifications, Structs, SubMessages Classes: AsyncOperations

Constant Summary collapse

NAME =
"rt-link"
PROTONUM =
0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.open(executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ RtLink .open(executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object

Overloads:

  • .open(executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ RtLink

    Parameters:

    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Returns:

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

    Returns the result of the block.

    Parameters:

    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Yield Parameters:

    Returns:

    • (Object) —

      the result of the block



24
25
26
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 24

def self.open(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:



10198
10199
10200
10201
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 10198

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

This method returns an undefined value.

Delete an existing link.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifi_family (Integer)
  • ifi_type (Integer)
  • ifi_index (Integer)
  • ifi_flags (Integer)
  • ifi_change (Integer)
  • ifname (String)

See Also:



9851
9852
9853
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9851

def do_dellink(**args)
  exchange_message(:"do", Messages::DoDellinkRequest, nil, args)
end

Get / dump information about a link.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifi_family (Integer)
  • ifi_type (Integer)
  • ifi_index (Integer)
  • ifi_flags (Integer)
  • ifi_change (Integer)
  • ifname (String)
  • ext_mask (Integer) —

    Known flags are defined in Nl::Linux::RtLink::Flags::RtextFilter.

  • target_netnsid (Integer)
  • alt_ifname (String)

Returns:

See Also:



9868
9869
9870
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9868

def do_getlink(**args)
  exchange_message(:"do", Messages::DoGetlinkRequest, Messages::DoGetlinkReply, args)
end

#do_getstats(**args) ⇒ Messages::DoGetstatsReply

Get / dump link stats.

Parameters:

  • args (Hash)

Options Hash (**args):

  • family (Integer)
  • ifindex (Integer)
  • filter_mask (Integer)

Returns:

See Also:



9986
9987
9988
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9986

def do_getstats(**args)
  exchange_message(:"do", Messages::DoGetstatsRequest, Messages::DoGetstatsReply, args)
end

This method returns an undefined value.

Create a new link.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifi_family (Integer)
  • ifi_type (Integer)
  • ifi_index (Integer)
  • ifi_flags (Integer)
  • ifi_change (Integer)
  • address (String)
  • broadcast (String)
  • ifname (String)
  • mtu (Integer)
  • txqlen (Integer)
  • operstate (Integer)
  • linkmode (Integer)
  • linkinfo (AttributeSets::LinkinfoAttrs, Hash<Symbol, Object>)
  • net_ns_pid (Integer)
  • af_spec (AttributeSets::AfSpecAttrs, Hash<Symbol, Object>)
  • group (Integer)
  • net_ns_fd (Integer)
  • num_tx_queues (Integer)
  • num_rx_queues (Integer)
  • link_netnsid (Integer)
  • gso_max_segs (Integer)
  • gso_max_size (Integer)
  • target_netnsid (Integer)
  • gro_max_size (Integer)
  • gso_ipv4_max_size (Integer)
  • gro_ipv4_max_size (Integer)

See Also:



9837
9838
9839
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9837

def do_newlink(**args)
  exchange_message(:"do", Messages::DoNewlinkRequest, nil, args)
end

This method returns an undefined value.

Set information about a link.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifi_family (Integer)
  • ifi_type (Integer)
  • ifi_index (Integer)
  • ifi_flags (Integer)
  • ifi_change (Integer)
  • address (String)
  • broadcast (String)
  • ifname (String)
  • mtu (Integer)
  • link (Integer)
  • qdisc (String)
  • stats (Structs::RtnlLinkStats, Hash<Symbol, Object>)
  • master (Integer)
  • wireless (String) —

    struct iw_event

  • protinfo (String) —

    A nest of ifla6-attrs or linkinfo-brport-attrs

  • txqlen (Integer)
  • map (Structs::RtnlLinkIfmap, Hash<Symbol, Object>)
  • weight (Integer)
  • operstate (Integer)
  • linkmode (Integer)
  • linkinfo (AttributeSets::LinkinfoAttrs, Hash<Symbol, Object>)
  • net_ns_pid (Integer)
  • ifalias (String)
  • num_vf (Integer)
  • vfinfo_list (AttributeSets::VfinfoListAttrs, Hash<Symbol, Object>)
  • stats64 (Structs::RtnlLinkStats64, Hash<Symbol, Object>)
  • vf_ports (AttributeSets::VfPortsAttrs, Hash<Symbol, Object>)
  • port_self (AttributeSets::PortSelfAttrs, Hash<Symbol, Object>)
  • af_spec (AttributeSets::AfSpecAttrs, Hash<Symbol, Object>)
  • group (Integer)
  • net_ns_fd (Integer)
  • ext_mask (Integer) —

    Known flags are defined in Nl::Linux::RtLink::Flags::RtextFilter.

  • promiscuity (Integer)
  • num_tx_queues (Integer)
  • num_rx_queues (Integer)
  • carrier (Integer)
  • phys_port_id (String)
  • carrier_changes (Integer)
  • phys_switch_id (String)
  • link_netnsid (Integer)
  • phys_port_name (String)
  • proto_down (Integer)
  • gso_max_segs (Integer)
  • gso_max_size (Integer)
  • xdp (AttributeSets::XdpAttrs, Hash<Symbol, Object>)
  • event (Integer)
  • new_netnsid (Integer)
  • target_netnsid (Integer)
  • carrier_up_count (Integer)
  • carrier_down_count (Integer)
  • new_ifindex (Integer)
  • min_mtu (Integer)
  • max_mtu (Integer)
  • prop_list (AttributeSets::PropListLinkAttrs, Hash<Symbol, Object>)
  • perm_address (String)
  • proto_down_reason (String)
  • parent_dev_name (String)
  • parent_dev_bus_name (String)
  • gro_max_size (Integer)
  • tso_max_size (Integer)
  • tso_max_segs (Integer)
  • allmulti (Integer)
  • devlink_port (String)
  • gso_ipv4_max_size (Integer)
  • gro_ipv4_max_size (Integer)

See Also:



9975
9976
9977
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9975

def do_setlink(**args)
  exchange_message(:"do", Messages::DoSetlinkRequest, nil, args)
end

Get / dump information about a link.

Overloads:

See Also:



9902
9903
9904
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 9902

def dump_getlink(**args, &block)
  exchange_message(:"dump", Messages::DumpGetlinkRequest, Messages::DumpGetlinkReply, args, &block)
end

#dump_getstats(**args) ⇒ Array<Messages::DumpGetstatsReply> #dump_getstats(**args) {|reply| ... } ⇒ void

Get / dump link stats.

Overloads:

  • #dump_getstats(**args) ⇒ Array<Messages::DumpGetstatsReply>

    Returns an array when no block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • family (Integer)
    • ifindex (Integer)
    • filter_mask (Integer)

    Returns:

  • #dump_getstats(**args) {|reply| ... } ⇒ void

    This method returns an undefined value.

    Yields each reply when a block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • family (Integer)
    • ifindex (Integer)
    • filter_mask (Integer)

    Yield Parameters:

See Also:



10008
10009
10010
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 10008

def dump_getstats(**args, &block)
  exchange_message(:"dump", Messages::DumpGetstatsRequest, Messages::DumpGetstatsReply, args, &block)
end

#subscribe(*groups) ⇒ self

Parameters:

  • groups (Array<:rtnlgrp_link, :rtnlgrp_stats>)

Returns:

  • (self)


10205
10206
10207
10208
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 10205

def subscribe(*groups) = super
# @rbs (*(:rtnlgrp_link | :rtnlgrp_stats) groups) -> self
# @param [Array<:rtnlgrp_link, :rtnlgrp_stats>] groups
# @return [self]

#unsubscribe(*groups) ⇒ self

Parameters:

  • groups (Array<:rtnlgrp_link, :rtnlgrp_stats>)

Returns:

  • (self)


10209
# File 'nl-linux/generated/nl/linux/rt_link.rb', line 10209

def unsubscribe(*groups) = super