nl-linux 0.4.1 → 0.5.0

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/NLSPEC_VERSION +1 -1
  4. data/generated/nl/linux/binder.rb +103 -187
  5. data/generated/nl/linux/conntrack.rb +1053 -1649
  6. data/generated/nl/linux/dev_energymodel.rb +303 -265
  7. data/generated/nl/linux/devlink.rb +4904 -5576
  8. data/generated/nl/linux/dpll.rb +1097 -1467
  9. data/generated/nl/linux/drm_ras.rb +235 -195
  10. data/generated/nl/linux/ethtool.rb +6652 -7415
  11. data/generated/nl/linux/fou.rb +234 -255
  12. data/generated/nl/linux/handshake.rb +208 -280
  13. data/generated/nl/linux/lockd.rb +99 -73
  14. data/generated/nl/linux/mptcp_pm.rb +589 -687
  15. data/generated/nl/linux/net_shaper.rb +520 -615
  16. data/generated/nl/linux/netdev.rb +1640 -1987
  17. data/generated/nl/linux/nfsd.rb +1341 -1215
  18. data/generated/nl/linux/nftables.rb +5143 -4870
  19. data/generated/nl/linux/nl80211.rb +2542 -6316
  20. data/generated/nl/linux/nlctrl.rb +338 -483
  21. data/generated/nl/linux/ovpn.rb +1006 -1522
  22. data/generated/nl/linux/ovs_datapath.rb +291 -186
  23. data/generated/nl/linux/ovs_flow.rb +1393 -2065
  24. data/generated/nl/linux/ovs_packet.rb +186 -223
  25. data/generated/nl/linux/ovs_vport.rb +328 -285
  26. data/generated/nl/linux/psp.rb +812 -717
  27. data/generated/nl/linux/rt_addr.rb +513 -243
  28. data/generated/nl/linux/rt_link.rb +4504 -7238
  29. data/generated/nl/linux/rt_neigh.rb +935 -847
  30. data/generated/nl/linux/rt_route.rb +1198 -871
  31. data/generated/nl/linux/rt_rule.rb +680 -659
  32. data/generated/nl/linux/sunrpc_cache.rb +323 -321
  33. data/generated/nl/linux/tc.rb +9058 -10454
  34. data/generated/nl/linux/tcp_metrics.rb +258 -367
  35. data/generated/nl/linux/team.rb +327 -345
  36. data/generated/nl/linux/wireguard.rb +270 -434
  37. data/lib/nl/linux/nlctrl_resolver.rb +1 -1
  38. data/lib/nl/linux/version.rb +1 -1
  39. data/linux/conntrack.yaml +18 -3
  40. data/linux/devlink.yaml +26 -4
  41. data/linux/dpll.yaml +19 -0
  42. data/linux/netdev.yaml +21 -0
  43. data/linux/nfsd.yaml +111 -0
  44. data/linux/nl80211.yaml +2 -2
  45. data/linux/rt-addr.yaml +4 -0
  46. data/linux/rt-link.yaml +7 -0
  47. data/linux/rt-neigh.yaml +3 -0
  48. data/linux/rt-route.yaml +83 -2
  49. data/sig/generated/nl/linux/binder.rbs +77 -220
  50. data/sig/generated/nl/linux/conntrack.rbs +770 -1954
  51. data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
  52. data/sig/generated/nl/linux/devlink.rbs +3318 -6068
  53. data/sig/generated/nl/linux/dpll.rbs +791 -1589
  54. data/sig/generated/nl/linux/drm_ras.rbs +160 -208
  55. data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
  56. data/sig/generated/nl/linux/fou.rbs +139 -254
  57. data/sig/generated/nl/linux/handshake.rbs +144 -319
  58. data/sig/generated/nl/linux/lockd.rbs +64 -74
  59. data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
  60. data/sig/generated/nl/linux/net_shaper.rbs +351 -644
  61. data/sig/generated/nl/linux/netdev.rbs +1151 -2146
  62. data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
  63. data/sig/generated/nl/linux/nftables.rbs +2907 -5030
  64. data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
  65. data/sig/generated/nl/linux/nlctrl.rbs +220 -544
  66. data/sig/generated/nl/linux/ovpn.rbs +835 -1859
  67. data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
  68. data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
  69. data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
  70. data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
  71. data/sig/generated/nl/linux/psp.rbs +550 -741
  72. data/sig/generated/nl/linux/rt_addr.rbs +188 -226
  73. data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
  74. data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
  75. data/sig/generated/nl/linux/rt_route.rbs +632 -862
  76. data/sig/generated/nl/linux/rt_rule.rbs +217 -639
  77. data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
  78. data/sig/generated/nl/linux/tc.rbs +6199 -13391
  79. data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
  80. data/sig/generated/nl/linux/team.rbs +232 -391
  81. data/sig/generated/nl/linux/wireguard.rbs +197 -502
  82. metadata +6 -6
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
2
  #
3
- # This file is based on Documentation/netlink/specs/net_shaper.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/net_shaper.yaml from Linux v7.3.
4
4
  #--
5
5
  # frozen_string_literal: true
6
6
  # This code is generated by Ynl::Generator. DO NOT EDIT.
@@ -54,7 +54,7 @@ class NetShaper < ::Nl::Genl::Family
54
54
  super
55
55
  end
56
56
  # @private
57
- MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
57
+ MCAST_GROUPS = {}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
58
58
  module Constants
59
59
  MAX_HANDLE_ID = 67108862
60
60
  end
@@ -87,639 +87,437 @@ class NetShaper < ::Nl::Genl::Family
87
87
  end
88
88
  module AttributeSets
89
89
  class NetShaper < ::Nl::AttributeSet
90
- # Abstract class
91
- class Attribute < ::Nl::AttributeSet::Attribute
90
+ module Definitions
91
+ # Unique identifier for the given shaper inside the owning device.
92
+ # @rbs return: AttributeSets::Handle
93
+ # @return [AttributeSets::Handle]
94
+ def handle; self[:"handle"]; end
95
+ # Metric used by the given shaper for bw-min, bw-max and burst.
96
+ #
97
+ # Known enum values are defined in {Enums::Metric}.
98
+ # @rbs return: ::Integer
99
+ # @return [Integer]
100
+ def metric; self[:"metric"]; end
101
+ # Guaranteed bandwidth for the given shaper.
102
+ # @rbs return: ::Integer
103
+ # @return [Integer]
104
+ def bw_min; self[:"bw_min"]; end
105
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
106
+ # @rbs return: ::Integer
107
+ # @return [Integer]
108
+ def bw_max; self[:"bw_max"]; end
109
+ # Maximum burst-size for shaping. Should not be interpreted
110
+ # as a quantum.
111
+ # @rbs return: ::Integer
112
+ # @return [Integer]
113
+ def burst; self[:"burst"]; end
114
+ # Scheduling priority for the given shaper. The priority
115
+ # scheduling is applied to sibling shapers.
116
+ # @rbs return: ::Integer
117
+ # @return [Integer]
118
+ def priority; self[:"priority"]; end
119
+ # Relative weight for round robin scheduling of the
120
+ # given shaper.
121
+ # The scheduling is applied to all sibling shapers
122
+ # with the same priority.
123
+ # @rbs return: ::Integer
124
+ # @return [Integer]
125
+ def weight; self[:"weight"]; end
126
+ # Interface index owning the specified shaper.
127
+ # @rbs return: ::Integer
128
+ # @return [Integer]
129
+ def ifindex; self[:"ifindex"]; end
130
+ # Identifier for the parent of the affected shaper.
131
+ # Only needed for `group` operation.
132
+ # @rbs return: AttributeSets::Handle
133
+ # @return [AttributeSets::Handle]
134
+ def parent; self[:"parent"]; end
135
+ # Describes a set of leaves shapers for a `group` operation.
136
+ # @rbs return: ::Array[AttributeSets::LeafInfo]
137
+ # @return [Array<AttributeSets::LeafInfo>]
138
+ def leaves; self[:"leaves"]; end
92
139
  end
