nl-linux 0.3.0 → 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.
- checksums.yaml +4 -4
- data/.yardopts +5 -0
- data/CHANGELOG.md +6 -0
- data/Rakefile +14 -2
- data/generated/nl/linux/binder.rb +172 -44
- data/generated/nl/linux/conntrack.rb +1293 -370
- data/generated/nl/linux/dev_energymodel.rb +278 -93
- data/generated/nl/linux/devlink.rb +5654 -1954
- data/generated/nl/linux/dpll.rb +1838 -669
- data/generated/nl/linux/drm_ras.rb +234 -72
- data/generated/nl/linux/ethtool.rb +6683 -2885
- data/generated/nl/linux/fou.rb +308 -129
- data/generated/nl/linux/handshake.rb +277 -99
- data/generated/nl/linux/lockd.rb +88 -33
- data/generated/nl/linux/mptcp_pm.rb +639 -186
- data/generated/nl/linux/net_shaper.rb +782 -224
- data/generated/nl/linux/netdev.rb +2105 -631
- data/generated/nl/linux/nfsd.rb +1030 -358
- data/generated/nl/linux/nftables.rb +5041 -1612
- data/generated/nl/linux/nl80211.rb +4531 -871
- data/generated/nl/linux/nlctrl.rb +411 -119
- data/generated/nl/linux/ovpn.rb +1211 -293
- data/generated/nl/linux/ovs_datapath.rb +271 -106
- data/generated/nl/linux/ovs_flow.rb +1819 -354
- data/generated/nl/linux/ovs_packet.rb +257 -82
- data/generated/nl/linux/ovs_vport.rb +334 -132
- data/generated/nl/linux/psp.rb +916 -281
- data/generated/nl/linux/rt_addr.rb +369 -166
- data/generated/nl/linux/rt_link.rb +6708 -1450
- data/generated/nl/linux/rt_neigh.rb +919 -364
- data/generated/nl/linux/rt_route.rb +1034 -448
- data/generated/nl/linux/rt_rule.rb +775 -395
- data/generated/nl/linux/sunrpc_cache.rb +297 -102
- data/generated/nl/linux/tc.rb +9989 -1780
- data/generated/nl/linux/tcp_metrics.rb +327 -105
- data/generated/nl/linux/team.rb +279 -93
- data/generated/nl/linux/wireguard.rb +432 -95
- data/generated/nl/linux.rb +1 -0
- data/lib/nl/linux/nlctrl_resolver.rb +31 -0
- data/lib/nl/linux/version.rb +1 -1
- data/sig/generated/nl/linux/binder.rbs +366 -0
- data/sig/generated/nl/linux/conntrack.rbs +2787 -0
- data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
- data/sig/generated/nl/linux/devlink.rbs +12496 -0
- data/sig/generated/nl/linux/dpll.rbs +3461 -0
- data/sig/generated/nl/linux/drm_ras.rbs +553 -0
- data/sig/generated/nl/linux/ethtool.rbs +15291 -0
- data/sig/generated/nl/linux/fou.rbs +702 -0
- data/sig/generated/nl/linux/handshake.rbs +622 -0
- data/sig/generated/nl/linux/lockd.rbs +234 -0
- data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
- data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
- data/sig/generated/nl/linux/netdev.rbs +4187 -0
- data/sig/generated/nl/linux/nfsd.rbs +2520 -0
- data/sig/generated/nl/linux/nftables.rbs +10304 -0
- data/sig/generated/nl/linux/nl80211.rbs +9786 -0
- data/sig/generated/nl/linux/nlctrl.rbs +944 -0
- data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
- data/sig/generated/nl/linux/ovpn.rbs +2564 -0
- data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
- data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
- data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
- data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
- data/sig/generated/nl/linux/psp.rbs +1846 -0
- data/sig/generated/nl/linux/rt_addr.rbs +866 -0
- data/sig/generated/nl/linux/rt_link.rbs +13438 -0
- data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
- data/sig/generated/nl/linux/rt_route.rbs +2218 -0
- data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
- data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
- data/sig/generated/nl/linux/tc.rbs +19931 -0
- data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
- data/sig/generated/nl/linux/team.rbs +733 -0
- data/sig/generated/nl/linux/version.rbs +7 -0
- data/sig/generated/nl/linux/wireguard.rbs +1006 -0
- data/sig/generated/nl/linux.rbs +6 -0
- data/sig/generated/nl-linux.rbs +2 -0
- metadata +46 -7
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
# This file is based on Documentation/netlink/specs/net_shaper.yaml from Linux v7.2.
|
|
4
4
|
#--
|
|
5
5
|
# frozen_string_literal: true
|
|
6
|
-
# rbs_inline: enabled
|
|
7
6
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
8
7
|
require 'nl'
|
|
9
8
|
module Nl; module Linux
|
|
@@ -35,334 +34,691 @@ module Nl; module Linux
|
|
|
35
34
|
# support for complex scheduling hierarchy, or for some shaping
|
|
36
35
|
# parameters. The user can introspect the HW capabilities via the
|
|
37
36
|
# `cap-get` operation.
|
|
38
|
-
class NetShaper < ::Nl::Family
|
|
37
|
+
class NetShaper < ::Nl::Genl::Family
|
|
39
38
|
NAME = "net-shaper"
|
|
40
|
-
|
|
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
|
|
41
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
|
|
42
86
|
module Structs
|
|
43
87
|
end
|
|
44
88
|
module AttributeSets
|
|
45
|
-
class NetShaper < ::Nl::
|
|
89
|
+
class NetShaper < ::Nl::AttributeSet
|
|
46
90
|
# Abstract class
|
|
47
|
-
class Attribute < ::Nl::
|
|
91
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
48
92
|
end
|
|
93
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
49
94
|
class Handle < Attribute
|
|
50
95
|
TYPE = 1
|
|
51
96
|
NAME = :"handle"
|
|
97
|
+
# @private
|
|
98
|
+
ORDER = 0
|
|
52
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}.
|
|
53
103
|
class Metric < Attribute
|
|
54
104
|
TYPE = 2
|
|
55
105
|
NAME = :"metric"
|
|
56
|
-
|
|
106
|
+
# @private
|
|
107
|
+
ORDER = 1
|
|
108
|
+
# @private
|
|
109
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
57
110
|
end
|
|
111
|
+
# Guaranteed bandwidth for the given shaper.
|
|
58
112
|
class BwMin < Attribute
|
|
59
113
|
TYPE = 3
|
|
60
114
|
NAME = :"bw_min"
|
|
61
|
-
|
|
115
|
+
# @private
|
|
116
|
+
ORDER = 2
|
|
117
|
+
# @private
|
|
118
|
+
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
62
119
|
end
|
|
120
|
+
# Maximum bandwidth for the given shaper or 0 when unlimited.
|
|
63
121
|
class BwMax < Attribute
|
|
64
122
|
TYPE = 4
|
|
65
123
|
NAME = :"bw_max"
|
|
66
|
-
|
|
124
|
+
# @private
|
|
125
|
+
ORDER = 3
|
|
126
|
+
# @private
|
|
127
|
+
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
67
128
|
end
|
|
129
|
+
# Maximum burst-size for shaping. Should not be interpreted
|
|
130
|
+
# as a quantum.
|
|
68
131
|
class Burst < Attribute
|
|
69
132
|
TYPE = 5
|
|
70
133
|
NAME = :"burst"
|
|
71
|
-
|
|
134
|
+
# @private
|
|
135
|
+
ORDER = 4
|
|
136
|
+
# @private
|
|
137
|
+
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
72
138
|
end
|
|
139
|
+
# Scheduling priority for the given shaper. The priority
|
|
140
|
+
# scheduling is applied to sibling shapers.
|
|
73
141
|
class Priority < Attribute
|
|
74
142
|
TYPE = 6
|
|
75
143
|
NAME = :"priority"
|
|
76
|
-
|
|
144
|
+
# @private
|
|
145
|
+
ORDER = 5
|
|
146
|
+
# @private
|
|
147
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
77
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.
|
|
78
153
|
class Weight < Attribute
|
|
79
154
|
TYPE = 7
|
|
80
155
|
NAME = :"weight"
|
|
81
|
-
|
|
156
|
+
# @private
|
|
157
|
+
ORDER = 6
|
|
158
|
+
# @private
|
|
159
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
82
160
|
end
|
|
161
|
+
# Interface index owning the specified shaper.
|
|
83
162
|
class Ifindex < Attribute
|
|
84
163
|
TYPE = 8
|
|
85
164
|
NAME = :"ifindex"
|
|
86
|
-
|
|
165
|
+
# @private
|
|
166
|
+
ORDER = 7
|
|
167
|
+
# @private
|
|
168
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
87
169
|
end
|
|
170
|
+
# Identifier for the parent of the affected shaper.
|
|
171
|
+
# Only needed for `group` operation.
|
|
88
172
|
class Parent < Attribute
|
|
89
173
|
TYPE = 9
|
|
90
174
|
NAME = :"parent"
|
|
175
|
+
# @private
|
|
176
|
+
ORDER = 8
|
|
91
177
|
end
|
|
178
|
+
# Describes a set of leaves shapers for a `group` operation.
|
|
92
179
|
class Leaves < Attribute
|
|
93
180
|
TYPE = 10
|
|
94
181
|
NAME = :"leaves"
|
|
182
|
+
# @private
|
|
183
|
+
MULTI = true
|
|
184
|
+
# @private
|
|
185
|
+
ORDER = 9
|
|
95
186
|
end
|
|
96
|
-
#
|
|
187
|
+
# @private
|
|
97
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]
|
|
98
|
-
#
|
|
189
|
+
# @private
|
|
99
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
|
|
100
249
|
class << self
|
|
101
250
|
# Looks up Attribute class by name.
|
|
102
|
-
#--
|
|
103
251
|
# @rbs name: Symbol
|
|
104
252
|
# @rbs return: Attribute
|
|
253
|
+
# @param [Symbol] name
|
|
254
|
+
# @return [Attribute]
|
|
105
255
|
def by_name(name); BY_NAME.fetch(name); end
|
|
106
256
|
# Looks up Attribute class by type value.
|
|
107
|
-
#--
|
|
108
257
|
# @rbs type: Integer
|
|
109
258
|
# @rbs return: Attribute
|
|
259
|
+
# @param [Integer] type
|
|
260
|
+
# @return [Attribute]
|
|
110
261
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
111
262
|
end
|
|
112
263
|
end
|
|
113
|
-
class Handle < ::Nl::
|
|
264
|
+
class Handle < ::Nl::AttributeSet
|
|
114
265
|
# Abstract class
|
|
115
|
-
class Attribute < ::Nl::
|
|
266
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
116
267
|
end
|
|
268
|
+
# Defines the shaper `id` interpretation.
|
|
269
|
+
#
|
|
270
|
+
# Known enum values are defined in {Enums::Scope}.
|
|
117
271
|
class Scope < Attribute
|
|
118
272
|
TYPE = 1
|
|
119
273
|
NAME = :"scope"
|
|
120
|
-
|
|
274
|
+
# @private
|
|
275
|
+
ORDER = 0
|
|
276
|
+
# @private
|
|
277
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
121
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.
|
|
122
282
|
class Id < Attribute
|
|
123
283
|
TYPE = 2
|
|
124
284
|
NAME = :"id"
|
|
125
|
-
|
|
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 })
|
|
126
289
|
end
|
|
127
|
-
#
|
|
290
|
+
# @private
|
|
128
291
|
BY_NAME = Ractor.make_shareable({:"scope" => Scope, :"id" => Id}) #: Hash[::Symbol, Attribute]
|
|
129
|
-
#
|
|
292
|
+
# @private
|
|
130
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
|
|
131
308
|
class << self
|
|
132
309
|
# Looks up Attribute class by name.
|
|
133
|
-
#--
|
|
134
310
|
# @rbs name: Symbol
|
|
135
311
|
# @rbs return: Attribute
|
|
312
|
+
# @param [Symbol] name
|
|
313
|
+
# @return [Attribute]
|
|
136
314
|
def by_name(name); BY_NAME.fetch(name); end
|
|
137
315
|
# Looks up Attribute class by type value.
|
|
138
|
-
#--
|
|
139
316
|
# @rbs type: Integer
|
|
140
317
|
# @rbs return: Attribute
|
|
318
|
+
# @param [Integer] type
|
|
319
|
+
# @return [Attribute]
|
|
141
320
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
142
321
|
end
|
|
143
322
|
end
|
|
144
|
-
class LeafInfo < ::Nl::
|
|
323
|
+
class LeafInfo < ::Nl::AttributeSet
|
|
145
324
|
# Abstract class
|
|
146
|
-
class Attribute < ::Nl::
|
|
325
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
147
326
|
end
|
|
327
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
148
328
|
class Handle < Attribute
|
|
149
329
|
TYPE = 1
|
|
150
330
|
NAME = :"handle"
|
|
331
|
+
# @private
|
|
332
|
+
ORDER = 0
|
|
151
333
|
end
|
|
334
|
+
# Scheduling priority for the given shaper. The priority
|
|
335
|
+
# scheduling is applied to sibling shapers.
|
|
152
336
|
class Priority < Attribute
|
|
153
337
|
TYPE = 6
|
|
154
338
|
NAME = :"priority"
|
|
155
|
-
|
|
339
|
+
# @private
|
|
340
|
+
ORDER = 1
|
|
341
|
+
# @private
|
|
342
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
156
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.
|
|
157
348
|
class Weight < Attribute
|
|
158
349
|
TYPE = 7
|
|
159
350
|
NAME = :"weight"
|
|
160
|
-
|
|
351
|
+
# @private
|
|
352
|
+
ORDER = 2
|
|
353
|
+
# @private
|
|
354
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
161
355
|
end
|
|
162
|
-
#
|
|
356
|
+
# @private
|
|
163
357
|
BY_NAME = Ractor.make_shareable({:"handle" => Handle, :"priority" => Priority, :"weight" => Weight}) #: Hash[::Symbol, Attribute]
|
|
164
|
-
#
|
|
358
|
+
# @private
|
|
165
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
|
|
166
379
|
class << self
|
|
167
380
|
# Looks up Attribute class by name.
|
|
168
|
-
#--
|
|
169
381
|
# @rbs name: Symbol
|
|
170
382
|
# @rbs return: Attribute
|
|
383
|
+
# @param [Symbol] name
|
|
384
|
+
# @return [Attribute]
|
|
171
385
|
def by_name(name); BY_NAME.fetch(name); end
|
|
172
386
|
# Looks up Attribute class by type value.
|
|
173
|
-
#--
|
|
174
387
|
# @rbs type: Integer
|
|
175
388
|
# @rbs return: Attribute
|
|
389
|
+
# @param [Integer] type
|
|
390
|
+
# @return [Attribute]
|
|
176
391
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
177
392
|
end
|
|
178
393
|
end
|
|
179
|
-
class Caps < ::Nl::
|
|
394
|
+
class Caps < ::Nl::AttributeSet
|
|
180
395
|
# Abstract class
|
|
181
|
-
class Attribute < ::Nl::
|
|
396
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
182
397
|
end
|
|
398
|
+
# Interface index queried for shapers capabilities.
|
|
183
399
|
class Ifindex < Attribute
|
|
184
400
|
TYPE = 1
|
|
185
401
|
NAME = :"ifindex"
|
|
186
|
-
|
|
402
|
+
# @private
|
|
403
|
+
ORDER = 0
|
|
404
|
+
# @private
|
|
405
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
187
406
|
end
|
|
407
|
+
# The scope to which the queried capabilities apply.
|
|
408
|
+
#
|
|
409
|
+
# Known enum values are defined in {Enums::Scope}.
|
|
188
410
|
class Scope < Attribute
|
|
189
411
|
TYPE = 2
|
|
190
412
|
NAME = :"scope"
|
|
191
|
-
|
|
413
|
+
# @private
|
|
414
|
+
ORDER = 1
|
|
415
|
+
# @private
|
|
416
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
192
417
|
end
|
|
418
|
+
# The device accepts 'bps' metric for bw-min, bw-max and burst.
|
|
193
419
|
class SupportMetricBps < Attribute
|
|
194
420
|
TYPE = 3
|
|
195
421
|
NAME = :"support_metric_bps"
|
|
196
|
-
|
|
422
|
+
# @private
|
|
423
|
+
ORDER = 2
|
|
424
|
+
# @private
|
|
425
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
197
426
|
end
|
|
427
|
+
# The device accepts 'pps' metric for bw-min, bw-max and burst.
|
|
198
428
|
class SupportMetricPps < Attribute
|
|
199
429
|
TYPE = 4
|
|
200
430
|
NAME = :"support_metric_pps"
|
|
201
|
-
|
|
431
|
+
# @private
|
|
432
|
+
ORDER = 3
|
|
433
|
+
# @private
|
|
434
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
202
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'.
|
|
203
439
|
class SupportNesting < Attribute
|
|
204
440
|
TYPE = 5
|
|
205
441
|
NAME = :"support_nesting"
|
|
206
|
-
|
|
442
|
+
# @private
|
|
443
|
+
ORDER = 4
|
|
444
|
+
# @private
|
|
445
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
207
446
|
end
|
|
447
|
+
# The device supports a minimum guaranteed B/W.
|
|
208
448
|
class SupportBwMin < Attribute
|
|
209
449
|
TYPE = 6
|
|
210
450
|
NAME = :"support_bw_min"
|
|
211
|
-
|
|
451
|
+
# @private
|
|
452
|
+
ORDER = 5
|
|
453
|
+
# @private
|
|
454
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
212
455
|
end
|
|
456
|
+
# The device supports maximum B/W shaping.
|
|
213
457
|
class SupportBwMax < Attribute
|
|
214
458
|
TYPE = 7
|
|
215
459
|
NAME = :"support_bw_max"
|
|
216
|
-
|
|
460
|
+
# @private
|
|
461
|
+
ORDER = 6
|
|
462
|
+
# @private
|
|
463
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
217
464
|
end
|
|
465
|
+
# The device supports a maximum burst size.
|
|
218
466
|
class SupportBurst < Attribute
|
|
219
467
|
TYPE = 8
|
|
220
468
|
NAME = :"support_burst"
|
|
221
|
-
|
|
469
|
+
# @private
|
|
470
|
+
ORDER = 7
|
|
471
|
+
# @private
|
|
472
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
222
473
|
end
|
|
474
|
+
# The device supports priority scheduling.
|
|
223
475
|
class SupportPriority < Attribute
|
|
224
476
|
TYPE = 9
|
|
225
477
|
NAME = :"support_priority"
|
|
226
|
-
|
|
478
|
+
# @private
|
|
479
|
+
ORDER = 8
|
|
480
|
+
# @private
|
|
481
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
227
482
|
end
|
|
483
|
+
# The device supports weighted round robin scheduling.
|
|
228
484
|
class SupportWeight < Attribute
|
|
229
485
|
TYPE = 10
|
|
230
486
|
NAME = :"support_weight"
|
|
231
|
-
|
|
487
|
+
# @private
|
|
488
|
+
ORDER = 9
|
|
489
|
+
# @private
|
|
490
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
232
491
|
end
|
|
233
|
-
#
|
|
492
|
+
# @private
|
|
234
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]
|
|
235
|
-
#
|
|
494
|
+
# @private
|
|
236
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
|
|
237
550
|
class << self
|
|
238
551
|
# Looks up Attribute class by name.
|
|
239
|
-
#--
|
|
240
552
|
# @rbs name: Symbol
|
|
241
553
|
# @rbs return: Attribute
|
|
554
|
+
# @param [Symbol] name
|
|
555
|
+
# @return [Attribute]
|
|
242
556
|
def by_name(name); BY_NAME.fetch(name); end
|
|
243
557
|
# Looks up Attribute class by type value.
|
|
244
|
-
#--
|
|
245
558
|
# @rbs type: Integer
|
|
246
559
|
# @rbs return: Attribute
|
|
560
|
+
# @param [Integer] type
|
|
561
|
+
# @return [Attribute]
|
|
247
562
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
248
563
|
end
|
|
249
564
|
end
|
|
250
|
-
|
|
251
|
-
NetShaper::
|
|
252
|
-
|
|
253
|
-
|
|
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([]))
|
|
254
573
|
end
|
|
255
574
|
module Messages
|
|
256
575
|
# Get information about a shaper for a given device.
|
|
257
|
-
class DoGetRequest < ::Nl::
|
|
576
|
+
class DoGetRequest < ::Nl::Genl::Message
|
|
258
577
|
TYPE = 1
|
|
259
578
|
FIXED_HEADER = nil
|
|
260
579
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
261
580
|
ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
|
|
262
|
-
#
|
|
263
|
-
#--
|
|
581
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
264
582
|
# @rbs return: AttributeSets::Handle
|
|
583
|
+
# @return [AttributeSets::Handle]
|
|
584
|
+
# @see AttributeSets::NetShaper::Handle
|
|
265
585
|
def handle; attributes[:"handle"]&.value; end
|
|
266
|
-
#
|
|
267
|
-
#--
|
|
586
|
+
# Interface index owning the specified shaper.
|
|
268
587
|
# @rbs return: ::Integer
|
|
588
|
+
# @return [Integer]
|
|
589
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
269
590
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
270
591
|
end
|
|
271
592
|
# Get information about a shaper for a given device.
|
|
272
|
-
class DoGetReply < ::Nl::
|
|
593
|
+
class DoGetReply < ::Nl::Genl::Message
|
|
273
594
|
TYPE = 1
|
|
274
595
|
FIXED_HEADER = nil
|
|
275
596
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
276
597
|
ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
|
|
277
|
-
#
|
|
278
|
-
#--
|
|
598
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
279
599
|
# @rbs return: AttributeSets::Handle
|
|
600
|
+
# @return [AttributeSets::Handle]
|
|
601
|
+
# @see AttributeSets::NetShaper::Handle
|
|
280
602
|
def handle; attributes[:"handle"]&.value; end
|
|
281
|
-
#
|
|
282
|
-
|
|
603
|
+
# Metric used by the given shaper for bw-min, bw-max and burst.
|
|
604
|
+
#
|
|
605
|
+
# Known enum values are defined in {Enums::Metric}.
|
|
283
606
|
# @rbs return: ::Integer
|
|
607
|
+
# @return [Integer]
|
|
608
|
+
# @see AttributeSets::NetShaper::Metric
|
|
284
609
|
def metric; attributes[:"metric"]&.value; end
|
|
285
|
-
#
|
|
286
|
-
#--
|
|
610
|
+
# Guaranteed bandwidth for the given shaper.
|
|
287
611
|
# @rbs return: ::Integer
|
|
612
|
+
# @return [Integer]
|
|
613
|
+
# @see AttributeSets::NetShaper::BwMin
|
|
288
614
|
def bw_min; attributes[:"bw_min"]&.value; end
|
|
289
|
-
#
|
|
290
|
-
#--
|
|
615
|
+
# Maximum bandwidth for the given shaper or 0 when unlimited.
|
|
291
616
|
# @rbs return: ::Integer
|
|
617
|
+
# @return [Integer]
|
|
618
|
+
# @see AttributeSets::NetShaper::BwMax
|
|
292
619
|
def bw_max; attributes[:"bw_max"]&.value; end
|
|
293
|
-
#
|
|
294
|
-
|
|
620
|
+
# Maximum burst-size for shaping. Should not be interpreted
|
|
621
|
+
# as a quantum.
|
|
295
622
|
# @rbs return: ::Integer
|
|
623
|
+
# @return [Integer]
|
|
624
|
+
# @see AttributeSets::NetShaper::Burst
|
|
296
625
|
def burst; attributes[:"burst"]&.value; end
|
|
297
|
-
#
|
|
298
|
-
|
|
626
|
+
# Scheduling priority for the given shaper. The priority
|
|
627
|
+
# scheduling is applied to sibling shapers.
|
|
299
628
|
# @rbs return: ::Integer
|
|
629
|
+
# @return [Integer]
|
|
630
|
+
# @see AttributeSets::NetShaper::Priority
|
|
300
631
|
def priority; attributes[:"priority"]&.value; end
|
|
301
|
-
#
|
|
302
|
-
|
|
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.
|
|
303
636
|
# @rbs return: ::Integer
|
|
637
|
+
# @return [Integer]
|
|
638
|
+
# @see AttributeSets::NetShaper::Weight
|
|
304
639
|
def weight; attributes[:"weight"]&.value; end
|
|
305
|
-
#
|
|
306
|
-
#--
|
|
640
|
+
# Interface index owning the specified shaper.
|
|
307
641
|
# @rbs return: ::Integer
|
|
642
|
+
# @return [Integer]
|
|
643
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
308
644
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
309
|
-
#
|
|
310
|
-
|
|
645
|
+
# Identifier for the parent of the affected shaper.
|
|
646
|
+
# Only needed for `group` operation.
|
|
311
647
|
# @rbs return: AttributeSets::Handle
|
|
648
|
+
# @return [AttributeSets::Handle]
|
|
649
|
+
# @see AttributeSets::NetShaper::Parent
|
|
312
650
|
def parent; attributes[:"parent"]&.value; end
|
|
313
651
|
end
|
|
314
652
|
# Get information about a shaper for a given device.
|
|
315
|
-
class DumpGetRequest < ::Nl::
|
|
653
|
+
class DumpGetRequest < ::Nl::Genl::Message
|
|
316
654
|
TYPE = 1
|
|
317
655
|
FIXED_HEADER = nil
|
|
318
656
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
319
657
|
ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
|
|
320
|
-
#
|
|
321
|
-
#--
|
|
658
|
+
# Interface index owning the specified shaper.
|
|
322
659
|
# @rbs return: ::Integer
|
|
660
|
+
# @return [Integer]
|
|
661
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
323
662
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
324
663
|
end
|
|
325
664
|
# Get information about a shaper for a given device.
|
|
326
|
-
class DumpGetReply < ::Nl::
|
|
665
|
+
class DumpGetReply < ::Nl::Genl::Message
|
|
327
666
|
TYPE = 1
|
|
328
667
|
FIXED_HEADER = nil
|
|
329
668
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
330
669
|
ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent])
|
|
331
|
-
#
|
|
332
|
-
#--
|
|
670
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
333
671
|
# @rbs return: AttributeSets::Handle
|
|
672
|
+
# @return [AttributeSets::Handle]
|
|
673
|
+
# @see AttributeSets::NetShaper::Handle
|
|
334
674
|
def handle; attributes[:"handle"]&.value; end
|
|
335
|
-
#
|
|
336
|
-
|
|
675
|
+
# Metric used by the given shaper for bw-min, bw-max and burst.
|
|
676
|
+
#
|
|
677
|
+
# Known enum values are defined in {Enums::Metric}.
|
|
337
678
|
# @rbs return: ::Integer
|
|
679
|
+
# @return [Integer]
|
|
680
|
+
# @see AttributeSets::NetShaper::Metric
|
|
338
681
|
def metric; attributes[:"metric"]&.value; end
|
|
339
|
-
#
|
|
340
|
-
#--
|
|
682
|
+
# Guaranteed bandwidth for the given shaper.
|
|
341
683
|
# @rbs return: ::Integer
|
|
684
|
+
# @return [Integer]
|
|
685
|
+
# @see AttributeSets::NetShaper::BwMin
|
|
342
686
|
def bw_min; attributes[:"bw_min"]&.value; end
|
|
343
|
-
#
|
|
344
|
-
#--
|
|
687
|
+
# Maximum bandwidth for the given shaper or 0 when unlimited.
|
|
345
688
|
# @rbs return: ::Integer
|
|
689
|
+
# @return [Integer]
|
|
690
|
+
# @see AttributeSets::NetShaper::BwMax
|
|
346
691
|
def bw_max; attributes[:"bw_max"]&.value; end
|
|
347
|
-
#
|
|
348
|
-
|
|
692
|
+
# Maximum burst-size for shaping. Should not be interpreted
|
|
693
|
+
# as a quantum.
|
|
349
694
|
# @rbs return: ::Integer
|
|
695
|
+
# @return [Integer]
|
|
696
|
+
# @see AttributeSets::NetShaper::Burst
|
|
350
697
|
def burst; attributes[:"burst"]&.value; end
|
|
351
|
-
#
|
|
352
|
-
|
|
698
|
+
# Scheduling priority for the given shaper. The priority
|
|
699
|
+
# scheduling is applied to sibling shapers.
|
|
353
700
|
# @rbs return: ::Integer
|
|
701
|
+
# @return [Integer]
|
|
702
|
+
# @see AttributeSets::NetShaper::Priority
|
|
354
703
|
def priority; attributes[:"priority"]&.value; end
|
|
355
|
-
#
|
|
356
|
-
|
|
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.
|
|
357
708
|
# @rbs return: ::Integer
|
|
709
|
+
# @return [Integer]
|
|
710
|
+
# @see AttributeSets::NetShaper::Weight
|
|
358
711
|
def weight; attributes[:"weight"]&.value; end
|
|
359
|
-
#
|
|
360
|
-
#--
|
|
712
|
+
# Interface index owning the specified shaper.
|
|
361
713
|
# @rbs return: ::Integer
|
|
714
|
+
# @return [Integer]
|
|
715
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
362
716
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
363
|
-
#
|
|
364
|
-
|
|
717
|
+
# Identifier for the parent of the affected shaper.
|
|
718
|
+
# Only needed for `group` operation.
|
|
365
719
|
# @rbs return: AttributeSets::Handle
|
|
720
|
+
# @return [AttributeSets::Handle]
|
|
721
|
+
# @see AttributeSets::NetShaper::Parent
|
|
366
722
|
def parent; attributes[:"parent"]&.value; end
|
|
367
723
|
end
|
|
368
724
|
# Create or update the specified shaper.
|
|
@@ -371,42 +727,57 @@ class NetShaper < ::Nl::Family
|
|
|
371
727
|
#
|
|
372
728
|
#
|
|
373
729
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
374
|
-
class DoSetRequest < ::Nl::
|
|
730
|
+
class DoSetRequest < ::Nl::Genl::Message
|
|
375
731
|
TYPE = 2
|
|
376
732
|
FIXED_HEADER = nil
|
|
377
733
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
378
734
|
ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex])
|
|
379
|
-
#
|
|
380
|
-
#--
|
|
735
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
381
736
|
# @rbs return: AttributeSets::Handle
|
|
737
|
+
# @return [AttributeSets::Handle]
|
|
738
|
+
# @see AttributeSets::NetShaper::Handle
|
|
382
739
|
def handle; attributes[:"handle"]&.value; end
|
|
383
|
-
#
|
|
384
|
-
|
|
740
|
+
# Metric used by the given shaper for bw-min, bw-max and burst.
|
|
741
|
+
#
|
|
742
|
+
# Known enum values are defined in {Enums::Metric}.
|
|
385
743
|
# @rbs return: ::Integer
|
|
744
|
+
# @return [Integer]
|
|
745
|
+
# @see AttributeSets::NetShaper::Metric
|
|
386
746
|
def metric; attributes[:"metric"]&.value; end
|
|
387
|
-
#
|
|
388
|
-
#--
|
|
747
|
+
# Guaranteed bandwidth for the given shaper.
|
|
389
748
|
# @rbs return: ::Integer
|
|
749
|
+
# @return [Integer]
|
|
750
|
+
# @see AttributeSets::NetShaper::BwMin
|
|
390
751
|
def bw_min; attributes[:"bw_min"]&.value; end
|
|
391
|
-
#
|
|
392
|
-
#--
|
|
752
|
+
# Maximum bandwidth for the given shaper or 0 when unlimited.
|
|
393
753
|
# @rbs return: ::Integer
|
|
754
|
+
# @return [Integer]
|
|
755
|
+
# @see AttributeSets::NetShaper::BwMax
|
|
394
756
|
def bw_max; attributes[:"bw_max"]&.value; end
|
|
395
|
-
#
|
|
396
|
-
|
|
757
|
+
# Maximum burst-size for shaping. Should not be interpreted
|
|
758
|
+
# as a quantum.
|
|
397
759
|
# @rbs return: ::Integer
|
|
760
|
+
# @return [Integer]
|
|
761
|
+
# @see AttributeSets::NetShaper::Burst
|
|
398
762
|
def burst; attributes[:"burst"]&.value; end
|
|
399
|
-
#
|
|
400
|
-
|
|
763
|
+
# Scheduling priority for the given shaper. The priority
|
|
764
|
+
# scheduling is applied to sibling shapers.
|
|
401
765
|
# @rbs return: ::Integer
|
|
766
|
+
# @return [Integer]
|
|
767
|
+
# @see AttributeSets::NetShaper::Priority
|
|
402
768
|
def priority; attributes[:"priority"]&.value; end
|
|
403
|
-
#
|
|
404
|
-
|
|
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.
|
|
405
773
|
# @rbs return: ::Integer
|
|
774
|
+
# @return [Integer]
|
|
775
|
+
# @see AttributeSets::NetShaper::Weight
|
|
406
776
|
def weight; attributes[:"weight"]&.value; end
|
|
407
|
-
#
|
|
408
|
-
#--
|
|
777
|
+
# Interface index owning the specified shaper.
|
|
409
778
|
# @rbs return: ::Integer
|
|
779
|
+
# @return [Integer]
|
|
780
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
410
781
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
411
782
|
end
|
|
412
783
|
# Clear (remove) the specified shaper. When deleting
|
|
@@ -423,18 +794,20 @@ class NetShaper < ::Nl::Family
|
|
|
423
794
|
#
|
|
424
795
|
#
|
|
425
796
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
426
|
-
class DoDeleteRequest < ::Nl::
|
|
797
|
+
class DoDeleteRequest < ::Nl::Genl::Message
|
|
427
798
|
TYPE = 3
|
|
428
799
|
FIXED_HEADER = nil
|
|
429
800
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
430
801
|
ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
|
|
431
|
-
#
|
|
432
|
-
#--
|
|
802
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
433
803
|
# @rbs return: AttributeSets::Handle
|
|
804
|
+
# @return [AttributeSets::Handle]
|
|
805
|
+
# @see AttributeSets::NetShaper::Handle
|
|
434
806
|
def handle; attributes[:"handle"]&.value; end
|
|
435
|
-
#
|
|
436
|
-
#--
|
|
807
|
+
# Interface index owning the specified shaper.
|
|
437
808
|
# @rbs return: ::Integer
|
|
809
|
+
# @return [Integer]
|
|
810
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
438
811
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
439
812
|
end
|
|
440
813
|
# Create or update a scheduling group, attaching the specified
|
|
@@ -459,51 +832,69 @@ class NetShaper < ::Nl::Family
|
|
|
459
832
|
#
|
|
460
833
|
#
|
|
461
834
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
462
|
-
class DoGroupRequest < ::Nl::
|
|
835
|
+
class DoGroupRequest < ::Nl::Genl::Message
|
|
463
836
|
TYPE = 4
|
|
464
837
|
FIXED_HEADER = nil
|
|
465
838
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
466
839
|
ATTRIBUTES = Ractor.make_shareable(%i[handle metric bw_min bw_max burst priority weight ifindex parent leaves])
|
|
467
|
-
#
|
|
468
|
-
#--
|
|
840
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
469
841
|
# @rbs return: AttributeSets::Handle
|
|
842
|
+
# @return [AttributeSets::Handle]
|
|
843
|
+
# @see AttributeSets::NetShaper::Handle
|
|
470
844
|
def handle; attributes[:"handle"]&.value; end
|
|
471
|
-
#
|
|
472
|
-
|
|
845
|
+
# Metric used by the given shaper for bw-min, bw-max and burst.
|
|
846
|
+
#
|
|
847
|
+
# Known enum values are defined in {Enums::Metric}.
|
|
473
848
|
# @rbs return: ::Integer
|
|
849
|
+
# @return [Integer]
|
|
850
|
+
# @see AttributeSets::NetShaper::Metric
|
|
474
851
|
def metric; attributes[:"metric"]&.value; end
|
|
475
|
-
#
|
|
476
|
-
#--
|
|
852
|
+
# Guaranteed bandwidth for the given shaper.
|
|
477
853
|
# @rbs return: ::Integer
|
|
854
|
+
# @return [Integer]
|
|
855
|
+
# @see AttributeSets::NetShaper::BwMin
|
|
478
856
|
def bw_min; attributes[:"bw_min"]&.value; end
|
|
479
|
-
#
|
|
480
|
-
#--
|
|
857
|
+
# Maximum bandwidth for the given shaper or 0 when unlimited.
|
|
481
858
|
# @rbs return: ::Integer
|
|
859
|
+
# @return [Integer]
|
|
860
|
+
# @see AttributeSets::NetShaper::BwMax
|
|
482
861
|
def bw_max; attributes[:"bw_max"]&.value; end
|
|
483
|
-
#
|
|
484
|
-
|
|
862
|
+
# Maximum burst-size for shaping. Should not be interpreted
|
|
863
|
+
# as a quantum.
|
|
485
864
|
# @rbs return: ::Integer
|
|
865
|
+
# @return [Integer]
|
|
866
|
+
# @see AttributeSets::NetShaper::Burst
|
|
486
867
|
def burst; attributes[:"burst"]&.value; end
|
|
487
|
-
#
|
|
488
|
-
|
|
868
|
+
# Scheduling priority for the given shaper. The priority
|
|
869
|
+
# scheduling is applied to sibling shapers.
|
|
489
870
|
# @rbs return: ::Integer
|
|
871
|
+
# @return [Integer]
|
|
872
|
+
# @see AttributeSets::NetShaper::Priority
|
|
490
873
|
def priority; attributes[:"priority"]&.value; end
|
|
491
|
-
#
|
|
492
|
-
|
|
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.
|
|
493
878
|
# @rbs return: ::Integer
|
|
879
|
+
# @return [Integer]
|
|
880
|
+
# @see AttributeSets::NetShaper::Weight
|
|
494
881
|
def weight; attributes[:"weight"]&.value; end
|
|
495
|
-
#
|
|
496
|
-
#--
|
|
882
|
+
# Interface index owning the specified shaper.
|
|
497
883
|
# @rbs return: ::Integer
|
|
884
|
+
# @return [Integer]
|
|
885
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
498
886
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
499
|
-
#
|
|
500
|
-
|
|
887
|
+
# Identifier for the parent of the affected shaper.
|
|
888
|
+
# Only needed for `group` operation.
|
|
501
889
|
# @rbs return: AttributeSets::Handle
|
|
890
|
+
# @return [AttributeSets::Handle]
|
|
891
|
+
# @see AttributeSets::NetShaper::Parent
|
|
502
892
|
def parent; attributes[:"parent"]&.value; end
|
|
503
|
-
#
|
|
504
|
-
|
|
505
|
-
# @
|
|
506
|
-
|
|
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
|
|
507
898
|
end
|
|
508
899
|
# Create or update a scheduling group, attaching the specified
|
|
509
900
|
# `leaves` shapers under the specified node identified by `handle.`
|
|
@@ -527,158 +918,209 @@ class NetShaper < ::Nl::Family
|
|
|
527
918
|
#
|
|
528
919
|
#
|
|
529
920
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
530
|
-
class DoGroupReply < ::Nl::
|
|
921
|
+
class DoGroupReply < ::Nl::Genl::Message
|
|
531
922
|
TYPE = 4
|
|
532
923
|
FIXED_HEADER = nil
|
|
533
924
|
ATTRIBUTE_SET = AttributeSets::NetShaper
|
|
534
925
|
ATTRIBUTES = Ractor.make_shareable(%i[handle ifindex])
|
|
535
|
-
#
|
|
536
|
-
#--
|
|
926
|
+
# Unique identifier for the given shaper inside the owning device.
|
|
537
927
|
# @rbs return: AttributeSets::Handle
|
|
928
|
+
# @return [AttributeSets::Handle]
|
|
929
|
+
# @see AttributeSets::NetShaper::Handle
|
|
538
930
|
def handle; attributes[:"handle"]&.value; end
|
|
539
|
-
#
|
|
540
|
-
#--
|
|
931
|
+
# Interface index owning the specified shaper.
|
|
541
932
|
# @rbs return: ::Integer
|
|
933
|
+
# @return [Integer]
|
|
934
|
+
# @see AttributeSets::NetShaper::Ifindex
|
|
542
935
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
543
936
|
end
|
|
544
937
|
# Get the shaper capabilities supported by the given device
|
|
545
938
|
# for the specified scope.
|
|
546
|
-
class DoCapGetRequest < ::Nl::
|
|
939
|
+
class DoCapGetRequest < ::Nl::Genl::Message
|
|
547
940
|
TYPE = 5
|
|
548
941
|
FIXED_HEADER = nil
|
|
549
942
|
ATTRIBUTE_SET = AttributeSets::Caps
|
|
550
943
|
ATTRIBUTES = Ractor.make_shareable(%i[ifindex scope])
|
|
551
|
-
#
|
|
552
|
-
#--
|
|
944
|
+
# Interface index queried for shapers capabilities.
|
|
553
945
|
# @rbs return: ::Integer
|
|
946
|
+
# @return [Integer]
|
|
947
|
+
# @see AttributeSets::Caps::Ifindex
|
|
554
948
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
555
|
-
#
|
|
556
|
-
|
|
949
|
+
# The scope to which the queried capabilities apply.
|
|
950
|
+
#
|
|
951
|
+
# Known enum values are defined in {Enums::Scope}.
|
|
557
952
|
# @rbs return: ::Integer
|
|
953
|
+
# @return [Integer]
|
|
954
|
+
# @see AttributeSets::Caps::Scope
|
|
558
955
|
def scope; attributes[:"scope"]&.value; end
|
|
559
956
|
end
|
|
560
957
|
# Get the shaper capabilities supported by the given device
|
|
561
958
|
# for the specified scope.
|
|
562
|
-
class DoCapGetReply < ::Nl::
|
|
959
|
+
class DoCapGetReply < ::Nl::Genl::Message
|
|
563
960
|
TYPE = 5
|
|
564
961
|
FIXED_HEADER = nil
|
|
565
962
|
ATTRIBUTE_SET = AttributeSets::Caps
|
|
566
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])
|
|
567
|
-
#
|
|
568
|
-
#--
|
|
964
|
+
# Interface index queried for shapers capabilities.
|
|
569
965
|
# @rbs return: ::Integer
|
|
966
|
+
# @return [Integer]
|
|
967
|
+
# @see AttributeSets::Caps::Ifindex
|
|
570
968
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
571
|
-
#
|
|
572
|
-
|
|
969
|
+
# The scope to which the queried capabilities apply.
|
|
970
|
+
#
|
|
971
|
+
# Known enum values are defined in {Enums::Scope}.
|
|
573
972
|
# @rbs return: ::Integer
|
|
973
|
+
# @return [Integer]
|
|
974
|
+
# @see AttributeSets::Caps::Scope
|
|
574
975
|
def scope; attributes[:"scope"]&.value; end
|
|
575
|
-
#
|
|
576
|
-
#--
|
|
976
|
+
# The device accepts 'bps' metric for bw-min, bw-max and burst.
|
|
577
977
|
# @rbs return: ::Integer
|
|
978
|
+
# @return [Integer]
|
|
979
|
+
# @see AttributeSets::Caps::SupportMetricBps
|
|
578
980
|
def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
|
|
579
|
-
#
|
|
580
|
-
#--
|
|
981
|
+
# The device accepts 'pps' metric for bw-min, bw-max and burst.
|
|
581
982
|
# @rbs return: ::Integer
|
|
983
|
+
# @return [Integer]
|
|
984
|
+
# @see AttributeSets::Caps::SupportMetricPps
|
|
582
985
|
def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
|
|
583
|
-
#
|
|
584
|
-
|
|
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'.
|
|
585
989
|
# @rbs return: ::Integer
|
|
990
|
+
# @return [Integer]
|
|
991
|
+
# @see AttributeSets::Caps::SupportNesting
|
|
586
992
|
def support_nesting; attributes[:"support_nesting"]&.value; end
|
|
587
|
-
#
|
|
588
|
-
#--
|
|
993
|
+
# The device supports a minimum guaranteed B/W.
|
|
589
994
|
# @rbs return: ::Integer
|
|
995
|
+
# @return [Integer]
|
|
996
|
+
# @see AttributeSets::Caps::SupportBwMin
|
|
590
997
|
def support_bw_min; attributes[:"support_bw_min"]&.value; end
|
|
591
|
-
#
|
|
592
|
-
#--
|
|
998
|
+
# The device supports maximum B/W shaping.
|
|
593
999
|
# @rbs return: ::Integer
|
|
1000
|
+
# @return [Integer]
|
|
1001
|
+
# @see AttributeSets::Caps::SupportBwMax
|
|
594
1002
|
def support_bw_max; attributes[:"support_bw_max"]&.value; end
|
|
595
|
-
#
|
|
596
|
-
#--
|
|
1003
|
+
# The device supports a maximum burst size.
|
|
597
1004
|
# @rbs return: ::Integer
|
|
1005
|
+
# @return [Integer]
|
|
1006
|
+
# @see AttributeSets::Caps::SupportBurst
|
|
598
1007
|
def support_burst; attributes[:"support_burst"]&.value; end
|
|
599
|
-
#
|
|
600
|
-
#--
|
|
1008
|
+
# The device supports priority scheduling.
|
|
601
1009
|
# @rbs return: ::Integer
|
|
1010
|
+
# @return [Integer]
|
|
1011
|
+
# @see AttributeSets::Caps::SupportPriority
|
|
602
1012
|
def support_priority; attributes[:"support_priority"]&.value; end
|
|
603
|
-
#
|
|
604
|
-
#--
|
|
1013
|
+
# The device supports weighted round robin scheduling.
|
|
605
1014
|
# @rbs return: ::Integer
|
|
1015
|
+
# @return [Integer]
|
|
1016
|
+
# @see AttributeSets::Caps::SupportWeight
|
|
606
1017
|
def support_weight; attributes[:"support_weight"]&.value; end
|
|
607
1018
|
end
|
|
608
1019
|
# Get the shaper capabilities supported by the given device
|
|
609
1020
|
# for the specified scope.
|
|
610
|
-
class DumpCapGetRequest < ::Nl::
|
|
1021
|
+
class DumpCapGetRequest < ::Nl::Genl::Message
|
|
611
1022
|
TYPE = 5
|
|
612
1023
|
FIXED_HEADER = nil
|
|
613
1024
|
ATTRIBUTE_SET = AttributeSets::Caps
|
|
614
1025
|
ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
|
|
615
|
-
#
|
|
616
|
-
#--
|
|
1026
|
+
# Interface index queried for shapers capabilities.
|
|
617
1027
|
# @rbs return: ::Integer
|
|
1028
|
+
# @return [Integer]
|
|
1029
|
+
# @see AttributeSets::Caps::Ifindex
|
|
618
1030
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
619
1031
|
end
|
|
620
1032
|
# Get the shaper capabilities supported by the given device
|
|
621
1033
|
# for the specified scope.
|
|
622
|
-
class DumpCapGetReply < ::Nl::
|
|
1034
|
+
class DumpCapGetReply < ::Nl::Genl::Message
|
|
623
1035
|
TYPE = 5
|
|
624
1036
|
FIXED_HEADER = nil
|
|
625
1037
|
ATTRIBUTE_SET = AttributeSets::Caps
|
|
626
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])
|
|
627
|
-
#
|
|
628
|
-
#--
|
|
1039
|
+
# Interface index queried for shapers capabilities.
|
|
629
1040
|
# @rbs return: ::Integer
|
|
1041
|
+
# @return [Integer]
|
|
1042
|
+
# @see AttributeSets::Caps::Ifindex
|
|
630
1043
|
def ifindex; attributes[:"ifindex"]&.value; end
|
|
631
|
-
#
|
|
632
|
-
|
|
1044
|
+
# The scope to which the queried capabilities apply.
|
|
1045
|
+
#
|
|
1046
|
+
# Known enum values are defined in {Enums::Scope}.
|
|
633
1047
|
# @rbs return: ::Integer
|
|
1048
|
+
# @return [Integer]
|
|
1049
|
+
# @see AttributeSets::Caps::Scope
|
|
634
1050
|
def scope; attributes[:"scope"]&.value; end
|
|
635
|
-
#
|
|
636
|
-
#--
|
|
1051
|
+
# The device accepts 'bps' metric for bw-min, bw-max and burst.
|
|
637
1052
|
# @rbs return: ::Integer
|
|
1053
|
+
# @return [Integer]
|
|
1054
|
+
# @see AttributeSets::Caps::SupportMetricBps
|
|
638
1055
|
def support_metric_bps; attributes[:"support_metric_bps"]&.value; end
|
|
639
|
-
#
|
|
640
|
-
#--
|
|
1056
|
+
# The device accepts 'pps' metric for bw-min, bw-max and burst.
|
|
641
1057
|
# @rbs return: ::Integer
|
|
1058
|
+
# @return [Integer]
|
|
1059
|
+
# @see AttributeSets::Caps::SupportMetricPps
|
|
642
1060
|
def support_metric_pps; attributes[:"support_metric_pps"]&.value; end
|
|
643
|
-
#
|
|
644
|
-
|
|
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'.
|
|
645
1064
|
# @rbs return: ::Integer
|
|
1065
|
+
# @return [Integer]
|
|
1066
|
+
# @see AttributeSets::Caps::SupportNesting
|
|
646
1067
|
def support_nesting; attributes[:"support_nesting"]&.value; end
|
|
647
|
-
#
|
|
648
|
-
#--
|
|
1068
|
+
# The device supports a minimum guaranteed B/W.
|
|
649
1069
|
# @rbs return: ::Integer
|
|
1070
|
+
# @return [Integer]
|
|
1071
|
+
# @see AttributeSets::Caps::SupportBwMin
|
|
650
1072
|
def support_bw_min; attributes[:"support_bw_min"]&.value; end
|
|
651
|
-
#
|
|
652
|
-
#--
|
|
1073
|
+
# The device supports maximum B/W shaping.
|
|
653
1074
|
# @rbs return: ::Integer
|
|
1075
|
+
# @return [Integer]
|
|
1076
|
+
# @see AttributeSets::Caps::SupportBwMax
|
|
654
1077
|
def support_bw_max; attributes[:"support_bw_max"]&.value; end
|
|
655
|
-
#
|
|
656
|
-
#--
|
|
1078
|
+
# The device supports a maximum burst size.
|
|
657
1079
|
# @rbs return: ::Integer
|
|
1080
|
+
# @return [Integer]
|
|
1081
|
+
# @see AttributeSets::Caps::SupportBurst
|
|
658
1082
|
def support_burst; attributes[:"support_burst"]&.value; end
|
|
659
|
-
#
|
|
660
|
-
#--
|
|
1083
|
+
# The device supports priority scheduling.
|
|
661
1084
|
# @rbs return: ::Integer
|
|
1085
|
+
# @return [Integer]
|
|
1086
|
+
# @see AttributeSets::Caps::SupportPriority
|
|
662
1087
|
def support_priority; attributes[:"support_priority"]&.value; end
|
|
663
|
-
#
|
|
664
|
-
#--
|
|
1088
|
+
# The device supports weighted round robin scheduling.
|
|
665
1089
|
# @rbs return: ::Integer
|
|
1090
|
+
# @return [Integer]
|
|
1091
|
+
# @see AttributeSets::Caps::SupportWeight
|
|
666
1092
|
def support_weight; attributes[:"support_weight"]&.value; end
|
|
667
1093
|
end
|
|
668
1094
|
end
|
|
669
1095
|
module Notifications
|
|
670
1096
|
end
|
|
1097
|
+
# @private
|
|
671
1098
|
NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
|
|
672
1099
|
# Get information about a shaper for a given device.
|
|
673
|
-
|
|
674
|
-
# @
|
|
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
|
|
675
1106
|
def do_get(**args)
|
|
676
1107
|
exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
|
|
677
1108
|
end
|
|
678
1109
|
# Get information about a shaper for a given device.
|
|
679
|
-
|
|
680
|
-
# @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpGetReply]
|
|
1110
|
+
# @rbs (?ifindex: ::Integer) -> Array[Messages::DumpGetReply]
|
|
681
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
|
|
682
1124
|
def dump_get(**args, &block)
|
|
683
1125
|
exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
|
|
684
1126
|
end
|
|
@@ -688,8 +1130,25 @@ class NetShaper < ::Nl::Family
|
|
|
688
1130
|
#
|
|
689
1131
|
#
|
|
690
1132
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
691
|
-
|
|
692
|
-
# @
|
|
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
|
|
693
1152
|
def do_set(**args)
|
|
694
1153
|
exchange_message(:"do", Messages::DoSetRequest, nil, args)
|
|
695
1154
|
end
|
|
@@ -707,8 +1166,12 @@ class NetShaper < ::Nl::Family
|
|
|
707
1166
|
#
|
|
708
1167
|
#
|
|
709
1168
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
710
|
-
|
|
711
|
-
# @
|
|
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
|
|
712
1175
|
def do_delete(**args)
|
|
713
1176
|
exchange_message(:"do", Messages::DoDeleteRequest, nil, args)
|
|
714
1177
|
end
|
|
@@ -734,40 +1197,84 @@ class NetShaper < ::Nl::Family
|
|
|
734
1197
|
#
|
|
735
1198
|
#
|
|
736
1199
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
737
|
-
|
|
738
|
-
# @
|
|
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
|
|
739
1222
|
def do_group(**args)
|
|
740
1223
|
exchange_message(:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args)
|
|
741
1224
|
end
|
|
742
1225
|
# Get the shaper capabilities supported by the given device
|
|
743
1226
|
# for the specified scope.
|
|
744
|
-
#--
|
|
745
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
|
|
746
1235
|
def do_cap_get(**args)
|
|
747
1236
|
exchange_message(:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args)
|
|
748
1237
|
end
|
|
749
1238
|
# Get the shaper capabilities supported by the given device
|
|
750
1239
|
# for the specified scope.
|
|
751
|
-
|
|
752
|
-
# @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpCapGetReply]
|
|
1240
|
+
# @rbs (?ifindex: ::Integer) -> Array[Messages::DumpCapGetReply]
|
|
753
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
|
|
754
1254
|
def dump_cap_get(**args, &block)
|
|
755
1255
|
exchange_message(:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args, &block)
|
|
756
1256
|
end
|
|
757
1257
|
class AsyncOperations
|
|
758
|
-
#
|
|
1258
|
+
# @private
|
|
759
1259
|
def initialize(&exchange)
|
|
760
1260
|
@exchange = exchange
|
|
761
1261
|
end
|
|
762
1262
|
# Get information about a shaper for a given device.
|
|
763
|
-
|
|
764
|
-
# @
|
|
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
|
|
765
1269
|
def do_get(**args)
|
|
766
1270
|
@exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
|
|
767
1271
|
end
|
|
768
1272
|
# Get information about a shaper for a given device.
|
|
769
|
-
#--
|
|
770
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
|
|
771
1278
|
def dump_get(**args)
|
|
772
1279
|
@exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
|
|
773
1280
|
end
|
|
@@ -777,8 +1284,25 @@ class NetShaper < ::Nl::Family
|
|
|
777
1284
|
#
|
|
778
1285
|
#
|
|
779
1286
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
780
|
-
|
|
781
|
-
# @
|
|
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
|
|
782
1306
|
def do_set(**args)
|
|
783
1307
|
@exchange.call(:"do", Messages::DoSetRequest, nil, args)
|
|
784
1308
|
end
|
|
@@ -796,8 +1320,12 @@ class NetShaper < ::Nl::Family
|
|
|
796
1320
|
#
|
|
797
1321
|
#
|
|
798
1322
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
799
|
-
|
|
800
|
-
# @
|
|
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
|
|
801
1329
|
def do_delete(**args)
|
|
802
1330
|
@exchange.call(:"do", Messages::DoDeleteRequest, nil, args)
|
|
803
1331
|
end
|
|
@@ -823,29 +1351,59 @@ class NetShaper < ::Nl::Family
|
|
|
823
1351
|
#
|
|
824
1352
|
#
|
|
825
1353
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
826
|
-
|
|
827
|
-
# @
|
|
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
|
|
828
1376
|
def do_group(**args)
|
|
829
1377
|
@exchange.call(:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args)
|
|
830
1378
|
end
|
|
831
1379
|
# Get the shaper capabilities supported by the given device
|
|
832
1380
|
# for the specified scope.
|
|
833
|
-
#--
|
|
834
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
|
|
835
1389
|
def do_cap_get(**args)
|
|
836
1390
|
@exchange.call(:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args)
|
|
837
1391
|
end
|
|
838
1392
|
# Get the shaper capabilities supported by the given device
|
|
839
1393
|
# for the specified scope.
|
|
840
|
-
#--
|
|
841
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
|
|
842
1399
|
def dump_cap_get(**args)
|
|
843
1400
|
@exchange.call(:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args)
|
|
844
1401
|
end
|
|
845
1402
|
end
|
|
846
1403
|
# Returns the asynchronous operation facade for this family.
|
|
847
|
-
#--
|
|
848
1404
|
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
1405
|
+
# @param [::Integer, nil] stream_capacity
|
|
1406
|
+
# @return [AsyncOperations]
|
|
849
1407
|
def async(stream_capacity: nil)
|
|
850
1408
|
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
851
1409
|
build_async_facade(AsyncOperations, stream_capacity:)
|