nl-linux 0.4.2 → 0.5.0
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/CHANGELOG.md +5 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/handshake.yaml from Linux v7.3.
|
|
4
4
|
#
|
|
5
5
|
# Original YNL comment:
|
|
6
6
|
#
|
|
@@ -34,7 +34,7 @@ class Handshake < ::Nl::Genl::Family
|
|
|
34
34
|
super
|
|
35
35
|
end
|
|
36
36
|
# @private
|
|
37
|
-
MCAST_GROUPS =
|
|
37
|
+
MCAST_GROUPS = {:"none" => ::Nl::McastGroup.new("none", nil), :"tlshd" => ::Nl::McastGroup.new("tlshd", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
38
38
|
module Constants
|
|
39
39
|
MAX_ERRNO = 4095
|
|
40
40
|
end
|
|
@@ -60,380 +60,308 @@ class Handshake < ::Nl::Genl::Family
|
|
|
60
60
|
end
|
|
61
61
|
module AttributeSets
|
|
62
62
|
class X509 < ::Nl::AttributeSet
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
module Definitions
|
|
64
|
+
# @rbs return: ::Integer
|
|
65
|
+
# @return [Integer]
|
|
66
|
+
def cert; self[:"cert"]; end
|
|
67
|
+
# @rbs return: ::Integer
|
|
68
|
+
# @return [Integer]
|
|
69
|
+
def privkey; self[:"privkey"]; end
|
|
65
70
|
end
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
# @private
|
|
72
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
73
|
-
end
|
|
74
|
-
class Privkey < Attribute
|
|
75
|
-
TYPE = 2
|
|
76
|
-
NAME = :"privkey"
|
|
77
|
-
# @private
|
|
78
|
-
ORDER = 1
|
|
79
|
-
# @private
|
|
80
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
81
|
-
end
|
|
82
|
-
# @private
|
|
83
|
-
BY_NAME = Ractor.make_shareable({:"cert" => Cert, :"privkey" => Privkey}) #: Hash[::Symbol, Attribute]
|
|
84
|
-
# @private
|
|
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
|
|
94
|
-
class << self
|
|
95
|
-
# Looks up Attribute class by name.
|
|
96
|
-
# @rbs name: Symbol
|
|
97
|
-
# @rbs return: Attribute
|
|
98
|
-
# @param [Symbol] name
|
|
99
|
-
# @return [Attribute]
|
|
100
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
101
|
-
# Looks up Attribute class by type value.
|
|
102
|
-
# @rbs type: Integer
|
|
103
|
-
# @rbs return: Attribute
|
|
104
|
-
# @param [Integer] type
|
|
105
|
-
# @return [Attribute]
|
|
106
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
71
|
+
include Definitions
|
|
72
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
73
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
74
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
75
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
107
76
|
end
|
|
108
77
|
end
|
|
109
78
|
class Accept < ::Nl::AttributeSet
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
# @
|
|
117
|
-
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
#
|
|
126
|
-
|
|
127
|
-
# @
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# @
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
NAME = :"timeout"
|
|
142
|
-
# @private
|
|
143
|
-
ORDER = 3
|
|
144
|
-
# @private
|
|
145
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
79
|
+
module Definitions
|
|
80
|
+
# @rbs return: ::Integer
|
|
81
|
+
# @return [Integer]
|
|
82
|
+
def sockfd; self[:"sockfd"]; end
|
|
83
|
+
# Known enum values are defined in {Enums::HandlerClass}.
|
|
84
|
+
# @rbs return: ::Integer
|
|
85
|
+
# @return [Integer]
|
|
86
|
+
def handler_class; self[:"handler_class"]; end
|
|
87
|
+
# Known enum values are defined in {Enums::MsgType}.
|
|
88
|
+
# @rbs return: ::Integer
|
|
89
|
+
# @return [Integer]
|
|
90
|
+
def message_type; self[:"message_type"]; end
|
|
91
|
+
# @rbs return: ::Integer
|
|
92
|
+
# @return [Integer]
|
|
93
|
+
def timeout; self[:"timeout"]; end
|
|
94
|
+
# Known enum values are defined in {Enums::Auth}.
|
|
95
|
+
# @rbs return: ::Integer
|
|
96
|
+
# @return [Integer]
|
|
97
|
+
def auth_mode; self[:"auth_mode"]; end
|
|
98
|
+
# @rbs return: ::Array[::Integer]
|
|
99
|
+
# @return [Array<Integer>]
|
|
100
|
+
def peer_identity; self[:"peer_identity"]; end
|
|
101
|
+
# @rbs return: ::Array[AttributeSets::X509]
|
|
102
|
+
# @return [Array<AttributeSets::X509>]
|
|
103
|
+
def certificate; self[:"certificate"]; end
|
|
104
|
+
# @rbs return: ::String
|
|
105
|
+
# @return [String]
|
|
106
|
+
def peername; self[:"peername"]; end
|
|
107
|
+
# @rbs return: ::Integer
|
|
108
|
+
# @return [Integer]
|
|
109
|
+
def keyring; self[:"keyring"]; end
|
|
146
110
|
end
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
ORDER = 4
|
|
153
|
-
# @private
|
|
154
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
155
|
-
end
|
|
156
|
-
class PeerIdentity < Attribute
|
|
157
|
-
TYPE = 6
|
|
158
|
-
NAME = :"peer_identity"
|
|
159
|
-
# @private
|
|
160
|
-
MULTI = true
|
|
161
|
-
# @private
|
|
162
|
-
ORDER = 5
|
|
163
|
-
# @private
|
|
164
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
165
|
-
end
|
|
166
|
-
class Certificate < Attribute
|
|
167
|
-
TYPE = 7
|
|
168
|
-
NAME = :"certificate"
|
|
169
|
-
# @private
|
|
170
|
-
MULTI = true
|
|
171
|
-
# @private
|
|
172
|
-
ORDER = 6
|
|
173
|
-
end
|
|
174
|
-
class Peername < Attribute
|
|
175
|
-
TYPE = 8
|
|
176
|
-
NAME = :"peername"
|
|
177
|
-
# @private
|
|
178
|
-
ORDER = 7
|
|
179
|
-
# @private
|
|
180
|
-
DATATYPE = ::Nl::DataTypes::String.new(check: nil)
|
|
181
|
-
end
|
|
182
|
-
class Keyring < Attribute
|
|
183
|
-
TYPE = 9
|
|
184
|
-
NAME = :"keyring"
|
|
185
|
-
# @private
|
|
186
|
-
ORDER = 8
|
|
187
|
-
# @private
|
|
188
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
189
|
-
end
|
|
190
|
-
# @private
|
|
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]
|
|
192
|
-
# @private
|
|
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
|
|
233
|
-
class << self
|
|
234
|
-
# Looks up Attribute class by name.
|
|
235
|
-
# @rbs name: Symbol
|
|
236
|
-
# @rbs return: Attribute
|
|
237
|
-
# @param [Symbol] name
|
|
238
|
-
# @return [Attribute]
|
|
239
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
240
|
-
# Looks up Attribute class by type value.
|
|
241
|
-
# @rbs type: Integer
|
|
242
|
-
# @rbs return: Attribute
|
|
243
|
-
# @param [Integer] type
|
|
244
|
-
# @return [Attribute]
|
|
245
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
111
|
+
include Definitions
|
|
112
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
113
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
114
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
115
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
246
116
|
end
|
|
247
117
|
end
|
|
248
118
|
class Done < ::Nl::AttributeSet
|
|
249
|
-
|
|
250
|
-
|
|
119
|
+
module Definitions
|
|
120
|
+
# @rbs return: ::Integer
|
|
121
|
+
# @return [Integer]
|
|
122
|
+
def status; self[:"status"]; end
|
|
123
|
+
# @rbs return: ::Integer
|
|
124
|
+
# @return [Integer]
|
|
125
|
+
def sockfd; self[:"sockfd"]; end
|
|
126
|
+
# @rbs return: ::Array[::Integer]
|
|
127
|
+
# @return [Array<Integer>]
|
|
128
|
+
def remote_auth; self[:"remote_auth"]; end
|
|
129
|
+
end
|
|
130
|
+
include Definitions
|
|
131
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
132
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
133
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
134
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
251
135
|
end
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
module AttributeSets
|
|
139
|
+
class X509
|
|
140
|
+
module Definitions
|
|
255
141
|
# @private
|
|
256
|
-
|
|
142
|
+
BY_TYPE = ::Array.new(3).tap do |definitions|
|
|
143
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"cert", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 0, selector_slot: nil)
|
|
144
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"privkey", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 1, selector_slot: nil)
|
|
145
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
146
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
257
147
|
# @private
|
|
258
|
-
|
|
148
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
259
149
|
end
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
150
|
+
end
|
|
151
|
+
class Accept
|
|
152
|
+
module Definitions
|
|
263
153
|
# @private
|
|
264
|
-
|
|
154
|
+
BY_TYPE = ::Array.new(10).tap do |definitions|
|
|
155
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"sockfd", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 0, selector_slot: nil)
|
|
156
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"handler_class", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
157
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"message_type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 2, selector_slot: nil)
|
|
158
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"timeout", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
|
|
159
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"auth_mode", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 4, selector_slot: nil)
|
|
160
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"peer_identity", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: true, order: 5, selector_slot: nil)
|
|
161
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"certificate", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::X509, selector_bindings: []), multi: true, order: 6, selector_slot: nil)
|
|
162
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"peername", datatype: ::Nl::DataTypes::String.new, multi: false, order: 7, selector_slot: nil)
|
|
163
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"keyring", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 8, selector_slot: nil)
|
|
164
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
165
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
265
166
|
# @private
|
|
266
|
-
|
|
167
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
267
168
|
end
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
# @private
|
|
272
|
-
MULTI = true
|
|
169
|
+
end
|
|
170
|
+
class Done
|
|
171
|
+
module Definitions
|
|
273
172
|
# @private
|
|
274
|
-
|
|
173
|
+
BY_TYPE = ::Array.new(4).tap do |definitions|
|
|
174
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"status", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum #{Constants::MAX_ERRNO}" unless it <= Constants::MAX_ERRNO } }), multi: false, order: 0, selector_slot: nil)
|
|
175
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"sockfd", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 1, selector_slot: nil)
|
|
176
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"remote_auth", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: true, order: 2, selector_slot: nil)
|
|
177
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
178
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
275
179
|
# @private
|
|
276
|
-
|
|
277
|
-
end
|
|
278
|
-
# @private
|
|
279
|
-
BY_NAME = Ractor.make_shareable({:"status" => Status, :"sockfd" => Sockfd, :"remote_auth" => RemoteAuth}) #: Hash[::Symbol, Attribute]
|
|
280
|
-
# @private
|
|
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
|
|
294
|
-
class << self
|
|
295
|
-
# Looks up Attribute class by name.
|
|
296
|
-
# @rbs name: Symbol
|
|
297
|
-
# @rbs return: Attribute
|
|
298
|
-
# @param [Symbol] name
|
|
299
|
-
# @return [Attribute]
|
|
300
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
301
|
-
# Looks up Attribute class by type value.
|
|
302
|
-
# @rbs type: Integer
|
|
303
|
-
# @rbs return: Attribute
|
|
304
|
-
# @param [Integer] type
|
|
305
|
-
# @return [Attribute]
|
|
306
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
180
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
307
181
|
end
|
|
308
182
|
end
|
|
309
|
-
# @private
|
|
310
|
-
Accept::Certificate::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::X509, selector_bindings: Ractor.make_shareable([]))
|
|
311
183
|
end
|
|
312
184
|
module Messages
|
|
313
185
|
# Handler retrieves next queued handshake request
|
|
314
186
|
#
|
|
315
187
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
316
|
-
class DoAcceptRequest < ::Nl::
|
|
188
|
+
class DoAcceptRequest < ::Nl::Message
|
|
317
189
|
TYPE = 2
|
|
318
190
|
FIXED_HEADER = nil
|
|
319
191
|
ATTRIBUTE_SET = AttributeSets::Accept
|
|
320
|
-
ATTRIBUTES =
|
|
192
|
+
ATTRIBUTES = %i[handler_class].freeze
|
|
193
|
+
include ATTRIBUTE_SET::Definitions
|
|
194
|
+
def initialize(attributes = [])
|
|
195
|
+
@attributes = attributes
|
|
196
|
+
end
|
|
197
|
+
# @private
|
|
198
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
199
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
200
|
+
new(
|
|
201
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
205
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
206
|
+
def self.decode(decoder)
|
|
207
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
208
|
+
end
|
|
209
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
210
|
+
encode_attributes(encoder, external_selectors:)
|
|
211
|
+
end
|
|
321
212
|
# Known enum values are defined in {Enums::HandlerClass}.
|
|
322
213
|
# @rbs return: ::Integer
|
|
323
214
|
# @return [Integer]
|
|
324
|
-
|
|
325
|
-
def handler_class; attributes[:"handler_class"]&.value; end
|
|
215
|
+
def handler_class; self[:"handler_class"]; end
|
|
326
216
|
end
|
|
327
217
|
# Handler retrieves next queued handshake request
|
|
328
218
|
#
|
|
329
219
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
330
|
-
class DoAcceptReply < ::Nl::
|
|
220
|
+
class DoAcceptReply < ::Nl::Message
|
|
331
221
|
TYPE = 2
|
|
332
222
|
FIXED_HEADER = nil
|
|
333
223
|
ATTRIBUTE_SET = AttributeSets::Accept
|
|
334
|
-
ATTRIBUTES =
|
|
224
|
+
ATTRIBUTES = %i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring].freeze
|
|
225
|
+
include ATTRIBUTE_SET::Definitions
|
|
226
|
+
def initialize(attributes = [])
|
|
227
|
+
@attributes = attributes
|
|
228
|
+
end
|
|
229
|
+
# @private
|
|
230
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
231
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
232
|
+
new(
|
|
233
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
234
|
+
)
|
|
235
|
+
end
|
|
236
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
237
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
238
|
+
def self.decode(decoder)
|
|
239
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
240
|
+
end
|
|
241
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
242
|
+
encode_attributes(encoder, external_selectors:)
|
|
243
|
+
end
|
|
335
244
|
# @rbs return: ::Integer
|
|
336
245
|
# @return [Integer]
|
|
337
|
-
|
|
338
|
-
def sockfd; attributes[:"sockfd"]&.value; end
|
|
246
|
+
def sockfd; self[:"sockfd"]; end
|
|
339
247
|
# Known enum values are defined in {Enums::MsgType}.
|
|
340
248
|
# @rbs return: ::Integer
|
|
341
249
|
# @return [Integer]
|
|
342
|
-
|
|
343
|
-
def message_type; attributes[:"message_type"]&.value; end
|
|
250
|
+
def message_type; self[:"message_type"]; end
|
|
344
251
|
# @rbs return: ::Integer
|
|
345
252
|
# @return [Integer]
|
|
346
|
-
|
|
347
|
-
def timeout; attributes[:"timeout"]&.value; end
|
|
253
|
+
def timeout; self[:"timeout"]; end
|
|
348
254
|
# Known enum values are defined in {Enums::Auth}.
|
|
349
255
|
# @rbs return: ::Integer
|
|
350
256
|
# @return [Integer]
|
|
351
|
-
|
|
352
|
-
def auth_mode; attributes[:"auth_mode"]&.value; end
|
|
257
|
+
def auth_mode; self[:"auth_mode"]; end
|
|
353
258
|
# @rbs return: ::Array[::Integer]
|
|
354
259
|
# @return [Array<Integer>]
|
|
355
|
-
|
|
356
|
-
def peer_identity; attributes[:"peer_identity"].map(&:value); end
|
|
260
|
+
def peer_identity; self[:"peer_identity"]; end
|
|
357
261
|
# @rbs return: ::Array[AttributeSets::X509]
|
|
358
262
|
# @return [Array<AttributeSets::X509>]
|
|
359
|
-
|
|
360
|
-
def certificate; attributes[:"certificate"].map(&:value); end
|
|
263
|
+
def certificate; self[:"certificate"]; end
|
|
361
264
|
# @rbs return: ::String
|
|
362
265
|
# @return [String]
|
|
363
|
-
|
|
364
|
-
def peername; attributes[:"peername"]&.value; end
|
|
266
|
+
def peername; self[:"peername"]; end
|
|
365
267
|
# @rbs return: ::Integer
|
|
366
268
|
# @return [Integer]
|
|
367
|
-
|
|
368
|
-
def keyring; attributes[:"keyring"]&.value; end
|
|
269
|
+
def keyring; self[:"keyring"]; end
|
|
369
270
|
end
|
|
370
271
|
# Handler reports handshake completion
|
|
371
272
|
#
|
|
372
273
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
373
|
-
class DoDoneRequest < ::Nl::
|
|
274
|
+
class DoDoneRequest < ::Nl::Message
|
|
374
275
|
TYPE = 3
|
|
375
276
|
FIXED_HEADER = nil
|
|
376
277
|
ATTRIBUTE_SET = AttributeSets::Done
|
|
377
|
-
ATTRIBUTES =
|
|
278
|
+
ATTRIBUTES = %i[status sockfd remote_auth].freeze
|
|
279
|
+
include ATTRIBUTE_SET::Definitions
|
|
280
|
+
def initialize(attributes = [])
|
|
281
|
+
@attributes = attributes
|
|
282
|
+
end
|
|
283
|
+
# @private
|
|
284
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
285
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
286
|
+
new(
|
|
287
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
288
|
+
)
|
|
289
|
+
end
|
|
290
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
291
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
292
|
+
def self.decode(decoder)
|
|
293
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
294
|
+
end
|
|
295
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
296
|
+
encode_attributes(encoder, external_selectors:)
|
|
297
|
+
end
|
|
378
298
|
# @rbs return: ::Integer
|
|
379
299
|
# @return [Integer]
|
|
380
|
-
|
|
381
|
-
def status; attributes[:"status"]&.value; end
|
|
300
|
+
def status; self[:"status"]; end
|
|
382
301
|
# @rbs return: ::Integer
|
|
383
302
|
# @return [Integer]
|
|
384
|
-
|
|
385
|
-
def sockfd; attributes[:"sockfd"]&.value; end
|
|
303
|
+
def sockfd; self[:"sockfd"]; end
|
|
386
304
|
# @rbs return: ::Array[::Integer]
|
|
387
305
|
# @return [Array<Integer>]
|
|
388
|
-
|
|
389
|
-
def remote_auth; attributes[:"remote_auth"].map(&:value); end
|
|
306
|
+
def remote_auth; self[:"remote_auth"]; end
|
|
390
307
|
end
|
|
391
308
|
end
|
|
392
309
|
module Notifications
|
|
393
310
|
# Notify handlers that a new handshake request is waiting
|
|
394
|
-
class Ready < ::Nl::
|
|
311
|
+
class Ready < ::Nl::Message
|
|
395
312
|
TYPE = 1
|
|
396
313
|
FIXED_HEADER = nil
|
|
397
314
|
ATTRIBUTE_SET = AttributeSets::Accept
|
|
398
|
-
ATTRIBUTES =
|
|
315
|
+
ATTRIBUTES = %i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring].freeze
|
|
316
|
+
include ATTRIBUTE_SET::Definitions
|
|
317
|
+
def initialize(attributes = [])
|
|
318
|
+
@attributes = attributes
|
|
319
|
+
end
|
|
320
|
+
# @private
|
|
321
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
322
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
323
|
+
new(
|
|
324
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
325
|
+
)
|
|
326
|
+
end
|
|
327
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
328
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
329
|
+
def self.decode(decoder)
|
|
330
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
331
|
+
end
|
|
332
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
333
|
+
encode_attributes(encoder, external_selectors:)
|
|
334
|
+
end
|
|
399
335
|
# @rbs return: ::Integer
|
|
400
336
|
# @return [Integer]
|
|
401
|
-
|
|
402
|
-
def sockfd; attributes[:"sockfd"]&.value; end
|
|
337
|
+
def sockfd; self[:"sockfd"]; end
|
|
403
338
|
# Known enum values are defined in {Enums::MsgType}.
|
|
404
339
|
# @rbs return: ::Integer
|
|
405
340
|
# @return [Integer]
|
|
406
|
-
|
|
407
|
-
def message_type; attributes[:"message_type"]&.value; end
|
|
341
|
+
def message_type; self[:"message_type"]; end
|
|
408
342
|
# @rbs return: ::Integer
|
|
409
343
|
# @return [Integer]
|
|
410
|
-
|
|
411
|
-
def timeout; attributes[:"timeout"]&.value; end
|
|
344
|
+
def timeout; self[:"timeout"]; end
|
|
412
345
|
# Known enum values are defined in {Enums::Auth}.
|
|
413
346
|
# @rbs return: ::Integer
|
|
414
347
|
# @return [Integer]
|
|
415
|
-
|
|
416
|
-
def auth_mode; attributes[:"auth_mode"]&.value; end
|
|
348
|
+
def auth_mode; self[:"auth_mode"]; end
|
|
417
349
|
# @rbs return: ::Array[::Integer]
|
|
418
350
|
# @return [Array<Integer>]
|
|
419
|
-
|
|
420
|
-
def peer_identity; attributes[:"peer_identity"].map(&:value); end
|
|
351
|
+
def peer_identity; self[:"peer_identity"]; end
|
|
421
352
|
# @rbs return: ::Array[AttributeSets::X509]
|
|
422
353
|
# @return [Array<AttributeSets::X509>]
|
|
423
|
-
|
|
424
|
-
def certificate; attributes[:"certificate"].map(&:value); end
|
|
354
|
+
def certificate; self[:"certificate"]; end
|
|
425
355
|
# @rbs return: ::String
|
|
426
356
|
# @return [String]
|
|
427
|
-
|
|
428
|
-
def peername; attributes[:"peername"]&.value; end
|
|
357
|
+
def peername; self[:"peername"]; end
|
|
429
358
|
# @rbs return: ::Integer
|
|
430
359
|
# @return [Integer]
|
|
431
|
-
|
|
432
|
-
def keyring; attributes[:"keyring"]&.value; end
|
|
360
|
+
def keyring; self[:"keyring"]; end
|
|
433
361
|
end
|
|
434
362
|
end
|
|
435
363
|
# @private
|
|
436
|
-
NOTIFICATIONS =
|
|
364
|
+
NOTIFICATIONS = {1 => Notifications::Ready}.freeze #: Hash[::Integer, ::Class]
|
|
437
365
|
# Handler retrieves next queued handshake request
|
|
438
366
|
#
|
|
439
367
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|