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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +5 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Rakefile +14 -2
  5. data/generated/nl/linux/binder.rb +172 -44
  6. data/generated/nl/linux/conntrack.rb +1293 -370
  7. data/generated/nl/linux/dev_energymodel.rb +278 -93
  8. data/generated/nl/linux/devlink.rb +5654 -1954
  9. data/generated/nl/linux/dpll.rb +1838 -669
  10. data/generated/nl/linux/drm_ras.rb +234 -72
  11. data/generated/nl/linux/ethtool.rb +6683 -2885
  12. data/generated/nl/linux/fou.rb +308 -129
  13. data/generated/nl/linux/handshake.rb +277 -99
  14. data/generated/nl/linux/lockd.rb +88 -33
  15. data/generated/nl/linux/mptcp_pm.rb +639 -186
  16. data/generated/nl/linux/net_shaper.rb +782 -224
  17. data/generated/nl/linux/netdev.rb +2105 -631
  18. data/generated/nl/linux/nfsd.rb +1030 -358
  19. data/generated/nl/linux/nftables.rb +5041 -1612
  20. data/generated/nl/linux/nl80211.rb +4531 -871
  21. data/generated/nl/linux/nlctrl.rb +411 -119
  22. data/generated/nl/linux/ovpn.rb +1211 -293
  23. data/generated/nl/linux/ovs_datapath.rb +271 -106
  24. data/generated/nl/linux/ovs_flow.rb +1819 -354
  25. data/generated/nl/linux/ovs_packet.rb +257 -82
  26. data/generated/nl/linux/ovs_vport.rb +334 -132
  27. data/generated/nl/linux/psp.rb +916 -281
  28. data/generated/nl/linux/rt_addr.rb +369 -166
  29. data/generated/nl/linux/rt_link.rb +6708 -1450
  30. data/generated/nl/linux/rt_neigh.rb +919 -364
  31. data/generated/nl/linux/rt_route.rb +1034 -448
  32. data/generated/nl/linux/rt_rule.rb +775 -395
  33. data/generated/nl/linux/sunrpc_cache.rb +297 -102
  34. data/generated/nl/linux/tc.rb +9989 -1780
  35. data/generated/nl/linux/tcp_metrics.rb +327 -105
  36. data/generated/nl/linux/team.rb +279 -93
  37. data/generated/nl/linux/wireguard.rb +432 -95
  38. data/generated/nl/linux.rb +1 -0
  39. data/lib/nl/linux/nlctrl_resolver.rb +31 -0
  40. data/lib/nl/linux/version.rb +1 -1
  41. data/sig/generated/nl/linux/binder.rbs +366 -0
  42. data/sig/generated/nl/linux/conntrack.rbs +2787 -0
  43. data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
  44. data/sig/generated/nl/linux/devlink.rbs +12496 -0
  45. data/sig/generated/nl/linux/dpll.rbs +3461 -0
  46. data/sig/generated/nl/linux/drm_ras.rbs +553 -0
  47. data/sig/generated/nl/linux/ethtool.rbs +15291 -0
  48. data/sig/generated/nl/linux/fou.rbs +702 -0
  49. data/sig/generated/nl/linux/handshake.rbs +622 -0
  50. data/sig/generated/nl/linux/lockd.rbs +234 -0
  51. data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
  52. data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
  53. data/sig/generated/nl/linux/netdev.rbs +4187 -0
  54. data/sig/generated/nl/linux/nfsd.rbs +2520 -0
  55. data/sig/generated/nl/linux/nftables.rbs +10304 -0
  56. data/sig/generated/nl/linux/nl80211.rbs +9786 -0
  57. data/sig/generated/nl/linux/nlctrl.rbs +944 -0
  58. data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
  59. data/sig/generated/nl/linux/ovpn.rbs +2564 -0
  60. data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
  61. data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
  62. data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
  63. data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
  64. data/sig/generated/nl/linux/psp.rbs +1846 -0
  65. data/sig/generated/nl/linux/rt_addr.rbs +866 -0
  66. data/sig/generated/nl/linux/rt_link.rbs +13438 -0
  67. data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
  68. data/sig/generated/nl/linux/rt_route.rbs +2218 -0
  69. data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
  70. data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
  71. data/sig/generated/nl/linux/tc.rbs +19931 -0
  72. data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
  73. data/sig/generated/nl/linux/team.rbs +733 -0
  74. data/sig/generated/nl/linux/version.rbs +7 -0
  75. data/sig/generated/nl/linux/wireguard.rbs +1006 -0
  76. data/sig/generated/nl/linux.rbs +6 -0
  77. data/sig/generated/nl-linux.rbs +2 -0
  78. metadata +46 -7
