Class: Nl::Genl::Endpoint

Inherits:
Raw::Endpoint show all
Defined in:
nl/lib/nl/genl/protocol.rb

Overview

A generated Generic Netlink family bound to nlctrl-provided information.

Instance Attribute Summary collapse

Attributes inherited from Raw::Endpoint

#definition

Instance Method Summary collapse

Methods inherited from Raw::Endpoint

#name

Constructor Details

#initialize(definition, info) ⇒ Endpoint

Returns a new instance of Endpoint.



10
11
12
13
# File 'nl/lib/nl/genl/protocol.rb', line 10

def initialize(definition, info)
  super(definition)
  @info = info
end

Instance Attribute Details

#info ⇒ Object (readonly)

Returns the value of attribute info.



8
9
10
# File 'nl/lib/nl/genl/protocol.rb', line 8

def info
  @info
end

Instance Method Details

#family_id ⇒ Object



15
# File 'nl/lib/nl/genl/protocol.rb', line 15

def family_id = @info.id

#frame_type(_message_class) ⇒ Object



17
# File 'nl/lib/nl/genl/protocol.rb', line 17

def frame_type(_message_class) = family_id

#multicast_group_id(name, _value) ⇒ Object



19
20
21
22
23
24
# File 'nl/lib/nl/genl/protocol.rb', line 19

def multicast_group_id(name, _value)
  @info.multicast_groups.fetch(name) do
    raise UnresolvedMulticastGroupError,
      "Generic Netlink multicast group #{name.inspect} was not resolved"
  end
end

#version ⇒ Object



16
# File 'nl/lib/nl/genl/protocol.rb', line 16

def version = @definition.version