nl-linux 0.2.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/.yardopts +5 -0
  4. data/CHANGELOG.md +8 -0
  5. data/Rakefile +27 -5
  6. data/generated/nl/linux/binder.rb +227 -19
  7. data/generated/nl/linux/conntrack.rb +1325 -365
  8. data/generated/nl/linux/dev_energymodel.rb +357 -66
  9. data/generated/nl/linux/devlink.rb +6310 -1859
  10. data/generated/nl/linux/dpll.rb +2202 -376
  11. data/generated/nl/linux/drm_ras.rb +312 -63
  12. data/generated/nl/linux/ethtool.rb +7555 -2447
  13. data/generated/nl/linux/fou.rb +381 -133
  14. data/generated/nl/linux/handshake.rb +340 -70
  15. data/generated/nl/linux/lockd.rb +132 -27
  16. data/generated/nl/linux/mptcp_pm.rb +773 -161
  17. data/generated/nl/linux/net_shaper.rb +892 -211
  18. data/generated/nl/linux/netdev.rb +2366 -518
  19. data/generated/nl/linux/nfsd.rb +1299 -317
  20. data/generated/nl/linux/nftables.rb +5351 -1533
  21. data/generated/nl/linux/nl80211.rb +4601 -882
  22. data/generated/nl/linux/nlctrl.rb +460 -117
  23. data/generated/nl/linux/ovpn.rb +1360 -262
  24. data/generated/nl/linux/ovs_datapath.rb +312 -98
  25. data/generated/nl/linux/ovs_flow.rb +1866 -358
  26. data/generated/nl/linux/ovs_packet.rb +331 -45
  27. data/generated/nl/linux/ovs_vport.rb +374 -123
  28. data/generated/nl/linux/psp.rb +1093 -201
  29. data/generated/nl/linux/rt_addr.rb +423 -165
  30. data/generated/nl/linux/rt_link.rb +6928 -1336
  31. data/generated/nl/linux/rt_neigh.rb +1063 -297
  32. data/generated/nl/linux/rt_route.rb +1112 -483
  33. data/generated/nl/linux/rt_rule.rb +931 -262
  34. data/generated/nl/linux/sunrpc_cache.rb +407 -82
  35. data/generated/nl/linux/tc.rb +10081 -1763
  36. data/generated/nl/linux/tcp_metrics.rb +388 -109
  37. data/generated/nl/linux/team.rb +350 -84
  38. data/generated/nl/linux/wireguard.rb +525 -96
  39. data/generated/nl/linux.rb +1 -0
  40. data/lib/nl/linux/nlctrl_resolver.rb +31 -0
  41. data/lib/nl/linux/version.rb +1 -1
  42. data/sig/generated/nl/linux/binder.rbs +366 -0
  43. data/sig/generated/nl/linux/conntrack.rbs +2787 -0
  44. data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
  45. data/sig/generated/nl/linux/devlink.rbs +12496 -0
  46. data/sig/generated/nl/linux/dpll.rbs +3461 -0
  47. data/sig/generated/nl/linux/drm_ras.rbs +553 -0
  48. data/sig/generated/nl/linux/ethtool.rbs +15291 -0
  49. data/sig/generated/nl/linux/fou.rbs +702 -0
  50. data/sig/generated/nl/linux/handshake.rbs +622 -0
  51. data/sig/generated/nl/linux/lockd.rbs +234 -0
  52. data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
  53. data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
  54. data/sig/generated/nl/linux/netdev.rbs +4187 -0
  55. data/sig/generated/nl/linux/nfsd.rbs +2520 -0
  56. data/sig/generated/nl/linux/nftables.rbs +10304 -0
  57. data/sig/generated/nl/linux/nl80211.rbs +9786 -0
  58. data/sig/generated/nl/linux/nlctrl.rbs +944 -0
  59. data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
  60. data/sig/generated/nl/linux/ovpn.rbs +2564 -0
  61. data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
  62. data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
  63. data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
  64. data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
  65. data/sig/generated/nl/linux/psp.rbs +1846 -0
  66. data/sig/generated/nl/linux/rt_addr.rbs +866 -0
  67. data/sig/generated/nl/linux/rt_link.rbs +13438 -0
  68. data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
  69. data/sig/generated/nl/linux/rt_route.rbs +2218 -0
  70. data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
  71. data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
  72. data/sig/generated/nl/linux/tc.rbs +19931 -0
  73. data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
  74. data/sig/generated/nl/linux/team.rbs +733 -0
  75. data/sig/generated/nl/linux/version.rbs +7 -0
  76. data/sig/generated/nl/linux/wireguard.rbs +1006 -0
  77. data/sig/generated/nl/linux.rbs +6 -0
  78. data/sig/generated/nl-linux.rbs +2 -0
  79. metadata +51 -10
@@ -1,7 +1,8 @@
1
1
  # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # This file is based on Documentation/netlink/specs/net_shaper.yaml from Linux v7.2.
2
4
  #--
3
5
  # frozen_string_literal: true
4
- # rbs_inline: enabled
5
6
  # This code is generated by Ynl::Generator. DO NOT EDIT.
6
7
  require 'nl'
7
8
  module Nl; module Linux
@@ -33,374 +34,750 @@ module Nl; module Linux
33
34
  # support for complex scheduling hierarchy, or for some shaping
34
35
  # parameters. The user can introspect the HW capabilities via the
35
36
  # `cap-get` operation.
36
- class NetShaper < ::Nl::Family
37
+ class NetShaper < ::Nl::Genl::Family
37
38
  NAME = "net-shaper"
38
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("net-shaper"))
39
+ VERSION = 1
40
+ # @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
41
+ # @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
42
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
43
+ # @param [#call] resolver
44
+ # @param [Symbol, nil] executor
45
+ # @param [Integer, nil] notification_capacity
46
+ # @return [NetShaper]
47
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
48
+ # @param [#call] resolver
49
+ # @param [Symbol, nil] executor
50
+ # @param [Integer, nil] notification_capacity
51
+ # @yieldparam [NetShaper] family
52
+ # @return [Object] the result of the block
53
+ def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
54
+ super
55
+ end
56
+ # @private
57
+ MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
58
+ module Constants
59
+ MAX_HANDLE_ID = 67108862
60
+ end
61
+ module Enums
62
+ # Defines the shaper `id` interpretation.
63
+ module Scope
64
+ # The scope is not specified.
65
+ Unspec = 0
66
+ # The main shaper for the given network device.
67
+ Netdev = 1
68
+ # The shaper is attached to the given device queue,
69
+ # the `id` represents the queue number.
70
+ Queue = 2
71
+ # The shaper allows grouping of queues or other
72
+ # node shapers; can be nested in either `netdev`
73
+ # shapers or other `node` shapers, allowing placement
74
+ # in any location of the scheduling tree, except
75
+ # leaves and root.
76
+ Node = 3
77
+ end
78
+ # Different metric supported by the shaper.
79
+ module Metric
80
+ # Shaper operates on a bits per second basis.
81
+ Bps = 0
82
+ # Shaper operates on a packets per second basis.
83
+ Pps = 1
84
+ end
85
+ end
39
86
  module Structs
40
87
  end
41
88
  module AttributeSets
42
- class NetShaper < ::Nl::Protocols::Genl::AttributeSet
89
+ class NetShaper < ::Nl::AttributeSet
43
90
  # Abstract class
44
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
91
+ class Attribute < ::Nl::AttributeSet::Attribute
45
92
  end
93
+ # Unique identifier for the given shaper inside the owning device.
46
94
  class Handle < Attribute
47
95
  TYPE = 1
48
96
  NAME = :"handle"
97
+ # @private
98
+ ORDER = 0
49
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}.
50
103
  class Metric < Attribute
51
104
  TYPE = 2
52
105
  NAME = :"metric"
53
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
106
+ # @private
107
+ ORDER = 1
108
+ # @private
109
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
54
110
  end
111
+ # Guaranteed bandwidth for the given shaper.
55
112
  class BwMin < Attribute
56
113
  TYPE = 3
57
114
  NAME = :"bw_min"
58
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
115
+ # @private
116
+ ORDER = 2
117
+ # @private
118
+ DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
59
119
  end