@@ -10,321 +10,499 @@
10
10
  #
11
11
  #--
12
12
  # frozen_string_literal: true
13
- # rbs_inline: enabled
14
13
  # This code is generated by Ynl::Generator. DO NOT EDIT.
15
14
  require 'nl'
16
15
  module Nl; module Linux
17
16
  # Netlink protocol to request a transport layer security handshake.
18
- class Handshake < ::Nl::Family
17
+ class Handshake < ::Nl::Genl::Family
19
18
  NAME = "handshake"
20
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("handshake"))
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
21
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
22
59
  module Structs
23
60
  end
24
61
  module AttributeSets
25
- class X509 < ::Nl::Protocols::Genl::AttributeSet
62
+ class X509 < ::Nl::AttributeSet
26
63
  # Abstract class
27
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
64
+ class Attribute < ::Nl::AttributeSet::Attribute
28
65
  end
29
66
  class Cert < Attribute
30
67
  TYPE = 1
31
68
  NAME = :"cert"
32
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
69
+ # @private
70
+ ORDER = 0
71
+ # @private
72
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
33
73
  end
34
74
  class Privkey < Attribute
35
75
  TYPE = 2
36
76
  NAME = :"privkey"
37
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
77
+ # @private
78
+ ORDER = 1
79
+ # @private
80
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
38
81
  end
39
- # :nodoc:
82
+ # @private
40
83
  BY_NAME = Ractor.make_shareable({:"cert" => Cert, :"privkey" => Privkey}) #: Hash[::Symbol, Attribute]
41
- # :nodoc:
84
+ # @private
42
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
43
94
  class << self
44
95
  # Looks up Attribute class by name.
45
- #--
46
96
  # @rbs name: Symbol
47
97
  # @rbs return: Attribute
98
+ # @param [Symbol] name
99
+ # @return [Attribute]
48
100
  def by_name(name); BY_NAME.fetch(name); end
49
101
  # Looks up Attribute class by type value.
50
- #--
51
102
  # @rbs type: Integer
52
103
  # @rbs return: Attribute
104
+ # @param [Integer] type
105
+ # @return [Attribute]
53
106
  def by_type(type); BY_TYPE.fetch(type); end
54
107
  end
55
108
  end
56
- class Accept < ::Nl::Protocols::Genl::AttributeSet
109
+ class Accept < ::Nl::AttributeSet
57
110
  # Abstract class
58
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
111
+ class Attribute < ::Nl::AttributeSet::Attribute
59
112
  end
60
113
  class Sockfd < Attribute
61
114
  TYPE = 1
62
115
  NAME = :"sockfd"
63
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
116
+ # @private
117
+ ORDER = 0
118
+ # @private
119
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
64
120
  end
121
+ # Known enum values are defined in {Enums::HandlerClass}.
65
122
  class HandlerClass < Attribute
66
123
  TYPE = 2
67
124
  NAME = :"handler_class"
68
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
125
+ # @private
126
+ ORDER = 1
127
+ # @private
128
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
69
129
  end
130
+ # Known enum values are defined in {Enums::MsgType}.
70
131
  class MessageType < Attribute
71
132
  TYPE = 3
72
133
  NAME = :"message_type"
73
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
134
+ # @private
135
+ ORDER = 2
136
+ # @private
137
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
74
138
  end
75
139
  class Timeout < Attribute
76
140
  TYPE = 4
77
141
  NAME = :"timeout"
78
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
142
+ # @private
143
+ ORDER = 3
144
+ # @private
145
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
79
146
  end
147
+ # Known enum values are defined in {Enums::Auth}.
80
148
  class AuthMode < Attribute
81
149
  TYPE = 5
82
150
  NAME = :"auth_mode"
83
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
151
+ # @private
152
+ ORDER = 4
153
+ # @private
154
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
84
155
  end
85
156
  class PeerIdentity < Attribute
86
157
  TYPE = 6
87
158
  NAME = :"peer_identity"
88
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
159
+ # @private
160
+ MULTI = true
161
+ # @private
162
+ ORDER = 5
163
+ # @private
164
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
89
165
  end
90
166
  class Certificate < Attribute
91
167
  TYPE = 7
92
168
  NAME = :"certificate"
169
+ # @private
170
+ MULTI = true
171
+ # @private
172
+ ORDER = 6
93
173
  end
94
174
  class Peername < Attribute