93
- # Unique identifier for the given shaper inside the owning device.
94
- class Handle < Attribute
95
- TYPE = 1
96
- NAME = :"handle"
97
- # @private
98
- ORDER = 0
99
- end
100
- # Metric used by the given shaper for bw-min, bw-max and burst.
101
- #
102
- # Known enum values are defined in {Enums::Metric}.
103
- class Metric < Attribute
104
- TYPE = 2
105
- NAME = :"metric"
106
- # @private
107
- ORDER = 1
108
- # @private
109
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
110
- end
111
- # Guaranteed bandwidth for the given shaper.
112
- class BwMin < Attribute
113
- TYPE = 3
114
- NAME = :"bw_min"
115
- # @private
116
- ORDER = 2
117
- # @private
118
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
119
- end
120
- # Maximum bandwidth for the given shaper or 0 when unlimited.
121
- class BwMax < Attribute
122
- TYPE = 4
123
- NAME = :"bw_max"
124
- # @private
125
- ORDER = 3
126
- # @private
127
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
128
- end
129
- # Maximum burst-size for shaping. Should not be interpreted
130
- # as a quantum.
131
- class Burst < Attribute
132
- TYPE = 5
133
- NAME = :"burst"
134
- # @private
135
- ORDER = 4
136
- # @private
137
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
138
- end
139
- # Scheduling priority for the given shaper. The priority
140
- # scheduling is applied to sibling shapers.
141
- class Priority < Attribute
142
- TYPE = 6
143
- NAME = :"priority"
144
- # @private
145
- ORDER = 5
146
- # @private
147
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
148
- end
149
- # Relative weight for round robin scheduling of the
150
- # given shaper.
151
- # The scheduling is applied to all sibling shapers
152
- # with the same priority.
153
- class Weight < Attribute
154
- TYPE = 7
155
- NAME = :"weight"
156
- # @private
157
- ORDER = 6
158
- # @private
159
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
160
- end
161
- # Interface index owning the specified shaper.
162
- class Ifindex < Attribute
163
- TYPE = 8
164
- NAME = :"ifindex"
165
- # @private
166
- ORDER = 7
167
- # @private
168
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
169
- end
170
- # Identifier for the parent of the affected shaper.
171
- # Only needed for `group` operation.
172
- class Parent < Attribute
173
- TYPE = 9
174
- NAME = :"parent"
175
- # @private
176
- ORDER = 8
177
- end
178
- # Describes a set of leaves shapers for a `group` operation.
179
- class Leaves < Attribute
180
- TYPE = 10
181
- NAME = :"leaves"
182
- # @private
183
- MULTI = true
184
- # @private
185
- ORDER = 9
186
- end
187
- # @private
188
- BY_NAME = Ractor.make_shareable({:"handle" => Handle, :"metric" => Metric, :"bw_min" => BwMin, :"bw_max" => BwMax, :"burst" => Burst, :"priority" => Priority, :"weight" => Weight, :"ifindex" => Ifindex, :"parent" => Parent, :"leaves" => Leaves}) #: Hash[::Symbol, Attribute]
189
- # @private
190
- BY_TYPE = Ractor.make_shareable({1 => Handle, 2 => Metric, 3 => BwMin, 4 => BwMax, 5 => Burst, 6 => Priority, 7 => Weight, 8 => Ifindex, 9 => Parent, 10 => Leaves}) #: Hash[::Integer, Attribute]
191
- # Unique identifier for the given shaper inside the owning device.
192
- # @rbs return: AttributeSets::Handle
193
- # @return [AttributeSets::Handle]
194
- # @see Handle
195
- def handle; self[:"handle"]&.value; end
196
- # Metric used by the given shaper for bw-min, bw-max and burst.
197
- #
198
- # Known enum values are defined in {Enums::Metric}.
199
- # @rbs return: ::Integer
200
- # @return [Integer]
201
- # @see Metric
202
- def metric; self[:"metric"]&.value; end
203
- # Guaranteed bandwidth for the given shaper.
204
- # @rbs return: ::Integer
205
- # @return [Integer]
206
- # @see BwMin
207
- def bw_min; self[:"bw_min"]&.value; end
208
- # Maximum bandwidth for the given shaper or 0 when unlimited.
209
- # @rbs return: ::Integer
210
- # @return [Integer]
211
- # @see BwMax
212
- def bw_max; self[:"bw_max"]&.value; end
213
- # Maximum burst-size for shaping. Should not be interpreted
214
- # as a quantum.
215
- # @rbs return: ::Integer
216
- # @return [Integer]
217
- # @see Burst
218
- def burst; self[:"burst"]&.value; end
219
- # Scheduling priority for the given shaper. The priority
220
- # scheduling is applied to sibling shapers.
221
- # @rbs return: ::Integer
222
- # @return [Integer]
223
- # @see Priority
224
- def priority; self[:"priority"]&.value; end
225
- # Relative weight for round robin scheduling of the
226
- # given shaper.
227
- # The scheduling is applied to all sibling shapers
228
- # with the same priority.
229
- # @rbs return: ::Integer
230
- # @return [Integer]
231
- # @see Weight
232
- def weight; self[:"weight"]&.value; end
233
- # Interface index owning the specified shaper.
234
- # @rbs return: ::Integer
235
- # @return [Integer]
236
- # @see Ifindex
237
- def ifindex; self[:"ifindex"]&.value; end
238
- # Identifier for the parent of the affected shaper.
239
- # Only needed for `group` operation.
240
- # @rbs return: AttributeSets::Handle
241
- # @return [AttributeSets::Handle]
242
- # @see Parent
243
- def parent; self[:"parent"]&.value; end
244
- # Describes a set of leaves shapers for a `group` operation.
245
- # @rbs return: ::Array[AttributeSets::LeafInfo]
246
- # @return [Array<AttributeSets::LeafInfo>]
247
- # @see Leaves
248
- def leaves; self[:"leaves"].map(&:value); end
249
- class << self
250
- # Looks up Attribute class by name.
251
- # @rbs name: Symbol
252
- # @rbs return: Attribute
253
- # @param [Symbol] name
254
- # @return [Attribute]
255
- def by_name(name); BY_NAME.fetch(name); end
256
- # Looks up Attribute class by type value.
257
- # @rbs type: Integer
258
- # @rbs return: Attribute
259
- # @param [Integer] type
260
- # @return [Attribute]
261
- def by_type(type); BY_TYPE.fetch(type); end
140
+ include Definitions
141
+ # Decodes attributes from the decoder into a new attribute set.
142
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
143
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
144
+ super(decoder, BY_TYPE, 0, external_selectors)
262
145
  end
263
146
  end
264
147
  class Handle < ::Nl::AttributeSet
265
- # Abstract class
266
- class Attribute < ::Nl::AttributeSet::Attribute
267
- end
268
- # Defines the shaper `id` interpretation.
269
- #
270
- # Known enum values are defined in {Enums::Scope}.
271
- class Scope < Attribute
272
- TYPE = 1
273
- NAME = :"scope"
274
- # @private
275
- ORDER = 0
276
- # @private
277
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
278
- end
279
- # Numeric identifier of a shaper. The id semantic depends on
280
- # the scope. For `queue` scope it's the queue id and for `node`
281
- # scope it's the node identifier.
282
- class Id < Attribute
283
- TYPE = 2
284
- NAME = :"id"
285
- # @private
286
- ORDER = 1
287
- # @private
288
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum #{Constants::MAX_HANDLE_ID}" unless it <= Constants::MAX_HANDLE_ID })
148
+ module Definitions
149
+ # Defines the shaper `id` interpretation.
150
+ #
151
+ # Known enum values are defined in {Enums::Scope}.
152
+ # @rbs return: ::Integer
153
+ # @return [Integer]
154
+ def scope; self[:"scope"]; end
155
+ # Numeric identifier of a shaper. The id semantic depends on
156
+ # the scope. For `queue` scope it's the queue id and for `node`
157
+ # scope it's the node identifier.
158
+ # @rbs return: ::Integer
159
+ # @return [Integer]
160
+ def id; self[:"id"]; end
289
161
  end
290
- # @private
291
- BY_NAME = Ractor.make_shareable({:"scope" => Scope, :"id" => Id}) #: Hash[::Symbol, Attribute]
292
- # @private
293
- BY_TYPE = Ractor.make_shareable({1 => Scope, 2 => Id}) #: Hash[::Integer, Attribute]
294
- # Defines the shaper `id` interpretation.
295
- #
296
- # Known enum values are defined in {Enums::Scope}.
297
- # @rbs return: ::Integer
298
- # @return [Integer]
299
- # @see Scope
300
- def scope; self[:"scope"]&.value; end
301
- # Numeric identifier of a shaper. The id semantic depends on
302
- # the scope. For `queue` scope it's the queue id and for `node`
303
- # scope it's the node identifier.
304
- # @rbs return: ::Integer
305
- # @return [Integer]
306
- # @see Id
307
- def id; self[:"id"]&.value; end
308
- class << self
309
- # Looks up Attribute class by name.
310
- # @rbs name: Symbol
311
- # @rbs return: Attribute
312
- # @param [Symbol] name
313
- # @return [Attribute]
314
- def by_name(name); BY_NAME.fetch(name); end
315
- # Looks up Attribute class by type value.
316
- # @rbs type: Integer
317
- # @rbs return: Attribute
318
- # @param [Integer] type
319
- # @return [Attribute]
320
- def by_type(type); BY_TYPE.fetch(type); end
162
+ include Definitions
163
+ # Decodes attributes from the decoder into a new attribute set.
164
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
165
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
166
+ super(decoder, BY_TYPE, 0, external_selectors)
321
167
  end