120
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
60
121
  class BwMax < Attribute
61
122
  TYPE = 4
62
123
  NAME = :"bw_max"
63
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
124
+ # @private
125
+ ORDER = 3
126
+ # @private
127
+ DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
64
128
  end
129
+ # Maximum burst-size for shaping. Should not be interpreted
130
+ # as a quantum.
65
131
  class Burst < Attribute
66
132
  TYPE = 5
67
133
  NAME = :"burst"
68
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
134
+ # @private
135
+ ORDER = 4
136
+ # @private
137
+ DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
69
138
  end
139
+ # Scheduling priority for the given shaper. The priority
140
+ # scheduling is applied to sibling shapers.
70
141
  class Priority < Attribute
71
142
  TYPE = 6
72
143
  NAME = :"priority"
73
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
144
+ # @private
145
+ ORDER = 5
146
+ # @private
147
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
74
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.
75
153
  class Weight < Attribute
76
154
  TYPE = 7
77
155
  NAME = :"weight"
78
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
156
+ # @private
157
+ ORDER = 6
158
+ # @private
159
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
79
160
  end
161
+ # Interface index owning the specified shaper.
80
162
  class Ifindex < Attribute
81
163
  TYPE = 8
82
164
  NAME = :"ifindex"
83
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
165
+ # @private
166
+ ORDER = 7
167
+ # @private
168
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
84
169
  end
170
+ # Identifier for the parent of the affected shaper.
171
+ # Only needed for `group` operation.
85
172
  class Parent < Attribute
86
173
  TYPE = 9
87
174
  NAME = :"parent"
175
+ # @private
176
+ ORDER = 8
88
177
  end
178
+ # Describes a set of leaves shapers for a `group` operation.
89
179
  class Leaves < Attribute
90
180
  TYPE = 10
91
181
  NAME = :"leaves"
182
+ # @private
183
+ MULTI = true
184
+ # @private
185
+ ORDER = 9
92
186
  end
93
- # :nodoc:
187
+ # @private
94
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]
95
- # :nodoc:
189
+ # @private
96
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
97
249
  class << self
98
250
  # Looks up Attribute class by name.
99
- #--
100
251
  # @rbs name: Symbol
101
252
  # @rbs return: Attribute
253
+ # @param [Symbol] name
254
+ # @return [Attribute]
102
255
  def by_name(name); BY_NAME.fetch(name); end
103
256
  # Looks up Attribute class by type value.
104
- #--
105
257
  # @rbs type: Integer
106
258
  # @rbs return: Attribute
259
+ # @param [Integer] type
260
+ # @return [Attribute]
107
261
  def by_type(type); BY_TYPE.fetch(type); end
108
262
  end
109
263
  end
110
- class Handle < ::Nl::Protocols::Genl::AttributeSet
264
+ class Handle < ::Nl::AttributeSet
111
265
  # Abstract class
112
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
266
+ class Attribute < ::Nl::AttributeSet::Attribute
113
267
  end
268
+ # Defines the shaper `id` interpretation.
269
+ #
270
+ # Known enum values are defined in {Enums::Scope}.
114
271
  class Scope < Attribute
115
272
  TYPE = 1
116
273
  NAME = :"scope"
117
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
274
+ # @private
275
+ ORDER = 0
276
+ # @private
277
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
118
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.
119
282
  class Id < Attribute
120
283
  TYPE = 2
121
284
  NAME = :"id"
122
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 67108862" unless it <= 67108862 })
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 })
123
289
  end
124
- # :nodoc:
290
+ # @private
125
291
  BY_NAME = Ractor.make_shareable({:"scope" => Scope, :"id" => Id}) #: Hash[::Symbol, Attribute]
126
- # :nodoc:
292
+ # @private
127
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
128
308
  class << self
129
309
  # Looks up Attribute class by name.
130
- #--
131
310
  # @rbs name: Symbol
132
311
  # @rbs return: Attribute
312
+ # @param [Symbol] name
313
+ # @return [Attribute]
133
314
  def by_name(name); BY_NAME.fetch(name); end
134
315
  # Looks up Attribute class by type value.
135
- #--
136
316
  # @rbs type: Integer
137
317
  # @rbs return: Attribute
318
+ # @param [Integer] type
319
+ # @return [Attribute]
138
320
  def by_type(type); BY_TYPE.fetch(type); end
139
321
  end
140
322
  end
141
- class LeafInfo < ::Nl::Protocols::Genl::AttributeSet
323
+ class LeafInfo < ::Nl::AttributeSet
142
324
  # Abstract class
143
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
325
+ class Attribute < ::Nl::AttributeSet::Attribute
144
326
  end
327
+ # Unique identifier for the given shaper inside the owning device.
145
328
  class Handle < Attribute
146
329
  TYPE = 1
147
330
  NAME = :"handle"
331
+ # @private
332
+ ORDER = 0
148
333
  end
334
+ # Scheduling priority for the given shaper. The priority
335
+ # scheduling is applied to sibling shapers.
149
336
  class Priority < Attribute
150
337
  TYPE = 6
151
338
  NAME = :"priority"
152
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
339
+ # @private
340
+ ORDER = 1
341
+ # @private
342
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
153
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.
154
348
  class Weight < Attribute
155
349
  TYPE = 7
156
350
  NAME = :"weight"
157
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
351
+ # @private
352
+ ORDER = 2
353
+ # @private
354
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
158
355
  end
159
- # :nodoc:
356
+ # @private
160
357
  BY_NAME = Ractor.make_shareable({:"handle" => Handle, :"priority" => Priority, :"weight" => Weight}) #: Hash[::Symbol, Attribute]
161
- # :nodoc:
358
+ # @private
162
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
163
379
  class << self
164
380
  # Looks up Attribute class by name.
165
- #--
166
381
  # @rbs name: Symbol
167
382
  # @rbs return: Attribute
383
+ # @param [Symbol] name
384
+ # @return [Attribute]
168
385
  def by_name(name); BY_NAME.fetch(name); end
169
386
  # Looks up Attribute class by type value.
170
- #--
171
387
  # @rbs type: Integer
172
388
  # @rbs return: Attribute
389
+ # @param [Integer] type
390
+ # @return [Attribute]
173
391
  def by_type(type); BY_TYPE.fetch(type); end
174
392
  end
175
393
  end
176
- class Caps < ::Nl::Protocols::Genl::AttributeSet
394
+ class Caps < ::Nl::AttributeSet
177
395
  # Abstract class
178
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
396
+ class Attribute < ::Nl::AttributeSet::Attribute
179
397
  end
398
+ # Interface index queried for shapers capabilities.
180
399
  class Ifindex < Attribute
181
400
  TYPE = 1
182
401
  NAME = :"ifindex"
183
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
402
+ # @private
403
+ ORDER = 0
404
+ # @private
405
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
184
406
  end
407
+ # The scope to which the queried capabilities apply.
408
+ #
409
+ # Known enum values are defined in {Enums::Scope}.
185
410
  class Scope < Attribute
186
411
  TYPE = 2
187
412
  NAME = :"scope"
188
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
413
+ # @private
414
+ ORDER = 1
415
+ # @private
416
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
189
417
  end
418
+ # The device accepts 'bps' metric for bw-min, bw-max and burst.
190
419
  class SupportMetricBps < Attribute
191
420
  TYPE = 3
192
421
  NAME = :"support_metric_bps"
193
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
422
+ # @private
423
+ ORDER = 2
424
+ # @private
425
+ DATATYPE = ::Nl::DataTypes::Flag.new
194
426
  end
427
+ # The device accepts 'pps' metric for bw-min, bw-max and burst.
195
428
  class SupportMetricPps < Attribute
196
429
  TYPE = 4
197
430
  NAME = :"support_metric_pps"
198
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
431
+ # @private
432
+ ORDER = 3
433
+ # @private
434
+ DATATYPE = ::Nl::DataTypes::Flag.new
199
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'.
200
439
  class SupportNesting < Attribute
201
440
  TYPE = 5
202
441
  NAME = :"support_nesting"
203
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
442
+ # @private
443
+ ORDER = 4
444
+ # @private
445
+ DATATYPE = ::Nl::DataTypes::Flag.new
204
446
  end