95
175
  TYPE = 8
96
176
  NAME = :"peername"
97
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
177
+ # @private
178
+ ORDER = 7
179
+ # @private
180
+ DATATYPE = ::Nl::DataTypes::String.new(check: nil)
98
181
  end
99
182
  class Keyring < Attribute
100
183
  TYPE = 9
101
184
  NAME = :"keyring"
102
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
185
+ # @private
186
+ ORDER = 8
187
+ # @private
188
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
103
189
  end
104
- # :nodoc:
190
+ # @private
105
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]
106
- # :nodoc:
192
+ # @private
107
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
108
233
  class << self
109
234
  # Looks up Attribute class by name.
110
- #--
111
235
  # @rbs name: Symbol
112
236
  # @rbs return: Attribute
237
+ # @param [Symbol] name
238
+ # @return [Attribute]
113
239
  def by_name(name); BY_NAME.fetch(name); end
114
240
  # Looks up Attribute class by type value.
115
- #--
116
241
  # @rbs type: Integer
117
242
  # @rbs return: Attribute
243
+ # @param [Integer] type
244
+ # @return [Attribute]
118
245
  def by_type(type); BY_TYPE.fetch(type); end
119
246
  end
120
247
  end
121
- class Done < ::Nl::Protocols::Genl::AttributeSet
248
+ class Done < ::Nl::AttributeSet
122
249
  # Abstract class
123
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
250
+ class Attribute < ::Nl::AttributeSet::Attribute
124
251
  end
125
252
  class Status < Attribute
126
253
  TYPE = 1
127
254
  NAME = :"status"
128
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 4095" unless it <= 4095 })
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 })
129
259
  end
130
260
  class Sockfd < Attribute
131
261
  TYPE = 2
132
262
  NAME = :"sockfd"
133
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
263
+ # @private
264
+ ORDER = 1
265
+ # @private
266
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
134
267
  end
135
268
  class RemoteAuth < Attribute
136
269
  TYPE = 3
137
270
  NAME = :"remote_auth"
138
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
271
+ # @private
272
+ MULTI = true
273
+ # @private
274
+ ORDER = 2
275
+ # @private
276
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
139
277
  end
140
- # :nodoc:
278
+ # @private
141
279
  BY_NAME = Ractor.make_shareable({:"status" => Status, :"sockfd" => Sockfd, :"remote_auth" => RemoteAuth}) #: Hash[::Symbol, Attribute]
142
- # :nodoc:
280
+ # @private
143
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
144
294
  class << self
145
295
  # Looks up Attribute class by name.
146
- #--
147
296
  # @rbs name: Symbol
148
297
  # @rbs return: Attribute
298
+ # @param [Symbol] name
299
+ # @return [Attribute]
149
300
  def by_name(name); BY_NAME.fetch(name); end
150
301
  # Looks up Attribute class by type value.
151
- #--
152
302
  # @rbs type: Integer
153
303
  # @rbs return: Attribute
304
+ # @param [Integer] type
305
+ # @return [Attribute]
154
306
  def by_type(type); BY_TYPE.fetch(type); end
155
307
  end
156
308
  end
157
- Accept::Certificate::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(X509)
309
+ # @private
310
+ Accept::Certificate::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::X509, selector_bindings: Ractor.make_shareable([]))
158
311
  end
159
312
  module Messages
160
313
  # Handler retrieves next queued handshake request
161
314
  #
162
315
  # Requires CAP_NET_ADMIN in the initial user namespace.
163
- class DoAcceptRequest < ::Nl::Protocols::Genl::Message
316
+ class DoAcceptRequest < ::Nl::Genl::Message
164
317
  TYPE = 2
165
318
  FIXED_HEADER = nil
166
319
  ATTRIBUTE_SET = AttributeSets::Accept
167
320
  ATTRIBUTES = Ractor.make_shareable(%i[handler_class])
168
- # Gets the value of `handler-class` attribute in the message.
169
- #--
321
+ # Known enum values are defined in {Enums::HandlerClass}.
170
322
  # @rbs return: ::Integer
323
+ # @return [Integer]
324
+ # @see AttributeSets::Accept::HandlerClass
171
325
  def handler_class; attributes[:"handler_class"]&.value; end
172
326
  end
173
327
  # Handler retrieves next queued handshake request
174
328
  #
175
329
  # Requires CAP_NET_ADMIN in the initial user namespace.
176
- class DoAcceptReply < ::Nl::Protocols::Genl::Message
330
+ class DoAcceptReply < ::Nl::Genl::Message
177
331
  TYPE = 2
