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,238 +1,508 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
2
|
#
|
|
3
|
+
# This file is based on Documentation/netlink/specs/handshake.yaml from Linux v7.2.
|
|
4
|
+
#
|
|
5
|
+
# Original YNL comment:
|
|
6
|
+
#
|
|
3
7
|
# Author: Chuck Lever <chuck.lever@oracle.com>
|
|
4
8
|
#
|
|
5
9
|
# Copyright (c) 2023, Oracle and/or its affiliates.
|
|
6
10
|
#
|
|
7
11
|
#--
|
|
8
12
|
# frozen_string_literal: true
|
|
9
|
-
# rbs_inline: enabled
|
|
10
13
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
11
14
|
require 'nl'
|
|
12
15
|
module Nl; module Linux
|
|
13
16
|
# Netlink protocol to request a transport layer security handshake.
|
|
14
|
-
class Handshake < ::Nl::Family
|
|
17
|
+
class Handshake < ::Nl::Genl::Family
|
|
15
18
|
NAME = "handshake"
|
|
16
|
-
|
|
19
|
+
VERSION = 1
|
|
20
|
+
# @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
|
|
21
|
+
# @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
|
|
22
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
23
|
+
# @param [#call] resolver
|
|
24
|
+
# @param [Symbol, nil] executor
|
|
25
|
+
# @param [Integer, nil] notification_capacity
|
|
26
|
+
# @return [Handshake]
|
|
27
|
+
# @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
|
|
28
|
+
# @param [#call] resolver
|
|
29
|
+
# @param [Symbol, nil] executor
|
|
30
|
+
# @param [Integer, nil] notification_capacity
|
|
31
|
+
# @yieldparam [Handshake] family
|
|
32
|
+
# @return [Object] the result of the block
|
|
33
|
+
def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
|
|
34
|
+
super
|
|
35
|
+
end
|
|
36
|
+
# @private
|
|
37
|
+
MCAST_GROUPS = Ractor.make_shareable({:"none" => ::Nl::McastGroup.new("none", nil), :"tlshd" => ::Nl::McastGroup.new("tlshd", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
|
|
38
|
+
module Constants
|
|
39
|
+
MAX_ERRNO = 4095
|
|
40
|
+
end
|
|
41
|
+
module Enums
|
|
42
|
+
module HandlerClass
|
|
43
|
+
None = 0
|
|
44
|
+
Tlshd = 1
|
|
45
|
+
Max = 2
|
|
46
|
+
end
|
|
47
|
+
module MsgType
|
|
48
|
+
Unspec = 0
|
|
49
|
+
Clienthello = 1
|
|
50
|
+
Serverhello = 2
|
|
51
|
+
end
|
|
52
|
+
module Auth
|
|
53
|
+
Unspec = 0
|
|
54
|
+
Unauth = 1
|
|
55
|
+
Psk = 2
|
|
56
|
+
X509 = 3
|
|
57
|
+
end
|
|
58
|
+
end
|
|
17
59
|
module Structs
|
|
18
60
|
end
|
|
19
61
|
module AttributeSets
|
|
20
|
-
class X509 < ::Nl::
|
|
62
|
+
class X509 < ::Nl::AttributeSet
|
|
21
63
|
# Abstract class
|
|
22
|
-
class Attribute < ::Nl::
|
|
64
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
23
65
|
end
|
|
24
66
|
class Cert < Attribute
|
|
25
67
|
TYPE = 1
|
|
26
68
|
NAME = :"cert"
|
|
27
|
-
|
|
69
|
+
# @private
|
|
70
|
+
ORDER = 0
|
|
71
|
+
# @private
|
|
72
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
28
73
|
end
|
|
29
74
|
class Privkey < Attribute
|
|
30
75
|
TYPE = 2
|
|
31
76
|
NAME = :"privkey"
|
|
32
|
-
|
|
77
|
+
# @private
|
|
78
|
+
ORDER = 1
|
|
79
|
+
# @private
|
|
80
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
33
81
|
end
|
|
34
|
-
#
|
|
82
|
+
# @private
|
|
35
83
|
BY_NAME = Ractor.make_shareable({:"cert" => Cert, :"privkey" => Privkey}) #: Hash[::Symbol, Attribute]
|
|
36
|
-
#
|
|
84
|
+
# @private
|
|
37
85
|
BY_TYPE = Ractor.make_shareable({1 => Cert, 2 => Privkey}) #: Hash[::Integer, Attribute]
|
|
86
|
+
# @rbs return: ::Integer
|
|
87
|
+
# @return [Integer]
|
|
88
|
+
# @see Cert
|
|
89
|
+
def cert; self[:"cert"]&.value; end
|
|
90
|
+
# @rbs return: ::Integer
|
|
91
|
+
# @return [Integer]
|
|
92
|
+
# @see Privkey
|
|
93
|
+
def privkey; self[:"privkey"]&.value; end
|
|
38
94
|
class << self
|
|
39
95
|
# Looks up Attribute class by name.
|
|
40
|
-
#--
|
|
41
96
|
# @rbs name: Symbol
|
|
42
97
|
# @rbs return: Attribute
|
|
98
|
+
# @param [Symbol] name
|
|
99
|
+
# @return [Attribute]
|
|
43
100
|
def by_name(name); BY_NAME.fetch(name); end
|
|
44
101
|
# Looks up Attribute class by type value.
|
|
45
|
-
#--
|
|
46
102
|
# @rbs type: Integer
|
|
47
103
|
# @rbs return: Attribute
|
|
104
|
+
# @param [Integer] type
|
|
105
|
+
# @return [Attribute]
|
|
48
106
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
49
107
|
end
|
|
50
108
|
end
|
|
51
|
-
class Accept < ::Nl::
|
|
109
|
+
class Accept < ::Nl::AttributeSet
|
|
52
110
|
# Abstract class
|
|
53
|
-
class Attribute < ::Nl::
|
|
111
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
54
112
|
end
|
|
55
113
|
class Sockfd < Attribute
|
|
56
114
|
TYPE = 1
|
|
57
115
|
NAME = :"sockfd"
|
|
58
|
-
|
|
116
|
+
# @private
|
|
117
|
+
ORDER = 0
|
|
118
|
+
# @private
|
|
119
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
59
120
|
end
|
|
121
|
+
# Known enum values are defined in {Enums::HandlerClass}.
|
|
60
122
|
class HandlerClass < Attribute
|
|
61
123
|
TYPE = 2
|
|
62
124
|
NAME = :"handler_class"
|
|
63
|
-
|
|
125
|
+
# @private
|
|
126
|
+
ORDER = 1
|
|
127
|
+
# @private
|
|
128
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
64
129
|
end
|
|
130
|
+
# Known enum values are defined in {Enums::MsgType}.
|
|
65
131
|
class MessageType < Attribute
|
|
66
132
|
TYPE = 3
|
|
67
133
|
NAME = :"message_type"
|
|
68
|
-
|
|
134
|
+
# @private
|
|
135
|
+
ORDER = 2
|
|
136
|
+
# @private
|
|
137
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
69
138
|
end
|
|
70
139
|
class Timeout < Attribute
|
|
71
140
|
TYPE = 4
|
|
72
141
|
NAME = :"timeout"
|
|
73
|
-
|
|
142
|
+
# @private
|
|
143
|
+
ORDER = 3
|
|
144
|
+
# @private
|
|
145
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
74
146
|
end
|
|
147
|
+
# Known enum values are defined in {Enums::Auth}.
|
|
75
148
|
class AuthMode < Attribute
|
|
76
149
|
TYPE = 5
|
|
77
150
|
NAME = :"auth_mode"
|
|
78
|
-
|
|
151
|
+
# @private
|
|
152
|
+
ORDER = 4
|
|
153
|
+
# @private
|
|
154
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
79
155
|
end
|
|
80
156
|
class PeerIdentity < Attribute
|
|
81
157
|
TYPE = 6
|
|
82
158
|
NAME = :"peer_identity"
|
|
83
|
-
|
|
159
|
+
# @private
|
|
160
|
+
MULTI = true
|
|
161
|
+
# @private
|
|
162
|
+
ORDER = 5
|
|
163
|
+
# @private
|
|
164
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
84
165
|
end
|
|
85
166
|
class Certificate < Attribute
|
|
86
167
|
TYPE = 7
|
|
87
168
|
NAME = :"certificate"
|
|
169
|
+
# @private
|
|
170
|
+
MULTI = true
|
|
171
|
+
# @private
|
|
172
|
+
ORDER = 6
|
|
88
173
|
end
|
|
89
174
|
class Peername < Attribute
|
|
90
175
|
TYPE = 8
|
|
91
176
|
NAME = :"peername"
|
|
92
|
-
|
|
177
|
+
# @private
|
|
178
|
+
ORDER = 7
|
|
179
|
+
# @private
|
|
180
|
+
DATATYPE = ::Nl::DataTypes::String.new(check: nil)
|
|
93
181
|
end
|
|
94
182
|
class Keyring < Attribute
|
|
95
183
|
TYPE = 9
|
|
96
184
|
NAME = :"keyring"
|
|
97
|
-
|
|
185
|
+
# @private
|
|
186
|
+
ORDER = 8
|
|
187
|
+
# @private
|
|
188
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
98
189
|
end
|
|
99
|
-
#
|
|
190
|
+
# @private
|
|
100
191
|
BY_NAME = Ractor.make_shareable({:"sockfd" => Sockfd, :"handler_class" => HandlerClass, :"message_type" => MessageType, :"timeout" => Timeout, :"auth_mode" => AuthMode, :"peer_identity" => PeerIdentity, :"certificate" => Certificate, :"peername" => Peername, :"keyring" => Keyring}) #: Hash[::Symbol, Attribute]
|
|
101
|
-
#
|
|
192
|
+
# @private
|
|
102
193
|
BY_TYPE = Ractor.make_shareable({1 => Sockfd, 2 => HandlerClass, 3 => MessageType, 4 => Timeout, 5 => AuthMode, 6 => PeerIdentity, 7 => Certificate, 8 => Peername, 9 => Keyring}) #: Hash[::Integer, Attribute]
|
|
194
|
+
# @rbs return: ::Integer
|
|
195
|
+
# @return [Integer]
|
|
196
|
+
# @see Sockfd
|
|
197
|
+
def sockfd; self[:"sockfd"]&.value; end
|
|
198
|
+
# Known enum values are defined in {Enums::HandlerClass}.
|
|
199
|
+
# @rbs return: ::Integer
|
|
200
|
+
# @return [Integer]
|
|
201
|
+
# @see HandlerClass
|
|
202
|
+
def handler_class; self[:"handler_class"]&.value; end
|
|
203
|
+
# Known enum values are defined in {Enums::MsgType}.
|
|
204
|
+
# @rbs return: ::Integer
|
|
205
|
+
# @return [Integer]
|
|
206
|
+
# @see MessageType
|
|
207
|
+
def message_type; self[:"message_type"]&.value; end
|
|
208
|
+
# @rbs return: ::Integer
|
|
209
|
+
# @return [Integer]
|
|
210
|
+
# @see Timeout
|
|
211
|
+
def timeout; self[:"timeout"]&.value; end
|
|
212
|
+
# Known enum values are defined in {Enums::Auth}.
|
|
213
|
+
# @rbs return: ::Integer
|
|
214
|
+
# @return [Integer]
|
|
215
|
+
# @see AuthMode
|
|
216
|
+
def auth_mode; self[:"auth_mode"]&.value; end
|
|
217
|
+
# @rbs return: ::Array[::Integer]
|
|
218
|
+
# @return [Array<Integer>]
|
|
219
|
+
# @see PeerIdentity
|
|
220
|
+
def peer_identity; self[:"peer_identity"].map(&:value); end
|
|
221
|
+
# @rbs return: ::Array[AttributeSets::X509]
|
|
222
|
+
# @return [Array<AttributeSets::X509>]
|
|
223
|
+
# @see Certificate
|
|
224
|
+
def certificate; self[:"certificate"].map(&:value); end
|
|
225
|
+
# @rbs return: ::String
|
|
226
|
+
# @return [String]
|
|
227
|
+
# @see Peername
|
|
228
|
+
def peername; self[:"peername"]&.value; end
|
|
229
|
+
# @rbs return: ::Integer
|
|
230
|
+
# @return [Integer]
|
|
231
|
+
# @see Keyring
|
|
232
|
+
def keyring; self[:"keyring"]&.value; end
|
|
103
233
|
class << self
|
|
104
234
|
# Looks up Attribute class by name.
|
|
105
|
-
#--
|
|
106
235
|
# @rbs name: Symbol
|
|
107
236
|
# @rbs return: Attribute
|
|
237
|
+
# @param [Symbol] name
|
|
238
|
+
# @return [Attribute]
|
|
108
239
|
def by_name(name); BY_NAME.fetch(name); end
|
|
109
240
|
# Looks up Attribute class by type value.
|
|
110
|
-
#--
|
|
111
241
|
# @rbs type: Integer
|
|
112
242
|
# @rbs return: Attribute
|
|
243
|
+
# @param [Integer] type
|
|
244
|
+
# @return [Attribute]
|
|
113
245
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
114
246
|
end
|
|
115
247
|
end
|
|
116
|
-
class Done < ::Nl::
|
|
248
|
+
class Done < ::Nl::AttributeSet
|
|
117
249
|
# Abstract class
|
|
118
|
-
class Attribute < ::Nl::
|
|
250
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
119
251
|
end
|
|
120
252
|
class Status < Attribute
|
|
121
253
|
TYPE = 1
|
|
122
254
|
NAME = :"status"
|
|
123
|
-
|
|
255
|
+
# @private
|
|
256
|
+
ORDER = 0
|
|
257
|
+
# @private
|
|
258
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum #{Constants::MAX_ERRNO}" unless it <= Constants::MAX_ERRNO })
|
|
124
259
|
end
|
|
125
260
|
class Sockfd < Attribute
|
|
126
261
|
TYPE = 2
|
|
127
262
|
NAME = :"sockfd"
|
|
128
|
-
|
|
263
|
+
# @private
|
|
264
|
+
ORDER = 1
|
|
265
|
+
# @private
|
|
266
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
129
267
|
end
|
|
130
268
|
class RemoteAuth < Attribute
|
|
131
269
|
TYPE = 3
|
|
132
270
|
NAME = :"remote_auth"
|
|
133
|
-
|
|
271
|
+
# @private
|
|
272
|
+
MULTI = true
|
|
273
|
+
# @private
|
|
274
|
+
ORDER = 2
|
|
275
|
+
# @private
|
|
276
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
134
277
|
end
|
|
135
|
-
#
|
|
278
|
+
# @private
|
|
136
279
|
BY_NAME = Ractor.make_shareable({:"status" => Status, :"sockfd" => Sockfd, :"remote_auth" => RemoteAuth}) #: Hash[::Symbol, Attribute]
|
|
137
|
-
#
|
|
280
|
+
# @private
|
|
138
281
|
BY_TYPE = Ractor.make_shareable({1 => Status, 2 => Sockfd, 3 => RemoteAuth}) #: Hash[::Integer, Attribute]
|
|
282
|
+
# @rbs return: ::Integer
|
|
283
|
+
# @return [Integer]
|
|
284
|
+
# @see Status
|
|
285
|
+
def status; self[:"status"]&.value; end
|
|
286
|
+
# @rbs return: ::Integer
|
|
287
|
+
# @return [Integer]
|
|
288
|
+
# @see Sockfd
|
|
289
|
+
def sockfd; self[:"sockfd"]&.value; end
|
|
290
|
+
# @rbs return: ::Array[::Integer]
|
|
291
|
+
# @return [Array<Integer>]
|
|
292
|
+
# @see RemoteAuth
|
|
293
|
+
def remote_auth; self[:"remote_auth"].map(&:value); end
|
|
139
294
|
class << self
|
|
140
295
|
# Looks up Attribute class by name.
|
|
141
|
-
#--
|
|
142
296
|
# @rbs name: Symbol
|
|
143
297
|
# @rbs return: Attribute
|
|
298
|
+
# @param [Symbol] name
|
|
299
|
+
# @return [Attribute]
|
|
144
300
|
def by_name(name); BY_NAME.fetch(name); end
|
|
145
301
|
# Looks up Attribute class by type value.
|
|
146
|
-
#--
|
|
147
302
|
# @rbs type: Integer
|
|
148
303
|
# @rbs return: Attribute
|
|
304
|
+
# @param [Integer] type
|
|
305
|
+
# @return [Attribute]
|
|
149
306
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
150
307
|
end
|
|
151
308
|
end
|
|
152
|
-
|
|
309
|
+
# @private
|
|
310
|
+
Accept::Certificate::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::X509, selector_bindings: Ractor.make_shareable([]))
|
|
153
311
|
end
|
|
154
312
|
module Messages
|
|
155
313
|
# Handler retrieves next queued handshake request
|
|
156
|
-
|
|
314
|
+
#
|
|
315
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
316
|
+
class DoAcceptRequest < ::Nl::Genl::Message
|
|
157
317
|
TYPE = 2
|
|
158
318
|
FIXED_HEADER = nil
|
|
159
319
|
ATTRIBUTE_SET = AttributeSets::Accept
|
|
160
320
|
ATTRIBUTES = Ractor.make_shareable(%i[handler_class])
|
|
161
|
-
#
|
|
162
|
-
#--
|
|
321
|
+
# Known enum values are defined in {Enums::HandlerClass}.
|
|
163
322
|
# @rbs return: ::Integer
|
|
323
|
+
# @return [Integer]
|
|
324
|
+
# @see AttributeSets::Accept::HandlerClass
|
|
164
325
|
def handler_class; attributes[:"handler_class"]&.value; end
|
|
165
326
|
end
|
|
166
327
|
# Handler retrieves next queued handshake request
|
|
167
|
-
|
|
328
|
+
#
|
|
329
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
330
|
+
class DoAcceptReply < ::Nl::Genl::Message
|
|
168
331
|
TYPE = 2
|
|
169
332
|
FIXED_HEADER = nil
|
|
170
333
|
ATTRIBUTE_SET = AttributeSets::Accept
|
|
171
334
|
ATTRIBUTES = Ractor.make_shareable(%i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring])
|
|
172
|
-
# Gets the value of `sockfd` attribute in the message.
|
|
173
|
-
#--
|
|
174
335
|
# @rbs return: ::Integer
|
|
336
|
+
# @return [Integer]
|
|
337
|
+
# @see AttributeSets::Accept::Sockfd
|
|
175
338
|
def sockfd; attributes[:"sockfd"]&.value; end
|
|
176
|
-
#
|
|
177
|
-
#--
|
|
339
|
+
# Known enum values are defined in {Enums::MsgType}.
|
|
178
340
|
# @rbs return: ::Integer
|
|
341
|
+
# @return [Integer]
|
|
342
|
+
# @see AttributeSets::Accept::MessageType
|
|
179
343
|
def message_type; attributes[:"message_type"]&.value; end
|
|
180
|
-
# Gets the value of `timeout` attribute in the message.
|
|
181
|
-
#--
|
|
182
344
|
# @rbs return: ::Integer
|
|
345
|
+
# @return [Integer]
|
|
346
|
+
# @see AttributeSets::Accept::Timeout
|
|
183
347
|
def timeout; attributes[:"timeout"]&.value; end
|
|
184
|
-
#
|
|
185
|
-
#--
|
|
348
|
+
# Known enum values are defined in {Enums::Auth}.
|
|
186
349
|
# @rbs return: ::Integer
|
|
350
|
+
# @return [Integer]
|
|
351
|
+
# @see AttributeSets::Accept::AuthMode
|
|
187
352
|
def auth_mode; attributes[:"auth_mode"]&.value; end
|
|
188
|
-
#
|
|
189
|
-
|
|
190
|
-
# @
|
|
191
|
-
def peer_identity; attributes[:"peer_identity"]
|
|
192
|
-
#
|
|
193
|
-
|
|
194
|
-
# @
|
|
195
|
-
def certificate; attributes[:"certificate"]
|
|
196
|
-
# Gets the value of `peername` attribute in the message.
|
|
197
|
-
#--
|
|
353
|
+
# @rbs return: ::Array[::Integer]
|
|
354
|
+
# @return [Array<Integer>]
|
|
355
|
+
# @see AttributeSets::Accept::PeerIdentity
|
|
356
|
+
def peer_identity; attributes[:"peer_identity"].map(&:value); end
|
|
357
|
+
# @rbs return: ::Array[AttributeSets::X509]
|
|
358
|
+
# @return [Array<AttributeSets::X509>]
|
|
359
|
+
# @see AttributeSets::Accept::Certificate
|
|
360
|
+
def certificate; attributes[:"certificate"].map(&:value); end
|
|
198
361
|
# @rbs return: ::String
|
|
362
|
+
# @return [String]
|
|
363
|
+
# @see AttributeSets::Accept::Peername
|
|
199
364
|
def peername; attributes[:"peername"]&.value; end
|
|
200
|
-
# Gets the value of `keyring` attribute in the message.
|
|
201
|
-
#--
|
|
202
365
|
# @rbs return: ::Integer
|
|
366
|
+
# @return [Integer]
|
|
367
|
+
# @see AttributeSets::Accept::Keyring
|
|
203
368
|
def keyring; attributes[:"keyring"]&.value; end
|
|
204
369
|
end
|
|
205
370
|
# Handler reports handshake completion
|
|
206
|
-
|
|
371
|
+
#
|
|
372
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
373
|
+
class DoDoneRequest < ::Nl::Genl::Message
|
|
207
374
|
TYPE = 3
|
|
208
375
|
FIXED_HEADER = nil
|
|
209
376
|
ATTRIBUTE_SET = AttributeSets::Done
|
|
210
377
|
ATTRIBUTES = Ractor.make_shareable(%i[status sockfd remote_auth])
|
|
211
|
-
# Gets the value of `status` attribute in the message.
|
|
212
|
-
#--
|
|
213
378
|
# @rbs return: ::Integer
|
|
379
|
+
# @return [Integer]
|
|
380
|
+
# @see AttributeSets::Done::Status
|
|
214
381
|
def status; attributes[:"status"]&.value; end
|
|
215
|
-
# Gets the value of `sockfd` attribute in the message.
|
|
216
|
-
#--
|
|
217
382
|
# @rbs return: ::Integer
|
|
383
|
+
# @return [Integer]
|
|
384
|
+
# @see AttributeSets::Done::Sockfd
|
|
385
|
+
def sockfd; attributes[:"sockfd"]&.value; end
|
|
386
|
+
# @rbs return: ::Array[::Integer]
|
|
387
|
+
# @return [Array<Integer>]
|
|
388
|
+
# @see AttributeSets::Done::RemoteAuth
|
|
389
|
+
def remote_auth; attributes[:"remote_auth"].map(&:value); end
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
|
+
module Notifications
|
|
393
|
+
# Notify handlers that a new handshake request is waiting
|
|
394
|
+
class Ready < ::Nl::Genl::Message
|
|
395
|
+
TYPE = 1
|
|
396
|
+
FIXED_HEADER = nil
|
|
397
|
+
ATTRIBUTE_SET = AttributeSets::Accept
|
|
398
|
+
ATTRIBUTES = Ractor.make_shareable(%i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring])
|
|
399
|
+
# @rbs return: ::Integer
|
|
400
|
+
# @return [Integer]
|
|
401
|
+
# @see AttributeSets::Accept::Sockfd
|
|
218
402
|
def sockfd; attributes[:"sockfd"]&.value; end
|
|
219
|
-
#
|
|
220
|
-
#--
|
|
403
|
+
# Known enum values are defined in {Enums::MsgType}.
|
|
221
404
|
# @rbs return: ::Integer
|
|
222
|
-
|
|
405
|
+
# @return [Integer]
|
|
406
|
+
# @see AttributeSets::Accept::MessageType
|
|
407
|
+
def message_type; attributes[:"message_type"]&.value; end
|
|
408
|
+
# @rbs return: ::Integer
|
|
409
|
+
# @return [Integer]
|
|
410
|
+
# @see AttributeSets::Accept::Timeout
|
|
411
|
+
def timeout; attributes[:"timeout"]&.value; end
|
|
412
|
+
# Known enum values are defined in {Enums::Auth}.
|
|
413
|
+
# @rbs return: ::Integer
|
|
414
|
+
# @return [Integer]
|
|
415
|
+
# @see AttributeSets::Accept::AuthMode
|
|
416
|
+
def auth_mode; attributes[:"auth_mode"]&.value; end
|
|
417
|
+
# @rbs return: ::Array[::Integer]
|
|
418
|
+
# @return [Array<Integer>]
|
|
419
|
+
# @see AttributeSets::Accept::PeerIdentity
|
|
420
|
+
def peer_identity; attributes[:"peer_identity"].map(&:value); end
|
|
421
|
+
# @rbs return: ::Array[AttributeSets::X509]
|
|
422
|
+
# @return [Array<AttributeSets::X509>]
|
|
423
|
+
# @see AttributeSets::Accept::Certificate
|
|
424
|
+
def certificate; attributes[:"certificate"].map(&:value); end
|
|
425
|
+
# @rbs return: ::String
|
|
426
|
+
# @return [String]
|
|
427
|
+
# @see AttributeSets::Accept::Peername
|
|
428
|
+
def peername; attributes[:"peername"]&.value; end
|
|
429
|
+
# @rbs return: ::Integer
|
|
430
|
+
# @return [Integer]
|
|
431
|
+
# @see AttributeSets::Accept::Keyring
|
|
432
|
+
def keyring; attributes[:"keyring"]&.value; end
|
|
223
433
|
end
|
|
224
434
|
end
|
|
435
|
+
# @private
|
|
436
|
+
NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::Ready}) #: Hash[::Integer, ::Class]
|
|
225
437
|
# Handler retrieves next queued handshake request
|
|
226
|
-
|
|
438
|
+
#
|
|
439
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
227
440
|
# @rbs (?handler_class: ::Integer) -> Messages::DoAcceptReply
|
|
441
|
+
# @param [Hash] args
|
|
442
|
+
# @option args [Integer] handler_class Known enum values are defined in {Enums::HandlerClass}.
|
|
443
|
+
# @return [Messages::DoAcceptReply]
|
|
444
|
+
# @see Messages::DoAcceptRequest
|
|
228
445
|
def do_accept(**args)
|
|
229
446
|
exchange_message(:"do", Messages::DoAcceptRequest, Messages::DoAcceptReply, args)
|
|
230
447
|
end
|
|
231
448
|
# Handler reports handshake completion
|
|
232
|
-
|
|
233
|
-
#
|
|
449
|
+
#
|
|
450
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
451
|
+
# @rbs (?status: ::Integer, ?sockfd: ::Integer, ?remote_auth: ::Array[::Integer]) -> void
|
|
452
|
+
# @param [Hash] args
|
|
453
|
+
# @option args [Integer] status
|
|
454
|
+
# @option args [Integer] sockfd
|
|
455
|
+
# @option args [Array<Integer>] remote_auth
|
|
456
|
+
# @return [void]
|
|
457
|
+
# @see Messages::DoDoneRequest
|
|
234
458
|
def do_done(**args)
|
|
235
459
|
exchange_message(:"do", Messages::DoDoneRequest, nil, args)
|
|
236
460
|
end
|
|
461
|
+
class AsyncOperations
|
|
462
|
+
# @private
|
|
463
|
+
def initialize(&exchange)
|
|
464
|
+
@exchange = exchange
|
|
465
|
+
end
|
|
466
|
+
# Handler retrieves next queued handshake request
|
|
467
|
+
#
|
|
468
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
469
|
+
# @rbs (?handler_class: ::Integer) -> ::Nl::Async::Future[Messages::DoAcceptReply]
|
|
470
|
+
# @param [Hash] args
|
|
471
|
+
# @option args [Integer] handler_class Known enum values are defined in {Enums::HandlerClass}.
|
|
472
|
+
# @return [Nl::Async::Future<Messages::DoAcceptReply>]
|
|
473
|
+
# @see Messages::DoAcceptRequest
|
|
474
|
+
def do_accept(**args)
|
|
475
|
+
@exchange.call(:"do", Messages::DoAcceptRequest, Messages::DoAcceptReply, args)
|
|
476
|
+
end
|
|
477
|
+
# Handler reports handshake completion
|
|
478
|
+
#
|
|
479
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
480
|
+
# @rbs (?status: ::Integer, ?sockfd: ::Integer, ?remote_auth: ::Array[::Integer]) -> ::Nl::Async::Future[void]
|
|
481
|
+
# @param [Hash] args
|
|
482
|
+
# @option args [Integer] status
|
|
483
|
+
# @option args [Integer] sockfd
|
|
484
|
+
# @option args [Array<Integer>] remote_auth
|
|
485
|
+
# @return [Nl::Async::Future<void>]
|
|
486
|
+
# @see Messages::DoDoneRequest
|
|
487
|
+
def do_done(**args)
|
|
488
|
+
@exchange.call(:"do", Messages::DoDoneRequest, nil, args)
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
# Returns the asynchronous operation facade for this family.
|
|
492
|
+
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
493
|
+
# @param [::Integer, nil] stream_capacity
|
|
494
|
+
# @return [AsyncOperations]
|
|
495
|
+
def async(stream_capacity: nil)
|
|
496
|
+
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
497
|
+
build_async_facade(AsyncOperations, stream_capacity:)
|
|
498
|
+
end
|
|
499
|
+
# @rbs (*(:none | :tlshd) groups) -> self
|
|
500
|
+
# @param [Array<:none, :tlshd>] groups
|
|
501
|
+
# @return [self]
|
|
502
|
+
def subscribe(*groups) = super
|
|
503
|
+
# @rbs (*(:none | :tlshd) groups) -> self
|
|
504
|
+
# @param [Array<:none, :tlshd>] groups
|
|
505
|
+
# @return [self]
|
|
506
|
+
def unsubscribe(*groups) = super
|
|
237
507
|
end
|
|
238
508
|
end; end
|