447
+ # The device supports a minimum guaranteed B/W.
205
448
  class SupportBwMin < Attribute
206
449
  TYPE = 6
207
450
  NAME = :"support_bw_min"
208
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
451
+ # @private
452
+ ORDER = 5
453
+ # @private
454
+ DATATYPE = ::Nl::DataTypes::Flag.new
209
455
  end
456
+ # The device supports maximum B/W shaping.
210
457
  class SupportBwMax < Attribute
211
458
  TYPE = 7
212
459
  NAME = :"support_bw_max"
213
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
460
+ # @private
461
+ ORDER = 6
462
+ # @private
463
+ DATATYPE = ::Nl::DataTypes::Flag.new
214
464
  end
465
+ # The device supports a maximum burst size.
215
466
  class SupportBurst < Attribute
216
467
  TYPE = 8
217
468
  NAME = :"support_burst"
218
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
469
+ # @private
470
+ ORDER = 7
471
+ # @private
472
+ DATATYPE = ::Nl::DataTypes::Flag.new
219
473
  end
474
+ # The device supports priority scheduling.
220
475
  class SupportPriority < Attribute
221
476
  TYPE = 9
222
477
  NAME = :"support_priority"
223
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
478
+ # @private
479
+ ORDER = 8
480
+ # @private
481
+ DATATYPE = ::Nl::DataTypes::Flag.new
224
482
  end
483
+ # The device supports weighted round robin scheduling.
225
484
  class SupportWeight < Attribute
226
485
  TYPE = 10
227
486
  NAME = :"support_weight"
228
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
487
+ # @private
488
+ ORDER = 9
489
+ # @private
490
+ DATATYPE = ::Nl::DataTypes::Flag.new
229
491
  end
230
- # :nodoc:
492
+ # @private
231
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]
232
- # :nodoc:
494
+ # @private
233
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
234
550
  class << self
235
551
  # Looks up Attribute class by name.
236
- #--
237
552
  # @rbs name: Symbol
238
553
  # @rbs return: Attribute
554
+ # @param [Symbol] name
555
+ # @return [Attribute]
239
556
  def by_name(name); BY_NAME.fetch(name); end
240
557
  # Looks up Attribute class by type value.
241
- #--
242
558
  # @rbs type: Integer
243
559
  # @rbs return: Attribute
560
+ # @param [Integer] type
561
+ # @return [Attribute]
244
562
  def by_type(type); BY_TYPE.fetch(type); end
245
563
  end
246
564
  end
247
- NetShaper::Handle::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
248
- NetShaper::Parent::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
249
- NetShaper::Leaves::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(LeafInfo)
250
- LeafInfo::Handle::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
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([]))
251
573
  end
252
574
  module Messages
253
575
  # Get information about a shaper for a given device.
254
- class DoGetRequest < ::Nl::Protocols::Genl::Message
576
+ class DoGetRequest < ::Nl::Genl::Message
255
577
  TYPE = 1
256
578
  FIXED_HEADER = nil
257
579
  ATTRIBUTE_SET = AttributeSets::NetShaper
258
580
  ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
259
- # Gets the value of `handle` attribute in the message.
260
- #--
581
+ # Unique identifier for the given shaper inside the owning device.
261
582
  # @rbs return: AttributeSets::Handle
583
+ # @return [AttributeSets::Handle]
584
+ # @see AttributeSets::NetShaper::Handle
262
585
  def handle; attributes[:"handle"]&.value; end
263
- # Gets the value of `ifindex` attribute in the message.
264
- #--
586
+ # Interface index owning the specified shaper.
265
587
  # @rbs return: ::Integer
588
+ # @return [Integer]
589
+ # @see AttributeSets::NetShaper::Ifindex
266
590
  def ifindex; attributes[:"ifindex"]&.value; end
267
591
  end
268
592
  # Get information about a shaper for a given device.
269
- class DoGetReply < ::Nl::Protocols::Genl::Message
593
+ class DoGetReply < ::Nl::Genl::Message
270
594
  TYPE = 1
271
595
  FIXED_HEADER = nil
272
596
  ATTRIBUTE_SET = AttributeSets::NetShaper
273
597
  ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
274
- # Gets the value of `handle` attribute in the message.
275
- #--
598
+ # Unique identifier for the given shaper inside the owning device.
276
599
  # @rbs return: AttributeSets::Handle
600
+ # @return [AttributeSets::Handle]
601
+ # @see AttributeSets::NetShaper::Handle
277
602
  def handle; attributes[:"handle"]&.value; end
278
- # Gets the value of `metric` attribute in the message.
279
- #--
603
+ # Metric used by the given shaper for bw-min, bw-max and burst.
604
+ #
605
+ # Known enum values are defined in {Enums::Metric}.
280
606
  # @rbs return: ::Integer
607
+ # @return [Integer]
608
+ # @see AttributeSets::NetShaper::Metric
281
609
  def metric; attributes[:"metric"]&.value; end
282
- # Gets the value of `bw-min` attribute in the message.
283
- #--
610
+ # Guaranteed bandwidth for the given shaper.
284
611
  # @rbs return: ::Integer
612
+ # @return [Integer]
613
+ # @see AttributeSets::NetShaper::BwMin
285
614
  def bw_min; attributes[:"bw_min"]&.value; end
286
- # Gets the value of `bw-max` attribute in the message.
287
- #--
615
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
288
616
  # @rbs return: ::Integer
617
+ # @return [Integer]
618
+ # @see AttributeSets::NetShaper::BwMax
289
619
  def bw_max; attributes[:"bw_max"]&.value; end
290
- # Gets the value of `burst` attribute in the message.
291
- #--
620
+ # Maximum burst-size for shaping. Should not be interpreted
621
+ # as a quantum.
292
622
  # @rbs return: ::Integer
623
+ # @return [Integer]
624
+ # @see AttributeSets::NetShaper::Burst
293
625
  def burst; attributes[:"burst"]&.value; end
294
- # Gets the value of `priority` attribute in the message.
295
- #--
626
+ # Scheduling priority for the given shaper. The priority
627
+ # scheduling is applied to sibling shapers.
296
628
  # @rbs return: ::Integer
629
+ # @return [Integer]
630
+ # @see AttributeSets::NetShaper::Priority
297
631
  def priority; attributes[:"priority"]&.value; end
298
- # Gets the value of `weight` attribute in the message.
299
- #--
632
+ # Relative weight for round robin scheduling of the
633
+ # given shaper.
634
+ # The scheduling is applied to all sibling shapers
635
+ # with the same priority.
300
636
  # @rbs return: ::Integer
637
+ # @return [Integer]
638
+ # @see AttributeSets::NetShaper::Weight
301
639
  def weight; attributes[:"weight"]&.value; end
302
- # Gets the value of `ifindex` attribute in the message.
303
- #--
640
+ # Interface index owning the specified shaper.
304
641
  # @rbs return: ::Integer
642
+ # @return [Integer]
643
+ # @see AttributeSets::NetShaper::Ifindex
305
644
  def ifindex; attributes[:"ifindex"]&.value; end
306
- # Gets the value of `parent` attribute in the message.
307
- #--
645
+ # Identifier for the parent of the affected shaper.
646
+ # Only needed for `group` operation.
308
647
  # @rbs return: AttributeSets::Handle
648
+ # @return [AttributeSets::Handle]
649
+ # @see AttributeSets::NetShaper::Parent
309
650
  def parent; attributes[:"parent"]&.value; end
310
651
  end
311
652
  # Get information about a shaper for a given device.
312
- class DumpGetRequest < ::Nl::Protocols::Genl::Message
653
+ class DumpGetRequest < ::Nl::Genl::Message
313
654
  TYPE = 1
314
655
  FIXED_HEADER = nil
315
656
  ATTRIBUTE_SET = AttributeSets::NetShaper
316
657
  ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
317
- # Gets the value of `ifindex` attribute in the message.
318
- #--
658
+ # Interface index owning the specified shaper.
319
659
  # @rbs return: ::Integer
660
+ # @return [Integer]
661
+ # @see AttributeSets::NetShaper::Ifindex
320
662
  def ifindex; attributes[:"ifindex"]&.value; end
321
663
  end