178
332
  FIXED_HEADER = nil
179
333
  ATTRIBUTE_SET = AttributeSets::Accept
180
334
  ATTRIBUTES = Ractor.make_shareable(%i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring])
181
- # Gets the value of `sockfd` attribute in the message.
182
- #--
183
335
  # @rbs return: ::Integer
336
+ # @return [Integer]
337
+ # @see AttributeSets::Accept::Sockfd
184
338
  def sockfd; attributes[:"sockfd"]&.value; end
185
- # Gets the value of `message-type` attribute in the message.
186
- #--
339
+ # Known enum values are defined in {Enums::MsgType}.
187
340
  # @rbs return: ::Integer
341
+ # @return [Integer]
342
+ # @see AttributeSets::Accept::MessageType
188
343
  def message_type; attributes[:"message_type"]&.value; end
189
- # Gets the value of `timeout` attribute in the message.
190
- #--
191
344
  # @rbs return: ::Integer
345
+ # @return [Integer]
346
+ # @see AttributeSets::Accept::Timeout
192
347
  def timeout; attributes[:"timeout"]&.value; end
193
- # Gets the value of `auth-mode` attribute in the message.
194
- #--
348
+ # Known enum values are defined in {Enums::Auth}.
195
349
  # @rbs return: ::Integer
350
+ # @return [Integer]
351
+ # @see AttributeSets::Accept::AuthMode
196
352
  def auth_mode; attributes[:"auth_mode"]&.value; end
197
- # Gets the value of `peer-identity` attribute in the message.
198
- #--
199
- # @rbs return: ::Integer
200
- def peer_identity; attributes[:"peer_identity"]&.value; end
201
- # Gets the value of `certificate` attribute in the message.
202
- #--
203
- # @rbs return: AttributeSets::X509
204
- def certificate; attributes[:"certificate"]&.value; end
205
- # Gets the value of `peername` attribute in the message.
206
- #--
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
207
361
  # @rbs return: ::String
362
+ # @return [String]
363
+ # @see AttributeSets::Accept::Peername
208
364
  def peername; attributes[:"peername"]&.value; end
209
- # Gets the value of `keyring` attribute in the message.
210
- #--
211
365
  # @rbs return: ::Integer
366
+ # @return [Integer]
367
+ # @see AttributeSets::Accept::Keyring
212
368
  def keyring; attributes[:"keyring"]&.value; end
213
369
  end
214
370
  # Handler reports handshake completion
215
371
  #
216
372
  # Requires CAP_NET_ADMIN in the initial user namespace.
217
- class DoDoneRequest < ::Nl::Protocols::Genl::Message
373
+ class DoDoneRequest < ::Nl::Genl::Message
218
374
  TYPE = 3
219
375
  FIXED_HEADER = nil
220
376
  ATTRIBUTE_SET = AttributeSets::Done
221
377
  ATTRIBUTES = Ractor.make_shareable(%i[status sockfd remote_auth])
222
- # Gets the value of `status` attribute in the message.
223
- #--
224
378
  # @rbs return: ::Integer
379
+ # @return [Integer]
380
+ # @see AttributeSets::Done::Status
225
381
  def status; attributes[:"status"]&.value; end
226
- # Gets the value of `sockfd` attribute in the message.
227
- #--
228
382
  # @rbs return: ::Integer
383
+ # @return [Integer]
384
+ # @see AttributeSets::Done::Sockfd
229
385
  def sockfd; attributes[:"sockfd"]&.value; end
230
- # Gets the value of `remote-auth` attribute in the message.
231
- #--
232
- # @rbs return: ::Integer
233
- def remote_auth; attributes[:"remote_auth"]&.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
234
390
  end
235
391
  end
236
392
  module Notifications
237
393
  # Notify handlers that a new handshake request is waiting
238
- class Ready < ::Nl::Protocols::Genl::Message
394
+ class Ready < ::Nl::Genl::Message
239
395
  TYPE = 1
240
396
  FIXED_HEADER = nil
241
397
  ATTRIBUTE_SET = AttributeSets::Accept
242
398
  ATTRIBUTES = Ractor.make_shareable(%i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring])
243
- # Gets the value of `sockfd` attribute in the message.
244
- #--
245
399
  # @rbs return: ::Integer
400
+ # @return [Integer]
401
+ # @see AttributeSets::Accept::Sockfd
246
402
  def sockfd; attributes[:"sockfd"]&.value; end
