nl-linux 0.2.0 → 0.2.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.
@@ -0,0 +1,315 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ # Management interface for TCP metrics.
8
+ class Nl::Linux::TcpMetrics < ::Nl::Family
9
+ NAME = "tcp_metrics"
10
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("tcp_metrics"))
11
+ module Structs
12
+ end
13
+ module AttributeSets
14
+ class TcpMetrics < ::Nl::Protocols::Genl::AttributeSet
15
+ # Abstract class
16
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
17
+ end
18
+ class AddrIpv4 < Attribute
19
+ TYPE = 1
20
+ NAME = :"addr_ipv4"
21
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
22
+ end
23
+ class AddrIpv6 < Attribute
24
+ TYPE = 2
25
+ NAME = :"addr_ipv6"
26
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
27
+ end
28
+ class Age < Attribute
29
+ TYPE = 3
30
+ NAME = :"age"
31
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
32
+ end
33
+ class TwTsval < Attribute
34
+ TYPE = 4
35
+ NAME = :"tw_tsval"
36
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
37
+ end
38
+ class TwTsStamp < Attribute
39
+ TYPE = 5
40
+ NAME = :"tw_ts_stamp"
41
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
42
+ end
43
+ class Vals < Attribute
44
+ TYPE = 6
45
+ NAME = :"vals"
46
+ end
47
+ class FopenMss < Attribute
48
+ TYPE = 7
49
+ NAME = :"fopen_mss"
50
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
51
+ end
52
+ class FopenSynDrops < Attribute
53
+ TYPE = 8
54
+ NAME = :"fopen_syn_drops"
55
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
56
+ end
57
+ class FopenSynDropTs < Attribute
58
+ TYPE = 9
59
+ NAME = :"fopen_syn_drop_ts"
60
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
61
+ end
62
+ class FopenCookie < Attribute
63
+ TYPE = 10
64
+ NAME = :"fopen_cookie"
65
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
66
+ end
67
+ class SaddrIpv4 < Attribute
68
+ TYPE = 11
69
+ NAME = :"saddr_ipv4"
70
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
71
+ end
72
+ class SaddrIpv6 < Attribute
73
+ TYPE = 12
74
+ NAME = :"saddr_ipv6"
75
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
76
+ end
77
+ class Pad < Attribute
78
+ TYPE = 13
79
+ NAME = :"pad"
80
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Pad.new()
81
+ end
82
+ # :nodoc:
83
+ BY_NAME = Ractor.make_shareable({:"addr_ipv4" => AddrIpv4, :"addr_ipv6" => AddrIpv6, :"age" => Age, :"tw_tsval" => TwTsval, :"tw_ts_stamp" => TwTsStamp, :"vals" => Vals, :"fopen_mss" => FopenMss, :"fopen_syn_drops" => FopenSynDrops, :"fopen_syn_drop_ts" => FopenSynDropTs, :"fopen_cookie" => FopenCookie, :"saddr_ipv4" => SaddrIpv4, :"saddr_ipv6" => SaddrIpv6, :"pad" => Pad}) #: Hash[::Symbol, Attribute]
84
+ # :nodoc:
85
+ BY_TYPE = Ractor.make_shareable({1 => AddrIpv4, 2 => AddrIpv6, 3 => Age, 4 => TwTsval, 5 => TwTsStamp, 6 => Vals, 7 => FopenMss, 8 => FopenSynDrops, 9 => FopenSynDropTs, 10 => FopenCookie, 11 => SaddrIpv4, 12 => SaddrIpv6, 13 => Pad}) #: Hash[::Integer, Attribute]
86
+ class << self
87
+ # Looks up Attribute class by name.
88
+ #--
89
+ # @rbs name: Symbol
90
+ # @rbs return: Attribute
91
+ def by_name(name); BY_NAME.fetch(name); end
92
+ # Looks up Attribute class by type value.
93
+ #--
94
+ # @rbs type: Integer
95
+ # @rbs return: Attribute
96
+ def by_type(type); BY_TYPE.fetch(type); end
97
+ end
98
+ end
99
+ # Attributes with metrics. Note that the values here do not match
100
+ # the TCP_METRIC_* defines in the kernel, because kernel defines
101
+ # are off-by one (e.g. rtt is defined as enum 0, while netlink carries
102
+ # attribute type 1).
103
+ class Metrics < ::Nl::Protocols::Genl::AttributeSet
104
+ # Abstract class
105
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
106
+ end
107
+ class Rtt < Attribute
108
+ TYPE = 1
109
+ NAME = :"rtt"
110
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
111
+ end
112
+ class Rttvar < Attribute
113
+ TYPE = 2
114
+ NAME = :"rttvar"
115
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
116
+ end
117
+ class Ssthresh < Attribute
118
+ TYPE = 3
119
+ NAME = :"ssthresh"
120
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
121
+ end
122
+ class Cwnd < Attribute
123
+ TYPE = 4
124
+ NAME = :"cwnd"
125
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
126
+ end
127
+ class Reodering < Attribute
128
+ TYPE = 5
129
+ NAME = :"reodering"
130
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
131
+ end
132
+ class RttUs < Attribute
133
+ TYPE = 6
134
+ NAME = :"rtt_us"
135
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
136
+ end
137
+ class RttvarUs < Attribute
138
+ TYPE = 7
139
+ NAME = :"rttvar_us"
140
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
141
+ end
142
+ # :nodoc:
143
+ BY_NAME = Ractor.make_shareable({:"rtt" => Rtt, :"rttvar" => Rttvar, :"ssthresh" => Ssthresh, :"cwnd" => Cwnd, :"reodering" => Reodering, :"rtt_us" => RttUs, :"rttvar_us" => RttvarUs}) #: Hash[::Symbol, Attribute]
144
+ # :nodoc:
145
+ BY_TYPE = Ractor.make_shareable({1 => Rtt, 2 => Rttvar, 3 => Ssthresh, 4 => Cwnd, 5 => Reodering, 6 => RttUs, 7 => RttvarUs}) #: Hash[::Integer, Attribute]
146
+ class << self
147
+ # Looks up Attribute class by name.
148
+ #--
149
+ # @rbs name: Symbol
150
+ # @rbs return: Attribute
151
+ def by_name(name); BY_NAME.fetch(name); end
152
+ # Looks up Attribute class by type value.
153
+ #--
154
+ # @rbs type: Integer
155
+ # @rbs return: Attribute
156
+ def by_type(type); BY_TYPE.fetch(type); end
157
+ end
158
+ end
159
+ TcpMetrics::Vals::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Metrics)
160
+ end
161
+ module Messages
162
+ # Retrieve metrics.
163
+ class DoGetRequest < ::Nl::Protocols::Genl::Message
164
+ TYPE = 1
165
+ FIXED_HEADER = nil
166
+ ATTRIBUTE_SET = AttributeSets::TcpMetrics
167
+ ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 saddr_ipv4 saddr_ipv6])
168
+ # Gets the value of `addr-ipv4` attribute in the message.
169
+ #--
170
+ # @rbs return: ::Integer
171
+ def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
172
+ # Gets the value of `addr-ipv6` attribute in the message.
173
+ #--
174
+ # @rbs return: untyped
175
+ def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
176
+ # Gets the value of `saddr-ipv4` attribute in the message.
177
+ #--
178
+ # @rbs return: ::Integer
179
+ def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
180
+ # Gets the value of `saddr-ipv6` attribute in the message.
181
+ #--
182
+ # @rbs return: untyped
183
+ def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
184
+ end
185
+ # Retrieve metrics.
186
+ class DoGetReply < ::Nl::Protocols::Genl::Message
187
+ TYPE = 1
188
+ FIXED_HEADER = nil
189
+ ATTRIBUTE_SET = AttributeSets::TcpMetrics
190
+ ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 age vals fopen_mss fopen_syn_drops fopen_syn_drop_ts fopen_cookie saddr_ipv4 saddr_ipv6])
191
+ # Gets the value of `addr-ipv4` attribute in the message.
192
+ #--
193
+ # @rbs return: ::Integer
194
+ def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
195
+ # Gets the value of `addr-ipv6` attribute in the message.
196
+ #--
197
+ # @rbs return: untyped
198
+ def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
199
+ # Gets the value of `age` attribute in the message.
200
+ #--
201
+ # @rbs return: ::Integer
202
+ def age; attributes[:"age"]&.value; end
203
+ # Gets the value of `vals` attribute in the message.
204
+ #--
205
+ # @rbs return: AttributeSets::Metrics
206
+ def vals; attributes[:"vals"]&.value; end
207
+ # Gets the value of `fopen-mss` attribute in the message.
208
+ #--
209
+ # @rbs return: ::Integer
210
+ def fopen_mss; attributes[:"fopen_mss"]&.value; end
211
+ # Gets the value of `fopen-syn-drops` attribute in the message.
212
+ #--
213
+ # @rbs return: ::Integer
214
+ def fopen_syn_drops; attributes[:"fopen_syn_drops"]&.value; end
215
+ # Gets the value of `fopen-syn-drop-ts` attribute in the message.
216
+ #--
217
+ # @rbs return: ::Integer
218
+ def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
219
+ # Gets the value of `fopen-cookie` attribute in the message.
220
+ #--
221
+ # @rbs return: untyped
222
+ def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
223
+ # Gets the value of `saddr-ipv4` attribute in the message.
224
+ #--
225
+ # @rbs return: ::Integer
226
+ def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
227
+ # Gets the value of `saddr-ipv6` attribute in the message.
228
+ #--
229
+ # @rbs return: untyped
230
+ def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
231
+ end
232
+ # Retrieve metrics.
233
+ class DumpGetReply < ::Nl::Protocols::Genl::Message
234
+ TYPE = 1
235
+ FIXED_HEADER = nil
236
+ ATTRIBUTE_SET = AttributeSets::TcpMetrics
237
+ ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 age vals fopen_mss fopen_syn_drops fopen_syn_drop_ts fopen_cookie saddr_ipv4 saddr_ipv6])
238
+ # Gets the value of `addr-ipv4` attribute in the message.
239
+ #--
240
+ # @rbs return: ::Integer
241
+ def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
242
+ # Gets the value of `addr-ipv6` attribute in the message.
243
+ #--
244
+ # @rbs return: untyped
245
+ def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
246
+ # Gets the value of `age` attribute in the message.
247
+ #--
248
+ # @rbs return: ::Integer
249
+ def age; attributes[:"age"]&.value; end
250
+ # Gets the value of `vals` attribute in the message.
251
+ #--
252
+ # @rbs return: AttributeSets::Metrics
253
+ def vals; attributes[:"vals"]&.value; end
254
+ # Gets the value of `fopen-mss` attribute in the message.
255
+ #--
256
+ # @rbs return: ::Integer
257
+ def fopen_mss; attributes[:"fopen_mss"]&.value; end
258
+ # Gets the value of `fopen-syn-drops` attribute in the message.
259
+ #--
260
+ # @rbs return: ::Integer
261
+ def fopen_syn_drops; attributes[:"fopen_syn_drops"]&.value; end
262
+ # Gets the value of `fopen-syn-drop-ts` attribute in the message.
263
+ #--
264
+ # @rbs return: ::Integer
265
+ def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
266
+ # Gets the value of `fopen-cookie` attribute in the message.
267
+ #--
268
+ # @rbs return: untyped
269
+ def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
270
+ # Gets the value of `saddr-ipv4` attribute in the message.
271
+ #--
272
+ # @rbs return: ::Integer
273
+ def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
274
+ # Gets the value of `saddr-ipv6` attribute in the message.
275
+ #--
276
+ # @rbs return: untyped
277
+ def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
278
+ end
279
+ # Delete metrics.
280
+ class DoDelRequest < ::Nl::Protocols::Genl::Message
281
+ TYPE = 2
282
+ FIXED_HEADER = nil
283
+ ATTRIBUTE_SET = AttributeSets::TcpMetrics
284
+ ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 saddr_ipv4 saddr_ipv6])
285
+ # Gets the value of `addr-ipv4` attribute in the message.
286
+ #--
287
+ # @rbs return: ::Integer
288
+ def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
289
+ # Gets the value of `addr-ipv6` attribute in the message.
290
+ #--
291
+ # @rbs return: untyped
292
+ def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
293
+ # Gets the value of `saddr-ipv4` attribute in the message.
294
+ #--
295
+ # @rbs return: ::Integer
296
+ def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
297
+ # Gets the value of `saddr-ipv6` attribute in the message.
298
+ #--
299
+ # @rbs return: untyped
300
+ def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
301
+ end
302
+ end
303
+ # Retrieve metrics.
304
+ #--
305
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: untyped, ?saddr_ipv4: ::Integer, ?saddr_ipv6: untyped) -> Messages::DoGetReply
306
+ def do_get(**args)
307
+ exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
308
+ end
309
+ # Delete metrics.
310
+ #--
311
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: untyped, ?saddr_ipv4: ::Integer, ?saddr_ipv6: untyped) -> void
312
+ def do_del(**args)
313
+ exchange_message(:"do", Messages::DoDelRequest, nil, args)
314
+ end
315
+ end
@@ -0,0 +1,337 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ # Network team device driver.
8
+ class Nl::Linux::Team < ::Nl::Family
9
+ NAME = "team"
10
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("team"))
11
+ module Structs
12
+ end
13
+ module AttributeSets
14
+ # The team nested layout of get/set msg looks like::
15
+ #
16
+ # [TEAM_ATTR_LIST_OPTION]
17
+ # [TEAM_ATTR_ITEM_OPTION]
18
+ # [TEAM_ATTR_OPTION_*], ...
19
+ # [TEAM_ATTR_ITEM_OPTION]
20
+ # [TEAM_ATTR_OPTION_*], ...
21
+ # ...
22
+ # [TEAM_ATTR_LIST_PORT]
23
+ # [TEAM_ATTR_ITEM_PORT]
24
+ # [TEAM_ATTR_PORT_*], ...
25
+ # [TEAM_ATTR_ITEM_PORT]
26
+ # [TEAM_ATTR_PORT_*], ...
27
+ # ...
28
+ class Team < ::Nl::Protocols::Genl::AttributeSet
29
+ # Abstract class
30
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
31
+ end
32
+ class TeamIfindex < Attribute
33
+ TYPE = 1
34
+ NAME = :"team_ifindex"
35
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
36
+ end
37
+ class ListOption < Attribute
38
+ TYPE = 2
39
+ NAME = :"list_option"
40
+ end
41
+ class ListPort < Attribute
42
+ TYPE = 3
43
+ NAME = :"list_port"
44
+ end
45
+ # :nodoc:
46
+ BY_NAME = Ractor.make_shareable({:"team_ifindex" => TeamIfindex, :"list_option" => ListOption, :"list_port" => ListPort}) #: Hash[::Symbol, Attribute]
47
+ # :nodoc:
48
+ BY_TYPE = Ractor.make_shareable({1 => TeamIfindex, 2 => ListOption, 3 => ListPort}) #: Hash[::Integer, Attribute]
49
+ class << self
50
+ # Looks up Attribute class by name.
51
+ #--
52
+ # @rbs name: Symbol
53
+ # @rbs return: Attribute
54
+ def by_name(name); BY_NAME.fetch(name); end
55
+ # Looks up Attribute class by type value.
56
+ #--
57
+ # @rbs type: Integer
58
+ # @rbs return: Attribute
59
+ def by_type(type); BY_TYPE.fetch(type); end
60
+ end
61
+ end
62
+ class ItemOption < ::Nl::Protocols::Genl::AttributeSet
63
+ # Abstract class
64
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
65
+ end
66
+ class Option < Attribute
67
+ TYPE = 1
68
+ NAME = :"option"
69
+ end
70
+ # :nodoc:
71
+ BY_NAME = Ractor.make_shareable({:"option" => Option}) #: Hash[::Symbol, Attribute]
72
+ # :nodoc:
73
+ BY_TYPE = Ractor.make_shareable({1 => Option}) #: Hash[::Integer, Attribute]
74
+ class << self
75
+ # Looks up Attribute class by name.
76
+ #--
77
+ # @rbs name: Symbol
78
+ # @rbs return: Attribute
79
+ def by_name(name); BY_NAME.fetch(name); end
80
+ # Looks up Attribute class by type value.
81
+ #--
82
+ # @rbs type: Integer
83
+ # @rbs return: Attribute
84
+ def by_type(type); BY_TYPE.fetch(type); end
85
+ end
86
+ end
87
+ class AttrOption < ::Nl::Protocols::Genl::AttributeSet
88
+ # Abstract class
89
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
90
+ end
91
+ class Name < Attribute
92
+ TYPE = 1
93
+ NAME = :"name"
94
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length 32" unless it.bytesize <= 32 })
95
+ end
96
+ class Changed < Attribute
97
+ TYPE = 2
98
+ NAME = :"changed"
99
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
100
+ end
101
+ class Type < Attribute
102
+ TYPE = 3
103
+ NAME = :"type"
104
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
105
+ end
106
+ class Data < Attribute
107
+ TYPE = 4
108
+ NAME = :"data"
109
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
110
+ end
111
+ class Removed < Attribute
112
+ TYPE = 5
113
+ NAME = :"removed"
114
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
115
+ end
116
+ class PortIfindex < Attribute
117
+ TYPE = 6
118
+ NAME = :"port_ifindex"
119
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
120
+ end
121
+ class ArrayIndex < Attribute
122
+ TYPE = 7
123
+ NAME = :"array_index"
124
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
125
+ end
126
+ # :nodoc:
127
+ BY_NAME = Ractor.make_shareable({:"name" => Name, :"changed" => Changed, :"type" => Type, :"data" => Data, :"removed" => Removed, :"port_ifindex" => PortIfindex, :"array_index" => ArrayIndex}) #: Hash[::Symbol, Attribute]
128
+ # :nodoc:
129
+ BY_TYPE = Ractor.make_shareable({1 => Name, 2 => Changed, 3 => Type, 4 => Data, 5 => Removed, 6 => PortIfindex, 7 => ArrayIndex}) #: Hash[::Integer, Attribute]
130
+ class << self
131
+ # Looks up Attribute class by name.
132
+ #--
133
+ # @rbs name: Symbol
134
+ # @rbs return: Attribute
135
+ def by_name(name); BY_NAME.fetch(name); end
136
+ # Looks up Attribute class by type value.
137
+ #--
138
+ # @rbs type: Integer
139
+ # @rbs return: Attribute
140
+ def by_type(type); BY_TYPE.fetch(type); end
141
+ end
142
+ end
143
+ class ItemPort < ::Nl::Protocols::Genl::AttributeSet
144
+ # Abstract class
145
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
146
+ end
147
+ class Port < Attribute
148
+ TYPE = 1
149
+ NAME = :"port"
150
+ end
151
+ # :nodoc:
152
+ BY_NAME = Ractor.make_shareable({:"port" => Port}) #: Hash[::Symbol, Attribute]
153
+ # :nodoc:
154
+ BY_TYPE = Ractor.make_shareable({1 => Port}) #: Hash[::Integer, Attribute]
155
+ class << self
156
+ # Looks up Attribute class by name.
157
+ #--
158
+ # @rbs name: Symbol
159
+ # @rbs return: Attribute
160
+ def by_name(name); BY_NAME.fetch(name); end
161
+ # Looks up Attribute class by type value.
162
+ #--
163
+ # @rbs type: Integer
164
+ # @rbs return: Attribute
165
+ def by_type(type); BY_TYPE.fetch(type); end
166
+ end
167
+ end
168
+ class AttrPort < ::Nl::Protocols::Genl::AttributeSet
169
+ # Abstract class
170
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
171
+ end
172
+ class Ifindex < Attribute
173
+ TYPE = 1
174
+ NAME = :"ifindex"
175
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
176
+ end
177
+ class Changed < Attribute
178
+ TYPE = 2
179
+ NAME = :"changed"
180
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
181
+ end
182
+ class Linkup < Attribute
183
+ TYPE = 3
184
+ NAME = :"linkup"
185
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
186
+ end
187
+ class Speed < Attribute
188
+ TYPE = 4
189
+ NAME = :"speed"
190
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
191
+ end
192
+ class Duplex < Attribute
193
+ TYPE = 5
194
+ NAME = :"duplex"
195
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
196
+ end
197
+ class Removed < Attribute
198
+ TYPE = 6
199
+ NAME = :"removed"
200
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
201
+ end
202
+ # :nodoc:
203
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"changed" => Changed, :"linkup" => Linkup, :"speed" => Speed, :"duplex" => Duplex, :"removed" => Removed}) #: Hash[::Symbol, Attribute]
204
+ # :nodoc:
205
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Changed, 3 => Linkup, 4 => Speed, 5 => Duplex, 6 => Removed}) #: Hash[::Integer, Attribute]
206
+ class << self
207
+ # Looks up Attribute class by name.
208
+ #--
209
+ # @rbs name: Symbol
210
+ # @rbs return: Attribute
211
+ def by_name(name); BY_NAME.fetch(name); end
212
+ # Looks up Attribute class by type value.
213
+ #--
214
+ # @rbs type: Integer
215
+ # @rbs return: Attribute
216
+ def by_type(type); BY_TYPE.fetch(type); end
217
+ end
218
+ end
219
+ Team::ListOption::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(ItemOption)
220
+ Team::ListPort::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(ItemPort)
221
+ ItemOption::Option::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(AttrOption)
222
+ ItemPort::Port::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(AttrPort)
223
+ end
224
+ module Messages
225
+ # No operation
226
+ class DoNoopReply < ::Nl::Protocols::Genl::Message
227
+ TYPE = 0
228
+ FIXED_HEADER = nil
229
+ ATTRIBUTE_SET = AttributeSets::Team
230
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
231
+ # Gets the value of `team-ifindex` attribute in the message.
232
+ #--
233
+ # @rbs return: ::Integer
234
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
235
+ end
236
+ # Set team options
237
+ class DoOptionsSetRequest < ::Nl::Protocols::Genl::Message
238
+ TYPE = 1
239
+ FIXED_HEADER = nil
240
+ ATTRIBUTE_SET = AttributeSets::Team
241
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
242
+ # Gets the value of `team-ifindex` attribute in the message.
243
+ #--
244
+ # @rbs return: ::Integer
245
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
246
+ # Gets the value of `list-option` attribute in the message.
247
+ #--
248
+ # @rbs return: AttributeSets::ItemOption
249
+ def list_option; attributes[:"list_option"]&.value; end
250
+ end
251
+ # Set team options
252
+ class DoOptionsSetReply < ::Nl::Protocols::Genl::Message
253
+ TYPE = 1
254
+ FIXED_HEADER = nil
255
+ ATTRIBUTE_SET = AttributeSets::Team
256
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
257
+ # Gets the value of `team-ifindex` attribute in the message.
258
+ #--
259
+ # @rbs return: ::Integer
260
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
261
+ # Gets the value of `list-option` attribute in the message.
262
+ #--
263
+ # @rbs return: AttributeSets::ItemOption
264
+ def list_option; attributes[:"list_option"]&.value; end
265
+ end
266
+ # Get team options info
267
+ class DoOptionsGetRequest < ::Nl::Protocols::Genl::Message
268
+ TYPE = 2
269
+ FIXED_HEADER = nil
270
+ ATTRIBUTE_SET = AttributeSets::Team
271
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
272
+ # Gets the value of `team-ifindex` attribute in the message.
273
+ #--
274
+ # @rbs return: ::Integer
275
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
276
+ end
277
+ # Get team options info
278
+ class DoOptionsGetReply < ::Nl::Protocols::Genl::Message
279
+ TYPE = 2
280
+ FIXED_HEADER = nil
281
+ ATTRIBUTE_SET = AttributeSets::Team
282
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
283
+ # Gets the value of `team-ifindex` attribute in the message.
284
+ #--
285
+ # @rbs return: ::Integer
286
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
287
+ # Gets the value of `list-option` attribute in the message.
288
+ #--
289
+ # @rbs return: AttributeSets::ItemOption
290
+ def list_option; attributes[:"list_option"]&.value; end
291
+ end
292
+ # Get team ports info
293
+ class DoPortListGetRequest < ::Nl::Protocols::Genl::Message
294
+ TYPE = 3
295
+ FIXED_HEADER = nil
296
+ ATTRIBUTE_SET = AttributeSets::Team
297
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
298
+ # Gets the value of `team-ifindex` attribute in the message.
299
+ #--
300
+ # @rbs return: ::Integer
301
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
302
+ end
303
+ # Get team ports info
304
+ class DoPortListGetReply < ::Nl::Protocols::Genl::Message
305
+ TYPE = 3
306
+ FIXED_HEADER = nil
307
+ ATTRIBUTE_SET = AttributeSets::Team
308
+ ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_port])
309
+ # Gets the value of `team-ifindex` attribute in the message.
310
+ #--
311
+ # @rbs return: ::Integer
312
+ def team_ifindex; attributes[:"team_ifindex"]&.value; end
313
+ # Gets the value of `list-port` attribute in the message.
314
+ #--
315
+ # @rbs return: AttributeSets::ItemPort
316
+ def list_port; attributes[:"list_port"]&.value; end
317
+ end
318
+ end
319
+ # Set team options
320
+ #--
321
+ # @rbs (?team_ifindex: ::Integer, ?list_option: AttributeSets::ItemOption) -> Messages::DoOptionsSetReply
322
+ def do_options_set(**args)
323
+ exchange_message(:"do", Messages::DoOptionsSetRequest, Messages::DoOptionsSetReply, args)
324
+ end
325
+ # Get team options info
326
+ #--
327
+ # @rbs (?team_ifindex: ::Integer) -> Messages::DoOptionsGetReply
328
+ def do_options_get(**args)
329
+ exchange_message(:"do", Messages::DoOptionsGetRequest, Messages::DoOptionsGetReply, args)
330
+ end
331
+ # Get team ports info
332
+ #--
333
+ # @rbs (?team_ifindex: ::Integer) -> Messages::DoPortListGetReply
334
+ def do_port_list_get(**args)
335
+ exchange_message(:"do", Messages::DoPortListGetRequest, Messages::DoPortListGetReply, args)
336
+ end
337
+ end