322
664
  # Get information about a shaper for a given device.
323
- class DumpGetReply < ::Nl::Protocols::Genl::Message
665
+ class DumpGetReply < ::Nl::Genl::Message
324
666
  TYPE = 1
325
667
  FIXED_HEADER = nil
326
668
  ATTRIBUTE_SET = AttributeSets::NetShaper
327
669
  ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
328
- # Gets the value of `handle` attribute in the message.
329
- #--
670
+ # Unique identifier for the given shaper inside the owning device.
330
671
  # @rbs return: AttributeSets::Handle
672
+ # @return [AttributeSets::Handle]
673
+ # @see AttributeSets::NetShaper::Handle
331
674
  def handle; attributes[:"handle"]&.value; end
332
- # Gets the value of `metric` attribute in the message.
333
- #--
675
+ # Metric used by the given shaper for bw-min, bw-max and burst.
676
+ #
677
+ # Known enum values are defined in {Enums::Metric}.
334
678
  # @rbs return: ::Integer
679
+ # @return [Integer]
680
+ # @see AttributeSets::NetShaper::Metric
335
681
  def metric; attributes[:"metric"]&.value; end
336
- # Gets the value of `bw-min` attribute in the message.
337
- #--
682
+ # Guaranteed bandwidth for the given shaper.
338
683
  # @rbs return: ::Integer
684
+ # @return [Integer]
685
+ # @see AttributeSets::NetShaper::BwMin
339
686
  def bw_min; attributes[:"bw_min"]&.value; end
340
- # Gets the value of `bw-max` attribute in the message.
341
- #--
687
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
342
688
  # @rbs return: ::Integer
689
+ # @return [Integer]
690
+ # @see AttributeSets::NetShaper::BwMax
343
691
  def bw_max; attributes[:"bw_max"]&.value; end
344
- # Gets the value of `burst` attribute in the message.
345
- #--
692
+ # Maximum burst-size for shaping. Should not be interpreted
693
+ # as a quantum.
346
694
  # @rbs return: ::Integer
695
+ # @return [Integer]
696
+ # @see AttributeSets::NetShaper::Burst
347
697
  def burst; attributes[:"burst"]&.value; end
348
- # Gets the value of `priority` attribute in the message.
349
- #--
698
+ # Scheduling priority for the given shaper. The priority
699
+ # scheduling is applied to sibling shapers.
350
700
  # @rbs return: ::Integer
701
+ # @return [Integer]
702
+ # @see AttributeSets::NetShaper::Priority
351
703
  def priority; attributes[:"priority"]&.value; end
352
- # Gets the value of `weight` attribute in the message.
353
- #--
704
+ # Relative weight for round robin scheduling of the
705
+ # given shaper.
706
+ # The scheduling is applied to all sibling shapers
707
+ # with the same priority.
354
708
  # @rbs return: ::Integer
709
+ # @return [Integer]
710
+ # @see AttributeSets::NetShaper::Weight
355
711
  def weight; attributes[:"weight"]&.value; end
356
- # Gets the value of `ifindex` attribute in the message.
357
- #--
712
+ # Interface index owning the specified shaper.
358
713
  # @rbs return: ::Integer
714
+ # @return [Integer]
715
+ # @see AttributeSets::NetShaper::Ifindex
359
716
  def ifindex; attributes[:"ifindex"]&.value; end
360
- # Gets the value of `parent` attribute in the message.
361
- #--
717
+ # Identifier for the parent of the affected shaper.
718
+ # Only needed for `group` operation.
362
719
  # @rbs return: AttributeSets::Handle
720
+ # @return [AttributeSets::Handle]
721
+ # @see AttributeSets::NetShaper::Parent
363
722
  def parent; attributes[:"parent"]&.value; end
364
723
  end
365
724
  # Create or update the specified shaper.
366
725
  # The set operation can't be used to create a `node` scope shaper,
367
726
  # use the `group` operation instead.
368
- class DoSetRequest < ::Nl::Protocols::Genl::Message
727
+ #
728
+ #
729
+ # Requires CAP_NET_ADMIN in the initial user namespace.
730
+ class DoSetRequest < ::Nl::Genl::Message
369
731
  TYPE = 2
370
732
  FIXED_HEADER = nil
371
733
  ATTRIBUTE_SET = AttributeSets::NetShaper
372
734
  ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex])
373
- # Gets the value of `handle` attribute in the message.
374
- #--
735
+ # Unique identifier for the given shaper inside the owning device.
375
736
  # @rbs return: AttributeSets::Handle
737
+ # @return [AttributeSets::Handle]
738
+ # @see AttributeSets::NetShaper::Handle
376
739
  def handle; attributes[:"handle"]&.value; end
377
- # Gets the value of `metric` attribute in the message.
378
- #--
740
+ # Metric used by the given shaper for bw-min, bw-max and burst.
741
+ #
742
+ # Known enum values are defined in {Enums::Metric}.
379
743
  # @rbs return: ::Integer
744
+ # @return [Integer]
745
+ # @see AttributeSets::NetShaper::Metric
380
746
  def metric; attributes[:"metric"]&.value; end
381
- # Gets the value of `bw-min` attribute in the message.
382
- #--
747
+ # Guaranteed bandwidth for the given shaper.
383
748
  # @rbs return: ::Integer
749
+ # @return [Integer]
750
+ # @see AttributeSets::NetShaper::BwMin
384
751
  def bw_min; attributes[:"bw_min"]&.value; end
385
- # Gets the value of `bw-max` attribute in the message.
386
- #--
752
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
387
753
  # @rbs return: ::Integer
754
+ # @return [Integer]
755
+ # @see AttributeSets::NetShaper::BwMax
388
756
  def bw_max; attributes[:"bw_max"]&.value; end
389
- # Gets the value of `burst` attribute in the message.
390
- #--
757
+ # Maximum burst-size for shaping. Should not be interpreted
758
+ # as a quantum.
391
759
  # @rbs return: ::Integer
760
+ # @return [Integer]
761
+ # @see AttributeSets::NetShaper::Burst
392
762
  def burst; attributes[:"burst"]&.value; end
393
- # Gets the value of `priority` attribute in the message.
394
- #--
763
+ # Scheduling priority for the given shaper. The priority
764
+ # scheduling is applied to sibling shapers.
395
765
  # @rbs return: ::Integer
766
+ # @return [Integer]
767
+ # @see AttributeSets::NetShaper::Priority
396
768
  def priority; attributes[:"priority"]&.value; end
397
- # Gets the value of `weight` attribute in the message.
398
- #--
769
+ # Relative weight for round robin scheduling of the
770
+ # given shaper.
771
+ # The scheduling is applied to all sibling shapers
772
+ # with the same priority.
399
773
  # @rbs return: ::Integer
774
+ # @return [Integer]
775
+ # @see AttributeSets::NetShaper::Weight
400
776
  def weight; attributes[:"weight"]&.value; end
401
- # Gets the value of `ifindex` attribute in the message.
402
- #--
777
+ # Interface index owning the specified shaper.
403
778
  # @rbs return: ::Integer
779
+ # @return [Integer]
780
+ # @see AttributeSets::NetShaper::Ifindex
404
781
  def ifindex; attributes[:"ifindex"]&.value; end
405
782
  end
406
783
  # Clear (remove) the specified shaper. When deleting
@@ -414,18 +791,23 @@ class NetShaper < ::Nl::Family
414
791
  # queue/device can still send traffic: it has an implicit
415
792
  # node with infinite bandwidth. The queue's implicit node
416
793
  # feeds an implicit RR node at the root of the hierarchy.
417
- class DoDeleteRequest < ::Nl::Protocols::Genl::Message
794
+ #
795
+ #
796
+ # Requires CAP_NET_ADMIN in the initial user namespace.
797
+ class DoDeleteRequest < ::Nl::Genl::Message
418
798
  TYPE = 3
419
799
  FIXED_HEADER = nil
420
800
  ATTRIBUTE_SET = AttributeSets::NetShaper
421
801
  ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
422
- # Gets the value of `handle` attribute in the message.
423
- #--
802
+ # Unique identifier for the given shaper inside the owning device.
424
803
  # @rbs return: AttributeSets::Handle