322
168
  end
323
169
  class LeafInfo < ::Nl::AttributeSet
324
- # Abstract class
325
- class Attribute < ::Nl::AttributeSet::Attribute
170
+ module Definitions
171
+ # Unique identifier for the given shaper inside the owning device.
172
+ # @rbs return: AttributeSets::Handle
173
+ # @return [AttributeSets::Handle]
174
+ def handle; self[:"handle"]; end
175
+ # Scheduling priority for the given shaper. The priority
176
+ # scheduling is applied to sibling shapers.
177
+ # @rbs return: ::Integer
178
+ # @return [Integer]
179
+ def priority; self[:"priority"]; end
180
+ # Relative weight for round robin scheduling of the
181
+ # given shaper.
182
+ # The scheduling is applied to all sibling shapers
183
+ # with the same priority.
184
+ # @rbs return: ::Integer
185
+ # @return [Integer]
186
+ def weight; self[:"weight"]; end
326
187
  end
327
- # Unique identifier for the given shaper inside the owning device.
328
- class Handle < Attribute
329
- TYPE = 1
330
- NAME = :"handle"
331
- # @private
332
- ORDER = 0
333
- end
334
- # Scheduling priority for the given shaper. The priority
335
- # scheduling is applied to sibling shapers.
336
- class Priority < Attribute
337
- TYPE = 6
338
- NAME = :"priority"
339
- # @private
340
- ORDER = 1
341
- # @private
342
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
343
- end
344
- # Relative weight for round robin scheduling of the
345
- # given shaper.
346
- # The scheduling is applied to all sibling shapers
347
- # with the same priority.
348
- class Weight < Attribute
349
- TYPE = 7
350
- NAME = :"weight"
351
- # @private
352
- ORDER = 2
353
- # @private
354
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
355
- end
356
- # @private
357
- BY_NAME = Ractor.make_shareable({:"handle" => Handle, :"priority" => Priority, :"weight" => Weight}) #: Hash[::Symbol, Attribute]
358
- # @private
359
- BY_TYPE = Ractor.make_shareable({1 => Handle, 6 => Priority, 7 => Weight}) #: Hash[::Integer, Attribute]
360
- # Unique identifier for the given shaper inside the owning device.
361
- # @rbs return: AttributeSets::Handle
362
- # @return [AttributeSets::Handle]
363
- # @see Handle
364
- def handle; self[:"handle"]&.value; end
365
- # Scheduling priority for the given shaper. The priority
366
- # scheduling is applied to sibling shapers.
367
- # @rbs return: ::Integer
368
- # @return [Integer]
369
- # @see Priority
370
- def priority; self[:"priority"]&.value; end
371
- # Relative weight for round robin scheduling of the
372
- # given shaper.
373
- # The scheduling is applied to all sibling shapers
374
- # with the same priority.
375
- # @rbs return: ::Integer
376
- # @return [Integer]
377
- # @see Weight
378
- def weight; self[:"weight"]&.value; end
379
- class << self
380
- # Looks up Attribute class by name.
381
- # @rbs name: Symbol
382
- # @rbs return: Attribute
383
- # @param [Symbol] name
384
- # @return [Attribute]
385
- def by_name(name); BY_NAME.fetch(name); end
386
- # Looks up Attribute class by type value.
387
- # @rbs type: Integer
388
- # @rbs return: Attribute
389
- # @param [Integer] type
390
- # @return [Attribute]
391
- def by_type(type); BY_TYPE.fetch(type); end
188
+ include Definitions
189
+ # Decodes attributes from the decoder into a new attribute set.
190
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
191
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
192
+ super(decoder, BY_TYPE, 0, external_selectors)
392
193
  end
393
194
  end
394
195
  class Caps < ::Nl::AttributeSet
395
- # Abstract class
396
- class Attribute < ::Nl::AttributeSet::Attribute
397
- end
398
- # Interface index queried for shapers capabilities.
399
- class Ifindex < Attribute
400
- TYPE = 1
401
- NAME = :"ifindex"
402
- # @private
403
- ORDER = 0
404
- # @private
405
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
406
- end
407
- # The scope to which the queried capabilities apply.
408
- #
409
- # Known enum values are defined in {Enums::Scope}.
410
- class Scope < Attribute
411
- TYPE = 2
412
- NAME = :"scope"
413
- # @private
414
- ORDER = 1
415
- # @private
416
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
417
- end
418
- # The device accepts 'bps' metric for bw-min, bw-max and burst.
419
- class SupportMetricBps < Attribute
420
- TYPE = 3
421
- NAME = :"support_metric_bps"
422
- # @private
423
- ORDER = 2
424
- # @private
425
- DATATYPE = ::Nl::DataTypes::Flag.new
426
- end
427
- # The device accepts 'pps' metric for bw-min, bw-max and burst.
428
- class SupportMetricPps < Attribute
429
- TYPE = 4
430
- NAME = :"support_metric_pps"
431
- # @private
432
- ORDER = 3
433
- # @private
434
- DATATYPE = ::Nl::DataTypes::Flag.new
435
- end
436
- # The device supports nesting shaper belonging to this scope
437
- # below 'node' scoped shapers. Only 'queue' and 'node'
438
- # scope can have flag 'support-nesting'.
439
- class SupportNesting < Attribute
440
- TYPE = 5
441
- NAME = :"support_nesting"
442
- # @private
443
- ORDER = 4
444
- # @private
445
- DATATYPE = ::Nl::DataTypes::Flag.new
196
+ module Definitions
197
+ # Interface index queried for shapers capabilities.
198
+ # @rbs return: ::Integer
199
+ # @return [Integer]
200
+ def ifindex; self[:"ifindex"]; end
201
+ # The scope to which the queried capabilities apply.
202
+ #
203
+ # Known enum values are defined in {Enums::Scope}.
204
+ # @rbs return: ::Integer
205
+ # @return [Integer]
206
+ def scope; self[:"scope"]; end
207
+ # The device accepts 'bps' metric for bw-min, bw-max and burst.
208
+ # @rbs return: ::Integer
209
+ # @return [Integer]
210
+ def support_metric_bps; self[:"support_metric_bps"]; end
211
+ # The device accepts 'pps' metric for bw-min, bw-max and burst.
212
+ # @rbs return: ::Integer
213
+ # @return [Integer]
214
+ def support_metric_pps; self[:"support_metric_pps"]; end
215
+ # The device supports nesting shaper belonging to this scope
216
+ # below 'node' scoped shapers. Only 'queue' and 'node'
217
+ # scope can have flag 'support-nesting'.
218
+ # @rbs return: ::Integer
219
+ # @return [Integer]
220
+ def support_nesting; self[:"support_nesting"]; end
221
+ # The device supports a minimum guaranteed B/W.
222
+ # @rbs return: ::Integer
223
+ # @return [Integer]
224
+ def support_bw_min; self[:"support_bw_min"]; end
225
+ # The device supports maximum B/W shaping.
226
+ # @rbs return: ::Integer
227
+ # @return [Integer]
228
+ def support_bw_max; self[:"support_bw_max"]; end
229
+ # The device supports a maximum burst size.
230
+ # @rbs return: ::Integer
231
+ # @return [Integer]
232
+ def support_burst; self[:"support_burst"]; end
233
+ # The device supports priority scheduling.
234
+ # @rbs return: ::Integer
235
+ # @return [Integer]
236
+ def support_priority; self[:"support_priority"]; end
237
+ # The device supports weighted round robin scheduling.
238
+ # @rbs return: ::Integer
239
+ # @return [Integer]
240
+ def support_weight; self[:"support_weight"]; end
446
241
  end
447
- # The device supports a minimum guaranteed B/W.
448
- class SupportBwMin < Attribute
449
- TYPE = 6
450
- NAME = :"support_bw_min"
451
- # @private
452
- ORDER = 5
453
- # @private
454
- DATATYPE = ::Nl::DataTypes::Flag.new
242
+ include Definitions
243
+ # Decodes attributes from the decoder into a new attribute set.
244
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
245
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
246
+ super(decoder, BY_TYPE, 0, external_selectors)
455
247
  end
456
- # The device supports maximum B/W shaping.
457
- class SupportBwMax < Attribute
458
- TYPE = 7
459
- NAME = :"support_bw_max"
248
+ end
249
+ end
250
+ module AttributeSets
251
+ class NetShaper
252
+ module Definitions
460
253
  # @private
461
- ORDER = 6
254
+ BY_TYPE = ::Array.new(11).tap do |definitions|
255
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"handle", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
256
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"metric", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
257
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"bw_min", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 2, selector_slot: nil)
258
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"bw_max", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 3, selector_slot: nil)
259
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"burst", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 4, selector_slot: nil)
260
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"priority", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
261
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"weight", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 6, selector_slot: nil)
262
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
263
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"parent", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: []), multi: false, order: 8, selector_slot: nil)
264
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"leaves", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::LeafInfo, selector_bindings: []), multi: true, order: 9, selector_slot: nil)
265
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
266
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
462
267
  # @private