247
- # Gets the value of `message-type` attribute in the message.
248
- #--
403
+ # Known enum values are defined in {Enums::MsgType}.
249
404
  # @rbs return: ::Integer
405
+ # @return [Integer]
406
+ # @see AttributeSets::Accept::MessageType
250
407
  def message_type; attributes[:"message_type"]&.value; end
251
- # Gets the value of `timeout` attribute in the message.
252
- #--
253
408
  # @rbs return: ::Integer
409
+ # @return [Integer]
410
+ # @see AttributeSets::Accept::Timeout
254
411
  def timeout; attributes[:"timeout"]&.value; end
255
- # Gets the value of `auth-mode` attribute in the message.
256
- #--
412
+ # Known enum values are defined in {Enums::Auth}.
257
413
  # @rbs return: ::Integer
414
+ # @return [Integer]
415
+ # @see AttributeSets::Accept::AuthMode
258
416
  def auth_mode; attributes[:"auth_mode"]&.value; end
259
- # Gets the value of `peer-identity` attribute in the message.
260
- #--
261
- # @rbs return: ::Integer
262
- def peer_identity; attributes[:"peer_identity"]&.value; end
263
- # Gets the value of `certificate` attribute in the message.
264
- #--
265
- # @rbs return: AttributeSets::X509
266
- def certificate; attributes[:"certificate"]&.value; end
267
- # Gets the value of `peername` attribute in the message.
268
- #--
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
269
425
  # @rbs return: ::String
426
+ # @return [String]
427
+ # @see AttributeSets::Accept::Peername
270
428
  def peername; attributes[:"peername"]&.value; end
271
- # Gets the value of `keyring` attribute in the message.
272
- #--
273
429
  # @rbs return: ::Integer
430
+ # @return [Integer]
431
+ # @see AttributeSets::Accept::Keyring
274
432
  def keyring; attributes[:"keyring"]&.value; end
275
433
  end
276
434
  end
435
+ # @private
277
436
  NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::Ready}) #: Hash[::Integer, ::Class]
278
437
  # Handler retrieves next queued handshake request
279
438
  #
280
439
  # Requires CAP_NET_ADMIN in the initial user namespace.
281
- #--
282
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
283
445
  def do_accept(**args)
284
446
  exchange_message(:"do", Messages::DoAcceptRequest, Messages::DoAcceptReply, args)
285
447
  end
286
448
  # Handler reports handshake completion
287
449
  #
288
450
  # Requires CAP_NET_ADMIN in the initial user namespace.
289
- #--
290
- # @rbs (?status: ::Integer, ?sockfd: ::Integer, ?remote_auth: ::Integer) -> void
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
291
458
  def do_done(**args)
292
459
  exchange_message(:"do", Messages::DoDoneRequest, nil, args)
293
460
  end
294
461
  class AsyncOperations
295
- # :nodoc:
462
+ # @private
296
463
  def initialize(&exchange)
297
464
  @exchange = exchange
298
465
  end
299
466
  # Handler retrieves next queued handshake request
300
467
  #
301
468
  # Requires CAP_NET_ADMIN in the initial user namespace.
302
- #--
303
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
304
474
  def do_accept(**args)
305
475
  @exchange.call(:"do", Messages::DoAcceptRequest, Messages::DoAcceptReply, args)
306
476
  end
307
477
  # Handler reports handshake completion
308
478
  #
309
479
  # Requires CAP_NET_ADMIN in the initial user namespace.
310
- #--
311
- # @rbs (?status: ::Integer, ?sockfd: ::Integer, ?remote_auth: ::Integer) -> ::Nl::Async::Future[void]
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
312
487
  def do_done(**args)
313
488
  @exchange.call(:"do", Messages::DoDoneRequest, nil, args)
314
489
  end
315
490
  end
316
491
  # Returns the asynchronous operation facade for this family.
317
- #--
318
492
  # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
493
+ # @param [::Integer, nil] stream_capacity
494
+ # @return [AsyncOperations]
319
495
  def async(stream_capacity: nil)
320
496
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
321
497
  build_async_facade(AsyncOperations, stream_capacity:)
322
498
  end
323
- #--
324
499
  # @rbs (*(:none | :tlshd) groups) -> self
500
+ # @param [Array<:none, :tlshd>] groups
501
+ # @return [self]
325
502
  def subscribe(*groups) = super
326
- #--
327
503
  # @rbs (*(:none | :tlshd) groups) -> self
504
+ # @param [Array<:none, :tlshd>] groups
505
+ # @return [self]
328
506
  def unsubscribe(*groups) = super
329
507
  end
330
508
  end; end