804
+ # @return [AttributeSets::Handle]
805
+ # @see AttributeSets::NetShaper::Handle
425
806
  def handle; attributes[:"handle"]&.value; end
426
- # Gets the value of `ifindex` attribute in the message.
427
- #--
807
+ # Interface index owning the specified shaper.
428
808
  # @rbs return: ::Integer
809
+ # @return [Integer]
810
+ # @see AttributeSets::NetShaper::Ifindex
429
811
  def ifindex; attributes[:"ifindex"]&.value; end
430
812
  end
431
813
  # Create or update a scheduling group, attaching the specified
@@ -447,51 +829,72 @@ class NetShaper < ::Nl::Family
447
829
  # the device shaping configuration, otherwise the `node` shaper
448
830
  # full identifier, comprising `binding` and `handle`, is provided
449
831
  # as the reply.
450
- class DoGroupRequest < ::Nl::Protocols::Genl::Message
832
+ #
833
+ #
834
+ # Requires CAP_NET_ADMIN in the initial user namespace.
835
+ class DoGroupRequest < ::Nl::Genl::Message
451
836
  TYPE = 4
452
837
  FIXED_HEADER = nil
453
838
  ATTRIBUTE_SET = AttributeSets::NetShaper
454
839
  ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent leaves])
455
- # Gets the value of `handle` attribute in the message.
456
- #--
840
+ # Unique identifier for the given shaper inside the owning device.
457
841
  # @rbs return: AttributeSets::Handle
842
+ # @return [AttributeSets::Handle]
843
+ # @see AttributeSets::NetShaper::Handle
458
844
  def handle; attributes[:"handle"]&.value; end
459
- # Gets the value of `metric` attribute in the message.
460
- #--
845
+ # Metric used by the given shaper for bw-min, bw-max and burst.
846
+ #
847
+ # Known enum values are defined in {Enums::Metric}.
461
848
  # @rbs return: ::Integer
849
+ # @return [Integer]
850
+ # @see AttributeSets::NetShaper::Metric
462
851
  def metric; attributes[:"metric"]&.value; end
463
- # Gets the value of `bw-min` attribute in the message.
464
- #--
852
+ # Guaranteed bandwidth for the given shaper.
465
853
  # @rbs return: ::Integer
854
+ # @return [Integer]
855
+ # @see AttributeSets::NetShaper::BwMin
466
856
  def bw_min; attributes[:"bw_min"]&.value; end
467
- # Gets the value of `bw-max` attribute in the message.
468
- #--
857
+ # Maximum bandwidth for the given shaper or 0 when unlimited.
469
858
  # @rbs return: ::Integer
859
+ # @return [Integer]
860
+ # @see AttributeSets::NetShaper::BwMax
470
861
  def bw_max; attributes[:"bw_max"]&.value; end
471
- # Gets the value of `burst` attribute in the message.
472
- #--
862
+ # Maximum burst-size for shaping. Should not be interpreted
863
+ # as a quantum.
473
864
  # @rbs return: ::Integer
865
+ # @return [Integer]
866
+ # @see AttributeSets::NetShaper::Burst
474
867
  def burst; attributes[:"burst"]&.value; end
475
- # Gets the value of `priority` attribute in the message.
476
- #--
868
+ # Scheduling priority for the given shaper. The priority
869
+ # scheduling is applied to sibling shapers.
477
870
  # @rbs return: ::Integer
871
+ # @return [Integer]
872
+ # @see AttributeSets::NetShaper::Priority
478
873
  def priority; attributes[:"priority"]&.value; end
479
- # Gets the value of `weight` attribute in the message.
480
- #--
874
+ # Relative weight for round robin scheduling of the
875
+ # given shaper.
876
+ # The scheduling is applied to all sibling shapers
877
+ # with the same priority.
481
878
  # @rbs return: ::Integer
879
+ # @return [Integer]
880
+ # @see AttributeSets::NetShaper::Weight
482
881
  def weight; attributes[:"weight"]&.value; end
483
- # Gets the value of `ifindex` attribute in the message.
484
- #--
882
+ # Interface index owning the specified shaper.
485
883
  # @rbs return: ::Integer
884
+ # @return [Integer]
885
+ # @see AttributeSets::NetShaper::Ifindex
486
886
  def ifindex; attributes[:"ifindex"]&.value; end
487
- # Gets the value of `parent` attribute in the message.
488
- #--
887
+ # Identifier for the parent of the affected shaper.
888
+ # Only needed for `group` operation.
489
889
  # @rbs return: AttributeSets::Handle
890
+ # @return [AttributeSets::Handle]
891
+ # @see AttributeSets::NetShaper::Parent
490
892
  def parent; attributes[:"parent"]&.value; end
491
- # Gets the value of `leaves` attribute in the message.
492
- #--
493
- # @rbs return: AttributeSets::LeafInfo
494
- def leaves; attributes[:"leaves"]&.value; end
893
+ # Describes a set of leaves shapers for a `group` operation.
894
+ # @rbs return: ::Array[AttributeSets::LeafInfo]
895
+ # @return [Array<AttributeSets::LeafInfo>]
896
+ # @see AttributeSets::NetShaper::Leaves
897
+ def leaves; attributes[:"leaves"].map(&:value); end
495
898
  end
496
899
  # Create or update a scheduling group, attaching the specified
497
900
  # `leaves` shapers under the specified node identified by `handle.`
@@ -512,163 +915,240 @@ class NetShaper < ::Nl::Family
512
915
  # the device shaping configuration, otherwise the `node` shaper
513
916
  # full identifier, comprising `binding` and `handle`, is provided
514
917
  # as the reply.
515
- class DoGroupReply < ::Nl::Protocols::Genl::Message
918
+ #
919
+ #
920
+ # Requires CAP_NET_ADMIN in the initial user namespace.
921
+ class DoGroupReply < ::Nl::Genl::Message
516
922
  TYPE = 4
517
923
  FIXED_HEADER = nil
518
924
  ATTRIBUTE_SET = AttributeSets::NetShaper
519
925
  ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
520
- # Gets the value of `handle` attribute in the message.
521
- #--
926
+ # Unique identifier for the given shaper inside the owning device.
522
927
  # @rbs return: AttributeSets::Handle
928
+ # @return [AttributeSets::Handle]
929
+ # @see AttributeSets::NetShaper::Handle
523
930
  def handle; attributes[:"handle"]&.value; end
524
- # Gets the value of `ifindex` attribute in the message.
525
- #--
931
+ # Interface index owning the specified shaper.
526
932
  # @rbs return: ::Integer
933
+ # @return [Integer]
934
+ # @see AttributeSets::NetShaper::Ifindex
527
935
  def ifindex; attributes[:"ifindex"]&.value; end
528
936
  end
529
937
  # Get the shaper capabilities supported by the given device
530
938
  # for the specified scope.
531
- class DoCapGetRequest < ::Nl::Protocols::Genl::Message
939
+ class DoCapGetRequest < ::Nl::Genl::Message
532
940
  TYPE = 5
533
941
  FIXED_HEADER = nil
534
942
  ATTRIBUTE_SET = AttributeSets::Caps
535
943
  ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope])
536
- # Gets the value of `ifindex` attribute in the message.
537
- #--
944
+ # Interface index queried for shapers capabilities.
538
945
  # @rbs return: ::Integer
946
+ # @return [Integer]
947
+ # @see AttributeSets::Caps::Ifindex
539
948
  def ifindex; attributes[:"ifindex"]&.value; end
540
- # Gets the value of `scope` attribute in the message.
541
- #--
949
+ # The scope to which the queried capabilities apply.
950
+ #
951
+ # Known enum values are defined in {Enums::Scope}.
542
952
  # @rbs return: ::Integer
953
+ # @return [Integer]
954
+ # @see AttributeSets::Caps::Scope
543
955
  def scope; attributes[:"scope"]&.value; end
544
956
  end
545
957
  # Get the shaper capabilities supported by the given device
546
958
  # for the specified scope.
547
- class DoCapGetReply < ::Nl::Protocols::Genl::Message
959
+ class DoCapGetReply < ::Nl::Genl::Message
548
960
  TYPE = 5
549
961
  FIXED_HEADER = nil
