nl-linux 0.2.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +8 -0
- data/Rakefile +27 -5
- data/generated/nl/linux/binder.rb +227 -19
- data/generated/nl/linux/conntrack.rb +1325 -365
- data/generated/nl/linux/dev_energymodel.rb +357 -66
- data/generated/nl/linux/devlink.rb +6310 -1859
- data/generated/nl/linux/dpll.rb +2202 -376
- data/generated/nl/linux/drm_ras.rb +312 -63
- data/generated/nl/linux/ethtool.rb +7555 -2447
- data/generated/nl/linux/fou.rb +381 -133
- data/generated/nl/linux/handshake.rb +340 -70
- data/generated/nl/linux/lockd.rb +132 -27
- data/generated/nl/linux/mptcp_pm.rb +773 -161
- data/generated/nl/linux/net_shaper.rb +892 -211
- data/generated/nl/linux/netdev.rb +2366 -518
- data/generated/nl/linux/nfsd.rb +1299 -317
- data/generated/nl/linux/nftables.rb +5351 -1533
- data/generated/nl/linux/nl80211.rb +4601 -882
- data/generated/nl/linux/nlctrl.rb +460 -117
- data/generated/nl/linux/ovpn.rb +1360 -262
- data/generated/nl/linux/ovs_datapath.rb +312 -98
- data/generated/nl/linux/ovs_flow.rb +1866 -358
- data/generated/nl/linux/ovs_packet.rb +331 -45
- data/generated/nl/linux/ovs_vport.rb +374 -123
- data/generated/nl/linux/psp.rb +1093 -201
- data/generated/nl/linux/rt_addr.rb +423 -165
- data/generated/nl/linux/rt_link.rb +6928 -1336
- data/generated/nl/linux/rt_neigh.rb +1063 -297
- data/generated/nl/linux/rt_route.rb +1112 -483
- data/generated/nl/linux/rt_rule.rb +931 -262
- data/generated/nl/linux/sunrpc_cache.rb +407 -82
- data/generated/nl/linux/tc.rb +10081 -1763
- data/generated/nl/linux/tcp_metrics.rb +388 -109
- data/generated/nl/linux/team.rb +350 -84
- data/generated/nl/linux/wireguard.rb +525 -96
- data/generated/nl/linux.rb +1 -0
- data/lib/nl/linux/nlctrl_resolver.rb +31 -0
- data/lib/nl/linux/version.rb +1 -1
- data/sig/generated/nl/linux/binder.rbs +366 -0
- data/sig/generated/nl/linux/conntrack.rbs +2787 -0
- data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
- data/sig/generated/nl/linux/devlink.rbs +12496 -0
- data/sig/generated/nl/linux/dpll.rbs +3461 -0
- data/sig/generated/nl/linux/drm_ras.rbs +553 -0
- data/sig/generated/nl/linux/ethtool.rbs +15291 -0
- data/sig/generated/nl/linux/fou.rbs +702 -0
- data/sig/generated/nl/linux/handshake.rbs +622 -0
- data/sig/generated/nl/linux/lockd.rbs +234 -0
- data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
- data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
- data/sig/generated/nl/linux/netdev.rbs +4187 -0
- data/sig/generated/nl/linux/nfsd.rbs +2520 -0
- data/sig/generated/nl/linux/nftables.rbs +10304 -0
- data/sig/generated/nl/linux/nl80211.rbs +9786 -0
- data/sig/generated/nl/linux/nlctrl.rbs +944 -0
- data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
- data/sig/generated/nl/linux/ovpn.rbs +2564 -0
- data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
- data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
- data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
- data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
- data/sig/generated/nl/linux/psp.rbs +1846 -0
- data/sig/generated/nl/linux/rt_addr.rbs +866 -0
- data/sig/generated/nl/linux/rt_link.rbs +13438 -0
- data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
- data/sig/generated/nl/linux/rt_route.rbs +2218 -0
- data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
- data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
- data/sig/generated/nl/linux/tc.rbs +19931 -0
- data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
- data/sig/generated/nl/linux/team.rbs +733 -0
- data/sig/generated/nl/linux/version.rbs +7 -0
- data/sig/generated/nl/linux/wireguard.rbs +1006 -0
- data/sig/generated/nl/linux.rbs +6 -0
- data/sig/generated/nl-linux.rbs +2 -0
- metadata +51 -10
data/generated/nl/linux/team.rb
CHANGED
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
|
+
#
|
|
3
|
+
# This file is based on Documentation/netlink/specs/team.yaml from Linux v7.2.
|
|
2
4
|
#--
|
|
3
5
|
# frozen_string_literal: true
|
|
4
|
-
# rbs_inline: enabled
|
|
5
6
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
6
7
|
require 'nl'
|
|
7
8
|
module Nl; module Linux
|
|
8
9
|
# Network team device driver.
|
|
9
|
-
class Team < ::Nl::Family
|
|
10
|
+
class Team < ::Nl::Genl::Family
|
|
10
11
|
NAME = "team"
|
|
11
|
-
|
|
12
|
+
VERSION = 1
|
|
13
|
+
# @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
|
|
14
|
+
# @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
|
|
15
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
16
|
+
# @param [#call] resolver
|
|
17
|
+
# @param [Symbol, nil] executor
|
|
18
|
+
# @param [Integer, nil] notification_capacity
|
|
19
|
+
# @return [Team]
|
|
20
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
|
|
21
|
+
# @param [#call] resolver
|
|
22
|
+
# @param [Symbol, nil] executor
|
|
23
|
+
# @param [Integer, nil] notification_capacity
|
|
24
|
+
# @yieldparam [Team] family
|
|
25
|
+
# @return [Object] the result of the block
|
|
26
|
+
def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
# @private
|
|
30
|
+
MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
|
|
31
|
+
module Constants
|
|
32
|
+
STRING_MAX_LEN = 32
|
|
33
|
+
GENL_CHANGE_EVENT_MC_GRP_NAME = "change_event"
|
|
34
|
+
end
|
|
12
35
|
module Structs
|
|
13
36
|
end
|
|
14
37
|
module AttributeSets
|
|
@@ -26,314 +49,557 @@ class Team < ::Nl::Family
|
|
|
26
49
|
# [TEAM_ATTR_ITEM_PORT]
|
|
27
50
|
# [TEAM_ATTR_PORT_*], ...
|
|
28
51
|
# ...
|
|
29
|
-
class Team < ::Nl::
|
|
52
|
+
class Team < ::Nl::AttributeSet
|
|
30
53
|
# Abstract class
|
|
31
|
-
class Attribute < ::Nl::
|
|
54
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
32
55
|
end
|
|
33
56
|
class TeamIfindex < Attribute
|
|
34
57
|
TYPE = 1
|
|
35
58
|
NAME = :"team_ifindex"
|
|
36
|
-
|
|
59
|
+
# @private
|
|
60
|
+
ORDER = 0
|
|
61
|
+
# @private
|
|
62
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
37
63
|
end
|
|
38
64
|
class ListOption < Attribute
|
|
39
65
|
TYPE = 2
|
|
40
66
|
NAME = :"list_option"
|
|
67
|
+
# @private
|
|
68
|
+
ORDER = 1
|
|
41
69
|
end
|
|
42
70
|
class ListPort < Attribute
|
|
43
71
|
TYPE = 3
|
|
44
72
|
NAME = :"list_port"
|
|
73
|
+
# @private
|
|
74
|
+
ORDER = 2
|
|
45
75
|
end
|
|
46
|
-
#
|
|
76
|
+
# @private
|
|
47
77
|
BY_NAME = Ractor.make_shareable({:"team_ifindex" => TeamIfindex, :"list_option" => ListOption, :"list_port" => ListPort}) #: Hash[::Symbol, Attribute]
|
|
48
|
-
#
|
|
78
|
+
# @private
|
|
49
79
|
BY_TYPE = Ractor.make_shareable({1 => TeamIfindex, 2 => ListOption, 3 => ListPort}) #: Hash[::Integer, Attribute]
|
|
80
|
+
# @rbs return: ::Integer
|
|
81
|
+
# @return [Integer]
|
|
82
|
+
# @see TeamIfindex
|
|
83
|
+
def team_ifindex; self[:"team_ifindex"]&.value; end
|
|
84
|
+
# @rbs return: AttributeSets::ItemOption
|
|
85
|
+
# @return [AttributeSets::ItemOption]
|
|
86
|
+
# @see ListOption
|
|
87
|
+
def list_option; self[:"list_option"]&.value; end
|
|
88
|
+
# @rbs return: AttributeSets::ItemPort
|
|
89
|
+
# @return [AttributeSets::ItemPort]
|
|
90
|
+
# @see ListPort
|
|
91
|
+
def list_port; self[:"list_port"]&.value; end
|
|
50
92
|
class << self
|
|
51
93
|
# Looks up Attribute class by name.
|
|
52
|
-
#--
|
|
53
94
|
# @rbs name: Symbol
|
|
54
95
|
# @rbs return: Attribute
|
|
96
|
+
# @param [Symbol] name
|
|
97
|
+
# @return [Attribute]
|
|
55
98
|
def by_name(name); BY_NAME.fetch(name); end
|
|
56
99
|
# Looks up Attribute class by type value.
|
|
57
|
-
#--
|
|
58
100
|
# @rbs type: Integer
|
|
59
101
|
# @rbs return: Attribute
|
|
102
|
+
# @param [Integer] type
|
|
103
|
+
# @return [Attribute]
|
|
60
104
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
61
105
|
end
|
|
62
106
|
end
|
|
63
|
-
class ItemOption < ::Nl::
|
|
107
|
+
class ItemOption < ::Nl::AttributeSet
|
|
64
108
|
# Abstract class
|
|
65
|
-
class Attribute < ::Nl::
|
|
109
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
66
110
|
end
|
|
67
111
|
class Option < Attribute
|
|
68
112
|
TYPE = 1
|
|
69
113
|
NAME = :"option"
|
|
114
|
+
# @private
|
|
115
|
+
ORDER = 0
|
|
70
116
|
end
|
|
71
|
-
#
|
|
117
|
+
# @private
|
|
72
118
|
BY_NAME = Ractor.make_shareable({:"option" => Option}) #: Hash[::Symbol, Attribute]
|
|
73
|
-
#
|
|
119
|
+
# @private
|
|
74
120
|
BY_TYPE = Ractor.make_shareable({1 => Option}) #: Hash[::Integer, Attribute]
|
|
121
|
+
# @rbs return: AttributeSets::AttrOption
|
|
122
|
+
# @return [AttributeSets::AttrOption]
|
|
123
|
+
# @see Option
|
|
124
|
+
def option; self[:"option"]&.value; end
|
|
75
125
|
class << self
|
|
76
126
|
# Looks up Attribute class by name.
|
|
77
|
-
#--
|
|
78
127
|
# @rbs name: Symbol
|
|
79
128
|
# @rbs return: Attribute
|
|
129
|
+
# @param [Symbol] name
|
|
130
|
+
# @return [Attribute]
|
|
80
131
|
def by_name(name); BY_NAME.fetch(name); end
|
|
81
132
|
# Looks up Attribute class by type value.
|
|
82
|
-
#--
|
|
83
133
|
# @rbs type: Integer
|
|
84
134
|
# @rbs return: Attribute
|
|
135
|
+
# @param [Integer] type
|
|
136
|
+
# @return [Attribute]
|
|
85
137
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
86
138
|
end
|
|
87
139
|
end
|
|
88
|
-
class AttrOption < ::Nl::
|
|
140
|
+
class AttrOption < ::Nl::AttributeSet
|
|
89
141
|
# Abstract class
|
|
90
|
-
class Attribute < ::Nl::
|
|
142
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
91
143
|
end
|
|
92
144
|
class Name < Attribute
|
|
93
145
|
TYPE = 1
|
|
94
146
|
NAME = :"name"
|
|
95
|
-
|
|
147
|
+
# @private
|
|
148
|
+
ORDER = 0
|
|
149
|
+
# @private
|
|
150
|
+
DATATYPE = ::Nl::DataTypes::String.new(check: -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length #{Constants::STRING_MAX_LEN}" unless it.bytesize <= Constants::STRING_MAX_LEN })
|
|
96
151
|
end
|
|
97
152
|
class Changed < Attribute
|
|
98
153
|
TYPE = 2
|
|
99
154
|
NAME = :"changed"
|
|
100
|
-
|
|
155
|
+
# @private
|
|
156
|
+
ORDER = 1
|
|
157
|
+
# @private
|
|
158
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
101
159
|
end
|
|
102
160
|
class Type < Attribute
|
|
103
161
|
TYPE = 3
|
|
104
162
|
NAME = :"type"
|
|
105
|
-
|
|
163
|
+
# @private
|
|
164
|
+
ORDER = 2
|
|
165
|
+
# @private
|
|
166
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
106
167
|
end
|
|
107
168
|
class Data < Attribute
|
|
108
169
|
TYPE = 4
|
|
109
170
|
NAME = :"data"
|
|
110
|
-
|
|
171
|
+
# @private
|
|
172
|
+
ORDER = 3
|
|
173
|
+
# @private
|
|
174
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
111
175
|
end
|
|
112
176
|
class Removed < Attribute
|
|
113
177
|
TYPE = 5
|
|
114
178
|
NAME = :"removed"
|
|
115
|
-
|
|
179
|
+
# @private
|
|
180
|
+
ORDER = 4
|
|
181
|
+
# @private
|
|
182
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
116
183
|
end
|
|
184
|
+
# for per-port options
|
|
117
185
|
class PortIfindex < Attribute
|
|
118
186
|
TYPE = 6
|
|
119
187
|
NAME = :"port_ifindex"
|
|
120
|
-
|
|
188
|
+
# @private
|
|
189
|
+
ORDER = 5
|
|
190
|
+
# @private
|
|
191
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
121
192
|
end
|
|
193
|
+
# for array options
|
|
122
194
|
class ArrayIndex < Attribute
|
|
123
195
|
TYPE = 7
|
|
124
196
|
NAME = :"array_index"
|
|
125
|
-
|
|
197
|
+
# @private
|
|
198
|
+
ORDER = 6
|
|
199
|
+
# @private
|
|
200
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
126
201
|
end
|
|
127
|
-
#
|
|
202
|
+
# @private
|
|
128
203
|
BY_NAME = Ractor.make_shareable({:"name" => Name, :"changed" => Changed, :"type" => Type, :"data" => Data, :"removed" => Removed, :"port_ifindex" => PortIfindex, :"array_index" => ArrayIndex}) #: Hash[::Symbol, Attribute]
|
|
129
|
-
#
|
|
204
|
+
# @private
|
|
130
205
|
BY_TYPE = Ractor.make_shareable({1 => Name, 2 => Changed, 3 => Type, 4 => Data, 5 => Removed, 6 => PortIfindex, 7 => ArrayIndex}) #: Hash[::Integer, Attribute]
|
|
206
|
+
# @rbs return: ::String
|
|
207
|
+
# @return [String]
|
|
208
|
+
# @see Name
|
|
209
|
+
def name; self[:"name"]&.value; end
|
|
210
|
+
# @rbs return: ::Integer
|
|
211
|
+
# @return [Integer]
|
|
212
|
+
# @see Changed
|
|
213
|
+
def changed; self[:"changed"]&.value; end
|
|
214
|
+
# @rbs return: ::Integer
|
|
215
|
+
# @return [Integer]
|
|
216
|
+
# @see Type
|
|
217
|
+
def type; self[:"type"]&.value; end
|
|
218
|
+
# @rbs return: ::String
|
|
219
|
+
# @return [String]
|
|
220
|
+
# @see Data
|
|
221
|
+
def data; self[:"data"]&.value; end
|
|
222
|
+
# @rbs return: ::Integer
|
|
223
|
+
# @return [Integer]
|
|
224
|
+
# @see Removed
|
|
225
|
+
def removed; self[:"removed"]&.value; end
|
|
226
|
+
# for per-port options
|
|
227
|
+
# @rbs return: ::Integer
|
|
228
|
+
# @return [Integer]
|
|
229
|
+
# @see PortIfindex
|
|
230
|
+
def port_ifindex; self[:"port_ifindex"]&.value; end
|
|
231
|
+
# for array options
|
|
232
|
+
# @rbs return: ::Integer
|
|
233
|
+
# @return [Integer]
|
|
234
|
+
# @see ArrayIndex
|
|
235
|
+
def array_index; self[:"array_index"]&.value; end
|
|
131
236
|
class << self
|
|
132
237
|
# Looks up Attribute class by name.
|
|
133
|
-
#--
|
|
134
238
|
# @rbs name: Symbol
|
|
135
239
|
# @rbs return: Attribute
|
|
240
|
+
# @param [Symbol] name
|
|
241
|
+
# @return [Attribute]
|
|
136
242
|
def by_name(name); BY_NAME.fetch(name); end
|
|
137
243
|
# Looks up Attribute class by type value.
|
|
138
|
-
#--
|
|
139
244
|
# @rbs type: Integer
|
|
140
245
|
# @rbs return: Attribute
|
|
246
|
+
# @param [Integer] type
|
|
247
|
+
# @return [Attribute]
|
|
141
248
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
142
249
|
end
|
|
143
250
|
end
|
|
144
|
-
class ItemPort < ::Nl::
|
|
251
|
+
class ItemPort < ::Nl::AttributeSet
|
|
145
252
|
# Abstract class
|
|
146
|
-
class Attribute < ::Nl::
|
|
253
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
147
254
|
end
|
|
148
255
|
class Port < Attribute
|
|
149
256
|
TYPE = 1
|
|
150
257
|
NAME = :"port"
|
|
258
|
+
# @private
|
|
259
|
+
ORDER = 0
|
|
151
260
|
end
|
|
152
|
-
#
|
|
261
|
+
# @private
|
|
153
262
|
BY_NAME = Ractor.make_shareable({:"port" => Port}) #: Hash[::Symbol, Attribute]
|
|
154
|
-
#
|
|
263
|
+
# @private
|
|
155
264
|
BY_TYPE = Ractor.make_shareable({1 => Port}) #: Hash[::Integer, Attribute]
|
|
265
|
+
# @rbs return: AttributeSets::AttrPort
|
|
266
|
+
# @return [AttributeSets::AttrPort]
|
|
267
|
+
# @see Port
|
|
268
|
+
def port; self[:"port"]&.value; end
|
|
156
269
|
class << self
|
|
157
270
|
# Looks up Attribute class by name.
|
|
158
|
-
#--
|
|
159
271
|
# @rbs name: Symbol
|
|
160
272
|
# @rbs return: Attribute
|
|
273
|
+
# @param [Symbol] name
|
|
274
|
+
# @return [Attribute]
|
|
161
275
|
def by_name(name); BY_NAME.fetch(name); end
|
|
162
276
|
# Looks up Attribute class by type value.
|
|
163
|
-
#--
|
|
164
277
|
# @rbs type: Integer
|
|
165
278
|
# @rbs return: Attribute
|
|
279
|
+
# @param [Integer] type
|
|
280
|
+
# @return [Attribute]
|
|
166
281
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
167
282
|
end
|
|
168
283
|
end
|
|
169
|
-
class AttrPort < ::Nl::
|
|
284
|
+
class AttrPort < ::Nl::AttributeSet
|
|
170
285
|
# Abstract class
|
|
171
|
-
class Attribute < ::Nl::
|
|
286
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
172
287
|
end
|
|
173
288
|
class Ifindex < Attribute
|
|
174
289
|
TYPE = 1
|
|
175
290
|
NAME = :"ifindex"
|
|
176
|
-
|
|
291
|
+
# @private
|
|
292
|
+
ORDER = 0
|
|
293
|
+
# @private
|
|
294
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
177
295
|
end
|
|
178
296
|
class Changed < Attribute
|
|
179
297
|
TYPE = 2
|
|
180
298
|
NAME = :"changed"
|
|
181
|
-
|
|
299
|
+
# @private
|
|
300
|
+
ORDER = 1
|
|
301
|
+
# @private
|
|
302
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
182
303
|
end
|
|
183
304
|
class Linkup < Attribute
|
|
184
305
|
TYPE = 3
|
|
185
306
|
NAME = :"linkup"
|
|
186
|
-
|
|
307
|
+
# @private
|
|
308
|
+
ORDER = 2
|
|
309
|
+
# @private
|
|
310
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
187
311
|
end
|
|
188
312
|
class Speed < Attribute
|
|
189
313
|
TYPE = 4
|
|
190
314
|
NAME = :"speed"
|
|
191
|
-
|
|
315
|
+
# @private
|
|
316
|
+
ORDER = 3
|
|
317
|
+
# @private
|
|
318
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
192
319
|
end
|
|
193
320
|
class Duplex < Attribute
|
|
194
321
|
TYPE = 5
|
|
195
322
|
NAME = :"duplex"
|
|
196
|
-
|
|
323
|
+
# @private
|
|
324
|
+
ORDER = 4
|
|
325
|
+
# @private
|
|
326
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
197
327
|
end
|
|
198
328
|
class Removed < Attribute
|
|
199
329
|
TYPE = 6
|
|
200
330
|
NAME = :"removed"
|
|
201
|
-
|
|
331
|
+
# @private
|
|
332
|
+
ORDER = 5
|
|
333
|
+
# @private
|
|
334
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
202
335
|
end
|
|
203
|
-
#
|
|
336
|
+
# @private
|
|
204
337
|
BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"changed" => Changed, :"linkup" => Linkup, :"speed" => Speed, :"duplex" => Duplex, :"removed" => Removed}) #: Hash[::Symbol, Attribute]
|
|
205
|
-
#
|
|
338
|
+
# @private
|
|
206
339
|
BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Changed, 3 => Linkup, 4 => Speed, 5 => Duplex, 6 => Removed}) #: Hash[::Integer, Attribute]
|
|
340
|
+
# @rbs return: ::Integer
|
|
341
|
+
# @return [Integer]
|
|
342
|
+
# @see Ifindex
|
|
343
|
+
def ifindex; self[:"ifindex"]&.value; end
|
|
344
|
+
# @rbs return: ::Integer
|
|
345
|
+
# @return [Integer]
|
|
346
|
+
# @see Changed
|
|
347
|
+
def changed; self[:"changed"]&.value; end
|
|
348
|
+
# @rbs return: ::Integer
|
|
349
|
+
# @return [Integer]
|
|
350
|
+
# @see Linkup
|
|
351
|
+
def linkup; self[:"linkup"]&.value; end
|
|
352
|
+
# @rbs return: ::Integer
|
|
353
|
+
# @return [Integer]
|
|
354
|
+
# @see Speed
|
|
355
|
+
def speed; self[:"speed"]&.value; end
|
|
356
|
+
# @rbs return: ::Integer
|
|
357
|
+
# @return [Integer]
|
|
358
|
+
# @see Duplex
|
|
359
|
+
def duplex; self[:"duplex"]&.value; end
|
|
360
|
+
# @rbs return: ::Integer
|
|
361
|
+
# @return [Integer]
|
|
362
|
+
# @see Removed
|
|
363
|
+
def removed; self[:"removed"]&.value; end
|
|
207
364
|
class << self
|
|
208
365
|
# Looks up Attribute class by name.
|
|
209
|
-
#--
|
|
210
366
|
# @rbs name: Symbol
|
|
211
367
|
# @rbs return: Attribute
|
|
368
|
+
# @param [Symbol] name
|
|
369
|
+
# @return [Attribute]
|
|
212
370
|
def by_name(name); BY_NAME.fetch(name); end
|
|
213
371
|
# Looks up Attribute class by type value.
|
|
214
|
-
#--
|
|
215
372
|
# @rbs type: Integer
|
|
216
373
|
# @rbs return: Attribute
|
|
374
|
+
# @param [Integer] type
|
|
375
|
+
# @return [Attribute]
|
|
217
376
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
218
377
|
end
|
|
219
378
|
end
|
|
220
|
-
|
|
221
|
-
Team::
|
|
222
|
-
|
|
223
|
-
|
|
379
|
+
# @private
|
|
380
|
+
Team::ListOption::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemOption, selector_bindings: Ractor.make_shareable([]))
|
|
381
|
+
# @private
|
|
382
|
+
Team::ListPort::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemPort, selector_bindings: Ractor.make_shareable([]))
|
|
383
|
+
# @private
|
|
384
|
+
ItemOption::Option::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrOption, selector_bindings: Ractor.make_shareable([]))
|
|
385
|
+
# @private
|
|
386
|
+
ItemPort::Port::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrPort, selector_bindings: Ractor.make_shareable([]))
|
|
224
387
|
end
|
|
225
388
|
module Messages
|
|
226
389
|
# No operation
|
|
227
|
-
class
|
|
390
|
+
class DoNoopRequest < ::Nl::Genl::Message
|
|
391
|
+
TYPE = 0
|
|
392
|
+
FIXED_HEADER = nil
|
|
393
|
+
ATTRIBUTE_SET = AttributeSets::Team
|
|
394
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
395
|
+
end
|
|
396
|
+
# No operation
|
|
397
|
+
class DoNoopReply < ::Nl::Genl::Message
|
|
228
398
|
TYPE = 0
|
|
229
399
|
FIXED_HEADER = nil
|
|
230
400
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
231
401
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
|
|
232
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
233
|
-
#--
|
|
234
402
|
# @rbs return: ::Integer
|
|
403
|
+
# @return [Integer]
|
|
404
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
235
405
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
236
406
|
end
|
|
237
407
|
# Set team options
|
|
238
|
-
|
|
408
|
+
#
|
|
409
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
410
|
+
class DoOptionsSetRequest < ::Nl::Genl::Message
|
|
239
411
|
TYPE = 1
|
|
240
412
|
FIXED_HEADER = nil
|
|
241
413
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
242
414
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
|
|
243
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
244
|
-
#--
|
|
245
415
|
# @rbs return: ::Integer
|
|
416
|
+
# @return [Integer]
|
|
417
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
246
418
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
247
|
-
# Gets the value of `list-option` attribute in the message.
|
|
248
|
-
#--
|
|
249
419
|
# @rbs return: AttributeSets::ItemOption
|
|
420
|
+
# @return [AttributeSets::ItemOption]
|
|
421
|
+
# @see AttributeSets::Team::ListOption
|
|
250
422
|
def list_option; attributes[:"list_option"]&.value; end
|
|
251
423
|
end
|
|
252
424
|
# Set team options
|
|
253
|
-
|
|
425
|
+
#
|
|
426
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
427
|
+
class DoOptionsSetReply < ::Nl::Genl::Message
|
|
254
428
|
TYPE = 1
|
|
255
429
|
FIXED_HEADER = nil
|
|
256
430
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
257
431
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
|
|
258
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
259
|
-
#--
|
|
260
432
|
# @rbs return: ::Integer
|
|
433
|
+
# @return [Integer]
|
|
434
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
261
435
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
262
|
-
# Gets the value of `list-option` attribute in the message.
|
|
263
|
-
#--
|
|
264
436
|
# @rbs return: AttributeSets::ItemOption
|
|
437
|
+
# @return [AttributeSets::ItemOption]
|
|
438
|
+
# @see AttributeSets::Team::ListOption
|
|
265
439
|
def list_option; attributes[:"list_option"]&.value; end
|
|
266
440
|
end
|
|
267
441
|
# Get team options info
|
|
268
|
-
|
|
442
|
+
#
|
|
443
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
444
|
+
class DoOptionsGetRequest < ::Nl::Genl::Message
|
|
269
445
|
TYPE = 2
|
|
270
446
|
FIXED_HEADER = nil
|
|
271
447
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
272
448
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
|
|
273
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
274
|
-
#--
|
|
275
449
|
# @rbs return: ::Integer
|
|
450
|
+
# @return [Integer]
|
|
451
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
276
452
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
277
453
|
end
|
|
278
454
|
# Get team options info
|
|
279
|
-
|
|
455
|
+
#
|
|
456
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
457
|
+
class DoOptionsGetReply < ::Nl::Genl::Message
|
|
280
458
|
TYPE = 2
|
|
281
459
|
FIXED_HEADER = nil
|
|
282
460
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
283
461
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
|
|
284
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
285
|
-
#--
|
|
286
462
|
# @rbs return: ::Integer
|
|
463
|
+
# @return [Integer]
|
|
464
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
287
465
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
288
|
-
# Gets the value of `list-option` attribute in the message.
|
|
289
|
-
#--
|
|
290
466
|
# @rbs return: AttributeSets::ItemOption
|
|
467
|
+
# @return [AttributeSets::ItemOption]
|
|
468
|
+
# @see AttributeSets::Team::ListOption
|
|
291
469
|
def list_option; attributes[:"list_option"]&.value; end
|
|
292
470
|
end
|
|
293
471
|
# Get team ports info
|
|
294
|
-
|
|
472
|
+
#
|
|
473
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
474
|
+
class DoPortListGetRequest < ::Nl::Genl::Message
|
|
295
475
|
TYPE = 3
|
|
296
476
|
FIXED_HEADER = nil
|
|
297
477
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
298
478
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
|
|
299
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
300
|
-
#--
|
|
301
479
|
# @rbs return: ::Integer
|
|
480
|
+
# @return [Integer]
|
|
481
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
302
482
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
303
483
|
end
|
|
304
484
|
# Get team ports info
|
|
305
|
-
|
|
485
|
+
#
|
|
486
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
487
|
+
class DoPortListGetReply < ::Nl::Genl::Message
|
|
306
488
|
TYPE = 3
|
|
307
489
|
FIXED_HEADER = nil
|
|
308
490
|
ATTRIBUTE_SET = AttributeSets::Team
|
|
309
491
|
ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_port])
|
|
310
|
-
# Gets the value of `team-ifindex` attribute in the message.
|
|
311
|
-
#--
|
|
312
492
|
# @rbs return: ::Integer
|
|
493
|
+
# @return [Integer]
|
|
494
|
+
# @see AttributeSets::Team::TeamIfindex
|
|
313
495
|
def team_ifindex; attributes[:"team_ifindex"]&.value; end
|
|
314
|
-
# Gets the value of `list-port` attribute in the message.
|
|
315
|
-
#--
|
|
316
496
|
# @rbs return: AttributeSets::ItemPort
|
|
497
|
+
# @return [AttributeSets::ItemPort]
|
|
498
|
+
# @see AttributeSets::Team::ListPort
|
|
317
499
|
def list_port; attributes[:"list_port"]&.value; end
|
|
318
500
|
end
|
|
319
501
|
end
|
|
502
|
+
module Notifications
|
|
503
|
+
end
|
|
504
|
+
# @private
|
|
505
|
+
NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
|
|
506
|
+
# No operation
|
|
507
|
+
# @rbs () -> Messages::DoNoopReply
|
|
508
|
+
# @param [Hash] args
|
|
509
|
+
# @return [Messages::DoNoopReply]
|
|
510
|
+
# @see Messages::DoNoopRequest
|
|
511
|
+
def do_noop(**args)
|
|
512
|
+
exchange_message(:"do", Messages::DoNoopRequest, Messages::DoNoopReply, args)
|
|
513
|
+
end
|
|
320
514
|
# Set team options
|
|
321
|
-
|
|
322
|
-
#
|
|
515
|
+
#
|
|
516
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
517
|
+
# @rbs (?team_ifindex: ::Integer, ?list_option: (AttributeSets::ItemOption | ::Hash[::Symbol, untyped])) -> Messages::DoOptionsSetReply
|
|
518
|
+
# @param [Hash] args
|
|
519
|
+
# @option args [Integer] team_ifindex
|
|
520
|
+
# @option args [AttributeSets::ItemOption, Hash<Symbol, Object>] list_option
|
|
521
|
+
# @return [Messages::DoOptionsSetReply]
|
|
522
|
+
# @see Messages::DoOptionsSetRequest
|
|
323
523
|
def do_options_set(**args)
|
|
324
524
|
exchange_message(:"do", Messages::DoOptionsSetRequest, Messages::DoOptionsSetReply, args)
|
|
325
525
|
end
|
|
326
526
|
# Get team options info
|
|
327
|
-
|
|
527
|
+
#
|
|
528
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
328
529
|
# @rbs (?team_ifindex: ::Integer) -> Messages::DoOptionsGetReply
|
|
530
|
+
# @param [Hash] args
|
|
531
|
+
# @option args [Integer] team_ifindex
|
|
532
|
+
# @return [Messages::DoOptionsGetReply]
|
|
533
|
+
# @see Messages::DoOptionsGetRequest
|
|
329
534
|
def do_options_get(**args)
|
|
330
535
|
exchange_message(:"do", Messages::DoOptionsGetRequest, Messages::DoOptionsGetReply, args)
|
|
331
536
|
end
|
|
332
537
|
# Get team ports info
|
|
333
|
-
|
|
538
|
+
#
|
|
539
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
334
540
|
# @rbs (?team_ifindex: ::Integer) -> Messages::DoPortListGetReply
|
|
541
|
+
# @param [Hash] args
|
|
542
|
+
# @option args [Integer] team_ifindex
|
|
543
|
+
# @return [Messages::DoPortListGetReply]
|
|
544
|
+
# @see Messages::DoPortListGetRequest
|
|
335
545
|
def do_port_list_get(**args)
|
|
336
546
|
exchange_message(:"do", Messages::DoPortListGetRequest, Messages::DoPortListGetReply, args)
|
|
337
547
|
end
|
|
548
|
+
class AsyncOperations
|
|
549
|
+
# @private
|
|
550
|
+
def initialize(&exchange)
|
|
551
|
+
@exchange = exchange
|
|
552
|
+
end
|
|
553
|
+
# No operation
|
|
554
|
+
# @rbs () -> ::Nl::Async::Future[Messages::DoNoopReply]
|
|
555
|
+
# @param [Hash] args
|
|
556
|
+
# @return [Nl::Async::Future<Messages::DoNoopReply>]
|
|
557
|
+
# @see Messages::DoNoopRequest
|
|
558
|
+
def do_noop(**args)
|
|
559
|
+
@exchange.call(:"do", Messages::DoNoopRequest, Messages::DoNoopReply, args)
|
|
560
|
+
end
|
|
561
|
+
# Set team options
|
|
562
|
+
#
|
|
563
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
564
|
+
# @rbs (?team_ifindex: ::Integer, ?list_option: (AttributeSets::ItemOption | ::Hash[::Symbol, untyped])) -> ::Nl::Async::Future[Messages::DoOptionsSetReply]
|
|
565
|
+
# @param [Hash] args
|
|
566
|
+
# @option args [Integer] team_ifindex
|
|
567
|
+
# @option args [AttributeSets::ItemOption, Hash<Symbol, Object>] list_option
|
|
568
|
+
# @return [Nl::Async::Future<Messages::DoOptionsSetReply>]
|
|
569
|
+
# @see Messages::DoOptionsSetRequest
|
|
570
|
+
def do_options_set(**args)
|
|
571
|
+
@exchange.call(:"do", Messages::DoOptionsSetRequest, Messages::DoOptionsSetReply, args)
|
|
572
|
+
end
|
|
573
|
+
# Get team options info
|
|
574
|
+
#
|
|
575
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
576
|
+
# @rbs (?team_ifindex: ::Integer) -> ::Nl::Async::Future[Messages::DoOptionsGetReply]
|
|
577
|
+
# @param [Hash] args
|
|
578
|
+
# @option args [Integer] team_ifindex
|
|
579
|
+
# @return [Nl::Async::Future<Messages::DoOptionsGetReply>]
|
|
580
|
+
# @see Messages::DoOptionsGetRequest
|
|
581
|
+
def do_options_get(**args)
|
|
582
|
+
@exchange.call(:"do", Messages::DoOptionsGetRequest, Messages::DoOptionsGetReply, args)
|
|
583
|
+
end
|
|
584
|
+
# Get team ports info
|
|
585
|
+
#
|
|
586
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
587
|
+
# @rbs (?team_ifindex: ::Integer) -> ::Nl::Async::Future[Messages::DoPortListGetReply]
|
|
588
|
+
# @param [Hash] args
|
|
589
|
+
# @option args [Integer] team_ifindex
|
|
590
|
+
# @return [Nl::Async::Future<Messages::DoPortListGetReply>]
|
|
591
|
+
# @see Messages::DoPortListGetRequest
|
|
592
|
+
def do_port_list_get(**args)
|
|
593
|
+
@exchange.call(:"do", Messages::DoPortListGetRequest, Messages::DoPortListGetReply, args)
|
|
594
|
+
end
|
|
595
|
+
end
|
|
596
|
+
# Returns the asynchronous operation facade for this family.
|
|
597
|
+
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
598
|
+
# @param [::Integer, nil] stream_capacity
|
|
599
|
+
# @return [AsyncOperations]
|
|
600
|
+
def async(stream_capacity: nil)
|
|
601
|
+
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
602
|
+
build_async_facade(AsyncOperations, stream_capacity:)
|
|
603
|
+
end
|
|
338
604
|
end
|
|
339
605
|
end; end
|