463
- DATATYPE = ::Nl::DataTypes::Flag.new
268
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
464
269
  end
465
- # The device supports a maximum burst size.
466
- class SupportBurst < Attribute
467
- TYPE = 8
468
- NAME = :"support_burst"
270
+ end
271
+ class Handle
272
+ module Definitions
469
273
  # @private
470
- ORDER = 7
274
+ BY_TYPE = ::Array.new(3).tap do |definitions|
275
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"scope", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
276
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"id", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum #{Constants::MAX_HANDLE_ID}" unless it <= Constants::MAX_HANDLE_ID } }), multi: false, order: 1, selector_slot: nil)
277
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
278
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
471
279
  # @private
472
- DATATYPE = ::Nl::DataTypes::Flag.new
280
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
473
281
  end
474
- # The device supports priority scheduling.
475
- class SupportPriority < Attribute
476
- TYPE = 9
477
- NAME = :"support_priority"
282
+ end
283
+ class LeafInfo
284
+ module Definitions
478
285
  # @private
479
- ORDER = 8
286
+ BY_TYPE = ::Array.new(8).tap do |definitions|
287
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"handle", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
288
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"priority", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
289
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"weight", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 2, selector_slot: nil)
290
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
291
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
480
292
  # @private
481
- DATATYPE = ::Nl::DataTypes::Flag.new
293
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
482
294
  end
483
- # The device supports weighted round robin scheduling.
484
- class SupportWeight < Attribute
485
- TYPE = 10
486
- NAME = :"support_weight"
295
+ end
296
+ class Caps
297
+ module Definitions
487
298
  # @private
488
- ORDER = 9
299
+ BY_TYPE = ::Array.new(11).tap do |definitions|
300
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
301
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"scope", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
302
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"support_metric_bps", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 2, selector_slot: nil)
303
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"support_metric_pps", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 3, selector_slot: nil)
304
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"support_nesting", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 4, selector_slot: nil)
305
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"support_bw_min", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 5, selector_slot: nil)
306
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"support_bw_max", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 6, selector_slot: nil)
307
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"support_burst", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 7, selector_slot: nil)
308
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"support_priority", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 8, selector_slot: nil)
309
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"support_weight", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 9, selector_slot: nil)
310
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
311
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
489
312
  # @private
490
- DATATYPE = ::Nl::DataTypes::Flag.new
491
- end
492
- # @private
493
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"scope" => Scope, :"support_metric_bps" => SupportMetricBps, :"support_metric_pps" => SupportMetricPps, :"support_nesting" => SupportNesting, :"support_bw_min" => SupportBwMin, :"support_bw_max" => SupportBwMax, :"support_burst" => SupportBurst, :"support_priority" => SupportPriority, :"support_weight" => SupportWeight}) #: Hash[::Symbol, Attribute]
494
- # @private
495
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Scope, 3 => SupportMetricBps, 4 => SupportMetricPps, 5 => SupportNesting, 6 => SupportBwMin, 7 => SupportBwMax, 8 => SupportBurst, 9 => SupportPriority, 10 => SupportWeight}) #: Hash[::Integer, Attribute]
496
- # Interface index queried for shapers capabilities.
497
- # @rbs return: ::Integer
498
- # @return [Integer]
499
- # @see Ifindex
500
- def ifindex; self[:"ifindex"]&.value; end
501
- # The scope to which the queried capabilities apply.
502
- #
503
- # Known enum values are defined in {Enums::Scope}.
504
- # @rbs return: ::Integer
505
- # @return [Integer]
506
- # @see Scope
507
- def scope; self[:"scope"]&.value; end
508
- # The device accepts 'bps' metric for bw-min, bw-max and burst.
509
- # @rbs return: ::Integer
510
- # @return [Integer]
511
- # @see SupportMetricBps
512
- def support_metric_bps; self[:"support_metric_bps"]&.value; end
513
- # The device accepts 'pps' metric for bw-min, bw-max and burst.
514
- # @rbs return: ::Integer
515
- # @return [Integer]
516
- # @see SupportMetricPps
517
- def support_metric_pps; self[:"support_metric_pps"]&.value; end
518
- # The device supports nesting shaper belonging to this scope
519
- # below 'node' scoped shapers. Only 'queue' and 'node'
520
- # scope can have flag 'support-nesting'.
521
- # @rbs return: ::Integer
522
- # @return [Integer]
523
- # @see SupportNesting
524
- def support_nesting; self[:"support_nesting"]&.value; end
525
- # The device supports a minimum guaranteed B/W.
526
- # @rbs return: ::Integer
527
- # @return [Integer]
528
- # @see SupportBwMin
529
- def support_bw_min; self[:"support_bw_min"]&.value; end
530
- # The device supports maximum B/W shaping.
531
- # @rbs return: ::Integer
532
- # @return [Integer]
533
- # @see SupportBwMax
534
- def support_bw_max; self[:"support_bw_max"]&.value; end
535
- # The device supports a maximum burst size.
536
- # @rbs return: ::Integer
537
- # @return [Integer]
538
- # @see SupportBurst
539
- def support_burst; self[:"support_burst"]&.value; end
540
- # The device supports priority scheduling.
541
- # @rbs return: ::Integer
542
- # @return [Integer]
543
- # @see SupportPriority
544
- def support_priority; self[:"support_priority"]&.value; end
545
- # The device supports weighted round robin scheduling.
546
- # @rbs return: ::Integer
547
- # @return [Integer]
548
- # @see SupportWeight
549
- def support_weight; self[:"support_weight"]&.value; end
550
- class << self
551
- # Looks up Attribute class by name.
552
- # @rbs name: Symbol
553
- # @rbs return: Attribute
554
- # @param [Symbol] name
555
- # @return [Attribute]
556
- def by_name(name); BY_NAME.fetch(name); end
557
- # Looks up Attribute class by type value.
558
- # @rbs type: Integer
559
- # @rbs return: Attribute
560
- # @param [Integer] type
561
- # @return [Attribute]
562
- def by_type(type); BY_TYPE.fetch(type); end
313
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
563
314
  end
564
315
  end
565
- # @private
566
- NetShaper::Handle::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: Ractor.make_shareable([]))
567
- # @private
568
- NetShaper::Parent::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: Ractor.make_shareable([]))
569
- # @private
570
- NetShaper::Leaves::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::LeafInfo, selector_bindings: Ractor.make_shareable([]))
571
- # @private
572
- LeafInfo::Handle::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Handle, selector_bindings: Ractor.make_shareable([]))
573
316
  end
574
317
  module Messages
575
318
  # Get information about a shaper for a given device.
576
- class DoGetRequest < ::Nl::Genl::Message
319
+ class DoGetRequest < ::Nl::Message
577
320
  TYPE = 1
578
321
  FIXED_HEADER = nil
579
322
  ATTRIBUTE_SET = AttributeSets::NetShaper
580
- ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
323
+ ATTRIBUTES = %i[handle ifindex].freeze
324
+ include ATTRIBUTE_SET::Definitions
325
+ def initialize(attributes = [])
326
+ @attributes = attributes
327
+ end
328
+ # @private
329
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
330
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
331
+ new(
332
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
333
+ )
334
+ end
335
+ # Decodes a message payload from the decoder into a new instance.
336
+ # @rbs (::Nl::Decoder decoder) -> instance
337
+ def self.decode(decoder)
338
+ new(decode_attributes(decoder, BY_TYPE, 0))
339
+ end
340
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
341
+ encode_attributes(encoder, external_selectors:)
342
+ end
581
343
  # Unique identifier for the given shaper inside the owning device.
582
344
  # @rbs return: AttributeSets::Handle
583
345
  # @return [AttributeSets::Handle]
584
- # @see AttributeSets::NetShaper::Handle
585
- def handle; attributes[:"handle"]&.value; end
346
+ def handle; self[:"handle"]; end
586
347
  # Interface index owning the specified shaper.
587
348
  # @rbs return: ::Integer
588
349
  # @return [Integer]
589
- # @see AttributeSets::NetShaper::Ifindex
590
- def ifindex; attributes[:"ifindex"]&.value; end
350
+ def ifindex; self[:"ifindex"]; end
591
351
  end
592
352
  # Get information about a shaper for a given device.
593
- class DoGetReply < ::Nl::Genl::Message
353
+ class DoGetReply < ::Nl::Message
594
354
  TYPE = 1
595
355
  FIXED_HEADER = nil
596
356
  ATTRIBUTE_SET = AttributeSets::NetShaper
