nl-linux 0.2.0 → 0.2.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.
@@ -0,0 +1,962 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # Author: Antonio Quartulli <antonio@openvpn.net>
4
+ #
5
+ # Copyright (c) 2024-2025, OpenVPN Inc.
6
+ #
7
+ #--
8
+ # frozen_string_literal: true
9
+ # rbs_inline: enabled
10
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
11
+ require 'nl'
12
+ # Netlink protocol to control OpenVPN network devices
13
+ class Nl::Linux::Ovpn < ::Nl::Family
14
+ NAME = "ovpn"
15
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovpn"))
16
+ module Structs
17
+ end
18
+ module AttributeSets
19
+ class Peer < ::Nl::Protocols::Genl::AttributeSet
20
+ # Abstract class
21
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
22
+ end
23
+ class Id < Attribute
24
+ TYPE = 1
25
+ NAME = :"id"
26
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
27
+ end
28
+ class RemoteIpv4 < Attribute
29
+ TYPE = 2
30
+ NAME = :"remote_ipv4"
31
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
32
+ end
33
+ class RemoteIpv6 < Attribute
34
+ TYPE = 3
35
+ NAME = :"remote_ipv6"
36
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
37
+ end
38
+ class RemoteIpv6ScopeId < Attribute
39
+ TYPE = 4
40
+ NAME = :"remote_ipv6_scope_id"
41
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
42
+ end
43
+ class RemotePort < Attribute
44
+ TYPE = 5
45
+ NAME = :"remote_port"
46
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
47
+ end
48
+ class Socket < Attribute
49
+ TYPE = 6
50
+ NAME = :"socket"
51
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
52
+ end
53
+ class SocketNetnsid < Attribute
54
+ TYPE = 7
55
+ NAME = :"socket_netnsid"
56
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
57
+ end
58
+ class VpnIpv4 < Attribute
59
+ TYPE = 8
60
+ NAME = :"vpn_ipv4"
61
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
62
+ end
63
+ class VpnIpv6 < Attribute
64
+ TYPE = 9
65
+ NAME = :"vpn_ipv6"
66
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
67
+ end
68
+ class LocalIpv4 < Attribute
69
+ TYPE = 10
70
+ NAME = :"local_ipv4"
71
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
72
+ end
73
+ class LocalIpv6 < Attribute
74
+ TYPE = 11
75
+ NAME = :"local_ipv6"
76
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
77
+ end
78
+ class LocalPort < Attribute
79
+ TYPE = 12
80
+ NAME = :"local_port"
81
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
82
+ end
83
+ class KeepaliveInterval < Attribute
84
+ TYPE = 13
85
+ NAME = :"keepalive_interval"
86
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
87
+ end
88
+ class KeepaliveTimeout < Attribute
89
+ TYPE = 14
90
+ NAME = :"keepalive_timeout"
91
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
92
+ end
93
+ class DelReason < Attribute
94
+ TYPE = 15
95
+ NAME = :"del_reason"
96
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
97
+ end
98
+ class VpnRxBytes < Attribute
99
+ TYPE = 16
100
+ NAME = :"vpn_rx_bytes"
101
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
102
+ end
103
+ class VpnTxBytes < Attribute
104
+ TYPE = 17
105
+ NAME = :"vpn_tx_bytes"
106
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
107
+ end
108
+ class VpnRxPackets < Attribute
109
+ TYPE = 18
110
+ NAME = :"vpn_rx_packets"
111
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
112
+ end
113
+ class VpnTxPackets < Attribute
114
+ TYPE = 19
115
+ NAME = :"vpn_tx_packets"
116
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
117
+ end
118
+ class LinkRxBytes < Attribute
119
+ TYPE = 20
120
+ NAME = :"link_rx_bytes"
121
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
122
+ end
123
+ class LinkTxBytes < Attribute
124
+ TYPE = 21
125
+ NAME = :"link_tx_bytes"
126
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
127
+ end
128
+ class LinkRxPackets < Attribute
129
+ TYPE = 22
130
+ NAME = :"link_rx_packets"
131
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
132
+ end
133
+ class LinkTxPackets < Attribute
134
+ TYPE = 23
135
+ NAME = :"link_tx_packets"
136
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
137
+ end
138
+ # :nodoc:
139
+ BY_NAME = Ractor.make_shareable({:"id" => Id, :"remote_ipv4" => RemoteIpv4, :"remote_ipv6" => RemoteIpv6, :"remote_ipv6_scope_id" => RemoteIpv6ScopeId, :"remote_port" => RemotePort, :"socket" => Socket, :"socket_netnsid" => SocketNetnsid, :"vpn_ipv4" => VpnIpv4, :"vpn_ipv6" => VpnIpv6, :"local_ipv4" => LocalIpv4, :"local_ipv6" => LocalIpv6, :"local_port" => LocalPort, :"keepalive_interval" => KeepaliveInterval, :"keepalive_timeout" => KeepaliveTimeout, :"del_reason" => DelReason, :"vpn_rx_bytes" => VpnRxBytes, :"vpn_tx_bytes" => VpnTxBytes, :"vpn_rx_packets" => VpnRxPackets, :"vpn_tx_packets" => VpnTxPackets, :"link_rx_bytes" => LinkRxBytes, :"link_tx_bytes" => LinkTxBytes, :"link_rx_packets" => LinkRxPackets, :"link_tx_packets" => LinkTxPackets}) #: Hash[::Symbol, Attribute]
140
+ # :nodoc:
141
+ BY_TYPE = Ractor.make_shareable({1 => Id, 2 => RemoteIpv4, 3 => RemoteIpv6, 4 => RemoteIpv6ScopeId, 5 => RemotePort, 6 => Socket, 7 => SocketNetnsid, 8 => VpnIpv4, 9 => VpnIpv6, 10 => LocalIpv4, 11 => LocalIpv6, 12 => LocalPort, 13 => KeepaliveInterval, 14 => KeepaliveTimeout, 15 => DelReason, 16 => VpnRxBytes, 17 => VpnTxBytes, 18 => VpnRxPackets, 19 => VpnTxPackets, 20 => LinkRxBytes, 21 => LinkTxBytes, 22 => LinkRxPackets, 23 => LinkTxPackets}) #: Hash[::Integer, Attribute]
142
+ class << self
143
+ # Looks up Attribute class by name.
144
+ #--
145
+ # @rbs name: Symbol
146
+ # @rbs return: Attribute
147
+ def by_name(name); BY_NAME.fetch(name); end
148
+ # Looks up Attribute class by type value.
149
+ #--
150
+ # @rbs type: Integer
151
+ # @rbs return: Attribute
152
+ def by_type(type); BY_TYPE.fetch(type); end
153
+ end
154
+ end
155
+ class PeerNewInput < ::Nl::Protocols::Genl::AttributeSet
156
+ # Abstract class
157
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
158
+ end
159
+ class Id < Attribute
160
+ TYPE = 1
161
+ NAME = :"id"
162
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
163
+ end
164
+ class RemoteIpv4 < Attribute
165
+ TYPE = 2
166
+ NAME = :"remote_ipv4"
167
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
168
+ end
169
+ class RemoteIpv6 < Attribute
170
+ TYPE = 3
171
+ NAME = :"remote_ipv6"
172
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
173
+ end
174
+ class RemoteIpv6ScopeId < Attribute
175
+ TYPE = 4
176
+ NAME = :"remote_ipv6_scope_id"
177
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
178
+ end
179
+ class RemotePort < Attribute
180
+ TYPE = 5
181
+ NAME = :"remote_port"
182
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
183
+ end
184
+ class Socket < Attribute
185
+ TYPE = 6
186
+ NAME = :"socket"
187
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
188
+ end
189
+ class VpnIpv4 < Attribute
190
+ TYPE = 8
191
+ NAME = :"vpn_ipv4"
192
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
193
+ end
194
+ class VpnIpv6 < Attribute
195
+ TYPE = 9
196
+ NAME = :"vpn_ipv6"
197
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
198
+ end
199
+ class LocalIpv4 < Attribute
200
+ TYPE = 10
201
+ NAME = :"local_ipv4"
202
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
203
+ end
204
+ class LocalIpv6 < Attribute
205
+ TYPE = 11
206
+ NAME = :"local_ipv6"
207
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
208
+ end
209
+ class KeepaliveInterval < Attribute
210
+ TYPE = 13
211
+ NAME = :"keepalive_interval"
212
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
213
+ end
214
+ class KeepaliveTimeout < Attribute
215
+ TYPE = 14
216
+ NAME = :"keepalive_timeout"
217
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
218
+ end
219
+ # :nodoc:
220
+ BY_NAME = Ractor.make_shareable({:"id" => Id, :"remote_ipv4" => RemoteIpv4, :"remote_ipv6" => RemoteIpv6, :"remote_ipv6_scope_id" => RemoteIpv6ScopeId, :"remote_port" => RemotePort, :"socket" => Socket, :"vpn_ipv4" => VpnIpv4, :"vpn_ipv6" => VpnIpv6, :"local_ipv4" => LocalIpv4, :"local_ipv6" => LocalIpv6, :"keepalive_interval" => KeepaliveInterval, :"keepalive_timeout" => KeepaliveTimeout}) #: Hash[::Symbol, Attribute]
221
+ # :nodoc:
222
+ BY_TYPE = Ractor.make_shareable({1 => Id, 2 => RemoteIpv4, 3 => RemoteIpv6, 4 => RemoteIpv6ScopeId, 5 => RemotePort, 6 => Socket, 8 => VpnIpv4, 9 => VpnIpv6, 10 => LocalIpv4, 11 => LocalIpv6, 13 => KeepaliveInterval, 14 => KeepaliveTimeout}) #: Hash[::Integer, Attribute]
223
+ class << self
224
+ # Looks up Attribute class by name.
225
+ #--
226
+ # @rbs name: Symbol
227
+ # @rbs return: Attribute
228
+ def by_name(name); BY_NAME.fetch(name); end
229
+ # Looks up Attribute class by type value.
230
+ #--
231
+ # @rbs type: Integer
232
+ # @rbs return: Attribute
233
+ def by_type(type); BY_TYPE.fetch(type); end
234
+ end
235
+ end
236
+ class PeerSetInput < ::Nl::Protocols::Genl::AttributeSet
237
+ # Abstract class
238
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
239
+ end
240
+ class Id < Attribute
241
+ TYPE = 1
242
+ NAME = :"id"
243
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
244
+ end
245
+ class RemoteIpv4 < Attribute
246
+ TYPE = 2
247
+ NAME = :"remote_ipv4"
248
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
249
+ end
250
+ class RemoteIpv6 < Attribute
251
+ TYPE = 3
252
+ NAME = :"remote_ipv6"
253
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
254
+ end
255
+ class RemoteIpv6ScopeId < Attribute
256
+ TYPE = 4
257
+ NAME = :"remote_ipv6_scope_id"
258
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
259
+ end
260
+ class RemotePort < Attribute
261
+ TYPE = 5
262
+ NAME = :"remote_port"
263
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
264
+ end
265
+ class VpnIpv4 < Attribute
266
+ TYPE = 8
267
+ NAME = :"vpn_ipv4"
268
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
269
+ end
270
+ class VpnIpv6 < Attribute
271
+ TYPE = 9
272
+ NAME = :"vpn_ipv6"
273
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
274
+ end
275
+ class LocalIpv4 < Attribute
276
+ TYPE = 10
277
+ NAME = :"local_ipv4"
278
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
279
+ end
280
+ class LocalIpv6 < Attribute
281
+ TYPE = 11
282
+ NAME = :"local_ipv6"
283
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
284
+ end
285
+ class KeepaliveInterval < Attribute
286
+ TYPE = 13
287
+ NAME = :"keepalive_interval"
288
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
289
+ end
290
+ class KeepaliveTimeout < Attribute
291
+ TYPE = 14
292
+ NAME = :"keepalive_timeout"
293
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
294
+ end
295
+ # :nodoc:
296
+ BY_NAME = Ractor.make_shareable({:"id" => Id, :"remote_ipv4" => RemoteIpv4, :"remote_ipv6" => RemoteIpv6, :"remote_ipv6_scope_id" => RemoteIpv6ScopeId, :"remote_port" => RemotePort, :"vpn_ipv4" => VpnIpv4, :"vpn_ipv6" => VpnIpv6, :"local_ipv4" => LocalIpv4, :"local_ipv6" => LocalIpv6, :"keepalive_interval" => KeepaliveInterval, :"keepalive_timeout" => KeepaliveTimeout}) #: Hash[::Symbol, Attribute]
297
+ # :nodoc:
298
+ BY_TYPE = Ractor.make_shareable({1 => Id, 2 => RemoteIpv4, 3 => RemoteIpv6, 4 => RemoteIpv6ScopeId, 5 => RemotePort, 8 => VpnIpv4, 9 => VpnIpv6, 10 => LocalIpv4, 11 => LocalIpv6, 13 => KeepaliveInterval, 14 => KeepaliveTimeout}) #: Hash[::Integer, Attribute]
299
+ class << self
300
+ # Looks up Attribute class by name.
301
+ #--
302
+ # @rbs name: Symbol
303
+ # @rbs return: Attribute
304
+ def by_name(name); BY_NAME.fetch(name); end
305
+ # Looks up Attribute class by type value.
306
+ #--
307
+ # @rbs type: Integer
308
+ # @rbs return: Attribute
309
+ def by_type(type); BY_TYPE.fetch(type); end
310
+ end
311
+ end
312
+ class PeerDelInput < ::Nl::Protocols::Genl::AttributeSet
313
+ # Abstract class
314
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
315
+ end
316
+ class Id < Attribute
317
+ TYPE = 1
318
+ NAME = :"id"
319
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
320
+ end
321
+ # :nodoc:
322
+ BY_NAME = Ractor.make_shareable({:"id" => Id}) #: Hash[::Symbol, Attribute]
323
+ # :nodoc:
324
+ BY_TYPE = Ractor.make_shareable({1 => Id}) #: Hash[::Integer, Attribute]
325
+ class << self
326
+ # Looks up Attribute class by name.
327
+ #--
328
+ # @rbs name: Symbol
329
+ # @rbs return: Attribute
330
+ def by_name(name); BY_NAME.fetch(name); end
331
+ # Looks up Attribute class by type value.
332
+ #--
333
+ # @rbs type: Integer
334
+ # @rbs return: Attribute
335
+ def by_type(type); BY_TYPE.fetch(type); end
336
+ end
337
+ end
338
+ class Keyconf < ::Nl::Protocols::Genl::AttributeSet
339
+ # Abstract class
340
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
341
+ end
342
+ class PeerId < Attribute
343
+ TYPE = 1
344
+ NAME = :"peer_id"
345
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
346
+ end
347
+ class Slot < Attribute
348
+ TYPE = 2
349
+ NAME = :"slot"
350
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
351
+ end
352
+ class KeyId < Attribute
353
+ TYPE = 3
354
+ NAME = :"key_id"
355
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 7" unless it <= 7 })
356
+ end
357
+ class CipherAlg < Attribute
358
+ TYPE = 4
359
+ NAME = :"cipher_alg"
360
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
361
+ end
362
+ class EncryptDir < Attribute
363
+ TYPE = 5
364
+ NAME = :"encrypt_dir"
365
+ end
366
+ class DecryptDir < Attribute
367
+ TYPE = 6
368
+ NAME = :"decrypt_dir"
369
+ end
370
+ # :nodoc:
371
+ BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId, :"slot" => Slot, :"key_id" => KeyId, :"cipher_alg" => CipherAlg, :"encrypt_dir" => EncryptDir, :"decrypt_dir" => DecryptDir}) #: Hash[::Symbol, Attribute]
372
+ # :nodoc:
373
+ BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot, 3 => KeyId, 4 => CipherAlg, 5 => EncryptDir, 6 => DecryptDir}) #: Hash[::Integer, Attribute]
374
+ class << self
375
+ # Looks up Attribute class by name.
376
+ #--
377
+ # @rbs name: Symbol
378
+ # @rbs return: Attribute
379
+ def by_name(name); BY_NAME.fetch(name); end
380
+ # Looks up Attribute class by type value.
381
+ #--
382
+ # @rbs type: Integer
383
+ # @rbs return: Attribute
384
+ def by_type(type); BY_TYPE.fetch(type); end
385
+ end
386
+ end
387
+ class Keydir < ::Nl::Protocols::Genl::AttributeSet
388
+ # Abstract class
389
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
390
+ end
391
+ class CipherKey < Attribute
392
+ TYPE = 1
393
+ NAME = :"cipher_key"
394
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length 256" unless it.bytesize <= 256 })
395
+ end
396
+ class NonceTail < Attribute
397
+ TYPE = 2
398
+ NAME = :"nonce_tail"
399
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 8" unless it.bytesize == 8 })
400
+ end
401
+ # :nodoc:
402
+ BY_NAME = Ractor.make_shareable({:"cipher_key" => CipherKey, :"nonce_tail" => NonceTail}) #: Hash[::Symbol, Attribute]
403
+ # :nodoc:
404
+ BY_TYPE = Ractor.make_shareable({1 => CipherKey, 2 => NonceTail}) #: Hash[::Integer, Attribute]
405
+ class << self
406
+ # Looks up Attribute class by name.
407
+ #--
408
+ # @rbs name: Symbol
409
+ # @rbs return: Attribute
410
+ def by_name(name); BY_NAME.fetch(name); end
411
+ # Looks up Attribute class by type value.
412
+ #--
413
+ # @rbs type: Integer
414
+ # @rbs return: Attribute
415
+ def by_type(type); BY_TYPE.fetch(type); end
416
+ end
417
+ end
418
+ class KeyconfGet < ::Nl::Protocols::Genl::AttributeSet
419
+ # Abstract class
420
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
421
+ end
422
+ class PeerId < Attribute
423
+ TYPE = 1
424
+ NAME = :"peer_id"
425
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
426
+ end
427
+ class Slot < Attribute
428
+ TYPE = 2
429
+ NAME = :"slot"
430
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
431
+ end
432
+ class KeyId < Attribute
433
+ TYPE = 3
434
+ NAME = :"key_id"
435
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 7" unless it <= 7 })
436
+ end
437
+ class CipherAlg < Attribute
438
+ TYPE = 4
439
+ NAME = :"cipher_alg"
440
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
441
+ end
442
+ # :nodoc:
443
+ BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId, :"slot" => Slot, :"key_id" => KeyId, :"cipher_alg" => CipherAlg}) #: Hash[::Symbol, Attribute]
444
+ # :nodoc:
445
+ BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot, 3 => KeyId, 4 => CipherAlg}) #: Hash[::Integer, Attribute]
446
+ class << self
447
+ # Looks up Attribute class by name.
448
+ #--
449
+ # @rbs name: Symbol
450
+ # @rbs return: Attribute
451
+ def by_name(name); BY_NAME.fetch(name); end
452
+ # Looks up Attribute class by type value.
453
+ #--
454
+ # @rbs type: Integer
455
+ # @rbs return: Attribute
456
+ def by_type(type); BY_TYPE.fetch(type); end
457
+ end
458
+ end
459
+ class KeyconfSwapInput < ::Nl::Protocols::Genl::AttributeSet
460
+ # Abstract class
461
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
462
+ end
463
+ class PeerId < Attribute
464
+ TYPE = 1
465
+ NAME = :"peer_id"
466
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
467
+ end
468
+ # :nodoc:
469
+ BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId}) #: Hash[::Symbol, Attribute]
470
+ # :nodoc:
471
+ BY_TYPE = Ractor.make_shareable({1 => PeerId}) #: Hash[::Integer, Attribute]
472
+ class << self
473
+ # Looks up Attribute class by name.
474
+ #--
475
+ # @rbs name: Symbol
476
+ # @rbs return: Attribute
477
+ def by_name(name); BY_NAME.fetch(name); end
478
+ # Looks up Attribute class by type value.
479
+ #--
480
+ # @rbs type: Integer
481
+ # @rbs return: Attribute
482
+ def by_type(type); BY_TYPE.fetch(type); end
483
+ end
484
+ end
485
+ class KeyconfDelInput < ::Nl::Protocols::Genl::AttributeSet
486
+ # Abstract class
487
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
488
+ end
489
+ class PeerId < Attribute
490
+ TYPE = 1
491
+ NAME = :"peer_id"
492
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
493
+ end
494
+ class Slot < Attribute
495
+ TYPE = 2
496
+ NAME = :"slot"
497
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
498
+ end
499
+ # :nodoc:
500
+ BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId, :"slot" => Slot}) #: Hash[::Symbol, Attribute]
501
+ # :nodoc:
502
+ BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot}) #: Hash[::Integer, Attribute]
503
+ class << self
504
+ # Looks up Attribute class by name.
505
+ #--
506
+ # @rbs name: Symbol
507
+ # @rbs return: Attribute
508
+ def by_name(name); BY_NAME.fetch(name); end
509
+ # Looks up Attribute class by type value.
510
+ #--
511
+ # @rbs type: Integer
512
+ # @rbs return: Attribute
513
+ def by_type(type); BY_TYPE.fetch(type); end
514
+ end
515
+ end
516
+ class Ovpn < ::Nl::Protocols::Genl::AttributeSet
517
+ # Abstract class
518
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
519
+ end
520
+ class Ifindex < Attribute
521
+ TYPE = 1
522
+ NAME = :"ifindex"
523
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
524
+ end
525
+ class Peer < Attribute
526
+ TYPE = 2
527
+ NAME = :"peer"
528
+ end
529
+ class Keyconf < Attribute
530
+ TYPE = 3
531
+ NAME = :"keyconf"
532
+ end
533
+ # :nodoc:
534
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
535
+ # :nodoc:
536
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer, 3 => Keyconf}) #: Hash[::Integer, Attribute]
537
+ class << self
538
+ # Looks up Attribute class by name.
539
+ #--
540
+ # @rbs name: Symbol
541
+ # @rbs return: Attribute
542
+ def by_name(name); BY_NAME.fetch(name); end
543
+ # Looks up Attribute class by type value.
544
+ #--
545
+ # @rbs type: Integer
546
+ # @rbs return: Attribute
547
+ def by_type(type); BY_TYPE.fetch(type); end
548
+ end
549
+ end
550
+ class OvpnPeerNewInput < ::Nl::Protocols::Genl::AttributeSet
551
+ # Abstract class
552
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
553
+ end
554
+ class Ifindex < Attribute
555
+ TYPE = 1
556
+ NAME = :"ifindex"
557
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
558
+ end
559
+ class Peer < Attribute
560
+ TYPE = 2
561
+ NAME = :"peer"
562
+ end
563
+ # :nodoc:
564
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
565
+ # :nodoc:
566
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
567
+ class << self
568
+ # Looks up Attribute class by name.
569
+ #--
570
+ # @rbs name: Symbol
571
+ # @rbs return: Attribute
572
+ def by_name(name); BY_NAME.fetch(name); end
573
+ # Looks up Attribute class by type value.
574
+ #--
575
+ # @rbs type: Integer
576
+ # @rbs return: Attribute
577
+ def by_type(type); BY_TYPE.fetch(type); end
578
+ end
579
+ end
580
+ class OvpnPeerSetInput < ::Nl::Protocols::Genl::AttributeSet
581
+ # Abstract class
582
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
583
+ end
584
+ class Ifindex < Attribute
585
+ TYPE = 1
586
+ NAME = :"ifindex"
587
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
588
+ end
589
+ class Peer < Attribute
590
+ TYPE = 2
591
+ NAME = :"peer"
592
+ end
593
+ # :nodoc:
594
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
595
+ # :nodoc:
596
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
597
+ class << self
598
+ # Looks up Attribute class by name.
599
+ #--
600
+ # @rbs name: Symbol
601
+ # @rbs return: Attribute
602
+ def by_name(name); BY_NAME.fetch(name); end
603
+ # Looks up Attribute class by type value.
604
+ #--
605
+ # @rbs type: Integer
606
+ # @rbs return: Attribute
607
+ def by_type(type); BY_TYPE.fetch(type); end
608
+ end
609
+ end
610
+ class OvpnPeerDelInput < ::Nl::Protocols::Genl::AttributeSet
611
+ # Abstract class
612
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
613
+ end
614
+ class Ifindex < Attribute
615
+ TYPE = 1
616
+ NAME = :"ifindex"
617
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
618
+ end
619
+ class Peer < Attribute
620
+ TYPE = 2
621
+ NAME = :"peer"
622
+ end
623
+ # :nodoc:
624
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
625
+ # :nodoc:
626
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
627
+ class << self
628
+ # Looks up Attribute class by name.
629
+ #--
630
+ # @rbs name: Symbol
631
+ # @rbs return: Attribute
632
+ def by_name(name); BY_NAME.fetch(name); end
633
+ # Looks up Attribute class by type value.
634
+ #--
635
+ # @rbs type: Integer
636
+ # @rbs return: Attribute
637
+ def by_type(type); BY_TYPE.fetch(type); end
638
+ end
639
+ end
640
+ class OvpnKeyconfGet < ::Nl::Protocols::Genl::AttributeSet
641
+ # Abstract class
642
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
643
+ end
644
+ class Ifindex < Attribute
645
+ TYPE = 1
646
+ NAME = :"ifindex"
647
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
648
+ end
649
+ class Keyconf < Attribute
650
+ TYPE = 3
651
+ NAME = :"keyconf"
652
+ end
653
+ # :nodoc:
654
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
655
+ # :nodoc:
656
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
657
+ class << self
658
+ # Looks up Attribute class by name.
659
+ #--
660
+ # @rbs name: Symbol
661
+ # @rbs return: Attribute
662
+ def by_name(name); BY_NAME.fetch(name); end
663
+ # Looks up Attribute class by type value.
664
+ #--
665
+ # @rbs type: Integer
666
+ # @rbs return: Attribute
667
+ def by_type(type); BY_TYPE.fetch(type); end
668
+ end
669
+ end
670
+ class OvpnKeyconfSwapInput < ::Nl::Protocols::Genl::AttributeSet
671
+ # Abstract class
672
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
673
+ end
674
+ class Ifindex < Attribute
675
+ TYPE = 1
676
+ NAME = :"ifindex"
677
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
678
+ end
679
+ class Keyconf < Attribute
680
+ TYPE = 3
681
+ NAME = :"keyconf"
682
+ end
683
+ # :nodoc:
684
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
685
+ # :nodoc:
686
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
687
+ class << self
688
+ # Looks up Attribute class by name.
689
+ #--
690
+ # @rbs name: Symbol
691
+ # @rbs return: Attribute
692
+ def by_name(name); BY_NAME.fetch(name); end
693
+ # Looks up Attribute class by type value.
694
+ #--
695
+ # @rbs type: Integer
696
+ # @rbs return: Attribute
697
+ def by_type(type); BY_TYPE.fetch(type); end
698
+ end
699
+ end
700
+ class OvpnKeyconfDelInput < ::Nl::Protocols::Genl::AttributeSet
701
+ # Abstract class
702
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
703
+ end
704
+ class Ifindex < Attribute
705
+ TYPE = 1
706
+ NAME = :"ifindex"
707
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
708
+ end
709
+ class Keyconf < Attribute
710
+ TYPE = 3
711
+ NAME = :"keyconf"
712
+ end
713
+ # :nodoc:
714
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
715
+ # :nodoc:
716
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
717
+ class << self
718
+ # Looks up Attribute class by name.
719
+ #--
720
+ # @rbs name: Symbol
721
+ # @rbs return: Attribute
722
+ def by_name(name); BY_NAME.fetch(name); end
723
+ # Looks up Attribute class by type value.
724
+ #--
725
+ # @rbs type: Integer
726
+ # @rbs return: Attribute
727
+ def by_type(type); BY_TYPE.fetch(type); end
728
+ end
729
+ end
730
+ Keyconf::EncryptDir::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keydir)
731
+ Keyconf::DecryptDir::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keydir)
732
+ Ovpn::Peer::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Peer)
733
+ Ovpn::Keyconf::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keyconf)
734
+ OvpnPeerNewInput::Peer::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Peer)
735
+ OvpnPeerSetInput::Peer::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Peer)
736
+ OvpnPeerDelInput::Peer::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Peer)
737
+ OvpnKeyconfGet::Keyconf::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keyconf)
738
+ OvpnKeyconfSwapInput::Keyconf::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keyconf)
739
+ OvpnKeyconfDelInput::Keyconf::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keyconf)
740
+ end
741
+ module Messages
742
+ # Add a remote peer
743
+ class DoPeerNewRequest < ::Nl::Protocols::Genl::Message
744
+ TYPE = 1
745
+ FIXED_HEADER = nil
746
+ ATTRIBUTE_SET = AttributeSets::OvpnPeerNewInput
747
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
748
+ # Gets the value of `ifindex` attribute in the message.
749
+ #--
750
+ # @rbs return: ::Integer
751
+ def ifindex; attributes[:"ifindex"]&.value; end
752
+ # Gets the value of `peer` attribute in the message.
753
+ #--
754
+ # @rbs return: AttributeSets::Peer
755
+ def peer; attributes[:"peer"]&.value; end
756
+ end
757
+ # modify a remote peer
758
+ class DoPeerSetRequest < ::Nl::Protocols::Genl::Message
759
+ TYPE = 2
760
+ FIXED_HEADER = nil
761
+ ATTRIBUTE_SET = AttributeSets::OvpnPeerSetInput
762
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
763
+ # Gets the value of `ifindex` attribute in the message.
764
+ #--
765
+ # @rbs return: ::Integer
766
+ def ifindex; attributes[:"ifindex"]&.value; end
767
+ # Gets the value of `peer` attribute in the message.
768
+ #--
769
+ # @rbs return: AttributeSets::Peer
770
+ def peer; attributes[:"peer"]&.value; end
771
+ end
772
+ # Retrieve data about existing remote peers (or a specific one)
773
+ class DoPeerGetRequest < ::Nl::Protocols::Genl::Message
774
+ TYPE = 3
775
+ FIXED_HEADER = nil
776
+ ATTRIBUTE_SET = AttributeSets::Ovpn
777
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
778
+ # Gets the value of `ifindex` attribute in the message.
779
+ #--
780
+ # @rbs return: ::Integer
781
+ def ifindex; attributes[:"ifindex"]&.value; end
782
+ # Gets the value of `peer` attribute in the message.
783
+ #--
784
+ # @rbs return: AttributeSets::Peer
785
+ def peer; attributes[:"peer"]&.value; end
786
+ end
787
+ # Retrieve data about existing remote peers (or a specific one)
788
+ class DoPeerGetReply < ::Nl::Protocols::Genl::Message
789
+ TYPE = 3
790
+ FIXED_HEADER = nil
791
+ ATTRIBUTE_SET = AttributeSets::Ovpn
792
+ ATTRIBUTES = Ractor.make_shareable(%i[peer])
793
+ # Gets the value of `peer` attribute in the message.
794
+ #--
795
+ # @rbs return: AttributeSets::Peer
796
+ def peer; attributes[:"peer"]&.value; end
797
+ end
798
+ # Retrieve data about existing remote peers (or a specific one)
799
+ class DumpPeerGetRequest < ::Nl::Protocols::Genl::Message
800
+ TYPE = 3
801
+ FIXED_HEADER = nil
802
+ ATTRIBUTE_SET = AttributeSets::Ovpn
803
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
804
+ # Gets the value of `ifindex` attribute in the message.
805
+ #--
806
+ # @rbs return: ::Integer
807
+ def ifindex; attributes[:"ifindex"]&.value; end
808
+ end
809
+ # Retrieve data about existing remote peers (or a specific one)
810
+ class DumpPeerGetReply < ::Nl::Protocols::Genl::Message
811
+ TYPE = 3
812
+ FIXED_HEADER = nil
813
+ ATTRIBUTE_SET = AttributeSets::Ovpn
814
+ ATTRIBUTES = Ractor.make_shareable(%i[peer])
815
+ # Gets the value of `peer` attribute in the message.
816
+ #--
817
+ # @rbs return: AttributeSets::Peer
818
+ def peer; attributes[:"peer"]&.value; end
819
+ end
820
+ # Delete existing remote peer
821
+ class DoPeerDelRequest < ::Nl::Protocols::Genl::Message
822
+ TYPE = 4
823
+ FIXED_HEADER = nil
824
+ ATTRIBUTE_SET = AttributeSets::OvpnPeerDelInput
825
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
826
+ # Gets the value of `ifindex` attribute in the message.
827
+ #--
828
+ # @rbs return: ::Integer
829
+ def ifindex; attributes[:"ifindex"]&.value; end
830
+ # Gets the value of `peer` attribute in the message.
831
+ #--
832
+ # @rbs return: AttributeSets::Peer
833
+ def peer; attributes[:"peer"]&.value; end
834
+ end
835
+ # Add a cipher key for a specific peer
836
+ class DoKeyNewRequest < ::Nl::Protocols::Genl::Message
837
+ TYPE = 6
838
+ FIXED_HEADER = nil
839
+ ATTRIBUTE_SET = AttributeSets::Ovpn
840
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
841
+ # Gets the value of `ifindex` attribute in the message.
842
+ #--
843
+ # @rbs return: ::Integer
844
+ def ifindex; attributes[:"ifindex"]&.value; end
845
+ # Gets the value of `keyconf` attribute in the message.
846
+ #--
847
+ # @rbs return: AttributeSets::Keyconf
848
+ def keyconf; attributes[:"keyconf"]&.value; end
849
+ end
850
+ # Retrieve non-sensitive data about peer key and cipher
851
+ class DoKeyGetRequest < ::Nl::Protocols::Genl::Message
852
+ TYPE = 7
853
+ FIXED_HEADER = nil
854
+ ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
855
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
856
+ # Gets the value of `ifindex` attribute in the message.
857
+ #--
858
+ # @rbs return: ::Integer
859
+ def ifindex; attributes[:"ifindex"]&.value; end
860
+ # Gets the value of `keyconf` attribute in the message.
861
+ #--
862
+ # @rbs return: AttributeSets::Keyconf
863
+ def keyconf; attributes[:"keyconf"]&.value; end
864
+ end
865
+ # Retrieve non-sensitive data about peer key and cipher
866
+ class DoKeyGetReply < ::Nl::Protocols::Genl::Message
867
+ TYPE = 7
868
+ FIXED_HEADER = nil
869
+ ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
870
+ ATTRIBUTES = Ractor.make_shareable(%i[keyconf])
871
+ # Gets the value of `keyconf` attribute in the message.
872
+ #--
873
+ # @rbs return: AttributeSets::Keyconf
874
+ def keyconf; attributes[:"keyconf"]&.value; end
875
+ end
876
+ # Swap primary and secondary session keys for a specific peer
877
+ class DoKeySwapRequest < ::Nl::Protocols::Genl::Message
878
+ TYPE = 8
879
+ FIXED_HEADER = nil
880
+ ATTRIBUTE_SET = AttributeSets::OvpnKeyconfSwapInput
881
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
882
+ # Gets the value of `ifindex` attribute in the message.
883
+ #--
884
+ # @rbs return: ::Integer
885
+ def ifindex; attributes[:"ifindex"]&.value; end
886
+ # Gets the value of `keyconf` attribute in the message.
887
+ #--
888
+ # @rbs return: AttributeSets::Keyconf
889
+ def keyconf; attributes[:"keyconf"]&.value; end
890
+ end
891
+ # Delete cipher key for a specific peer
892
+ class DoKeyDelRequest < ::Nl::Protocols::Genl::Message
893
+ TYPE = 10
894
+ FIXED_HEADER = nil
895
+ ATTRIBUTE_SET = AttributeSets::OvpnKeyconfDelInput
896
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
897
+ # Gets the value of `ifindex` attribute in the message.
898
+ #--
899
+ # @rbs return: ::Integer
900
+ def ifindex; attributes[:"ifindex"]&.value; end
901
+ # Gets the value of `keyconf` attribute in the message.
902
+ #--
903
+ # @rbs return: AttributeSets::Keyconf
904
+ def keyconf; attributes[:"keyconf"]&.value; end
905
+ end
906
+ end
907
+ # Add a remote peer
908
+ #--
909
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
910
+ def do_peer_new(**args)
911
+ exchange_message(:"do", Messages::DoPeerNewRequest, nil, args)
912
+ end
913
+ # modify a remote peer
914
+ #--
915
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
916
+ def do_peer_set(**args)
917
+ exchange_message(:"do", Messages::DoPeerSetRequest, nil, args)
918
+ end
919
+ # Retrieve data about existing remote peers (or a specific one)
920
+ #--
921
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> Messages::DoPeerGetReply
922
+ def do_peer_get(**args)
923
+ exchange_message(:"do", Messages::DoPeerGetRequest, Messages::DoPeerGetReply, args)
924
+ end
925
+ # Retrieve data about existing remote peers (or a specific one)
926
+ #--
927
+ # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpPeerGetReply]
928
+ # | (?ifindex: ::Integer) { (Messages::DumpPeerGetReply) -> void } -> void
929
+ def dump_peer_get(**args, &block)
930
+ exchange_message(:"dump", Messages::DumpPeerGetRequest, Messages::DumpPeerGetReply, args, &block)
931
+ end
932
+ # Delete existing remote peer
933
+ #--
934
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
935
+ def do_peer_del(**args)
936
+ exchange_message(:"do", Messages::DoPeerDelRequest, nil, args)
937
+ end
938
+ # Add a cipher key for a specific peer
939
+ #--
940
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
941
+ def do_key_new(**args)
942
+ exchange_message(:"do", Messages::DoKeyNewRequest, nil, args)
943
+ end
944
+ # Retrieve non-sensitive data about peer key and cipher
945
+ #--
946
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> Messages::DoKeyGetReply
947
+ def do_key_get(**args)
948
+ exchange_message(:"do", Messages::DoKeyGetRequest, Messages::DoKeyGetReply, args)
949
+ end
950
+ # Swap primary and secondary session keys for a specific peer
951
+ #--
952
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
953
+ def do_key_swap(**args)
954
+ exchange_message(:"do", Messages::DoKeySwapRequest, nil, args)
955
+ end
956
+ # Delete cipher key for a specific peer
957
+ #--
958
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
959
+ def do_key_del(**args)
960
+ exchange_message(:"do", Messages::DoKeyDelRequest, nil, args)
961
+ end
962
+ end