550
962
  ATTRIBUTE_SET = AttributeSets::Caps
551
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])
552
- # Gets the value of `ifindex` attribute in the message.
553
- #--
964
+ # Interface index queried for shapers capabilities.
554
965
  # @rbs return: ::Integer
966
+ # @return [Integer]
967
+ # @see AttributeSets::Caps::Ifindex
555
968
  def ifindex; attributes[:"ifindex"]&.value; end
556
- # Gets the value of `scope` attribute in the message.
557
- #--
969
+ # The scope to which the queried capabilities apply.
970
+ #
971
+ # Known enum values are defined in {Enums::Scope}.
558
972
  # @rbs return: ::Integer
973
+ # @return [Integer]
974
+ # @see AttributeSets::Caps::Scope
559
975
  def scope; attributes[:"scope"]&.value; end
560
- # Gets the value of `support-metric-bps` attribute in the message.
561
- #--
976
+ # The device accepts 'bps' metric for bw-min, bw-max and burst.
562
977
  # @rbs return: ::Integer
978
+ # @return [Integer]
979
+ # @see AttributeSets::Caps::SupportMetricBps
563
980
  def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
564
- # Gets the value of `support-metric-pps` attribute in the message.
565
- #--
981
+ # The device accepts 'pps' metric for bw-min, bw-max and burst.
566
982
  # @rbs return: ::Integer
983
+ # @return [Integer]
984
+ # @see AttributeSets::Caps::SupportMetricPps
567
985
  def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
568
- # Gets the value of `support-nesting` attribute in the message.
569
- #--
986
+ # The device supports nesting shaper belonging to this scope
987
+ # below 'node' scoped shapers. Only 'queue' and 'node'
988
+ # scope can have flag 'support-nesting'.
570
989
  # @rbs return: ::Integer
990
+ # @return [Integer]
991
+ # @see AttributeSets::Caps::SupportNesting
571
992
  def support_nesting; attributes[:"support_nesting"]&.value; end
572
- # Gets the value of `support-bw-min` attribute in the message.
573
- #--
993
+ # The device supports a minimum guaranteed B/W.
574
994
  # @rbs return: ::Integer
995
+ # @return [Integer]
996
+ # @see AttributeSets::Caps::SupportBwMin
575
997
  def support_bw_min; attributes[:"support_bw_min"]&.value; end
576
- # Gets the value of `support-bw-max` attribute in the message.
577
- #--
998
+ # The device supports maximum B/W shaping.
578
999
  # @rbs return: ::Integer
1000
+ # @return [Integer]
1001
+ # @see AttributeSets::Caps::SupportBwMax
579
1002
  def support_bw_max; attributes[:"support_bw_max"]&.value; end
580
- # Gets the value of `support-burst` attribute in the message.
581
- #--
1003
+ # The device supports a maximum burst size.
582
1004
  # @rbs return: ::Integer
1005
+ # @return [Integer]
1006
+ # @see AttributeSets::Caps::SupportBurst
583
1007
  def support_burst; attributes[:"support_burst"]&.value; end
584
- # Gets the value of `support-priority` attribute in the message.
585
- #--
1008
+ # The device supports priority scheduling.
586
1009
  # @rbs return: ::Integer
1010
+ # @return [Integer]
1011
+ # @see AttributeSets::Caps::SupportPriority
587
1012
  def support_priority; attributes[:"support_priority"]&.value; end
588
- # Gets the value of `support-weight` attribute in the message.
589
- #--
1013
+ # The device supports weighted round robin scheduling.
590
1014
  # @rbs return: ::Integer
1015
+ # @return [Integer]
1016
+ # @see AttributeSets::Caps::SupportWeight
591
1017
  def support_weight; attributes[:"support_weight"]&.value; end
592
1018
  end
593
1019
  # Get the shaper capabilities supported by the given device
594
1020
  # for the specified scope.
595
- class DumpCapGetRequest < ::Nl::Protocols::Genl::Message
1021
+ class DumpCapGetRequest < ::Nl::Genl::Message
596
1022
  TYPE = 5
597
1023
  FIXED_HEADER = nil
598
1024
  ATTRIBUTE_SET = AttributeSets::Caps
599
1025
  ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
600
- # Gets the value of `ifindex` attribute in the message.
601
- #--
1026
+ # Interface index queried for shapers capabilities.
602
1027
  # @rbs return: ::Integer
1028
+ # @return [Integer]
1029
+ # @see AttributeSets::Caps::Ifindex
603
1030
  def ifindex; attributes[:"ifindex"]&.value; end
604
1031
  end
605
1032
  # Get the shaper capabilities supported by the given device
606
1033
  # for the specified scope.
607
- class DumpCapGetReply < ::Nl::Protocols::Genl::Message
1034
+ class DumpCapGetReply < ::Nl::Genl::Message
608
1035
  TYPE = 5
609
1036
  FIXED_HEADER = nil
610
1037
  ATTRIBUTE_SET = AttributeSets::Caps
611
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])
612
- # Gets the value of `ifindex` attribute in the message.
613
- #--
1039
+ # Interface index queried for shapers capabilities.
614
1040
  # @rbs return: ::Integer
1041
+ # @return [Integer]
1042
+ # @see AttributeSets::Caps::Ifindex
615
1043
  def ifindex; attributes[:"ifindex"]&.value; end
616
- # Gets the value of `scope` attribute in the message.
617
- #--
1044
+ # The scope to which the queried capabilities apply.
1045
+ #
1046
+ # Known enum values are defined in {Enums::Scope}.
618
1047
  # @rbs return: ::Integer
1048
+ # @return [Integer]
1049
+ # @see AttributeSets::Caps::Scope
619
1050
  def scope; attributes[:"scope"]&.value; end
620
- # Gets the value of `support-metric-bps` attribute in the message.
621
- #--
1051
+ # The device accepts 'bps' metric for bw-min, bw-max and burst.
622
1052
  # @rbs return: ::Integer
1053
+ # @return [Integer]
1054
+ # @see AttributeSets::Caps::SupportMetricBps
623
1055
  def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
624
- # Gets the value of `support-metric-pps` attribute in the message.
625
- #--
1056
+ # The device accepts 'pps' metric for bw-min, bw-max and burst.
626
1057
  # @rbs return: ::Integer
1058
+ # @return [Integer]
1059
+ # @see AttributeSets::Caps::SupportMetricPps
627
1060
  def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
628
- # Gets the value of `support-nesting` attribute in the message.
629
- #--
1061
+ # The device supports nesting shaper belonging to this scope
1062
+ # below 'node' scoped shapers. Only 'queue' and 'node'
1063
+ # scope can have flag 'support-nesting'.
630
1064
  # @rbs return: ::Integer
1065
+ # @return [Integer]
1066
+ # @see AttributeSets::Caps::SupportNesting
631
1067
  def support_nesting; attributes[:"support_nesting"]&.value; end
632
- # Gets the value of `support-bw-min` attribute in the message.
633
- #--
1068
+ # The device supports a minimum guaranteed B/W.
634
1069
  # @rbs return: ::Integer
1070
+ # @return [Integer]
1071
+ # @see AttributeSets::Caps::SupportBwMin
635
1072
  def support_bw_min; attributes[:"support_bw_min"]&.value; end
636
- # Gets the value of `support-bw-max` attribute in the message.
637
- #--
1073
+ # The device supports maximum B/W shaping.
638
1074
  # @rbs return: ::Integer
1075
+ # @return [Integer]
1076
+ # @see AttributeSets::Caps::SupportBwMax
639
1077
  def support_bw_max; attributes[:"support_bw_max"]&.value; end
640
- # Gets the value of `support-burst` attribute in the message.
641
- #--
1078
+ # The device supports a maximum burst size.
642
1079
  # @rbs return: ::Integer
1080
+ # @return [Integer]
1081
+ # @see AttributeSets::Caps::SupportBurst
643
1082
  def support_burst; attributes[:"support_burst"]&.value; end
644
- # Gets the value of `support-priority` attribute in the message.
645
- #--
1083
+ # The device supports priority scheduling.
646
1084
  # @rbs return: ::Integer
1085
+ # @return [Integer]
1086
+ # @see AttributeSets::Caps::SupportPriority
647
1087
  def support_priority; attributes[:"support_priority"]&.value; end