597
- ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
357
+ ATTRIBUTES = %i[handle metric bw_min bw_max burst priority weight ifindex parent].freeze
358
+ include ATTRIBUTE_SET::Definitions
359
+ def initialize(attributes = [])
360
+ @attributes = attributes
361
+ end
362
+ # @private
363
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
364
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
365
+ new(
366
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
367
+ )
368
+ end
369
+ # Decodes a message payload from the decoder into a new instance.
370
+ # @rbs (::Nl::Decoder decoder) -> instance
371
+ def self.decode(decoder)
372
+ new(decode_attributes(decoder, BY_TYPE, 0))
373
+ end
374
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
375
+ encode_attributes(encoder, external_selectors:)
376
+ end
598
377
  # Unique identifier for the given shaper inside the owning device.
599
378
  # @rbs return: AttributeSets::Handle
600
379
  # @return [AttributeSets::Handle]
601
- # @see AttributeSets::NetShaper::Handle
602
- def handle; attributes[:"handle"]&.value; end
380
+ def handle; self[:"handle"]; end
603
381
  # Metric used by the given shaper for bw-min, bw-max and burst.
604
382
  #
605
383
  # Known enum values are defined in {Enums::Metric}.
606
384
  # @rbs return: ::Integer
607
385
  # @return [Integer]
608
- # @see AttributeSets::NetShaper::Metric
609
- def metric; attributes[:"metric"]&.value; end
386
+ def metric; self[:"metric"]; end
610
387
  # Guaranteed bandwidth for the given shaper.
611
388
  # @rbs return: ::Integer
612
389
  # @return [Integer]
613
- # @see AttributeSets::NetShaper::BwMin
614
- def bw_min; attributes[:"bw_min"]&.value; end
390
+ def bw_min; self[:"bw_min"]; end
615
391
  # Maximum bandwidth for the given shaper or 0 when unlimited.
616
392
  # @rbs return: ::Integer
617
393
  # @return [Integer]
618
- # @see AttributeSets::NetShaper::BwMax
619
- def bw_max; attributes[:"bw_max"]&.value; end
394
+ def bw_max; self[:"bw_max"]; end
620
395
  # Maximum burst-size for shaping. Should not be interpreted
621
396
  # as a quantum.
622
397
  # @rbs return: ::Integer
623
398
  # @return [Integer]
624
- # @see AttributeSets::NetShaper::Burst
625
- def burst; attributes[:"burst"]&.value; end
399
+ def burst; self[:"burst"]; end
626
400
  # Scheduling priority for the given shaper. The priority
627
401
  # scheduling is applied to sibling shapers.
628
402
  # @rbs return: ::Integer
629
403
  # @return [Integer]
630
- # @see AttributeSets::NetShaper::Priority
631
- def priority; attributes[:"priority"]&.value; end
404
+ def priority; self[:"priority"]; end
632
405
  # Relative weight for round robin scheduling of the
633
406
  # given shaper.
634
407
  # The scheduling is applied to all sibling shapers
635
408
  # with the same priority.
636
409
  # @rbs return: ::Integer
637
410
  # @return [Integer]
638
- # @see AttributeSets::NetShaper::Weight
639
- def weight; attributes[:"weight"]&.value; end
411
+ def weight; self[:"weight"]; end
640
412
  # Interface index owning the specified shaper.
641
413
  # @rbs return: ::Integer
642
414
  # @return [Integer]
643
- # @see AttributeSets::NetShaper::Ifindex
644
- def ifindex; attributes[:"ifindex"]&.value; end
415
+ def ifindex; self[:"ifindex"]; end
645
416
  # Identifier for the parent of the affected shaper.
646
417
  # Only needed for `group` operation.
647
418
  # @rbs return: AttributeSets::Handle
648
419
  # @return [AttributeSets::Handle]
649
- # @see AttributeSets::NetShaper::Parent
650
- def parent; attributes[:"parent"]&.value; end
420
+ def parent; self[:"parent"]; end
651
421
  end
652
422
  # Get information about a shaper for a given device.
653
- class DumpGetRequest < ::Nl::Genl::Message
423
+ class DumpGetRequest < ::Nl::Message
654
424
  TYPE = 1
655
425
  FIXED_HEADER = nil
656
426
  ATTRIBUTE_SET = AttributeSets::NetShaper
657
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
427
+ ATTRIBUTES = %i[ifindex].freeze
428
+ include ATTRIBUTE_SET::Definitions
429
+ def initialize(attributes = [])
430
+ @attributes = attributes
431
+ end
432
+ # @private
433
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
434
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
435
+ new(
436
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
437
+ )
438
+ end
439
+ # Decodes a message payload from the decoder into a new instance.
440
+ # @rbs (::Nl::Decoder decoder) -> instance
441
+ def self.decode(decoder)
442
+ new(decode_attributes(decoder, BY_TYPE, 0))
443
+ end
444
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
445
+ encode_attributes(encoder, external_selectors:)
446
+ end
658
447
  # Interface index owning the specified shaper.
659
448
  # @rbs return: ::Integer
660
449
  # @return [Integer]
661
- # @see AttributeSets::NetShaper::Ifindex
662
- def ifindex; attributes[:"ifindex"]&.value; end
450
+ def ifindex; self[:"ifindex"]; end
663
451
  end
664
452
  # Get information about a shaper for a given device.
665
- class DumpGetReply < ::Nl::Genl::Message
453
+ class DumpGetReply < ::Nl::Message
666
454
  TYPE = 1
667
455
  FIXED_HEADER = nil
668
456
  ATTRIBUTE_SET = AttributeSets::NetShaper
669
- ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
457
+ ATTRIBUTES = %i[handle metric bw_min bw_max burst priority weight ifindex parent].freeze
458
+ include ATTRIBUTE_SET::Definitions
459
+ def initialize(attributes = [])
460
+ @attributes = attributes
461
+ end
462
+ # @private
463
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
464
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
465
+ new(
466
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
467
+ )
468
+ end
469
+ # Decodes a message payload from the decoder into a new instance.
470
+ # @rbs (::Nl::Decoder decoder) -> instance
471
+ def self.decode(decoder)
472
+ new(decode_attributes(decoder, BY_TYPE, 0))
473
+ end
474
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
475
+ encode_attributes(encoder, external_selectors:)
476
+ end
670
477
  # Unique identifier for the given shaper inside the owning device.
671
478
  # @rbs return: AttributeSets::Handle
672
479
  # @return [AttributeSets::Handle]
673
- # @see AttributeSets::NetShaper::Handle
674
- def handle; attributes[:"handle"]&.value; end
480
+ def handle; self[:"handle"]; end
675
481
  # Metric used by the given shaper for bw-min, bw-max and burst.
676
482
  #
677
483
  # Known enum values are defined in {Enums::Metric}.
678
484
  # @rbs return: ::Integer
679
485
  # @return [Integer]
680
- # @see AttributeSets::NetShaper::Metric
681
- def metric; attributes[:"metric"]&.value; end
486
+ def metric; self[:"metric"]; end
682
487
  # Guaranteed bandwidth for the given shaper.
683
488
  # @rbs return: ::Integer
684
489
  # @return [Integer]
685
- # @see AttributeSets::NetShaper::BwMin
686
- def bw_min; attributes[:"bw_min"]&.value; end
490
+ def bw_min; self[:"bw_min"]; end
687
491
  # Maximum bandwidth for the given shaper or 0 when unlimited.
688
492
  # @rbs return: ::Integer
689
493
  # @return [Integer]
690
- # @see AttributeSets::NetShaper::BwMax
691
- def bw_max; attributes[:"bw_max"]&.value; end
494
+ def bw_max; self[:"bw_max"]; end
692
495
  # Maximum burst-size for shaping. Should not be interpreted
693
496
  # as a quantum.
694
497
  # @rbs return: ::Integer
695
498
  # @return [Integer]
696
- # @see AttributeSets::NetShaper::Burst
697
- def burst; attributes[:"burst"]&.value; end
499
+ def burst; self[:"burst"]; end
698
500
  # Scheduling priority for the given shaper. The priority
699
501
  # scheduling is applied to sibling shapers.
700
502
  # @rbs return: ::Integer
701
503
  # @return [Integer]
702
- # @see AttributeSets::NetShaper::Priority
703
- def priority; attributes[:"priority"]&.value; end
504
+ def priority; self[:"priority"]; end
704
505
  # Relative weight for round robin scheduling of the
705
506
  # given shaper.
706
507
  # The scheduling is applied to all sibling shapers
707
508
  # with the same priority.
708
509
  # @rbs return: ::Integer
709
510
  # @return [Integer]
710
- # @see AttributeSets::NetShaper::Weight
711
- def weight; attributes[:"weight"]&.value; end
511
+ def weight; self[:"weight"]; end
712
512
  # Interface index owning the specified shaper.
713
513
  # @rbs return: ::Integer
714
514
  # @return [Integer]
