nl-linux 0.2.0 → 0.2.2

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