648
- # Gets the value of `support-weight` attribute in the message.
649
- #--
1088
+ # The device supports weighted round robin scheduling.
650
1089
  # @rbs return: ::Integer
1090
+ # @return [Integer]
1091
+ # @see AttributeSets::Caps::SupportWeight
651
1092
  def support_weight; attributes[:"support_weight"]&.value; end
652
1093
  end
653
1094
  end
1095
+ module Notifications
1096
+ end
1097
+ # @private
1098
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
654
1099
  # Get information about a shaper for a given device.
655
- #--
656
- # @rbs (?handle: AttributeSets::Handle, ?ifindex: ::Integer) -> Messages::DoGetReply
1100
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?ifindex: ::Integer) -> Messages::DoGetReply
1101
+ # @param [Hash] args
1102
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1103
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1104
+ # @return [Messages::DoGetReply]
1105
+ # @see Messages::DoGetRequest
657
1106
  def do_get(**args)
658
1107
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
659
1108
  end
660
1109
  # Get information about a shaper for a given device.
661
- #--
662
- # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpGetReply]
1110
+ # @rbs (?ifindex: ::Integer) -> Array[Messages::DumpGetReply]
663
1111
  # | (?ifindex: ::Integer) { (Messages::DumpGetReply) -> void } -> void
1112
+ # @overload dump_get(**args)
1113
+ # Returns an array when no block is given.
1114
+ # @param [Hash] args
1115
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1116
+ # @return [Array<Messages::DumpGetReply>]
1117
+ # @overload dump_get(**args, &block)
1118
+ # Yields each reply when a block is given.
1119
+ # @param [Hash] args
1120
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1121
+ # @yieldparam [Messages::DumpGetReply] reply
1122
+ # @return [void]
1123
+ # @see Messages::DumpGetRequest
664
1124
  def dump_get(**args, &block)
665
1125
  exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
666
1126
  end
667
1127
  # Create or update the specified shaper.
668
1128
  # The set operation can't be used to create a `node` scope shaper,
669
1129
  # use the `group` operation instead.
670
- #--
671
- # @rbs (?handle: AttributeSets::Handle, ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer) -> void
1130
+ #
1131
+ #
1132
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1133
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer) -> void
1134
+ # @param [Hash] args
1135
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1136
+ # @option args [Integer] metric Metric used by the given shaper for bw-min, bw-max and burst.
1137
+ #
1138
+ # Known enum values are defined in {Enums::Metric}.
1139
+ # @option args [Integer] bw_min Guaranteed bandwidth for the given shaper.
1140
+ # @option args [Integer] bw_max Maximum bandwidth for the given shaper or 0 when unlimited.
1141
+ # @option args [Integer] burst Maximum burst-size for shaping. Should not be interpreted
1142
+ # as a quantum.
1143
+ # @option args [Integer] priority Scheduling priority for the given shaper. The priority
1144
+ # scheduling is applied to sibling shapers.
1145
+ # @option args [Integer] weight Relative weight for round robin scheduling of the
1146
+ # given shaper.
1147
+ # The scheduling is applied to all sibling shapers
1148
+ # with the same priority.
1149
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1150
+ # @return [void]
1151
+ # @see Messages::DoSetRequest
672
1152
  def do_set(**args)
673
1153
  exchange_message(:"do", Messages::DoSetRequest, nil, args)
674
1154
  end
@@ -683,8 +1163,15 @@ class NetShaper < ::Nl::Family
683
1163
  # queue/device can still send traffic: it has an implicit
684
1164
  # node with infinite bandwidth. The queue's implicit node
685
1165
  # feeds an implicit RR node at the root of the hierarchy.
686
- #--
687
- # @rbs (?handle: AttributeSets::Handle, ?ifindex: ::Integer) -> void
1166
+ #
1167
+ #
1168
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1169
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?ifindex: ::Integer) -> void
1170
+ # @param [Hash] args
1171
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1172
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1173
+ # @return [void]
1174
+ # @see Messages::DoDeleteRequest
688
1175
  def do_delete(**args)
689
1176
  exchange_message(:"do", Messages::DoDeleteRequest, nil, args)
690
1177
  end
@@ -707,25 +1194,219 @@ class NetShaper < ::Nl::Family
707
1194
  # the device shaping configuration, otherwise the `node` shaper
708
1195
  # full identifier, comprising `binding` and `handle`, is provided
709
1196
  # as the reply.
710
- #--
711
- # @rbs (?handle: AttributeSets::Handle, ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer, ?parent: AttributeSets::Handle, ?leaves: AttributeSets::LeafInfo) -> Messages::DoGroupReply
1197
+ #
1198
+ #
1199
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1200
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer, ?parent: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?leaves: ::Array[(AttributeSets::LeafInfo | ::Hash[::Symbol, untyped])]) -> Messages::DoGroupReply
1201
+ # @param [Hash] args
1202
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1203
+ # @option args [Integer] metric Metric used by the given shaper for bw-min, bw-max and burst.
1204
+ #
1205
+ # Known enum values are defined in {Enums::Metric}.
1206
+ # @option args [Integer] bw_min Guaranteed bandwidth for the given shaper.
1207
+ # @option args [Integer] bw_max Maximum bandwidth for the given shaper or 0 when unlimited.
1208
+ # @option args [Integer] burst Maximum burst-size for shaping. Should not be interpreted
1209
+ # as a quantum.
1210
+ # @option args [Integer] priority Scheduling priority for the given shaper. The priority
1211
+ # scheduling is applied to sibling shapers.
1212
+ # @option args [Integer] weight Relative weight for round robin scheduling of the
1213
+ # given shaper.
1214
+ # The scheduling is applied to all sibling shapers
1215
+ # with the same priority.
1216
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1217
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] parent Identifier for the parent of the affected shaper.
1218
+ # Only needed for `group` operation.
1219
+ # @option args [Array<AttributeSets::LeafInfo, Hash<Symbol, Object>>] leaves Describes a set of leaves shapers for a `group` operation.
1220
+ # @return [Messages::DoGroupReply]
1221
+ # @see Messages::DoGroupRequest
712
1222
  def do_group(**args)
713
1223
  exchange_message(:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args)
714
1224
  end
715
1225
  # Get the shaper capabilities supported by the given device
716
1226
  # for the specified scope.
717
- #--
718
1227
  # @rbs (?ifindex: ::Integer, ?scope: ::Integer) -> Messages::DoCapGetReply
1228
+ # @param [Hash] args
1229
+ # @option args [Integer] ifindex Interface index queried for shapers capabilities.
1230
+ # @option args [Integer] scope The scope to which the queried capabilities apply.
1231
+ #
1232
+ # Known enum values are defined in {Enums::Scope}.
1233
+ # @return [Messages::DoCapGetReply]
1234
+ # @see Messages::DoCapGetRequest
719
1235
  def do_cap_get(**args)
720
1236
  exchange_message(:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args)
721
1237
  end
722
1238
  # Get the shaper capabilities supported by the given device
723
1239
  # for the specified scope.
724
- #--
725
- # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpCapGetReply]
1240
+ # @rbs (?ifindex: ::Integer) -> Array[Messages::DumpCapGetReply]
726
1241
  # | (?ifindex: ::Integer) { (Messages::DumpCapGetReply) -> void } -> void
1242
+ # @overload dump_cap_get(**args)
1243
+ # Returns an array when no block is given.
1244
+ # @param [Hash] args
1245
+ # @option args [Integer] ifindex Interface index queried for shapers capabilities.
1246
+ # @return [Array<Messages::DumpCapGetReply>]
1247
+ # @overload dump_cap_get(**args, &block)
1248
+ # Yields each reply when a block is given.
1249
+ # @param [Hash] args
1250
+ # @option args [Integer] ifindex Interface index queried for shapers capabilities.
1251
+ # @yieldparam [Messages::DumpCapGetReply] reply
1252
+ # @return [void]
1253
+ # @see Messages::DumpCapGetRequest
727
1254
  def dump_cap_get(**args, &block)
728
1255
  exchange_message(:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args, &block)
729
1256
  end