715
- # @see AttributeSets::NetShaper::Ifindex
716
- def ifindex; attributes[:"ifindex"]&.value; end
515
+ def ifindex; self[:"ifindex"]; end
717
516
  # Identifier for the parent of the affected shaper.
718
517
  # Only needed for `group` operation.
719
518
  # @rbs return: AttributeSets::Handle
720
519
  # @return [AttributeSets::Handle]
721
- # @see AttributeSets::NetShaper::Parent
722
- def parent; attributes[:"parent"]&.value; end
520
+ def parent; self[:"parent"]; end
723
521
  end
724
522
  # Create or update the specified shaper.
725
523
  # The set operation can't be used to create a `node` scope shaper,
@@ -727,58 +525,69 @@ class NetShaper < ::Nl::Genl::Family
727
525
  #
728
526
  #
729
527
  # Requires CAP_NET_ADMIN in the initial user namespace.
730
- class DoSetRequest < ::Nl::Genl::Message
528
+ class DoSetRequest < ::Nl::Message
731
529
  TYPE = 2
732
530
  FIXED_HEADER = nil
733
531
  ATTRIBUTE_SET = AttributeSets::NetShaper
734
- ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex])
532
+ ATTRIBUTES = %i[handle metric bw_min bw_max burst priority weight ifindex].freeze
533
+ include ATTRIBUTE_SET::Definitions
534
+ def initialize(attributes = [])
535
+ @attributes = attributes
536
+ end
537
+ # @private
538
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
539
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
540
+ new(
541
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
542
+ )
543
+ end
544
+ # Decodes a message payload from the decoder into a new instance.
545
+ # @rbs (::Nl::Decoder decoder) -> instance
546
+ def self.decode(decoder)
547
+ new(decode_attributes(decoder, BY_TYPE, 0))
548
+ end
549
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
550
+ encode_attributes(encoder, external_selectors:)
551
+ end
735
552
  # Unique identifier for the given shaper inside the owning device.
736
553
  # @rbs return: AttributeSets::Handle
737
554
  # @return [AttributeSets::Handle]
738
- # @see AttributeSets::NetShaper::Handle
739
- def handle; attributes[:"handle"]&.value; end
555
+ def handle; self[:"handle"]; end
740
556
  # Metric used by the given shaper for bw-min, bw-max and burst.
741
557
  #
742
558
  # Known enum values are defined in {Enums::Metric}.
743
559
  # @rbs return: ::Integer
744
560
  # @return [Integer]
745
- # @see AttributeSets::NetShaper::Metric
746
- def metric; attributes[:"metric"]&.value; end
561
+ def metric; self[:"metric"]; end
747
562
  # Guaranteed bandwidth for the given shaper.
748
563
  # @rbs return: ::Integer
749
564
  # @return [Integer]
750
- # @see AttributeSets::NetShaper::BwMin
751
- def bw_min; attributes[:"bw_min"]&.value; end
565
+ def bw_min; self[:"bw_min"]; end
752
566
  # Maximum bandwidth for the given shaper or 0 when unlimited.
753
567
  # @rbs return: ::Integer
754
568
  # @return [Integer]
755
- # @see AttributeSets::NetShaper::BwMax
756
- def bw_max; attributes[:"bw_max"]&.value; end
569
+ def bw_max; self[:"bw_max"]; end
757
570
  # Maximum burst-size for shaping. Should not be interpreted
758
571
  # as a quantum.
759
572
  # @rbs return: ::Integer
760
573
  # @return [Integer]
761
- # @see AttributeSets::NetShaper::Burst
762
- def burst; attributes[:"burst"]&.value; end
574
+ def burst; self[:"burst"]; end
763
575
  # Scheduling priority for the given shaper. The priority
764
576
  # scheduling is applied to sibling shapers.
765
577
  # @rbs return: ::Integer
766
578
  # @return [Integer]
767
- # @see AttributeSets::NetShaper::Priority
768
- def priority; attributes[:"priority"]&.value; end
579
+ def priority; self[:"priority"]; end
769
580
  # Relative weight for round robin scheduling of the
770
581
  # given shaper.
771
582
  # The scheduling is applied to all sibling shapers
772
583
  # with the same priority.
773
584
  # @rbs return: ::Integer
774
585
  # @return [Integer]
775
- # @see AttributeSets::NetShaper::Weight
776
- def weight; attributes[:"weight"]&.value; end
586
+ def weight; self[:"weight"]; end
777
587
  # Interface index owning the specified shaper.
778
588
  # @rbs return: ::Integer
779
589
  # @return [Integer]
780
- # @see AttributeSets::NetShaper::Ifindex
781
- def ifindex; attributes[:"ifindex"]&.value; end
590
+ def ifindex; self[:"ifindex"]; end
782
591
  end
783
592
  # Clear (remove) the specified shaper. When deleting
784
593
  # a `node` shaper, reattach all the node's leaves to the
@@ -794,21 +603,38 @@ class NetShaper < ::Nl::Genl::Family
794
603
  #
795
604
  #
796
605
  # Requires CAP_NET_ADMIN in the initial user namespace.
797
- class DoDeleteRequest < ::Nl::Genl::Message
606
+ class DoDeleteRequest < ::Nl::Message
798
607
  TYPE = 3
799
608
  FIXED_HEADER = nil
800
609
  ATTRIBUTE_SET = AttributeSets::NetShaper
801
- ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
610
+ ATTRIBUTES = %i[handle ifindex].freeze
611
+ include ATTRIBUTE_SET::Definitions
612
+ def initialize(attributes = [])
613
+ @attributes = attributes
614
+ end
615
+ # @private
616
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
617
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
618
+ new(
619
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
620
+ )
621
+ end
622
+ # Decodes a message payload from the decoder into a new instance.
623
+ # @rbs (::Nl::Decoder decoder) -> instance
624
+ def self.decode(decoder)
625
+ new(decode_attributes(decoder, BY_TYPE, 0))
626
+ end
627
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
628
+ encode_attributes(encoder, external_selectors:)
629
+ end
802
630
  # Unique identifier for the given shaper inside the owning device.
803
631
  # @rbs return: AttributeSets::Handle
804
632
  # @return [AttributeSets::Handle]
805
- # @see AttributeSets::NetShaper::Handle
806
- def handle; attributes[:"handle"]&.value; end
633
+ def handle; self[:"handle"]; end
807
634
  # Interface index owning the specified shaper.
808
635
  # @rbs return: ::Integer
809
636
  # @return [Integer]
810
- # @see AttributeSets::NetShaper::Ifindex
811
- def ifindex; attributes[:"ifindex"]&.value; end
637
+ def ifindex; self[:"ifindex"]; end
812
638
  end
813
639
  # Create or update a scheduling group, attaching the specified
814
640
  # `leaves` shapers under the specified node identified by `handle.`
@@ -832,69 +658,78 @@ class NetShaper < ::Nl::Genl::Family
832
658
  #
833
659
  #
834
660
  # Requires CAP_NET_ADMIN in the initial user namespace.
835
- class DoGroupRequest < ::Nl::Genl::Message
661
+ class DoGroupRequest < ::Nl::Message
836
662
  TYPE = 4
837
663
  FIXED_HEADER = nil
838
664
  ATTRIBUTE_SET = AttributeSets::NetShaper
839
- ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent leaves])
665
+ ATTRIBUTES = %i[handle metric bw_min bw_max burst priority weight ifindex parent leaves].freeze
666
+ include ATTRIBUTE_SET::Definitions
667
+ def initialize(attributes = [])
668
+ @attributes = attributes
669
+ end
670
+ # @private
671
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
672
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
673
+ new(
674
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
675
+ )
676
+ end
677
+ # Decodes a message payload from the decoder into a new instance.
678
+ # @rbs (::Nl::Decoder decoder) -> instance
679
+ def self.decode(decoder)
680
+ new(decode_attributes(decoder, BY_TYPE, 0))
681
+ end
682
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
683
+ encode_attributes(encoder, external_selectors:)
684
+ end
840
685
  # Unique identifier for the given shaper inside the owning device.
841
686
  # @rbs return: AttributeSets::Handle
842
687
  # @return [AttributeSets::Handle]
843
- # @see AttributeSets::NetShaper::Handle
844
- def handle; attributes[:"handle"]&.value; end
688
+ def handle; self[:"handle"]; end
845
689
  # Metric used by the given shaper for bw-min, bw-max and burst.
846
690
  #
847
691
  # Known enum values are defined in {Enums::Metric}.
848
692
  # @rbs return: ::Integer
849
693
  # @return [Integer]
850
- # @see AttributeSets::NetShaper::Metric
851
- def metric; attributes[:"metric"]&.value; end
694
+ def metric; self[:"metric"]; end
852
695
  # Guaranteed bandwidth for the given shaper.
853
696
  # @rbs return: ::Integer
854
697
  # @return [Integer]
