nl-linux 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,729 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ # Networking HW rate limiting configuration.
8
+ #
9
+ # This API allows configuring HW shapers available on the network
10
+ # devices at different levels (queues, network device) and allows
11
+ # arbitrary manipulation of the scheduling tree of the involved
12
+ # shapers.
13
+ #
14
+ # Each `shaper` is identified within the given device, by a `handle`,
15
+ # comprising both a `scope` and an `id.`
16
+ #
17
+ # Depending on the `scope` value, the shapers are attached to specific
18
+ # HW objects (queues, devices) or, for `node` scope, represent a
19
+ # scheduling group, that can be placed in an arbitrary location of
20
+ # the scheduling tree.
21
+ #
22
+ # Shapers can be created with two different operations: the `set`
23
+ # operation, to create and update a single "attached" shaper, and
24
+ # the `group` operation, to create and update a scheduling
25
+ # group. Only the `group` operation can create `node` scope shapers.
26
+ #
27
+ # Existing shapers can be deleted/reset via the `delete` operation.
28
+ #
29
+ # The user can query the running configuration via the `get` operation.
30
+ #
31
+ # Different devices can provide different feature sets, e.g. with no
32
+ # support for complex scheduling hierarchy, or for some shaping
33
+ # parameters. The user can introspect the HW capabilities via the
34
+ # `cap-get` operation.
35
+ class Nl::Linux::NetShaper < ::Nl::Family
36
+ NAME = "net-shaper"
37
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("net-shaper"))
38
+ module Structs
39
+ end
40
+ module AttributeSets
41
+ class NetShaper < ::Nl::Protocols::Genl::AttributeSet
42
+ # Abstract class
43
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
44
+ end
45
+ class Handle < Attribute
46
+ TYPE = 1
47
+ NAME = :"handle"
48
+ end
49
+ class Metric < Attribute
50
+ TYPE = 2
51
+ NAME = :"metric"
52
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
53
+ end
54
+ class BwMin < Attribute
55
+ TYPE = 3
56
+ NAME = :"bw_min"
57
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
58
+ end
59
+ class BwMax < Attribute
60
+ TYPE = 4
61
+ NAME = :"bw_max"
62
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
63
+ end
64
+ class Burst < Attribute
65
+ TYPE = 5
66
+ NAME = :"burst"
67
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
68
+ end
69
+ class Priority < Attribute
70
+ TYPE = 6
71
+ NAME = :"priority"
72
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
73
+ end
74
+ class Weight < Attribute
75
+ TYPE = 7
76
+ NAME = :"weight"
77
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
78
+ end
79
+ class Ifindex < Attribute
80
+ TYPE = 8
81
+ NAME = :"ifindex"
82
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
83
+ end
84
+ class Parent < Attribute
85
+ TYPE = 9
86
+ NAME = :"parent"
87
+ end
88
+ class Leaves < Attribute
89
+ TYPE = 10
90
+ NAME = :"leaves"
91
+ end
92
+ # :nodoc:
93
+ 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]
94
+ # :nodoc:
95
+ 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]
96
+ class << self
97
+ # Looks up Attribute class by name.
98
+ #--
99
+ # @rbs name: Symbol
100
+ # @rbs return: Attribute
101
+ def by_name(name); BY_NAME.fetch(name); end
102
+ # Looks up Attribute class by type value.
103
+ #--
104
+ # @rbs type: Integer
105
+ # @rbs return: Attribute
106
+ def by_type(type); BY_TYPE.fetch(type); end
107
+ end
108
+ end
109
+ class Handle < ::Nl::Protocols::Genl::AttributeSet
110
+ # Abstract class
111
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
112
+ end
113
+ class Scope < Attribute
114
+ TYPE = 1
115
+ NAME = :"scope"
116
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
117
+ end
118
+ class Id < Attribute
119
+ TYPE = 2
120
+ NAME = :"id"
121
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
122
+ end
123
+ # :nodoc:
124
+ BY_NAME = Ractor.make_shareable({:"scope" => Scope, :"id" => Id}) #: Hash[::Symbol, Attribute]
125
+ # :nodoc:
126
+ BY_TYPE = Ractor.make_shareable({1 => Scope, 2 => Id}) #: Hash[::Integer, Attribute]
127
+ class << self
128
+ # Looks up Attribute class by name.
129
+ #--
130
+ # @rbs name: Symbol
131
+ # @rbs return: Attribute
132
+ def by_name(name); BY_NAME.fetch(name); end
133
+ # Looks up Attribute class by type value.
134
+ #--
135
+ # @rbs type: Integer
136
+ # @rbs return: Attribute
137
+ def by_type(type); BY_TYPE.fetch(type); end
138
+ end
139
+ end
140
+ class LeafInfo < ::Nl::Protocols::Genl::AttributeSet
141
+ # Abstract class
142
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
143
+ end
144
+ class Handle < Attribute
145
+ TYPE = 1
146
+ NAME = :"handle"
147
+ end
148
+ class Priority < Attribute
149
+ TYPE = 6
150
+ NAME = :"priority"
151
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
152
+ end
153
+ class Weight < Attribute
154
+ TYPE = 7
155
+ NAME = :"weight"
156
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
157
+ end
158
+ # :nodoc:
159
+ BY_NAME = Ractor.make_shareable({:"handle" => Handle, :"priority" => Priority, :"weight" => Weight}) #: Hash[::Symbol, Attribute]
160
+ # :nodoc:
161
+ BY_TYPE = Ractor.make_shareable({1 => Handle, 6 => Priority, 7 => Weight}) #: Hash[::Integer, Attribute]
162
+ class << self
163
+ # Looks up Attribute class by name.
164
+ #--
165
+ # @rbs name: Symbol
166
+ # @rbs return: Attribute
167
+ def by_name(name); BY_NAME.fetch(name); end
168
+ # Looks up Attribute class by type value.
169
+ #--
170
+ # @rbs type: Integer
171
+ # @rbs return: Attribute
172
+ def by_type(type); BY_TYPE.fetch(type); end
173
+ end
174
+ end
175
+ class Caps < ::Nl::Protocols::Genl::AttributeSet
176
+ # Abstract class
177
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
178
+ end
179
+ class Ifindex < Attribute
180
+ TYPE = 1
181
+ NAME = :"ifindex"
182
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
183
+ end
184
+ class Scope < Attribute
185
+ TYPE = 2
186
+ NAME = :"scope"
187
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
188
+ end
189
+ class SupportMetricBps < Attribute
190
+ TYPE = 3
191
+ NAME = :"support_metric_bps"
192
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
193
+ end
194
+ class SupportMetricPps < Attribute
195
+ TYPE = 4
196
+ NAME = :"support_metric_pps"
197
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
198
+ end
199
+ class SupportNesting < Attribute
200
+ TYPE = 5
201
+ NAME = :"support_nesting"
202
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
203
+ end
204
+ class SupportBwMin < Attribute
205
+ TYPE = 6
206
+ NAME = :"support_bw_min"
207
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
208
+ end
209
+ class SupportBwMax < Attribute
210
+ TYPE = 7
211
+ NAME = :"support_bw_max"
212
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
213
+ end
214
+ class SupportBurst < Attribute
215
+ TYPE = 8
216
+ NAME = :"support_burst"
217
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
218
+ end
219
+ class SupportPriority < Attribute
220
+ TYPE = 9
221
+ NAME = :"support_priority"
222
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
223
+ end
224
+ class SupportWeight < Attribute
225
+ TYPE = 10
226
+ NAME = :"support_weight"
227
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
228
+ end
229
+ # :nodoc:
230
+ 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]
231
+ # :nodoc:
232
+ 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]
233
+ class << self
234
+ # Looks up Attribute class by name.
235
+ #--
236
+ # @rbs name: Symbol
237
+ # @rbs return: Attribute
238
+ def by_name(name); BY_NAME.fetch(name); end
239
+ # Looks up Attribute class by type value.
240
+ #--
241
+ # @rbs type: Integer
242
+ # @rbs return: Attribute
243
+ def by_type(type); BY_TYPE.fetch(type); end
244
+ end
245
+ end
246
+ NetShaper::Handle::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
247
+ NetShaper::Parent::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
248
+ NetShaper::Leaves::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(LeafInfo)
249
+ LeafInfo::Handle::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Handle)
250
+ end
251
+ module Messages
252
+ # Get information about a shaper for a given device.
253
+ class DoGetRequest < ::Nl::Protocols::Genl::Message
254
+ TYPE = 1
255
+ FIXED_HEADER = nil
256
+ ATTRIBUTE_SET = AttributeSets::NetShaper
257
+ ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
258
+ # Gets the value of `handle` attribute in the message.
259
+ #--
260
+ # @rbs return: AttributeSets::Handle
261
+ def handle; attributes[:"handle"]&.value; end
262
+ # Gets the value of `ifindex` attribute in the message.
263
+ #--
264
+ # @rbs return: ::Integer
265
+ def ifindex; attributes[:"ifindex"]&.value; end
266
+ end
267
+ # Get information about a shaper for a given device.
268
+ class DoGetReply < ::Nl::Protocols::Genl::Message
269
+ TYPE = 1
270
+ FIXED_HEADER = nil
271
+ ATTRIBUTE_SET = AttributeSets::NetShaper
272
+ ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
273
+ # Gets the value of `handle` attribute in the message.
274
+ #--
275
+ # @rbs return: AttributeSets::Handle
276
+ def handle; attributes[:"handle"]&.value; end
277
+ # Gets the value of `metric` attribute in the message.
278
+ #--
279
+ # @rbs return: ::Integer
280
+ def metric; attributes[:"metric"]&.value; end
281
+ # Gets the value of `bw-min` attribute in the message.
282
+ #--
283
+ # @rbs return: ::Integer
284
+ def bw_min; attributes[:"bw_min"]&.value; end
285
+ # Gets the value of `bw-max` attribute in the message.
286
+ #--
287
+ # @rbs return: ::Integer
288
+ def bw_max; attributes[:"bw_max"]&.value; end
289
+ # Gets the value of `burst` attribute in the message.
290
+ #--
291
+ # @rbs return: ::Integer
292
+ def burst; attributes[:"burst"]&.value; end
293
+ # Gets the value of `priority` attribute in the message.
294
+ #--
295
+ # @rbs return: ::Integer
296
+ def priority; attributes[:"priority"]&.value; end
297
+ # Gets the value of `weight` attribute in the message.
298
+ #--
299
+ # @rbs return: ::Integer
300
+ def weight; attributes[:"weight"]&.value; end
301
+ # Gets the value of `ifindex` attribute in the message.
302
+ #--
303
+ # @rbs return: ::Integer
304
+ def ifindex; attributes[:"ifindex"]&.value; end
305
+ # Gets the value of `parent` attribute in the message.
306
+ #--
307
+ # @rbs return: AttributeSets::Handle
308
+ def parent; attributes[:"parent"]&.value; end
309
+ end
310
+ # Get information about a shaper for a given device.
311
+ class DumpGetRequest < ::Nl::Protocols::Genl::Message
312
+ TYPE = 1
313
+ FIXED_HEADER = nil
314
+ ATTRIBUTE_SET = AttributeSets::NetShaper
315
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
316
+ # Gets the value of `ifindex` attribute in the message.
317
+ #--
318
+ # @rbs return: ::Integer
319
+ def ifindex; attributes[:"ifindex"]&.value; end
320
+ end
321
+ # Get information about a shaper for a given device.
322
+ class DumpGetReply < ::Nl::Protocols::Genl::Message
323
+ TYPE = 1
324
+ FIXED_HEADER = nil
325
+ ATTRIBUTE_SET = AttributeSets::NetShaper
326
+ ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
327
+ # Gets the value of `handle` attribute in the message.
328
+ #--
329
+ # @rbs return: AttributeSets::Handle
330
+ def handle; attributes[:"handle"]&.value; end
331
+ # Gets the value of `metric` attribute in the message.
332
+ #--
333
+ # @rbs return: ::Integer
334
+ def metric; attributes[:"metric"]&.value; end
335
+ # Gets the value of `bw-min` attribute in the message.
336
+ #--
337
+ # @rbs return: ::Integer
338
+ def bw_min; attributes[:"bw_min"]&.value; end
339
+ # Gets the value of `bw-max` attribute in the message.
340
+ #--
341
+ # @rbs return: ::Integer
342
+ def bw_max; attributes[:"bw_max"]&.value; end
343
+ # Gets the value of `burst` attribute in the message.
344
+ #--
345
+ # @rbs return: ::Integer
346
+ def burst; attributes[:"burst"]&.value; end
347
+ # Gets the value of `priority` attribute in the message.
348
+ #--
349
+ # @rbs return: ::Integer
350
+ def priority; attributes[:"priority"]&.value; end
351
+ # Gets the value of `weight` attribute in the message.
352
+ #--
353
+ # @rbs return: ::Integer
354
+ def weight; attributes[:"weight"]&.value; end
355
+ # Gets the value of `ifindex` attribute in the message.
356
+ #--
357
+ # @rbs return: ::Integer
358
+ def ifindex; attributes[:"ifindex"]&.value; end
359
+ # Gets the value of `parent` attribute in the message.
360
+ #--
361
+ # @rbs return: AttributeSets::Handle
362
+ def parent; attributes[:"parent"]&.value; end
363
+ end
364
+ # Create or update the specified shaper.
365
+ # The set operation can't be used to create a `node` scope shaper,
366
+ # use the `group` operation instead.
367
+ class DoSetRequest < ::Nl::Protocols::Genl::Message
368
+ TYPE = 2
369
+ FIXED_HEADER = nil
370
+ ATTRIBUTE_SET = AttributeSets::NetShaper
371
+ ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex])
372
+ # Gets the value of `handle` attribute in the message.
373
+ #--
374
+ # @rbs return: AttributeSets::Handle
375
+ def handle; attributes[:"handle"]&.value; end
376
+ # Gets the value of `metric` attribute in the message.
377
+ #--
378
+ # @rbs return: ::Integer
379
+ def metric; attributes[:"metric"]&.value; end
380
+ # Gets the value of `bw-min` attribute in the message.
381
+ #--
382
+ # @rbs return: ::Integer
383
+ def bw_min; attributes[:"bw_min"]&.value; end
384
+ # Gets the value of `bw-max` attribute in the message.
385
+ #--
386
+ # @rbs return: ::Integer
387
+ def bw_max; attributes[:"bw_max"]&.value; end
388
+ # Gets the value of `burst` attribute in the message.
389
+ #--
390
+ # @rbs return: ::Integer
391
+ def burst; attributes[:"burst"]&.value; end
392
+ # Gets the value of `priority` attribute in the message.
393
+ #--
394
+ # @rbs return: ::Integer
395
+ def priority; attributes[:"priority"]&.value; end
396
+ # Gets the value of `weight` attribute in the message.
397
+ #--
398
+ # @rbs return: ::Integer
399
+ def weight; attributes[:"weight"]&.value; end
400
+ # Gets the value of `ifindex` attribute in the message.
401
+ #--
402
+ # @rbs return: ::Integer
403
+ def ifindex; attributes[:"ifindex"]&.value; end
404
+ end
405
+ # Clear (remove) the specified shaper. When deleting
406
+ # a `node` shaper, reattach all the node's leaves to the
407
+ # deleted node's parent.
408
+ # If, after the removal, the parent shaper has no more
409
+ # leaves and the parent shaper scope is `node`, the parent
410
+ # node is deleted, recursively.
411
+ # When deleting a `queue` shaper or a `netdev` shaper,
412
+ # the shaper disappears from the hierarchy, but the
413
+ # queue/device can still send traffic: it has an implicit
414
+ # node with infinite bandwidth. The queue's implicit node
415
+ # feeds an implicit RR node at the root of the hierarchy.
416
+ class DoDeleteRequest < ::Nl::Protocols::Genl::Message
417
+ TYPE = 3
418
+ FIXED_HEADER = nil
419
+ ATTRIBUTE_SET = AttributeSets::NetShaper
420
+ ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
421
+ # Gets the value of `handle` attribute in the message.
422
+ #--
423
+ # @rbs return: AttributeSets::Handle
424
+ def handle; attributes[:"handle"]&.value; end
425
+ # Gets the value of `ifindex` attribute in the message.
426
+ #--
427
+ # @rbs return: ::Integer
428
+ def ifindex; attributes[:"ifindex"]&.value; end
429
+ end
430
+ # Create or update a scheduling group, attaching the specified
431
+ # `leaves` shapers under the specified node identified by `handle.`
432
+ # The `leaves` shapers scope must be `queue` and the node shaper
433
+ # scope must be either `node` or `netdev.`
434
+ # When the node shaper has `node` scope, if the `handle` `id` is not
435
+ # specified, a new shaper of such scope is created, otherwise the
436
+ # specified node must already exist.
437
+ # When updating an existing node shaper, the specified `leaves` are
438
+ # added to the existing node; such node will also retain any preexisting
439
+ # leave.
440
+ # The `parent` handle for a new node shaper defaults to the parent
441
+ # of all the leaves, provided all the leaves share the same parent.
442
+ # Otherwise `parent` handle must be specified.
443
+ # The user can optionally provide shaping attributes for the node
444
+ # shaper.
445
+ # The operation is atomic, on failure no change is applied to
446
+ # the device shaping configuration, otherwise the `node` shaper
447
+ # full identifier, comprising `binding` and `handle`, is provided
448
+ # as the reply.
449
+ class DoGroupRequest < ::Nl::Protocols::Genl::Message
450
+ TYPE = 4
451
+ FIXED_HEADER = nil
452
+ ATTRIBUTE_SET = AttributeSets::NetShaper
453
+ ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent leaves])
454
+ # Gets the value of `handle` attribute in the message.
455
+ #--
456
+ # @rbs return: AttributeSets::Handle
457
+ def handle; attributes[:"handle"]&.value; end
458
+ # Gets the value of `metric` attribute in the message.
459
+ #--
460
+ # @rbs return: ::Integer
461
+ def metric; attributes[:"metric"]&.value; end
462
+ # Gets the value of `bw-min` attribute in the message.
463
+ #--
464
+ # @rbs return: ::Integer
465
+ def bw_min; attributes[:"bw_min"]&.value; end
466
+ # Gets the value of `bw-max` attribute in the message.
467
+ #--
468
+ # @rbs return: ::Integer
469
+ def bw_max; attributes[:"bw_max"]&.value; end
470
+ # Gets the value of `burst` attribute in the message.
471
+ #--
472
+ # @rbs return: ::Integer
473
+ def burst; attributes[:"burst"]&.value; end
474
+ # Gets the value of `priority` attribute in the message.
475
+ #--
476
+ # @rbs return: ::Integer
477
+ def priority; attributes[:"priority"]&.value; end
478
+ # Gets the value of `weight` attribute in the message.
479
+ #--
480
+ # @rbs return: ::Integer
481
+ def weight; attributes[:"weight"]&.value; end
482
+ # Gets the value of `ifindex` attribute in the message.
483
+ #--
484
+ # @rbs return: ::Integer
485
+ def ifindex; attributes[:"ifindex"]&.value; end
486
+ # Gets the value of `parent` attribute in the message.
487
+ #--
488
+ # @rbs return: AttributeSets::Handle
489
+ def parent; attributes[:"parent"]&.value; end
490
+ # Gets the value of `leaves` attribute in the message.
491
+ #--
492
+ # @rbs return: AttributeSets::LeafInfo
493
+ def leaves; attributes[:"leaves"]&.value; end
494
+ end
495
+ # Create or update a scheduling group, attaching the specified
496
+ # `leaves` shapers under the specified node identified by `handle.`
497
+ # The `leaves` shapers scope must be `queue` and the node shaper
498
+ # scope must be either `node` or `netdev.`
499
+ # When the node shaper has `node` scope, if the `handle` `id` is not
500
+ # specified, a new shaper of such scope is created, otherwise the
501
+ # specified node must already exist.
502
+ # When updating an existing node shaper, the specified `leaves` are
503
+ # added to the existing node; such node will also retain any preexisting
504
+ # leave.
505
+ # The `parent` handle for a new node shaper defaults to the parent
506
+ # of all the leaves, provided all the leaves share the same parent.
507
+ # Otherwise `parent` handle must be specified.
508
+ # The user can optionally provide shaping attributes for the node
509
+ # shaper.
510
+ # The operation is atomic, on failure no change is applied to
511
+ # the device shaping configuration, otherwise the `node` shaper
512
+ # full identifier, comprising `binding` and `handle`, is provided
513
+ # as the reply.
514
+ class DoGroupReply < ::Nl::Protocols::Genl::Message
515
+ TYPE = 4
516
+ FIXED_HEADER = nil
517
+ ATTRIBUTE_SET = AttributeSets::NetShaper
518
+ ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
519
+ # Gets the value of `handle` attribute in the message.
520
+ #--
521
+ # @rbs return: AttributeSets::Handle
522
+ def handle; attributes[:"handle"]&.value; end
523
+ # Gets the value of `ifindex` attribute in the message.
524
+ #--
525
+ # @rbs return: ::Integer
526
+ def ifindex; attributes[:"ifindex"]&.value; end
527
+ end
528
+ # Get the shaper capabilities supported by the given device
529
+ # for the specified scope.
530
+ class DoCapGetRequest < ::Nl::Protocols::Genl::Message
531
+ TYPE = 5
532
+ FIXED_HEADER = nil
533
+ ATTRIBUTE_SET = AttributeSets::Caps
534
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope])
535
+ # Gets the value of `ifindex` attribute in the message.
536
+ #--
537
+ # @rbs return: ::Integer
538
+ def ifindex; attributes[:"ifindex"]&.value; end
539
+ # Gets the value of `scope` attribute in the message.
540
+ #--
541
+ # @rbs return: ::Integer
542
+ def scope; attributes[:"scope"]&.value; end
543
+ end
544
+ # Get the shaper capabilities supported by the given device
545
+ # for the specified scope.
546
+ class DoCapGetReply < ::Nl::Protocols::Genl::Message
547
+ TYPE = 5
548
+ FIXED_HEADER = nil
549
+ ATTRIBUTE_SET = AttributeSets::Caps
550
+ 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])
551
+ # Gets the value of `ifindex` attribute in the message.
552
+ #--
553
+ # @rbs return: ::Integer
554
+ def ifindex; attributes[:"ifindex"]&.value; end
555
+ # Gets the value of `scope` attribute in the message.
556
+ #--
557
+ # @rbs return: ::Integer
558
+ def scope; attributes[:"scope"]&.value; end
559
+ # Gets the value of `support-metric-bps` attribute in the message.
560
+ #--
561
+ # @rbs return: ::Integer
562
+ def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
563
+ # Gets the value of `support-metric-pps` attribute in the message.
564
+ #--
565
+ # @rbs return: ::Integer
566
+ def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
567
+ # Gets the value of `support-nesting` attribute in the message.
568
+ #--
569
+ # @rbs return: ::Integer
570
+ def support_nesting; attributes[:"support_nesting"]&.value; end
571
+ # Gets the value of `support-bw-min` attribute in the message.
572
+ #--
573
+ # @rbs return: ::Integer
574
+ def support_bw_min; attributes[:"support_bw_min"]&.value; end
575
+ # Gets the value of `support-bw-max` attribute in the message.
576
+ #--
577
+ # @rbs return: ::Integer
578
+ def support_bw_max; attributes[:"support_bw_max"]&.value; end
579
+ # Gets the value of `support-burst` attribute in the message.
580
+ #--
581
+ # @rbs return: ::Integer
582
+ def support_burst; attributes[:"support_burst"]&.value; end
583
+ # Gets the value of `support-priority` attribute in the message.
584
+ #--
585
+ # @rbs return: ::Integer
586
+ def support_priority; attributes[:"support_priority"]&.value; end
587
+ # Gets the value of `support-weight` attribute in the message.
588
+ #--
589
+ # @rbs return: ::Integer
590
+ def support_weight; attributes[:"support_weight"]&.value; end
591
+ end
592
+ # Get the shaper capabilities supported by the given device
593
+ # for the specified scope.
594
+ class DumpCapGetRequest < ::Nl::Protocols::Genl::Message
595
+ TYPE = 5
596
+ FIXED_HEADER = nil
597
+ ATTRIBUTE_SET = AttributeSets::Caps
598
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
599
+ # Gets the value of `ifindex` attribute in the message.
600
+ #--
601
+ # @rbs return: ::Integer
602
+ def ifindex; attributes[:"ifindex"]&.value; end
603
+ end
604
+ # Get the shaper capabilities supported by the given device
605
+ # for the specified scope.
606
+ class DumpCapGetReply < ::Nl::Protocols::Genl::Message
607
+ TYPE = 5
608
+ FIXED_HEADER = nil
609
+ ATTRIBUTE_SET = AttributeSets::Caps
610
+ 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])
611
+ # Gets the value of `ifindex` attribute in the message.
612
+ #--
613
+ # @rbs return: ::Integer
614
+ def ifindex; attributes[:"ifindex"]&.value; end
615
+ # Gets the value of `scope` attribute in the message.
616
+ #--
617
+ # @rbs return: ::Integer
618
+ def scope; attributes[:"scope"]&.value; end
619
+ # Gets the value of `support-metric-bps` attribute in the message.
620
+ #--
621
+ # @rbs return: ::Integer
622
+ def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
623
+ # Gets the value of `support-metric-pps` attribute in the message.
624
+ #--
625
+ # @rbs return: ::Integer
626
+ def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
627
+ # Gets the value of `support-nesting` attribute in the message.
628
+ #--
629
+ # @rbs return: ::Integer
630
+ def support_nesting; attributes[:"support_nesting"]&.value; end
631
+ # Gets the value of `support-bw-min` attribute in the message.
632
+ #--
633
+ # @rbs return: ::Integer
634
+ def support_bw_min; attributes[:"support_bw_min"]&.value; end
635
+ # Gets the value of `support-bw-max` attribute in the message.
636
+ #--
637
+ # @rbs return: ::Integer
638
+ def support_bw_max; attributes[:"support_bw_max"]&.value; end
639
+ # Gets the value of `support-burst` attribute in the message.
640
+ #--
641
+ # @rbs return: ::Integer
642
+ def support_burst; attributes[:"support_burst"]&.value; end
643
+ # Gets the value of `support-priority` attribute in the message.
644
+ #--
645
+ # @rbs return: ::Integer
646
+ def support_priority; attributes[:"support_priority"]&.value; end
647
+ # Gets the value of `support-weight` attribute in the message.
648
+ #--
649
+ # @rbs return: ::Integer
650
+ def support_weight; attributes[:"support_weight"]&.value; end
651
+ end
652
+ end
653
+ # Get information about a shaper for a given device.
654
+ #--
655
+ # @rbs (?handle: AttributeSets::Handle, ?ifindex: ::Integer) -> Messages::DoGetReply
656
+ def do_get(**args)
657
+ exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
658
+ end
659
+ # Get information about a shaper for a given device.
660
+ #--
661
+ # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpGetReply]
662
+ # | (?ifindex: ::Integer) { (Messages::DumpGetReply) -> void } -> void
663
+ def dump_get(**args, &block)
664
+ exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
665
+ end
666
+ # Create or update the specified shaper.
667
+ # The set operation can't be used to create a `node` scope shaper,
668
+ # use the `group` operation instead.
669
+ #--
670
+ # @rbs (?handle: AttributeSets::Handle, ?metric: ::Integer, ?bw_min: ::Integer, ?bw_max: ::Integer, ?burst: ::Integer, ?priority: ::Integer, ?weight: ::Integer, ?ifindex: ::Integer) -> void
671
+ def do_set(**args)
672
+ exchange_message(:"do", Messages::DoSetRequest, nil, args)
673
+ end
674
+ # Clear (remove) the specified shaper. When deleting
675
+ # a `node` shaper, reattach all the node's leaves to the
676
+ # deleted node's parent.
677
+ # If, after the removal, the parent shaper has no more
678
+ # leaves and the parent shaper scope is `node`, the parent
679
+ # node is deleted, recursively.
680
+ # When deleting a `queue` shaper or a `netdev` shaper,
681
+ # the shaper disappears from the hierarchy, but the
682
+ # queue/device can still send traffic: it has an implicit
683
+ # node with infinite bandwidth. The queue's implicit node
684
+ # feeds an implicit RR node at the root of the hierarchy.
685
+ #--
686
+ # @rbs (?handle: AttributeSets::Handle, ?ifindex: ::Integer) -> void
687
+ def do_delete(**args)
688
+ exchange_message(:"do", Messages::DoDeleteRequest, nil, args)
689
+ end
690
+ # Create or update a scheduling group, attaching the specified
691
+ # `leaves` shapers under the specified node identified by `handle.`
692
+ # The `leaves` shapers scope must be `queue` and the node shaper
693
+ # scope must be either `node` or `netdev.`
694
+ # When the node shaper has `node` scope, if the `handle` `id` is not
695
+ # specified, a new shaper of such scope is created, otherwise the
696
+ # specified node must already exist.
697
+ # When updating an existing node shaper, the specified `leaves` are
698
+ # added to the existing node; such node will also retain any preexisting
699
+ # leave.
700
+ # The `parent` handle for a new node shaper defaults to the parent
701
+ # of all the leaves, provided all the leaves share the same parent.
702
+ # Otherwise `parent` handle must be specified.
703
+ # The user can optionally provide shaping attributes for the node
704
+ # shaper.
705
+ # The operation is atomic, on failure no change is applied to
706
+ # the device shaping configuration, otherwise the `node` shaper
707
+ # full identifier, comprising `binding` and `handle`, is provided
708
+ # as the reply.
709
+ #--
710
+ # @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
711
+ def do_group(**args)
712
+ exchange_message(:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args)
713
+ end
714
+ # Get the shaper capabilities supported by the given device
715
+ # for the specified scope.
716
+ #--
717
+ # @rbs (?ifindex: ::Integer, ?scope: ::Integer) -> Messages::DoCapGetReply
718
+ def do_cap_get(**args)
719
+ exchange_message(:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args)
720
+ end
721
+ # Get the shaper capabilities supported by the given device
722
+ # for the specified scope.
723
+ #--
724
+ # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpCapGetReply]
725
+ # | (?ifindex: ::Integer) { (Messages::DumpCapGetReply) -> void } -> void
726
+ def dump_cap_get(**args, &block)
727
+ exchange_message(:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args, &block)
728
+ end
729
+ end