1257
+ class AsyncOperations
1258
+ # @private
1259
+ def initialize(&exchange)
1260
+ @exchange = exchange
1261
+ end
1262
+ # Get information about a shaper for a given device.
1263
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?ifindex: ::Integer) -> ::Nl::Async::Future[Messages::DoGetReply]
1264
+ # @param [Hash] args
1265
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1266
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1267
+ # @return [Nl::Async::Future<Messages::DoGetReply>]
1268
+ # @see Messages::DoGetRequest
1269
+ def do_get(**args)
1270
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
1271
+ end
1272
+ # Get information about a shaper for a given device.
1273
+ # @rbs (?ifindex: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetReply]
1274
+ # @param [Hash] args
1275
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1276
+ # @return [Nl::Async::Stream<Messages::DumpGetReply>]
1277
+ # @see Messages::DumpGetRequest
1278
+ def dump_get(**args)
1279
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
1280
+ end
1281
+ # Create or update the specified shaper.
1282
+ # The set operation can't be used to create a `node` scope shaper,
1283
+ # use the `group` operation instead.
1284
+ #
1285
+ #
1286
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1287
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer) -> ::Nl::Async::Future[void]
1288
+ # @param [Hash] args
1289
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1290
+ # @option args [Integer] metric Metric used by the given shaper for bw-min, bw-max and burst.
1291
+ #
1292
+ # Known enum values are defined in {Enums::Metric}.
1293
+ # @option args [Integer] bw_min Guaranteed bandwidth for the given shaper.
1294
+ # @option args [Integer] bw_max Maximum bandwidth for the given shaper or 0 when unlimited.
1295
+ # @option args [Integer] burst Maximum burst-size for shaping. Should not be interpreted
1296
+ # as a quantum.
1297
+ # @option args [Integer] priority Scheduling priority for the given shaper. The priority
1298
+ # scheduling is applied to sibling shapers.
1299
+ # @option args [Integer] weight Relative weight for round robin scheduling of the
1300
+ # given shaper.
1301
+ # The scheduling is applied to all sibling shapers
1302
+ # with the same priority.
1303
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1304
+ # @return [Nl::Async::Future<void>]
1305
+ # @see Messages::DoSetRequest
1306
+ def do_set(**args)
1307
+ @exchange.call(:"do", Messages::DoSetRequest, nil, args)
1308
+ end
1309
+ # Clear (remove) the specified shaper. When deleting
1310
+ # a `node` shaper, reattach all the node's leaves to the
1311
+ # deleted node's parent.
1312
+ # If, after the removal, the parent shaper has no more
1313
+ # leaves and the parent shaper scope is `node`, the parent
1314
+ # node is deleted, recursively.
1315
+ # When deleting a `queue` shaper or a `netdev` shaper,
1316
+ # the shaper disappears from the hierarchy, but the
1317
+ # queue/device can still send traffic: it has an implicit
1318
+ # node with infinite bandwidth. The queue's implicit node
1319
+ # feeds an implicit RR node at the root of the hierarchy.
1320
+ #
1321
+ #
1322
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1323
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?ifindex: ::Integer) -> ::Nl::Async::Future[void]
1324
+ # @param [Hash] args
1325
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1326
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1327
+ # @return [Nl::Async::Future<void>]
1328
+ # @see Messages::DoDeleteRequest
1329
+ def do_delete(**args)
1330
+ @exchange.call(:"do", Messages::DoDeleteRequest, nil, args)
1331
+ end
1332
+ # Create or update a scheduling group, attaching the specified
1333
+ # `leaves` shapers under the specified node identified by `handle.`
1334
+ # The `leaves` shapers scope must be `queue` and the node shaper
1335
+ # scope must be either `node` or `netdev.`
1336
+ # When the node shaper has `node` scope, if the `handle` `id` is not
1337
+ # specified, a new shaper of such scope is created, otherwise the
1338
+ # specified node must already exist.
1339
+ # When updating an existing node shaper, the specified `leaves` are
1340
+ # added to the existing node; such node will also retain any preexisting
1341
+ # leave.
1342
+ # The `parent` handle for a new node shaper defaults to the parent
1343
+ # of all the leaves, provided all the leaves share the same parent.
1344
+ # Otherwise `parent` handle must be specified.
1345
+ # The user can optionally provide shaping attributes for the node
1346
+ # shaper.
1347
+ # The operation is atomic, on failure no change is applied to
1348
+ # the device shaping configuration, otherwise the `node` shaper
1349
+ # full identifier, comprising `binding` and `handle`, is provided
1350
+ # as the reply.
1351
+ #
1352
+ #
1353
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1354
+ # @rbs (?handle: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer, ?parent: (AttributeSets::Handle | ::Hash[::Symbol, untyped]), ?leaves: ::Array[(AttributeSets::LeafInfo | ::Hash[::Symbol, untyped])]) -> ::Nl::Async::Future[Messages::DoGroupReply]
1355
+ # @param [Hash] args
1356
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] handle Unique identifier for the given shaper inside the owning device.
1357
+ # @option args [Integer] metric Metric used by the given shaper for bw-min, bw-max and burst.
1358
+ #
1359
+ # Known enum values are defined in {Enums::Metric}.
1360
+ # @option args [Integer] bw_min Guaranteed bandwidth for the given shaper.
1361
+ # @option args [Integer] bw_max Maximum bandwidth for the given shaper or 0 when unlimited.
1362
+ # @option args [Integer] burst Maximum burst-size for shaping. Should not be interpreted
1363
+ # as a quantum.
1364
+ # @option args [Integer] priority Scheduling priority for the given shaper. The priority
1365
+ # scheduling is applied to sibling shapers.
1366
+ # @option args [Integer] weight Relative weight for round robin scheduling of the
1367
+ # given shaper.
1368
+ # The scheduling is applied to all sibling shapers
1369
+ # with the same priority.
1370
+ # @option args [Integer] ifindex Interface index owning the specified shaper.
1371
+ # @option args [AttributeSets::Handle, Hash<Symbol, Object>] parent Identifier for the parent of the affected shaper.
1372
+ # Only needed for `group` operation.
1373
+ # @option args [Array<AttributeSets::LeafInfo, Hash<Symbol, Object>>] leaves Describes a set of leaves shapers for a `group` operation.
1374
+ # @return [Nl::Async::Future<Messages::DoGroupReply>]
1375
+ # @see Messages::DoGroupRequest
1376
+ def do_group(**args)
1377
+ @exchange.call(:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args)
1378
+ end
1379
+ # Get the shaper capabilities supported by the given device
1380
+ # for the specified scope.
1381
+ # @rbs (?ifindex: ::Integer, ?scope: ::Integer) -> ::Nl::Async::Future[Messages::DoCapGetReply]
1382
+ # @param [Hash] args
1383
+ # @option args [Integer] ifindex Interface index queried for shapers capabilities.
1384
+ # @option args [Integer] scope The scope to which the queried capabilities apply.
1385
+ #
1386
+ # Known enum values are defined in {Enums::Scope}.
1387
+ # @return [Nl::Async::Future<Messages::DoCapGetReply>]
1388
+ # @see Messages::DoCapGetRequest
1389
+ def do_cap_get(**args)
1390
+ @exchange.call(:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args)
1391
+ end
1392
+ # Get the shaper capabilities supported by the given device
1393
+ # for the specified scope.
1394
+ # @rbs (?ifindex: ::Integer) -> ::Nl::Async::Stream[Messages::DumpCapGetReply]
1395
+ # @param [Hash] args
1396
+ # @option args [Integer] ifindex Interface index queried for shapers capabilities.
1397
+ # @return [Nl::Async::Stream<Messages::DumpCapGetReply>]
1398
+ # @see Messages::DumpCapGetRequest
1399
+ def dump_cap_get(**args)
1400
+ @exchange.call(:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args)
1401
+ end
1402
+ end
1403
+ # Returns the asynchronous operation facade for this family.
1404
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1405
+ # @param [::Integer, nil] stream_capacity
1406
+ # @return [AsyncOperations]
1407
+ def async(stream_capacity: nil)
1408
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
1409
+ build_async_facade(AsyncOperations, stream_capacity:)
1410
+ end
730
1411
  end
731
1412
  end; end