855
- # @see AttributeSets::NetShaper::BwMin
856
- def bw_min; attributes[:"bw_min"]&.value; end
698
+ def bw_min; self[:"bw_min"]; end
857
699
  # Maximum bandwidth for the given shaper or 0 when unlimited.
858
700
  # @rbs return: ::Integer
859
701
  # @return [Integer]
860
- # @see AttributeSets::NetShaper::BwMax
861
- def bw_max; attributes[:"bw_max"]&.value; end
702
+ def bw_max; self[:"bw_max"]; end
862
703
  # Maximum burst-size for shaping. Should not be interpreted
863
704
  # as a quantum.
864
705
  # @rbs return: ::Integer
865
706
  # @return [Integer]
866
- # @see AttributeSets::NetShaper::Burst
867
- def burst; attributes[:"burst"]&.value; end
707
+ def burst; self[:"burst"]; end
868
708
  # Scheduling priority for the given shaper. The priority
869
709
  # scheduling is applied to sibling shapers.
870
710
  # @rbs return: ::Integer
871
711
  # @return [Integer]
872
- # @see AttributeSets::NetShaper::Priority
873
- def priority; attributes[:"priority"]&.value; end
712
+ def priority; self[:"priority"]; end
874
713
  # Relative weight for round robin scheduling of the
875
714
  # given shaper.
876
715
  # The scheduling is applied to all sibling shapers
877
716
  # with the same priority.
878
717
  # @rbs return: ::Integer
879
718
  # @return [Integer]
880
- # @see AttributeSets::NetShaper::Weight
881
- def weight; attributes[:"weight"]&.value; end
719
+ def weight; self[:"weight"]; end
882
720
  # Interface index owning the specified shaper.
883
721
  # @rbs return: ::Integer
884
722
  # @return [Integer]
885
- # @see AttributeSets::NetShaper::Ifindex
886
- def ifindex; attributes[:"ifindex"]&.value; end
723
+ def ifindex; self[:"ifindex"]; end
887
724
  # Identifier for the parent of the affected shaper.
888
725
  # Only needed for `group` operation.
889
726
  # @rbs return: AttributeSets::Handle
890
727
  # @return [AttributeSets::Handle]
891
- # @see AttributeSets::NetShaper::Parent
892
- def parent; attributes[:"parent"]&.value; end
728
+ def parent; self[:"parent"]; end
893
729
  # Describes a set of leaves shapers for a `group` operation.
894
730
  # @rbs return: ::Array[AttributeSets::LeafInfo]
895
731
  # @return [Array<AttributeSets::LeafInfo>]
896
- # @see AttributeSets::NetShaper::Leaves
897
- def leaves; attributes[:"leaves"].map(&:value); end
732
+ def leaves; self[:"leaves"]; end
898
733
  end
899
734
  # Create or update a scheduling group, attaching the specified
900
735
  # `leaves` shapers under the specified node identified by `handle.`
@@ -918,184 +753,254 @@ class NetShaper < ::Nl::Genl::Family
918
753
  #
919
754
  #
920
755
  # Requires CAP_NET_ADMIN in the initial user namespace.
921
- class DoGroupReply < ::Nl::Genl::Message
756
+ class DoGroupReply < ::Nl::Message
922
757
  TYPE = 4
923
758
  FIXED_HEADER = nil
924
759
  ATTRIBUTE_SET = AttributeSets::NetShaper
925
- ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
760
+ ATTRIBUTES = %i[handle ifindex].freeze
761
+ include ATTRIBUTE_SET::Definitions
762
+ def initialize(attributes = [])
763
+ @attributes = attributes
764
+ end
765
+ # @private
766
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
767
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
768
+ new(
769
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
770
+ )
771
+ end
772
+ # Decodes a message payload from the decoder into a new instance.
773
+ # @rbs (::Nl::Decoder decoder) -> instance
774
+ def self.decode(decoder)
775
+ new(decode_attributes(decoder, BY_TYPE, 0))
776
+ end
777
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
778
+ encode_attributes(encoder, external_selectors:)
779
+ end
926
780
  # Unique identifier for the given shaper inside the owning device.
927
781
  # @rbs return: AttributeSets::Handle
928
782
  # @return [AttributeSets::Handle]
929
- # @see AttributeSets::NetShaper::Handle
930
- def handle; attributes[:"handle"]&.value; end
783
+ def handle; self[:"handle"]; end
931
784
  # Interface index owning the specified shaper.
932
785
  # @rbs return: ::Integer
933
786
  # @return [Integer]
934
- # @see AttributeSets::NetShaper::Ifindex
935
- def ifindex; attributes[:"ifindex"]&.value; end
787
+ def ifindex; self[:"ifindex"]; end
936
788
  end
937
789
  # Get the shaper capabilities supported by the given device
938
790
  # for the specified scope.
939
- class DoCapGetRequest < ::Nl::Genl::Message
791
+ class DoCapGetRequest < ::Nl::Message
940
792
  TYPE = 5
941
793
  FIXED_HEADER = nil
942
794
  ATTRIBUTE_SET = AttributeSets::Caps
943
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope])
795
+ ATTRIBUTES = %i[ifindex scope].freeze
796
+ include ATTRIBUTE_SET::Definitions
797
+ def initialize(attributes = [])
798
+ @attributes = attributes
799
+ end
800
+ # @private
801
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
802
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
803
+ new(
804
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
805
+ )
806
+ end
807
+ # Decodes a message payload from the decoder into a new instance.
808
+ # @rbs (::Nl::Decoder decoder) -> instance
809
+ def self.decode(decoder)
810
+ new(decode_attributes(decoder, BY_TYPE, 0))
811
+ end
812
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
813
+ encode_attributes(encoder, external_selectors:)
814
+ end
944
815
  # Interface index queried for shapers capabilities.
945
816
  # @rbs return: ::Integer
946
817
  # @return [Integer]
947
- # @see AttributeSets::Caps::Ifindex
948
- def ifindex; attributes[:"ifindex"]&.value; end
818
+ def ifindex; self[:"ifindex"]; end
949
819
  # The scope to which the queried capabilities apply.
950
820
  #
951
821
  # Known enum values are defined in {Enums::Scope}.
952
822
  # @rbs return: ::Integer
953
823
  # @return [Integer]
954
- # @see AttributeSets::Caps::Scope
955
- def scope; attributes[:"scope"]&.value; end
824
+ def scope; self[:"scope"]; end
956
825
  end
957
826
  # Get the shaper capabilities supported by the given device
958
827
  # for the specified scope.
959
- class DoCapGetReply < ::Nl::Genl::Message
828
+ class DoCapGetReply < ::Nl::Message
960
829
  TYPE = 5
961
830
  FIXED_HEADER = nil
962
831
  ATTRIBUTE_SET = AttributeSets::Caps
963
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope support_metric_bps support_metric_pps support_nesting support_bw_min support_bw_max support_burst support_priority support_weight])
832
+ ATTRIBUTES = %i[ifindex scope support_metric_bps support_metric_pps support_nesting support_bw_min support_bw_max support_burst support_priority support_weight].freeze
833
+ include ATTRIBUTE_SET::Definitions
834
+ def initialize(attributes = [])
835
+ @attributes = attributes
836
+ end
837
+ # @private
838
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
839
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
840
+ new(
841
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
842
+ )
843
+ end
844
+ # Decodes a message payload from the decoder into a new instance.
845
+ # @rbs (::Nl::Decoder decoder) -> instance
846
+ def self.decode(decoder)
847
+ new(decode_attributes(decoder, BY_TYPE, 0))
848
+ end
849
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
850
+ encode_attributes(encoder, external_selectors:)
851
+ end
964
852
  # Interface index queried for shapers capabilities.
965
853
  # @rbs return: ::Integer
966
854
  # @return [Integer]
967
- # @see AttributeSets::Caps::Ifindex
968
- def ifindex; attributes[:"ifindex"]&.value; end
855
+ def ifindex; self[:"ifindex"]; end
969
856
  # The scope to which the queried capabilities apply.
970
857
  #
971
858
  # Known enum values are defined in {Enums::Scope}.
972
859
  # @rbs return: ::Integer
973
860
  # @return [Integer]
974
- # @see AttributeSets::Caps::Scope
975
- def scope; attributes[:"scope"]&.value; end
861
+ def scope; self[:"scope"]; end
976
862
  # The device accepts 'bps' metric for bw-min, bw-max and burst.
977
863
  # @rbs return: ::Integer
978
864
  # @return [Integer]
979
- # @see AttributeSets::Caps::SupportMetricBps
980
- def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
865
+ def support_metric_bps; self[:"support_metric_bps"]; end
981
866
  # The device accepts 'pps' metric for bw-min, bw-max and burst.
982
867
  # @rbs return: ::Integer
983
868
  # @return [Integer]
