nl-linux 0.2.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +8 -0
- data/Rakefile +27 -5
- data/generated/nl/linux/binder.rb +227 -19
- data/generated/nl/linux/conntrack.rb +1325 -365
- data/generated/nl/linux/dev_energymodel.rb +357 -66
- data/generated/nl/linux/devlink.rb +6310 -1859
- data/generated/nl/linux/dpll.rb +2202 -376
- data/generated/nl/linux/drm_ras.rb +312 -63
- data/generated/nl/linux/ethtool.rb +7555 -2447
- data/generated/nl/linux/fou.rb +381 -133
- data/generated/nl/linux/handshake.rb +340 -70
- data/generated/nl/linux/lockd.rb +132 -27
- data/generated/nl/linux/mptcp_pm.rb +773 -161
- data/generated/nl/linux/net_shaper.rb +892 -211
- data/generated/nl/linux/netdev.rb +2366 -518
- data/generated/nl/linux/nfsd.rb +1299 -317
- data/generated/nl/linux/nftables.rb +5351 -1533
- data/generated/nl/linux/nl80211.rb +4601 -882
- data/generated/nl/linux/nlctrl.rb +460 -117
- data/generated/nl/linux/ovpn.rb +1360 -262
- data/generated/nl/linux/ovs_datapath.rb +312 -98
- data/generated/nl/linux/ovs_flow.rb +1866 -358
- data/generated/nl/linux/ovs_packet.rb +331 -45
- data/generated/nl/linux/ovs_vport.rb +374 -123
- data/generated/nl/linux/psp.rb +1093 -201
- data/generated/nl/linux/rt_addr.rb +423 -165
- data/generated/nl/linux/rt_link.rb +6928 -1336
- data/generated/nl/linux/rt_neigh.rb +1063 -297
- data/generated/nl/linux/rt_route.rb +1112 -483
- data/generated/nl/linux/rt_rule.rb +931 -262
- data/generated/nl/linux/sunrpc_cache.rb +407 -82
- data/generated/nl/linux/tc.rb +10081 -1763
- data/generated/nl/linux/tcp_metrics.rb +388 -109
- data/generated/nl/linux/team.rb +350 -84
- data/generated/nl/linux/wireguard.rb +525 -96
- 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 +51 -10
|
@@ -1,99 +1,213 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
|
+
#
|
|
3
|
+
# This file is based on Documentation/netlink/specs/tcp_metrics.yaml from Linux v7.2.
|
|
2
4
|
#--
|
|
3
5
|
# frozen_string_literal: true
|
|
4
|
-
# rbs_inline: enabled
|
|
5
6
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
6
7
|
require 'nl'
|
|
7
8
|
module Nl; module Linux
|
|
8
9
|
# Management interface for TCP metrics.
|
|
9
|
-
class TcpMetrics < ::Nl::Family
|
|
10
|
+
class TcpMetrics < ::Nl::Genl::Family
|
|
10
11
|
NAME = "tcp_metrics"
|
|
11
|
-
|
|
12
|
+
VERSION = 1
|
|
13
|
+
# @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
|
|
14
|
+
# @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
|
|
15
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
16
|
+
# @param [#call] resolver
|
|
17
|
+
# @param [Symbol, nil] executor
|
|
18
|
+
# @param [Integer, nil] notification_capacity
|
|
19
|
+
# @return [TcpMetrics]
|
|
20
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
|
|
21
|
+
# @param [#call] resolver
|
|
22
|
+
# @param [Symbol, nil] executor
|
|
23
|
+
# @param [Integer, nil] notification_capacity
|
|
24
|
+
# @yieldparam [TcpMetrics] family
|
|
25
|
+
# @return [Object] the result of the block
|
|
26
|
+
def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
# @private
|
|
30
|
+
MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
|
|
31
|
+
module Constants
|
|
32
|
+
TCP_FASTOPEN_COOKIE_MAX = 16
|
|
33
|
+
end
|
|
12
34
|
module Structs
|
|
13
35
|
end
|
|
14
36
|
module AttributeSets
|
|
15
|
-
class TcpMetrics < ::Nl::
|
|
37
|
+
class TcpMetrics < ::Nl::AttributeSet
|
|
16
38
|
# Abstract class
|
|
17
|
-
class Attribute < ::Nl::
|
|
39
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
18
40
|
end
|
|
19
41
|
class AddrIpv4 < Attribute
|
|
20
42
|
TYPE = 1
|
|
21
43
|
NAME = :"addr_ipv4"
|
|
22
|
-
|
|
44
|
+
# @private
|
|
45
|
+
ORDER = 0
|
|
46
|
+
# @private
|
|
47
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
|
|
23
48
|
end
|
|
24
49
|
class AddrIpv6 < Attribute
|
|
25
50
|
TYPE = 2
|
|
26
51
|
NAME = :"addr_ipv6"
|
|
27
|
-
|
|
52
|
+
# @private
|
|
53
|
+
ORDER = 1
|
|
54
|
+
# @private
|
|
55
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
|
|
28
56
|
end
|
|
29
57
|
class Age < Attribute
|
|
30
58
|
TYPE = 3
|
|
31
59
|
NAME = :"age"
|
|
32
|
-
|
|
60
|
+
# @private
|
|
61
|
+
ORDER = 2
|
|
62
|
+
# @private
|
|
63
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
33
64
|
end
|
|
65
|
+
# unused
|
|
34
66
|
class TwTsval < Attribute
|
|
35
67
|
TYPE = 4
|
|
36
68
|
NAME = :"tw_tsval"
|
|
37
|
-
|
|
69
|
+
# @private
|
|
70
|
+
ORDER = 3
|
|
71
|
+
# @private
|
|
72
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
38
73
|
end
|
|
74
|
+
# unused
|
|
39
75
|
class TwTsStamp < Attribute
|
|
40
76
|
TYPE = 5
|
|
41
77
|
NAME = :"tw_ts_stamp"
|
|
42
|
-
|
|
78
|
+
# @private
|
|
79
|
+
ORDER = 4
|
|
80
|
+
# @private
|
|
81
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
43
82
|
end
|
|
44
83
|
class Vals < Attribute
|
|
45
84
|
TYPE = 6
|
|
46
85
|
NAME = :"vals"
|
|
86
|
+
# @private
|
|
87
|
+
ORDER = 5
|
|
47
88
|
end
|
|
48
89
|
class FopenMss < Attribute
|
|
49
90
|
TYPE = 7
|
|
50
91
|
NAME = :"fopen_mss"
|
|
51
|
-
|
|
92
|
+
# @private
|
|
93
|
+
ORDER = 6
|
|
94
|
+
# @private
|
|
95
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
52
96
|
end
|
|
53
97
|
class FopenSynDrops < Attribute
|
|
54
98
|
TYPE = 8
|
|
55
99
|
NAME = :"fopen_syn_drops"
|
|
56
|
-
|
|
100
|
+
# @private
|
|
101
|
+
ORDER = 7
|
|
102
|
+
# @private
|
|
103
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
57
104
|
end
|
|
58
105
|
class FopenSynDropTs < Attribute
|
|
59
106
|
TYPE = 9
|
|
60
107
|
NAME = :"fopen_syn_drop_ts"
|
|
61
|
-
|
|
108
|
+
# @private
|
|
109
|
+
ORDER = 8
|
|
110
|
+
# @private
|
|
111
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
62
112
|
end
|
|
63
113
|
class FopenCookie < Attribute
|
|
64
114
|
TYPE = 10
|
|
65
115
|
NAME = :"fopen_cookie"
|
|
66
|
-
|
|
116
|
+
# @private
|
|
117
|
+
ORDER = 9
|
|
118
|
+
# @private
|
|
119
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length #{Constants::TCP_FASTOPEN_COOKIE_MAX}" unless it.bytesize >= Constants::TCP_FASTOPEN_COOKIE_MAX })
|
|
67
120
|
end
|
|
68
121
|
class SaddrIpv4 < Attribute
|
|
69
122
|
TYPE = 11
|
|
70
123
|
NAME = :"saddr_ipv4"
|
|
71
|
-
|
|
124
|
+
# @private
|
|
125
|
+
ORDER = 10
|
|
126
|
+
# @private
|
|
127
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
|
|
72
128
|
end
|
|
73
129
|
class SaddrIpv6 < Attribute
|
|
74
130
|
TYPE = 12
|
|
75
131
|
NAME = :"saddr_ipv6"
|
|
76
|
-
|
|
132
|
+
# @private
|
|
133
|
+
ORDER = 11
|
|
134
|
+
# @private
|
|
135
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
|
|
77
136
|
end
|
|
78
137
|
class Pad < Attribute
|
|
79
138
|
TYPE = 13
|
|
80
139
|
NAME = :"pad"
|
|
81
|
-
|
|
140
|
+
# @private
|
|
141
|
+
ORDER = 12
|
|
142
|
+
# @private
|
|
143
|
+
DATATYPE = ::Nl::DataTypes::Pad.new()
|
|
82
144
|
end
|
|
83
|
-
#
|
|
145
|
+
# @private
|
|
84
146
|
BY_NAME = Ractor.make_shareable({:"addr_ipv4" => AddrIpv4, :"addr_ipv6" => AddrIpv6, :"age" => Age, :"tw_tsval" => TwTsval, :"tw_ts_stamp" => TwTsStamp, :"vals" => Vals, :"fopen_mss" => FopenMss, :"fopen_syn_drops" => FopenSynDrops, :"fopen_syn_drop_ts" => FopenSynDropTs, :"fopen_cookie" => FopenCookie, :"saddr_ipv4" => SaddrIpv4, :"saddr_ipv6" => SaddrIpv6, :"pad" => Pad}) #: Hash[::Symbol, Attribute]
|
|
85
|
-
#
|
|
147
|
+
# @private
|
|
86
148
|
BY_TYPE = Ractor.make_shareable({1 => AddrIpv4, 2 => AddrIpv6, 3 => Age, 4 => TwTsval, 5 => TwTsStamp, 6 => Vals, 7 => FopenMss, 8 => FopenSynDrops, 9 => FopenSynDropTs, 10 => FopenCookie, 11 => SaddrIpv4, 12 => SaddrIpv6, 13 => Pad}) #: Hash[::Integer, Attribute]
|
|
149
|
+
# @rbs return: ::Integer
|
|
150
|
+
# @return [Integer]
|
|
151
|
+
# @see AddrIpv4
|
|
152
|
+
def addr_ipv4; self[:"addr_ipv4"]&.value; end
|
|
153
|
+
# @rbs return: ::String
|
|
154
|
+
# @return [String]
|
|
155
|
+
# @see AddrIpv6
|
|
156
|
+
def addr_ipv6; self[:"addr_ipv6"]&.value; end
|
|
157
|
+
# @rbs return: ::Integer
|
|
158
|
+
# @return [Integer]
|
|
159
|
+
# @see Age
|
|
160
|
+
def age; self[:"age"]&.value; end
|
|
161
|
+
# unused
|
|
162
|
+
# @rbs return: ::Integer
|
|
163
|
+
# @return [Integer]
|
|
164
|
+
# @see TwTsval
|
|
165
|
+
def tw_tsval; self[:"tw_tsval"]&.value; end
|
|
166
|
+
# unused
|
|
167
|
+
# @rbs return: ::Integer
|
|
168
|
+
# @return [Integer]
|
|
169
|
+
# @see TwTsStamp
|
|
170
|
+
def tw_ts_stamp; self[:"tw_ts_stamp"]&.value; end
|
|
171
|
+
# @rbs return: AttributeSets::Metrics
|
|
172
|
+
# @return [AttributeSets::Metrics]
|
|
173
|
+
# @see Vals
|
|
174
|
+
def vals; self[:"vals"]&.value; end
|
|
175
|
+
# @rbs return: ::Integer
|
|
176
|
+
# @return [Integer]
|
|
177
|
+
# @see FopenMss
|
|
178
|
+
def fopen_mss; self[:"fopen_mss"]&.value; end
|
|
179
|
+
# @rbs return: ::Integer
|
|
180
|
+
# @return [Integer]
|
|
181
|
+
# @see FopenSynDrops
|
|
182
|
+
def fopen_syn_drops; self[:"fopen_syn_drops"]&.value; end
|
|
183
|
+
# @rbs return: ::Integer
|
|
184
|
+
# @return [Integer]
|
|
185
|
+
# @see FopenSynDropTs
|
|
186
|
+
def fopen_syn_drop_ts; self[:"fopen_syn_drop_ts"]&.value; end
|
|
187
|
+
# @rbs return: ::String
|
|
188
|
+
# @return [String]
|
|
189
|
+
# @see FopenCookie
|
|
190
|
+
def fopen_cookie; self[:"fopen_cookie"]&.value; end
|
|
191
|
+
# @rbs return: ::Integer
|
|
192
|
+
# @return [Integer]
|
|
193
|
+
# @see SaddrIpv4
|
|
194
|
+
def saddr_ipv4; self[:"saddr_ipv4"]&.value; end
|
|
195
|
+
# @rbs return: ::String
|
|
196
|
+
# @return [String]
|
|
197
|
+
# @see SaddrIpv6
|
|
198
|
+
def saddr_ipv6; self[:"saddr_ipv6"]&.value; end
|
|
87
199
|
class << self
|
|
88
200
|
# Looks up Attribute class by name.
|
|
89
|
-
#--
|
|
90
201
|
# @rbs name: Symbol
|
|
91
202
|
# @rbs return: Attribute
|
|
203
|
+
# @param [Symbol] name
|
|
204
|
+
# @return [Attribute]
|
|
92
205
|
def by_name(name); BY_NAME.fetch(name); end
|
|
93
206
|
# Looks up Attribute class by type value.
|
|
94
|
-
#--
|
|
95
207
|
# @rbs type: Integer
|
|
96
208
|
# @rbs return: Attribute
|
|
209
|
+
# @param [Integer] type
|
|
210
|
+
# @return [Attribute]
|
|
97
211
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
98
212
|
end
|
|
99
213
|
end
|
|
@@ -101,217 +215,382 @@ class TcpMetrics < ::Nl::Family
|
|
|
101
215
|
# the TCP_METRIC_* defines in the kernel, because kernel defines
|
|
102
216
|
# are off-by one (e.g. rtt is defined as enum 0, while netlink carries
|
|
103
217
|
# attribute type 1).
|
|
104
|
-
class Metrics < ::Nl::
|
|
218
|
+
class Metrics < ::Nl::AttributeSet
|
|
105
219
|
# Abstract class
|
|
106
|
-
class Attribute < ::Nl::
|
|
220
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
107
221
|
end
|
|
222
|
+
# Round Trip Time (RTT), in msecs with 3 bits fractional
|
|
223
|
+
# (left-shift by 3 to get the msec value).
|
|
108
224
|
class Rtt < Attribute
|
|
109
225
|
TYPE = 1
|
|
110
226
|
NAME = :"rtt"
|
|
111
|
-
|
|
227
|
+
# @private
|
|
228
|
+
ORDER = 0
|
|
229
|
+
# @private
|
|
230
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
112
231
|
end
|
|
232
|
+
# Round Trip Time VARiance (RTT), in msecs with 2 bits fractional
|
|
233
|
+
# (left-shift by 2 to get the msec value).
|
|
113
234
|
class Rttvar < Attribute
|
|
114
235
|
TYPE = 2
|
|
115
236
|
NAME = :"rttvar"
|
|
116
|
-
|
|
237
|
+
# @private
|
|
238
|
+
ORDER = 1
|
|
239
|
+
# @private
|
|
240
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
117
241
|
end
|
|
242
|
+
# Slow Start THRESHold.
|
|
118
243
|
class Ssthresh < Attribute
|
|
119
244
|
TYPE = 3
|
|
120
245
|
NAME = :"ssthresh"
|
|
121
|
-
|
|
246
|
+
# @private
|
|
247
|
+
ORDER = 2
|
|
248
|
+
# @private
|
|
249
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
122
250
|
end
|
|
251
|
+
# Congestion Window.
|
|
123
252
|
class Cwnd < Attribute
|
|
124
253
|
TYPE = 4
|
|
125
254
|
NAME = :"cwnd"
|
|
126
|
-
|
|
255
|
+
# @private
|
|
256
|
+
ORDER = 3
|
|
257
|
+
# @private
|
|
258
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
127
259
|
end
|
|
260
|
+
# Reodering metric.
|
|
128
261
|
class Reodering < Attribute
|
|
129
262
|
TYPE = 5
|
|
130
263
|
NAME = :"reodering"
|
|
131
|
-
|
|
264
|
+
# @private
|
|
265
|
+
ORDER = 4
|
|
266
|
+
# @private
|
|
267
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
132
268
|
end
|
|
269
|
+
# Round Trip Time (RTT), in usecs, with 3 bits fractional
|
|
270
|
+
# (left-shift by 3 to get the msec value).
|
|
133
271
|
class RttUs < Attribute
|
|
134
272
|
TYPE = 6
|
|
135
273
|
NAME = :"rtt_us"
|
|
136
|
-
|
|
274
|
+
# @private
|
|
275
|
+
ORDER = 5
|
|
276
|
+
# @private
|
|
277
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
137
278
|
end
|
|
279
|
+
# Round Trip Time (RTT), in usecs, with 2 bits fractional
|
|
280
|
+
# (left-shift by 3 to get the msec value).
|
|
138
281
|
class RttvarUs < Attribute
|
|
139
282
|
TYPE = 7
|
|
140
283
|
NAME = :"rttvar_us"
|
|
141
|
-
|
|
284
|
+
# @private
|
|
285
|
+
ORDER = 6
|
|
286
|
+
# @private
|
|
287
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
142
288
|
end
|
|
143
|
-
#
|
|
289
|
+
# @private
|
|
144
290
|
BY_NAME = Ractor.make_shareable({:"rtt" => Rtt, :"rttvar" => Rttvar, :"ssthresh" => Ssthresh, :"cwnd" => Cwnd, :"reodering" => Reodering, :"rtt_us" => RttUs, :"rttvar_us" => RttvarUs}) #: Hash[::Symbol, Attribute]
|
|
145
|
-
#
|
|
291
|
+
# @private
|
|
146
292
|
BY_TYPE = Ractor.make_shareable({1 => Rtt, 2 => Rttvar, 3 => Ssthresh, 4 => Cwnd, 5 => Reodering, 6 => RttUs, 7 => RttvarUs}) #: Hash[::Integer, Attribute]
|
|
293
|
+
# Round Trip Time (RTT), in msecs with 3 bits fractional
|
|
294
|
+
# (left-shift by 3 to get the msec value).
|
|
295
|
+
# @rbs return: ::Integer
|
|
296
|
+
# @return [Integer]
|
|
297
|
+
# @see Rtt
|
|
298
|
+
def rtt; self[:"rtt"]&.value; end
|
|
299
|
+
# Round Trip Time VARiance (RTT), in msecs with 2 bits fractional
|
|
300
|
+
# (left-shift by 2 to get the msec value).
|
|
301
|
+
# @rbs return: ::Integer
|
|
302
|
+
# @return [Integer]
|
|
303
|
+
# @see Rttvar
|
|
304
|
+
def rttvar; self[:"rttvar"]&.value; end
|
|
305
|
+
# Slow Start THRESHold.
|
|
306
|
+
# @rbs return: ::Integer
|
|
307
|
+
# @return [Integer]
|
|
308
|
+
# @see Ssthresh
|
|
309
|
+
def ssthresh; self[:"ssthresh"]&.value; end
|
|
310
|
+
# Congestion Window.
|
|
311
|
+
# @rbs return: ::Integer
|
|
312
|
+
# @return [Integer]
|
|
313
|
+
# @see Cwnd
|
|
314
|
+
def cwnd; self[:"cwnd"]&.value; end
|
|
315
|
+
# Reodering metric.
|
|
316
|
+
# @rbs return: ::Integer
|
|
317
|
+
# @return [Integer]
|
|
318
|
+
# @see Reodering
|
|
319
|
+
def reodering; self[:"reodering"]&.value; end
|
|
320
|
+
# Round Trip Time (RTT), in usecs, with 3 bits fractional
|
|
321
|
+
# (left-shift by 3 to get the msec value).
|
|
322
|
+
# @rbs return: ::Integer
|
|
323
|
+
# @return [Integer]
|
|
324
|
+
# @see RttUs
|
|
325
|
+
def rtt_us; self[:"rtt_us"]&.value; end
|
|
326
|
+
# Round Trip Time (RTT), in usecs, with 2 bits fractional
|
|
327
|
+
# (left-shift by 3 to get the msec value).
|
|
328
|
+
# @rbs return: ::Integer
|
|
329
|
+
# @return [Integer]
|
|
330
|
+
# @see RttvarUs
|
|
331
|
+
def rttvar_us; self[:"rttvar_us"]&.value; end
|
|
147
332
|
class << self
|
|
148
333
|
# Looks up Attribute class by name.
|
|
149
|
-
#--
|
|
150
334
|
# @rbs name: Symbol
|
|
151
335
|
# @rbs return: Attribute
|
|
336
|
+
# @param [Symbol] name
|
|
337
|
+
# @return [Attribute]
|
|
152
338
|
def by_name(name); BY_NAME.fetch(name); end
|
|
153
339
|
# Looks up Attribute class by type value.
|
|
154
|
-
#--
|
|
155
340
|
# @rbs type: Integer
|
|
156
341
|
# @rbs return: Attribute
|
|
342
|
+
# @param [Integer] type
|
|
343
|
+
# @return [Attribute]
|
|
157
344
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
158
345
|
end
|
|
159
346
|
end
|
|
160
|
-
|
|
347
|
+
# @private
|
|
348
|
+
TcpMetrics::Vals::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Metrics, selector_bindings: Ractor.make_shareable([]))
|
|
161
349
|
end
|
|
162
350
|
module Messages
|
|
163
351
|
# Retrieve metrics.
|
|
164
|
-
class DoGetRequest < ::Nl::
|
|
352
|
+
class DoGetRequest < ::Nl::Genl::Message
|
|
165
353
|
TYPE = 1
|
|
166
354
|
FIXED_HEADER = nil
|
|
167
355
|
ATTRIBUTE_SET = AttributeSets::TcpMetrics
|
|
168
356
|
ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 saddr_ipv4 saddr_ipv6])
|
|
169
|
-
# Gets the value of `addr-ipv4` attribute in the message.
|
|
170
|
-
#--
|
|
171
357
|
# @rbs return: ::Integer
|
|
358
|
+
# @return [Integer]
|
|
359
|
+
# @see AttributeSets::TcpMetrics::AddrIpv4
|
|
172
360
|
def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
|
|
173
|
-
#
|
|
174
|
-
|
|
175
|
-
# @
|
|
361
|
+
# @rbs return: ::String
|
|
362
|
+
# @return [String]
|
|
363
|
+
# @see AttributeSets::TcpMetrics::AddrIpv6
|
|
176
364
|
def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
|
|
177
|
-
# Gets the value of `saddr-ipv4` attribute in the message.
|
|
178
|
-
#--
|
|
179
365
|
# @rbs return: ::Integer
|
|
366
|
+
# @return [Integer]
|
|
367
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv4
|
|
180
368
|
def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
|
|
181
|
-
#
|
|
182
|
-
|
|
183
|
-
# @
|
|
369
|
+
# @rbs return: ::String
|
|
370
|
+
# @return [String]
|
|
371
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv6
|
|
184
372
|
def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
|
|
185
373
|
end
|
|
186
374
|
# Retrieve metrics.
|
|
187
|
-
class DoGetReply < ::Nl::
|
|
375
|
+
class DoGetReply < ::Nl::Genl::Message
|
|
188
376
|
TYPE = 1
|
|
189
377
|
FIXED_HEADER = nil
|
|
190
378
|
ATTRIBUTE_SET = AttributeSets::TcpMetrics
|
|
191
379
|
ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 age vals fopen_mss fopen_syn_drops fopen_syn_drop_ts fopen_cookie saddr_ipv4 saddr_ipv6])
|
|
192
|
-
# Gets the value of `addr-ipv4` attribute in the message.
|
|
193
|
-
#--
|
|
194
380
|
# @rbs return: ::Integer
|
|
381
|
+
# @return [Integer]
|
|
382
|
+
# @see AttributeSets::TcpMetrics::AddrIpv4
|
|
195
383
|
def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
|
|
196
|
-
#
|
|
197
|
-
|
|
198
|
-
# @
|
|
384
|
+
# @rbs return: ::String
|
|
385
|
+
# @return [String]
|
|
386
|
+
# @see AttributeSets::TcpMetrics::AddrIpv6
|
|
199
387
|
def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
|
|
200
|
-
# Gets the value of `age` attribute in the message.
|
|
201
|
-
#--
|
|
202
388
|
# @rbs return: ::Integer
|
|
389
|
+
# @return [Integer]
|
|
390
|
+
# @see AttributeSets::TcpMetrics::Age
|
|
203
391
|
def age; attributes[:"age"]&.value; end
|
|
204
|
-
# Gets the value of `vals` attribute in the message.
|
|
205
|
-
#--
|
|
206
392
|
# @rbs return: AttributeSets::Metrics
|
|
393
|
+
# @return [AttributeSets::Metrics]
|
|
394
|
+
# @see AttributeSets::TcpMetrics::Vals
|
|
207
395
|
def vals; attributes[:"vals"]&.value; end
|
|
208
|
-
# Gets the value of `fopen-mss` attribute in the message.
|
|
209
|
-
#--
|
|
210
396
|
# @rbs return: ::Integer
|
|
397
|
+
# @return [Integer]
|
|
398
|
+
# @see AttributeSets::TcpMetrics::FopenMss
|
|
211
399
|
def fopen_mss; attributes[:"fopen_mss"]&.value; end
|
|
212
|
-
# Gets the value of `fopen-syn-drops` attribute in the message.
|
|
213
|
-
#--
|
|
214
400
|
# @rbs return: ::Integer
|
|
401
|
+
# @return [Integer]
|
|
402
|
+
# @see AttributeSets::TcpMetrics::FopenSynDrops
|
|
215
403
|
def fopen_syn_drops; attributes[:"fopen_syn_drops"]&.value; end
|
|
216
|
-
# Gets the value of `fopen-syn-drop-ts` attribute in the message.
|
|
217
|
-
#--
|
|
218
404
|
# @rbs return: ::Integer
|
|
405
|
+
# @return [Integer]
|
|
406
|
+
# @see AttributeSets::TcpMetrics::FopenSynDropTs
|
|
219
407
|
def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
|
|
220
|
-
#
|
|
221
|
-
|
|
222
|
-
# @
|
|
408
|
+
# @rbs return: ::String
|
|
409
|
+
# @return [String]
|
|
410
|
+
# @see AttributeSets::TcpMetrics::FopenCookie
|
|
223
411
|
def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
|
|
224
|
-
# Gets the value of `saddr-ipv4` attribute in the message.
|
|
225
|
-
#--
|
|
226
412
|
# @rbs return: ::Integer
|
|
413
|
+
# @return [Integer]
|
|
414
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv4
|
|
227
415
|
def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
|
|
228
|
-
#
|
|
229
|
-
|
|
230
|
-
# @
|
|
416
|
+
# @rbs return: ::String
|
|
417
|
+
# @return [String]
|
|
418
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv6
|
|
231
419
|
def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
|
|
232
420
|
end
|
|
233
421
|
# Retrieve metrics.
|
|
234
|
-
class
|
|
422
|
+
class DumpGetRequest < ::Nl::Genl::Message
|
|
423
|
+
TYPE = 1
|
|
424
|
+
FIXED_HEADER = nil
|
|
425
|
+
ATTRIBUTE_SET = AttributeSets::TcpMetrics
|
|
426
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
427
|
+
end
|
|
428
|
+
# Retrieve metrics.
|
|
429
|
+
class DumpGetReply < ::Nl::Genl::Message
|
|
235
430
|
TYPE = 1
|
|
236
431
|
FIXED_HEADER = nil
|
|
237
432
|
ATTRIBUTE_SET = AttributeSets::TcpMetrics
|
|
238
433
|
ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 age vals fopen_mss fopen_syn_drops fopen_syn_drop_ts fopen_cookie saddr_ipv4 saddr_ipv6])
|
|
239
|
-
# Gets the value of `addr-ipv4` attribute in the message.
|
|
240
|
-
#--
|
|
241
434
|
# @rbs return: ::Integer
|
|
435
|
+
# @return [Integer]
|
|
436
|
+
# @see AttributeSets::TcpMetrics::AddrIpv4
|
|
242
437
|
def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
|
|
243
|
-
#
|
|
244
|
-
|
|
245
|
-
# @
|
|
438
|
+
# @rbs return: ::String
|
|
439
|
+
# @return [String]
|
|
440
|
+
# @see AttributeSets::TcpMetrics::AddrIpv6
|
|
246
441
|
def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
|
|
247
|
-
# Gets the value of `age` attribute in the message.
|
|
248
|
-
#--
|
|
249
442
|
# @rbs return: ::Integer
|
|
443
|
+
# @return [Integer]
|
|
444
|
+
# @see AttributeSets::TcpMetrics::Age
|
|
250
445
|
def age; attributes[:"age"]&.value; end
|
|
251
|
-
# Gets the value of `vals` attribute in the message.
|
|
252
|
-
#--
|
|
253
446
|
# @rbs return: AttributeSets::Metrics
|
|
447
|
+
# @return [AttributeSets::Metrics]
|
|
448
|
+
# @see AttributeSets::TcpMetrics::Vals
|
|
254
449
|
def vals; attributes[:"vals"]&.value; end
|
|
255
|
-
# Gets the value of `fopen-mss` attribute in the message.
|
|
256
|
-
#--
|
|
257
450
|
# @rbs return: ::Integer
|
|
451
|
+
# @return [Integer]
|
|
452
|
+
# @see AttributeSets::TcpMetrics::FopenMss
|
|
258
453
|
def fopen_mss; attributes[:"fopen_mss"]&.value; end
|
|
259
|
-
# Gets the value of `fopen-syn-drops` attribute in the message.
|
|
260
|
-
#--
|
|
261
454
|
# @rbs return: ::Integer
|
|
455
|
+
# @return [Integer]
|
|
456
|
+
# @see AttributeSets::TcpMetrics::FopenSynDrops
|
|
262
457
|
def fopen_syn_drops; attributes[:"fopen_syn_drops"]&.value; end
|
|
263
|
-
# Gets the value of `fopen-syn-drop-ts` attribute in the message.
|
|
264
|
-
#--
|
|
265
458
|
# @rbs return: ::Integer
|
|
459
|
+
# @return [Integer]
|
|
460
|
+
# @see AttributeSets::TcpMetrics::FopenSynDropTs
|
|
266
461
|
def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
|
|
267
|
-
#
|
|
268
|
-
|
|
269
|
-
# @
|
|
462
|
+
# @rbs return: ::String
|
|
463
|
+
# @return [String]
|
|
464
|
+
# @see AttributeSets::TcpMetrics::FopenCookie
|
|
270
465
|
def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
|
|
271
|
-
# Gets the value of `saddr-ipv4` attribute in the message.
|
|
272
|
-
#--
|
|
273
466
|
# @rbs return: ::Integer
|
|
467
|
+
# @return [Integer]
|
|
468
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv4
|
|
274
469
|
def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
|
|
275
|
-
#
|
|
276
|
-
|
|
277
|
-
# @
|
|
470
|
+
# @rbs return: ::String
|
|
471
|
+
# @return [String]
|
|
472
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv6
|
|
278
473
|
def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
|
|
279
474
|
end
|
|
280
475
|
# Delete metrics.
|
|
281
|
-
|
|
476
|
+
#
|
|
477
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
478
|
+
class DoDelRequest < ::Nl::Genl::Message
|
|
282
479
|
TYPE = 2
|
|
283
480
|
FIXED_HEADER = nil
|
|
284
481
|
ATTRIBUTE_SET = AttributeSets::TcpMetrics
|
|
285
482
|
ATTRIBUTES = Ractor.make_shareable(%i[addr_ipv4 addr_ipv6 saddr_ipv4 saddr_ipv6])
|
|
286
|
-
# Gets the value of `addr-ipv4` attribute in the message.
|
|
287
|
-
#--
|
|
288
483
|
# @rbs return: ::Integer
|
|
484
|
+
# @return [Integer]
|
|
485
|
+
# @see AttributeSets::TcpMetrics::AddrIpv4
|
|
289
486
|
def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
|
|
290
|
-
#
|
|
291
|
-
|
|
292
|
-
# @
|
|
487
|
+
# @rbs return: ::String
|
|
488
|
+
# @return [String]
|
|
489
|
+
# @see AttributeSets::TcpMetrics::AddrIpv6
|
|
293
490
|
def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
|
|
294
|
-
# Gets the value of `saddr-ipv4` attribute in the message.
|
|
295
|
-
#--
|
|
296
491
|
# @rbs return: ::Integer
|
|
492
|
+
# @return [Integer]
|
|
493
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv4
|
|
297
494
|
def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
|
|
298
|
-
#
|
|
299
|
-
|
|
300
|
-
# @
|
|
495
|
+
# @rbs return: ::String
|
|
496
|
+
# @return [String]
|
|
497
|
+
# @see AttributeSets::TcpMetrics::SaddrIpv6
|
|
301
498
|
def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
|
|
302
499
|
end
|
|
303
500
|
end
|
|
501
|
+
module Notifications
|
|
502
|
+
end
|
|
503
|
+
# @private
|
|
504
|
+
NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
|
|
304
505
|
# Retrieve metrics.
|
|
305
|
-
|
|
306
|
-
# @
|
|
506
|
+
# @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> Messages::DoGetReply
|
|
507
|
+
# @param [Hash] args
|
|
508
|
+
# @option args [Integer] addr_ipv4
|
|
509
|
+
# @option args [String] addr_ipv6
|
|
510
|
+
# @option args [Integer] saddr_ipv4
|
|
511
|
+
# @option args [String] saddr_ipv6
|
|
512
|
+
# @return [Messages::DoGetReply]
|
|
513
|
+
# @see Messages::DoGetRequest
|
|
307
514
|
def do_get(**args)
|
|
308
515
|
exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
|
|
309
516
|
end
|
|
517
|
+
# Retrieve metrics.
|
|
518
|
+
# @rbs () -> Array[Messages::DumpGetReply]
|
|
519
|
+
# | () { (Messages::DumpGetReply) -> void } -> void
|
|
520
|
+
# @overload dump_get(**args)
|
|
521
|
+
# Returns an array when no block is given.
|
|
522
|
+
# @param [Hash] args
|
|
523
|
+
# @return [Array<Messages::DumpGetReply>]
|
|
524
|
+
# @overload dump_get(**args, &block)
|
|
525
|
+
# Yields each reply when a block is given.
|
|
526
|
+
# @param [Hash] args
|
|
527
|
+
# @yieldparam [Messages::DumpGetReply] reply
|
|
528
|
+
# @return [void]
|
|
529
|
+
# @see Messages::DumpGetRequest
|
|
530
|
+
def dump_get(**args, &block)
|
|
531
|
+
exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
|
|
532
|
+
end
|
|
310
533
|
# Delete metrics.
|
|
311
|
-
|
|
312
|
-
#
|
|
534
|
+
#
|
|
535
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
536
|
+
# @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> void
|
|
537
|
+
# @param [Hash] args
|
|
538
|
+
# @option args [Integer] addr_ipv4
|
|
539
|
+
# @option args [String] addr_ipv6
|
|
540
|
+
# @option args [Integer] saddr_ipv4
|
|
541
|
+
# @option args [String] saddr_ipv6
|
|
542
|
+
# @return [void]
|
|
543
|
+
# @see Messages::DoDelRequest
|
|
313
544
|
def do_del(**args)
|
|
314
545
|
exchange_message(:"do", Messages::DoDelRequest, nil, args)
|
|
315
546
|
end
|
|
547
|
+
class AsyncOperations
|
|
548
|
+
# @private
|
|
549
|
+
def initialize(&exchange)
|
|
550
|
+
@exchange = exchange
|
|
551
|
+
end
|
|
552
|
+
# Retrieve metrics.
|
|
553
|
+
# @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> ::Nl::Async::Future[Messages::DoGetReply]
|
|
554
|
+
# @param [Hash] args
|
|
555
|
+
# @option args [Integer] addr_ipv4
|
|
556
|
+
# @option args [String] addr_ipv6
|
|
557
|
+
# @option args [Integer] saddr_ipv4
|
|
558
|
+
# @option args [String] saddr_ipv6
|
|
559
|
+
# @return [Nl::Async::Future<Messages::DoGetReply>]
|
|
560
|
+
# @see Messages::DoGetRequest
|
|
561
|
+
def do_get(**args)
|
|
562
|
+
@exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
|
|
563
|
+
end
|
|
564
|
+
# Retrieve metrics.
|
|
565
|
+
# @rbs () -> ::Nl::Async::Stream[Messages::DumpGetReply]
|
|
566
|
+
# @param [Hash] args
|
|
567
|
+
# @return [Nl::Async::Stream<Messages::DumpGetReply>]
|
|
568
|
+
# @see Messages::DumpGetRequest
|
|
569
|
+
def dump_get(**args)
|
|
570
|
+
@exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
|
|
571
|
+
end
|
|
572
|
+
# Delete metrics.
|
|
573
|
+
#
|
|
574
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
575
|
+
# @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> ::Nl::Async::Future[void]
|
|
576
|
+
# @param [Hash] args
|
|
577
|
+
# @option args [Integer] addr_ipv4
|
|
578
|
+
# @option args [String] addr_ipv6
|
|
579
|
+
# @option args [Integer] saddr_ipv4
|
|
580
|
+
# @option args [String] saddr_ipv6
|
|
581
|
+
# @return [Nl::Async::Future<void>]
|
|
582
|
+
# @see Messages::DoDelRequest
|
|
583
|
+
def do_del(**args)
|
|
584
|
+
@exchange.call(:"do", Messages::DoDelRequest, nil, args)
|
|
585
|
+
end
|
|
586
|
+
end
|
|
587
|
+
# Returns the asynchronous operation facade for this family.
|
|
588
|
+
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
589
|
+
# @param [::Integer, nil] stream_capacity
|
|
590
|
+
# @return [AsyncOperations]
|
|
591
|
+
def async(stream_capacity: nil)
|
|
592
|
+
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
593
|
+
build_async_facade(AsyncOperations, stream_capacity:)
|
|
594
|
+
end
|
|
316
595
|
end
|
|
317
596
|
end; end
|