984
- # @see AttributeSets::Caps::SupportMetricPps
985
- def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
869
+ def support_metric_pps; self[:"support_metric_pps"]; end
986
870
  # The device supports nesting shaper belonging to this scope
987
871
  # below 'node' scoped shapers. Only 'queue' and 'node'
988
872
  # scope can have flag 'support-nesting'.
989
873
  # @rbs return: ::Integer
990
874
  # @return [Integer]
991
- # @see AttributeSets::Caps::SupportNesting
992
- def support_nesting; attributes[:"support_nesting"]&.value; end
875
+ def support_nesting; self[:"support_nesting"]; end
993
876
  # The device supports a minimum guaranteed B/W.
994
877
  # @rbs return: ::Integer
995
878
  # @return [Integer]
996
- # @see AttributeSets::Caps::SupportBwMin
997
- def support_bw_min; attributes[:"support_bw_min"]&.value; end
879
+ def support_bw_min; self[:"support_bw_min"]; end
998
880
  # The device supports maximum B/W shaping.
999
881
  # @rbs return: ::Integer
1000
882
  # @return [Integer]
1001
- # @see AttributeSets::Caps::SupportBwMax
1002
- def support_bw_max; attributes[:"support_bw_max"]&.value; end
883
+ def support_bw_max; self[:"support_bw_max"]; end
1003
884
  # The device supports a maximum burst size.
1004
885
  # @rbs return: ::Integer
1005
886
  # @return [Integer]
1006
- # @see AttributeSets::Caps::SupportBurst
1007
- def support_burst; attributes[:"support_burst"]&.value; end
887
+ def support_burst; self[:"support_burst"]; end
1008
888
  # The device supports priority scheduling.
1009
889
  # @rbs return: ::Integer
1010
890
  # @return [Integer]
1011
- # @see AttributeSets::Caps::SupportPriority
1012
- def support_priority; attributes[:"support_priority"]&.value; end
891
+ def support_priority; self[:"support_priority"]; end
1013
892
  # The device supports weighted round robin scheduling.
1014
893
  # @rbs return: ::Integer
1015
894
  # @return [Integer]
1016
- # @see AttributeSets::Caps::SupportWeight
1017
- def support_weight; attributes[:"support_weight"]&.value; end
895
+ def support_weight; self[:"support_weight"]; end
1018
896
  end
1019
897
  # Get the shaper capabilities supported by the given device
1020
898
  # for the specified scope.
1021
- class DumpCapGetRequest < ::Nl::Genl::Message
899
+ class DumpCapGetRequest < ::Nl::Message
1022
900
  TYPE = 5
1023
901
  FIXED_HEADER = nil
1024
902
  ATTRIBUTE_SET = AttributeSets::Caps
1025
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
903
+ ATTRIBUTES = %i[ifindex].freeze
904
+ include ATTRIBUTE_SET::Definitions
905
+ def initialize(attributes = [])
906
+ @attributes = attributes
907
+ end
908
+ # @private
909
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
910
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
911
+ new(
912
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
913
+ )
914
+ end
915
+ # Decodes a message payload from the decoder into a new instance.
916
+ # @rbs (::Nl::Decoder decoder) -> instance
917
+ def self.decode(decoder)
918
+ new(decode_attributes(decoder, BY_TYPE, 0))
919
+ end
920
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
921
+ encode_attributes(encoder, external_selectors:)
922
+ end
1026
923
  # Interface index queried for shapers capabilities.
1027
924
  # @rbs return: ::Integer
1028
925
  # @return [Integer]
1029
- # @see AttributeSets::Caps::Ifindex
1030
- def ifindex; attributes[:"ifindex"]&.value; end
926
+ def ifindex; self[:"ifindex"]; end
1031
927
  end
1032
928
  # Get the shaper capabilities supported by the given device
1033
929
  # for the specified scope.
1034
- class DumpCapGetReply < ::Nl::Genl::Message
930
+ class DumpCapGetReply < ::Nl::Message
1035
931
  TYPE = 5
1036
932
  FIXED_HEADER = nil
1037
933
  ATTRIBUTE_SET = AttributeSets::Caps
1038
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope support_metric_bps support_metric_pps support_nesting support_bw_min support_bw_max support_burst support_priority support_weight])
934
+ ATTRIBUTES = %i[ifindex scope support_metric_bps support_metric_pps support_nesting support_bw_min support_bw_max support_burst support_priority support_weight].freeze
935
+ include ATTRIBUTE_SET::Definitions
936
+ def initialize(attributes = [])
937
+ @attributes = attributes
938
+ end
939
+ # @private
940
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
941
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
942
+ new(
943
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
944
+ )
945
+ end
946
+ # Decodes a message payload from the decoder into a new instance.
947
+ # @rbs (::Nl::Decoder decoder) -> instance
948
+ def self.decode(decoder)
949
+ new(decode_attributes(decoder, BY_TYPE, 0))
950
+ end
951
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
952
+ encode_attributes(encoder, external_selectors:)
953
+ end
1039
954
  # Interface index queried for shapers capabilities.
1040
955
  # @rbs return: ::Integer
1041
956
  # @return [Integer]
1042
- # @see AttributeSets::Caps::Ifindex
1043
- def ifindex; attributes[:"ifindex"]&.value; end
957
+ def ifindex; self[:"ifindex"]; end
1044
958
  # The scope to which the queried capabilities apply.
1045
959
  #
1046
960
  # Known enum values are defined in {Enums::Scope}.
1047
961
  # @rbs return: ::Integer
1048
962
  # @return [Integer]
1049
- # @see AttributeSets::Caps::Scope
1050
- def scope; attributes[:"scope"]&.value; end
963
+ def scope; self[:"scope"]; end
1051
964
  # The device accepts 'bps' metric for bw-min, bw-max and burst.
1052
965
  # @rbs return: ::Integer
1053
966
  # @return [Integer]
1054
- # @see AttributeSets::Caps::SupportMetricBps
1055
- def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
967
+ def support_metric_bps; self[:"support_metric_bps"]; end
1056
968
  # The device accepts 'pps' metric for bw-min, bw-max and burst.
1057
969
  # @rbs return: ::Integer
1058
970
  # @return [Integer]
1059
- # @see AttributeSets::Caps::SupportMetricPps
1060
- def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
971
+ def support_metric_pps; self[:"support_metric_pps"]; end
1061
972
  # The device supports nesting shaper belonging to this scope
1062
973
  # below 'node' scoped shapers. Only 'queue' and 'node'
1063
974
  # scope can have flag 'support-nesting'.
1064
975
  # @rbs return: ::Integer
1065
976
  # @return [Integer]
1066
- # @see AttributeSets::Caps::SupportNesting
1067
- def support_nesting; attributes[:"support_nesting"]&.value; end
977
+ def support_nesting; self[:"support_nesting"]; end
1068
978
  # The device supports a minimum guaranteed B/W.
1069
979
  # @rbs return: ::Integer
1070
980
  # @return [Integer]
1071
- # @see AttributeSets::Caps::SupportBwMin
1072
- def support_bw_min; attributes[:"support_bw_min"]&.value; end
981
+ def support_bw_min; self[:"support_bw_min"]; end
1073
982
  # The device supports maximum B/W shaping.
1074
983
  # @rbs return: ::Integer
1075
984
  # @return [Integer]
1076
- # @see AttributeSets::Caps::SupportBwMax
1077
- def support_bw_max; attributes[:"support_bw_max"]&.value; end
985
+ def support_bw_max; self[:"support_bw_max"]; end
1078
986
  # The device supports a maximum burst size.
1079
987
  # @rbs return: ::Integer
1080
988
  # @return [Integer]
1081
- # @see AttributeSets::Caps::SupportBurst
1082
- def support_burst; attributes[:"support_burst"]&.value; end
989
+ def support_burst; self[:"support_burst"]; end
1083
990
  # The device supports priority scheduling.
1084
991
  # @rbs return: ::Integer
1085
992
  # @return [Integer]
1086
- # @see AttributeSets::Caps::SupportPriority
1087
- def support_priority; attributes[:"support_priority"]&.value; end
993
+ def support_priority; self[:"support_priority"]; end
1088
994
  # The device supports weighted round robin scheduling.
1089
995
  # @rbs return: ::Integer
1090
996
  # @return [Integer]
1091
- # @see AttributeSets::Caps::SupportWeight
1092
- def support_weight; attributes[:"support_weight"]&.value; end
997
+ def support_weight; self[:"support_weight"]; end
1093
998
  end
1094
999
  end
1095
1000
  module Notifications
1096
1001
  end
1097
1002
  # @private
1098
- NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
1003
+ NOTIFICATIONS = {}.freeze #: Hash[::Integer, ::Class]
1099
1004
  # Get information about a shaper for a given device.
1100
1005
  # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?ifindex: ::Integer) -> Messages::DoGetReply
1101
1006
  # @param [Hash] args