nl-linux 0.4.1 → 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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/NLSPEC_VERSION +1 -1
  4. data/generated/nl/linux/binder.rb +103 -187
  5. data/generated/nl/linux/conntrack.rb +1053 -1649
  6. data/generated/nl/linux/dev_energymodel.rb +303 -265
  7. data/generated/nl/linux/devlink.rb +4904 -5576
  8. data/generated/nl/linux/dpll.rb +1097 -1467
  9. data/generated/nl/linux/drm_ras.rb +235 -195
  10. data/generated/nl/linux/ethtool.rb +6652 -7415
  11. data/generated/nl/linux/fou.rb +234 -255
  12. data/generated/nl/linux/handshake.rb +208 -280
  13. data/generated/nl/linux/lockd.rb +99 -73
  14. data/generated/nl/linux/mptcp_pm.rb +589 -687
  15. data/generated/nl/linux/net_shaper.rb +520 -615
  16. data/generated/nl/linux/netdev.rb +1640 -1987
  17. data/generated/nl/linux/nfsd.rb +1341 -1215
  18. data/generated/nl/linux/nftables.rb +5143 -4870
  19. data/generated/nl/linux/nl80211.rb +2542 -6316
  20. data/generated/nl/linux/nlctrl.rb +338 -483
  21. data/generated/nl/linux/ovpn.rb +1006 -1522
  22. data/generated/nl/linux/ovs_datapath.rb +291 -186
  23. data/generated/nl/linux/ovs_flow.rb +1393 -2065
  24. data/generated/nl/linux/ovs_packet.rb +186 -223
  25. data/generated/nl/linux/ovs_vport.rb +328 -285
  26. data/generated/nl/linux/psp.rb +812 -717
  27. data/generated/nl/linux/rt_addr.rb +513 -243
  28. data/generated/nl/linux/rt_link.rb +4504 -7238
  29. data/generated/nl/linux/rt_neigh.rb +935 -847
  30. data/generated/nl/linux/rt_route.rb +1198 -871
  31. data/generated/nl/linux/rt_rule.rb +680 -659
  32. data/generated/nl/linux/sunrpc_cache.rb +323 -321
  33. data/generated/nl/linux/tc.rb +9058 -10454
  34. data/generated/nl/linux/tcp_metrics.rb +258 -367
  35. data/generated/nl/linux/team.rb +327 -345
  36. data/generated/nl/linux/wireguard.rb +270 -434
  37. data/lib/nl/linux/nlctrl_resolver.rb +1 -1
  38. data/lib/nl/linux/version.rb +1 -1
  39. data/linux/conntrack.yaml +18 -3
  40. data/linux/devlink.yaml +26 -4
  41. data/linux/dpll.yaml +19 -0
  42. data/linux/netdev.yaml +21 -0
  43. data/linux/nfsd.yaml +111 -0
  44. data/linux/nl80211.yaml +2 -2
  45. data/linux/rt-addr.yaml +4 -0
  46. data/linux/rt-link.yaml +7 -0
  47. data/linux/rt-neigh.yaml +3 -0
  48. data/linux/rt-route.yaml +83 -2
  49. data/sig/generated/nl/linux/binder.rbs +77 -220
  50. data/sig/generated/nl/linux/conntrack.rbs +770 -1954
  51. data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
  52. data/sig/generated/nl/linux/devlink.rbs +3318 -6068
  53. data/sig/generated/nl/linux/dpll.rbs +791 -1589
  54. data/sig/generated/nl/linux/drm_ras.rbs +160 -208
  55. data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
  56. data/sig/generated/nl/linux/fou.rbs +139 -254
  57. data/sig/generated/nl/linux/handshake.rbs +144 -319
  58. data/sig/generated/nl/linux/lockd.rbs +64 -74
  59. data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
  60. data/sig/generated/nl/linux/net_shaper.rbs +351 -644
  61. data/sig/generated/nl/linux/netdev.rbs +1151 -2146
  62. data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
  63. data/sig/generated/nl/linux/nftables.rbs +2907 -5030
  64. data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
  65. data/sig/generated/nl/linux/nlctrl.rbs +220 -544
  66. data/sig/generated/nl/linux/ovpn.rbs +835 -1859
  67. data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
  68. data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
  69. data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
  70. data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
  71. data/sig/generated/nl/linux/psp.rbs +550 -741
  72. data/sig/generated/nl/linux/rt_addr.rbs +188 -226
  73. data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
  74. data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
  75. data/sig/generated/nl/linux/rt_route.rbs +632 -862
  76. data/sig/generated/nl/linux/rt_rule.rbs +217 -639
  77. data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
  78. data/sig/generated/nl/linux/tc.rbs +6199 -13391
  79. data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
  80. data/sig/generated/nl/linux/team.rbs +232 -391
  81. data/sig/generated/nl/linux/wireguard.rbs +197 -502
  82. 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/ovpn.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/ovpn.yaml from Linux v7.3.
4
4
  #
5
5
  # Original YNL comment:
6
6
  #
@@ -34,7 +34,7 @@ class Ovpn < ::Nl::Genl::Family
34
34
  super
35
35
  end
36
36
  # @private
37
- MCAST_GROUPS = Ractor.make_shareable({:"peers" => ::Nl::McastGroup.new("peers", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
37
+ MCAST_GROUPS = {:"peers" => ::Nl::McastGroup.new("peers", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
38
38
  module Constants
39
39
  NONCE_TAIL_SIZE = 8
40
40
  end
@@ -60,1774 +60,1258 @@ class Ovpn < ::Nl::Genl::Family
60
60
  end
61
61
  module AttributeSets
62
62
  class Peer < ::Nl::AttributeSet
63
- # Abstract class
64
- class Attribute < ::Nl::AttributeSet::Attribute
65
- end
66
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
67
- class Id < Attribute
68
- TYPE = 1
69
- NAME = :"id"
70
- # @private
71
- ORDER = 0
72
- # @private
73
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
74
- end
75
- # The remote IPv4 address of the peer
76
- class RemoteIpv4 < Attribute
77
- TYPE = 2
78
- NAME = :"remote_ipv4"
79
- # @private
80
- ORDER = 1
81
- # @private
82
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
83
- end
84
- # The remote IPv6 address of the peer
85
- class RemoteIpv6 < Attribute
86
- TYPE = 3
87
- NAME = :"remote_ipv6"
88
- # @private
89
- ORDER = 2
90
- # @private
91
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
92
- end
93
- # The scope id of the remote IPv6 address of the peer (RFC2553)
94
- class RemoteIpv6ScopeId < Attribute
95
- TYPE = 4
96
- NAME = :"remote_ipv6_scope_id"
97
- # @private
98
- ORDER = 3
99
- # @private
100
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
101
- end
102
- # The remote port of the peer
103
- class RemotePort < Attribute
104
- TYPE = 5
105
- NAME = :"remote_port"
106
- # @private
107
- ORDER = 4
108
- # @private
109
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
110
- end
111
- # The socket to be used to communicate with the peer
112
- class Socket < Attribute
113
- TYPE = 6
114
- NAME = :"socket"
115
- # @private
116
- ORDER = 5
117
- # @private
118
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
119
- end
120
- # The ID of the netns the socket assigned to this peer lives in
121
- class SocketNetnsid < Attribute
122
- TYPE = 7
123
- NAME = :"socket_netnsid"
124
- # @private
125
- ORDER = 6
126
- # @private
127
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
128
- end
129
- # The IPv4 address assigned to the peer by the server
130
- class VpnIpv4 < Attribute
131
- TYPE = 8
132
- NAME = :"vpn_ipv4"
133
- # @private
134
- ORDER = 7
135
- # @private
136
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
137
- end
138
- # The IPv6 address assigned to the peer by the server
139
- class VpnIpv6 < Attribute
140
- TYPE = 9
141
- NAME = :"vpn_ipv6"
142
- # @private
143
- ORDER = 8
144
- # @private
145
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
146
- end
147
- # The local IPv4 to be used to send packets to the peer (UDP only)
148
- class LocalIpv4 < Attribute
149
- TYPE = 10
150
- NAME = :"local_ipv4"
151
- # @private
152
- ORDER = 9
153
- # @private
154
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
155
- end
156
- # The local IPv6 to be used to send packets to the peer (UDP only)
157
- class LocalIpv6 < Attribute
158
- TYPE = 11
159
- NAME = :"local_ipv6"
160
- # @private
161
- ORDER = 10
162
- # @private
163
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
164
- end
165
- # The local port to be used to send packets to the peer (UDP only)
166
- class LocalPort < Attribute
167
- TYPE = 12
168
- NAME = :"local_port"
169
- # @private
170
- ORDER = 11
171
- # @private
172
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
173
- end
174
- # The number of seconds after which a keep alive message is sent to the peer
175
- class KeepaliveInterval < Attribute
176
- TYPE = 13
177
- NAME = :"keepalive_interval"
178
- # @private
179
- ORDER = 12
180
- # @private
181
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
182
- end
183
- # The number of seconds from the last activity after which the peer is assumed dead
184
- class KeepaliveTimeout < Attribute
185
- TYPE = 14
186
- NAME = :"keepalive_timeout"
187
- # @private
188
- ORDER = 13
189
- # @private
190
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
191
- end
192
- # The reason why a peer was deleted
193
- #
194
- # Known enum values are defined in {Enums::DelPeerReason}.
195
- class DelReason < Attribute
196
- TYPE = 15
197
- NAME = :"del_reason"
198
- # @private
199
- ORDER = 14
200
- # @private
201
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
202
- end
203
- # Number of bytes received over the tunnel
204
- class VpnRxBytes < Attribute
205
- TYPE = 16
206
- NAME = :"vpn_rx_bytes"
207
- # @private
208
- ORDER = 15
209
- # @private
210
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
211
- end
212
- # Number of bytes transmitted over the tunnel
213
- class VpnTxBytes < Attribute
214
- TYPE = 17
215
- NAME = :"vpn_tx_bytes"
216
- # @private
217
- ORDER = 16
218
- # @private
219
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
220
- end
221
- # Number of packets received over the tunnel
222
- class VpnRxPackets < Attribute
223
- TYPE = 18
224
- NAME = :"vpn_rx_packets"
225
- # @private
226
- ORDER = 17
227
- # @private
228
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
229
- end
230
- # Number of packets transmitted over the tunnel
231
- class VpnTxPackets < Attribute
232
- TYPE = 19
233
- NAME = :"vpn_tx_packets"
234
- # @private
235
- ORDER = 18
236
- # @private
237
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
238
- end
239
- # Number of bytes received at the transport level
240
- class LinkRxBytes < Attribute
241
- TYPE = 20
242
- NAME = :"link_rx_bytes"
243
- # @private
244
- ORDER = 19
245
- # @private
246
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
247
- end
248
- # Number of bytes transmitted at the transport level
249
- class LinkTxBytes < Attribute
250
- TYPE = 21
251
- NAME = :"link_tx_bytes"
252
- # @private
253
- ORDER = 20
254
- # @private
255
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
256
- end
257
- # Number of packets received at the transport level
258
- class LinkRxPackets < Attribute
259
- TYPE = 22
260
- NAME = :"link_rx_packets"
261
- # @private
262
- ORDER = 21
263
- # @private
264
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
265
- end
266
- # Number of packets transmitted at the transport level
267
- class LinkTxPackets < Attribute
268
- TYPE = 23
269
- NAME = :"link_tx_packets"
270
- # @private
271
- ORDER = 22
272
- # @private
273
- DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
274
- end
275
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
276
- class TxId < Attribute
277
- TYPE = 24
278
- NAME = :"tx_id"
279
- # @private
280
- ORDER = 23
281
- # @private
282
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
283
- end
284
- # @private
285
- 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, :"tx_id" => TxId}) #: Hash[::Symbol, Attribute]
286
- # @private
287
- 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, 24 => TxId}) #: Hash[::Integer, Attribute]
288
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
289
- # @rbs return: ::Integer
290
- # @return [Integer]
291
- # @see Id
292
- def id; self[:"id"]&.value; end
293
- # The remote IPv4 address of the peer
294
- # @rbs return: ::Integer
295
- # @return [Integer]
296
- # @see RemoteIpv4
297
- def remote_ipv4; self[:"remote_ipv4"]&.value; end
298
- # The remote IPv6 address of the peer
299
- # @rbs return: ::String
300
- # @return [String]
301
- # @see RemoteIpv6
302
- def remote_ipv6; self[:"remote_ipv6"]&.value; end
303
- # The scope id of the remote IPv6 address of the peer (RFC2553)
304
- # @rbs return: ::Integer
305
- # @return [Integer]
306
- # @see RemoteIpv6ScopeId
307
- def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]&.value; end
308
- # The remote port of the peer
309
- # @rbs return: ::Integer
310
- # @return [Integer]
311
- # @see RemotePort
312
- def remote_port; self[:"remote_port"]&.value; end
313
- # The socket to be used to communicate with the peer
314
- # @rbs return: ::Integer
315
- # @return [Integer]
316
- # @see Socket
317
- def socket; self[:"socket"]&.value; end
318
- # The ID of the netns the socket assigned to this peer lives in
319
- # @rbs return: ::Integer
320
- # @return [Integer]
321
- # @see SocketNetnsid
322
- def socket_netnsid; self[:"socket_netnsid"]&.value; end
323
- # The IPv4 address assigned to the peer by the server
324
- # @rbs return: ::Integer
325
- # @return [Integer]
326
- # @see VpnIpv4
327
- def vpn_ipv4; self[:"vpn_ipv4"]&.value; end
328
- # The IPv6 address assigned to the peer by the server
329
- # @rbs return: ::String
330
- # @return [String]
331
- # @see VpnIpv6
332
- def vpn_ipv6; self[:"vpn_ipv6"]&.value; end
333
- # The local IPv4 to be used to send packets to the peer (UDP only)
334
- # @rbs return: ::Integer
335
- # @return [Integer]
336
- # @see LocalIpv4
337
- def local_ipv4; self[:"local_ipv4"]&.value; end
338
- # The local IPv6 to be used to send packets to the peer (UDP only)
339
- # @rbs return: ::String
340
- # @return [String]
341
- # @see LocalIpv6
342
- def local_ipv6; self[:"local_ipv6"]&.value; end
343
- # The local port to be used to send packets to the peer (UDP only)
344
- # @rbs return: ::Integer
345
- # @return [Integer]
346
- # @see LocalPort
347
- def local_port; self[:"local_port"]&.value; end
348
- # The number of seconds after which a keep alive message is sent to the peer
349
- # @rbs return: ::Integer
350
- # @return [Integer]
351
- # @see KeepaliveInterval
352
- def keepalive_interval; self[:"keepalive_interval"]&.value; end
353
- # The number of seconds from the last activity after which the peer is assumed dead
354
- # @rbs return: ::Integer
355
- # @return [Integer]
356
- # @see KeepaliveTimeout
357
- def keepalive_timeout; self[:"keepalive_timeout"]&.value; end
358
- # The reason why a peer was deleted
359
- #
360
- # Known enum values are defined in {Enums::DelPeerReason}.
361
- # @rbs return: ::Integer
362
- # @return [Integer]
363
- # @see DelReason
364
- def del_reason; self[:"del_reason"]&.value; end
365
- # Number of bytes received over the tunnel
366
- # @rbs return: ::Integer
367
- # @return [Integer]
368
- # @see VpnRxBytes
369
- def vpn_rx_bytes; self[:"vpn_rx_bytes"]&.value; end
370
- # Number of bytes transmitted over the tunnel
371
- # @rbs return: ::Integer
372
- # @return [Integer]
373
- # @see VpnTxBytes
374
- def vpn_tx_bytes; self[:"vpn_tx_bytes"]&.value; end
375
- # Number of packets received over the tunnel
376
- # @rbs return: ::Integer
377
- # @return [Integer]
378
- # @see VpnRxPackets
379
- def vpn_rx_packets; self[:"vpn_rx_packets"]&.value; end
380
- # Number of packets transmitted over the tunnel
381
- # @rbs return: ::Integer
382
- # @return [Integer]
383
- # @see VpnTxPackets
384
- def vpn_tx_packets; self[:"vpn_tx_packets"]&.value; end
385
- # Number of bytes received at the transport level
386
- # @rbs return: ::Integer
387
- # @return [Integer]
388
- # @see LinkRxBytes
389
- def link_rx_bytes; self[:"link_rx_bytes"]&.value; end
390
- # Number of bytes transmitted at the transport level
391
- # @rbs return: ::Integer
392
- # @return [Integer]
393
- # @see LinkTxBytes
394
- def link_tx_bytes; self[:"link_tx_bytes"]&.value; end
395
- # Number of packets received at the transport level
396
- # @rbs return: ::Integer
397
- # @return [Integer]
398
- # @see LinkRxPackets
399
- def link_rx_packets; self[:"link_rx_packets"]&.value; end
400
- # Number of packets transmitted at the transport level
401
- # @rbs return: ::Integer
402
- # @return [Integer]
403
- # @see LinkTxPackets
404
- def link_tx_packets; self[:"link_tx_packets"]&.value; end
405
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
406
- # @rbs return: ::Integer
407
- # @return [Integer]
408
- # @see TxId
409
- def tx_id; self[:"tx_id"]&.value; end
410
- class << self
411
- # Looks up Attribute class by name.
412
- # @rbs name: Symbol
413
- # @rbs return: Attribute
414
- # @param [Symbol] name
415
- # @return [Attribute]
416
- def by_name(name); BY_NAME.fetch(name); end
417
- # Looks up Attribute class by type value.
418
- # @rbs type: Integer
419
- # @rbs return: Attribute
420
- # @param [Integer] type
421
- # @return [Attribute]
422
- def by_type(type); BY_TYPE.fetch(type); end
63
+ module Definitions
64
+ # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
65
+ # @rbs return: ::Integer
66
+ # @return [Integer]
67
+ def id; self[:"id"]; end
68
+ # The remote IPv4 address of the peer
69
+ # @rbs return: ::Integer
70
+ # @return [Integer]
71
+ def remote_ipv4; self[:"remote_ipv4"]; end
72
+ # The remote IPv6 address of the peer
73
+ # @rbs return: ::String
74
+ # @return [String]
75
+ def remote_ipv6; self[:"remote_ipv6"]; end
76
+ # The scope id of the remote IPv6 address of the peer (RFC2553)
77
+ # @rbs return: ::Integer
78
+ # @return [Integer]
79
+ def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]; end
80
+ # The remote port of the peer
81
+ # @rbs return: ::Integer
82
+ # @return [Integer]
83
+ def remote_port; self[:"remote_port"]; end
84
+ # The socket to be used to communicate with the peer
85
+ # @rbs return: ::Integer
86
+ # @return [Integer]
87
+ def socket; self[:"socket"]; end
88
+ # The ID of the netns the socket assigned to this peer lives in
89
+ # @rbs return: ::Integer
90
+ # @return [Integer]
91
+ def socket_netnsid; self[:"socket_netnsid"]; end
92
+ # The IPv4 address assigned to the peer by the server
93
+ # @rbs return: ::Integer
94
+ # @return [Integer]
95
+ def vpn_ipv4; self[:"vpn_ipv4"]; end
96
+ # The IPv6 address assigned to the peer by the server
97
+ # @rbs return: ::String
98
+ # @return [String]
99
+ def vpn_ipv6; self[:"vpn_ipv6"]; end
100
+ # The local IPv4 to be used to send packets to the peer (UDP only)
101
+ # @rbs return: ::Integer
102
+ # @return [Integer]
103
+ def local_ipv4; self[:"local_ipv4"]; end
104
+ # The local IPv6 to be used to send packets to the peer (UDP only)
105
+ # @rbs return: ::String
106
+ # @return [String]
107
+ def local_ipv6; self[:"local_ipv6"]; end
108
+ # The local port to be used to send packets to the peer (UDP only)
109
+ # @rbs return: ::Integer
110
+ # @return [Integer]
111
+ def local_port; self[:"local_port"]; end
112
+ # The number of seconds after which a keep alive message is sent to the peer
113
+ # @rbs return: ::Integer
114
+ # @return [Integer]
115
+ def keepalive_interval; self[:"keepalive_interval"]; end
116
+ # The number of seconds from the last activity after which the peer is assumed dead
117
+ # @rbs return: ::Integer
118
+ # @return [Integer]
119
+ def keepalive_timeout; self[:"keepalive_timeout"]; end
120
+ # The reason why a peer was deleted
121
+ #
122
+ # Known enum values are defined in {Enums::DelPeerReason}.
123
+ # @rbs return: ::Integer
124
+ # @return [Integer]
125
+ def del_reason; self[:"del_reason"]; end
126
+ # Number of bytes received over the tunnel
127
+ # @rbs return: ::Integer
128
+ # @return [Integer]
129
+ def vpn_rx_bytes; self[:"vpn_rx_bytes"]; end
130
+ # Number of bytes transmitted over the tunnel
131
+ # @rbs return: ::Integer
132
+ # @return [Integer]
133
+ def vpn_tx_bytes; self[:"vpn_tx_bytes"]; end
134
+ # Number of packets received over the tunnel
135
+ # @rbs return: ::Integer
136
+ # @return [Integer]
137
+ def vpn_rx_packets; self[:"vpn_rx_packets"]; end
138
+ # Number of packets transmitted over the tunnel
139
+ # @rbs return: ::Integer
140
+ # @return [Integer]
141
+ def vpn_tx_packets; self[:"vpn_tx_packets"]; end
142
+ # Number of bytes received at the transport level
143
+ # @rbs return: ::Integer
144
+ # @return [Integer]
145
+ def link_rx_bytes; self[:"link_rx_bytes"]; end
146
+ # Number of bytes transmitted at the transport level
147
+ # @rbs return: ::Integer
148
+ # @return [Integer]
149
+ def link_tx_bytes; self[:"link_tx_bytes"]; end
150
+ # Number of packets received at the transport level
151
+ # @rbs return: ::Integer
152
+ # @return [Integer]
153
+ def link_rx_packets; self[:"link_rx_packets"]; end
154
+ # Number of packets transmitted at the transport level
155
+ # @rbs return: ::Integer
156
+ # @return [Integer]
157
+ def link_tx_packets; self[:"link_tx_packets"]; end
158
+ # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
159
+ # @rbs return: ::Integer
160
+ # @return [Integer]
161
+ def tx_id; self[:"tx_id"]; end
162
+ end
163
+ include Definitions
164
+ # Decodes attributes from the decoder into a new attribute set.
165
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
166
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
167
+ super(decoder, BY_TYPE, 0, external_selectors)
423
168
  end
424
169
  end
425
170
  class PeerNewInput < ::Nl::AttributeSet
426
- # Abstract class
427
- class Attribute < ::Nl::AttributeSet::Attribute
428
- end
429
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
430
- class Id < Attribute
431
- TYPE = 1
432
- NAME = :"id"
433
- # @private
434
- ORDER = 0
435
- # @private
436
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
437
- end
438
- # The remote IPv4 address of the peer
439
- class RemoteIpv4 < Attribute
440
- TYPE = 2
441
- NAME = :"remote_ipv4"
442
- # @private
443
- ORDER = 1
444
- # @private
445
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
446
- end
447
- # The remote IPv6 address of the peer
448
- class RemoteIpv6 < Attribute
449
- TYPE = 3
450
- NAME = :"remote_ipv6"
451
- # @private
452
- ORDER = 2
453
- # @private
454
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
455
- end
456
- # The scope id of the remote IPv6 address of the peer (RFC2553)
457
- class RemoteIpv6ScopeId < Attribute
458
- TYPE = 4
459
- NAME = :"remote_ipv6_scope_id"
460
- # @private
461
- ORDER = 3
462
- # @private
463
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
464
- end
465
- # The remote port of the peer
466
- class RemotePort < Attribute
467
- TYPE = 5
468
- NAME = :"remote_port"
469
- # @private
470
- ORDER = 4
471
- # @private
472
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
473
- end
474
- # The socket to be used to communicate with the peer
475
- class Socket < Attribute
476
- TYPE = 6
477
- NAME = :"socket"
478
- # @private
479
- ORDER = 5
480
- # @private
481
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
482
- end
483
- # The IPv4 address assigned to the peer by the server
484
- class VpnIpv4 < Attribute
485
- TYPE = 8
486
- NAME = :"vpn_ipv4"
487
- # @private
488
- ORDER = 6
489
- # @private
490
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
491
- end
492
- # The IPv6 address assigned to the peer by the server
493
- class VpnIpv6 < Attribute
494
- TYPE = 9
495
- NAME = :"vpn_ipv6"
496
- # @private
497
- ORDER = 7
498
- # @private
499
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
500
- end
501
- # The local IPv4 to be used to send packets to the peer (UDP only)
502
- class LocalIpv4 < Attribute
503
- TYPE = 10
504
- NAME = :"local_ipv4"
505
- # @private
506
- ORDER = 8
507
- # @private
508
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
509
- end
510
- # The local IPv6 to be used to send packets to the peer (UDP only)
511
- class LocalIpv6 < Attribute
512
- TYPE = 11
513
- NAME = :"local_ipv6"
514
- # @private
515
- ORDER = 9
516
- # @private
517
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
518
- end
519
- # The number of seconds after which a keep alive message is sent to the peer
520
- class KeepaliveInterval < Attribute
521
- TYPE = 13
522
- NAME = :"keepalive_interval"
523
- # @private
524
- ORDER = 10
525
- # @private
526
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
527
- end
528
- # The number of seconds from the last activity after which the peer is assumed dead
529
- class KeepaliveTimeout < Attribute
530
- TYPE = 14
531
- NAME = :"keepalive_timeout"
532
- # @private
533
- ORDER = 11
534
- # @private
535
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
536
- end
537
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
538
- class TxId < Attribute
539
- TYPE = 24
540
- NAME = :"tx_id"
541
- # @private
542
- ORDER = 12
543
- # @private
544
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
545
- end
546
- # @private
547
- 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, :"tx_id" => TxId}) #: Hash[::Symbol, Attribute]
548
- # @private
549
- 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, 24 => TxId}) #: Hash[::Integer, Attribute]
550
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
551
- # @rbs return: ::Integer
552
- # @return [Integer]
553
- # @see Id
554
- def id; self[:"id"]&.value; end
555
- # The remote IPv4 address of the peer
556
- # @rbs return: ::Integer
557
- # @return [Integer]
558
- # @see RemoteIpv4
559
- def remote_ipv4; self[:"remote_ipv4"]&.value; end
560
- # The remote IPv6 address of the peer
561
- # @rbs return: ::String
562
- # @return [String]
563
- # @see RemoteIpv6
564
- def remote_ipv6; self[:"remote_ipv6"]&.value; end
565
- # The scope id of the remote IPv6 address of the peer (RFC2553)
566
- # @rbs return: ::Integer
567
- # @return [Integer]
568
- # @see RemoteIpv6ScopeId
569
- def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]&.value; end
570
- # The remote port of the peer
571
- # @rbs return: ::Integer
572
- # @return [Integer]
573
- # @see RemotePort
574
- def remote_port; self[:"remote_port"]&.value; end
575
- # The socket to be used to communicate with the peer
576
- # @rbs return: ::Integer
577
- # @return [Integer]
578
- # @see Socket
579
- def socket; self[:"socket"]&.value; end
580
- # The IPv4 address assigned to the peer by the server
581
- # @rbs return: ::Integer
582
- # @return [Integer]
583
- # @see VpnIpv4
584
- def vpn_ipv4; self[:"vpn_ipv4"]&.value; end
585
- # The IPv6 address assigned to the peer by the server
586
- # @rbs return: ::String
587
- # @return [String]
588
- # @see VpnIpv6
589
- def vpn_ipv6; self[:"vpn_ipv6"]&.value; end
590
- # The local IPv4 to be used to send packets to the peer (UDP only)
591
- # @rbs return: ::Integer
592
- # @return [Integer]
593
- # @see LocalIpv4
594
- def local_ipv4; self[:"local_ipv4"]&.value; end
595
- # The local IPv6 to be used to send packets to the peer (UDP only)
596
- # @rbs return: ::String
597
- # @return [String]
598
- # @see LocalIpv6
599
- def local_ipv6; self[:"local_ipv6"]&.value; end
600
- # The number of seconds after which a keep alive message is sent to the peer
601
- # @rbs return: ::Integer
602
- # @return [Integer]
603
- # @see KeepaliveInterval
604
- def keepalive_interval; self[:"keepalive_interval"]&.value; end
605
- # The number of seconds from the last activity after which the peer is assumed dead
606
- # @rbs return: ::Integer
607
- # @return [Integer]
608
- # @see KeepaliveTimeout
609
- def keepalive_timeout; self[:"keepalive_timeout"]&.value; end
610
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
611
- # @rbs return: ::Integer
612
- # @return [Integer]
613
- # @see TxId
614
- def tx_id; self[:"tx_id"]&.value; end
615
- class << self
616
- # Looks up Attribute class by name.
617
- # @rbs name: Symbol
618
- # @rbs return: Attribute
619
- # @param [Symbol] name
620
- # @return [Attribute]
621
- def by_name(name); BY_NAME.fetch(name); end
622
- # Looks up Attribute class by type value.
623
- # @rbs type: Integer
624
- # @rbs return: Attribute
625
- # @param [Integer] type
626
- # @return [Attribute]
627
- def by_type(type); BY_TYPE.fetch(type); end
171
+ module Definitions
172
+ # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
173
+ # @rbs return: ::Integer
174
+ # @return [Integer]
175
+ def id; self[:"id"]; end
176
+ # The remote IPv4 address of the peer
177
+ # @rbs return: ::Integer
178
+ # @return [Integer]
179
+ def remote_ipv4; self[:"remote_ipv4"]; end
180
+ # The remote IPv6 address of the peer
181
+ # @rbs return: ::String
182
+ # @return [String]
183
+ def remote_ipv6; self[:"remote_ipv6"]; end
184
+ # The scope id of the remote IPv6 address of the peer (RFC2553)
185
+ # @rbs return: ::Integer
186
+ # @return [Integer]
187
+ def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]; end
188
+ # The remote port of the peer
189
+ # @rbs return: ::Integer
190
+ # @return [Integer]
191
+ def remote_port; self[:"remote_port"]; end
192
+ # The socket to be used to communicate with the peer
193
+ # @rbs return: ::Integer
194
+ # @return [Integer]
195
+ def socket; self[:"socket"]; end
196
+ # The IPv4 address assigned to the peer by the server
197
+ # @rbs return: ::Integer
198
+ # @return [Integer]
199
+ def vpn_ipv4; self[:"vpn_ipv4"]; end
200
+ # The IPv6 address assigned to the peer by the server
201
+ # @rbs return: ::String
202
+ # @return [String]
203
+ def vpn_ipv6; self[:"vpn_ipv6"]; end
204
+ # The local IPv4 to be used to send packets to the peer (UDP only)
205
+ # @rbs return: ::Integer
206
+ # @return [Integer]
207
+ def local_ipv4; self[:"local_ipv4"]; end
208
+ # The local IPv6 to be used to send packets to the peer (UDP only)
209
+ # @rbs return: ::String
210
+ # @return [String]
211
+ def local_ipv6; self[:"local_ipv6"]; end
212
+ # The number of seconds after which a keep alive message is sent to the peer
213
+ # @rbs return: ::Integer
214
+ # @return [Integer]
215
+ def keepalive_interval; self[:"keepalive_interval"]; end
216
+ # The number of seconds from the last activity after which the peer is assumed dead
217
+ # @rbs return: ::Integer
218
+ # @return [Integer]
219
+ def keepalive_timeout; self[:"keepalive_timeout"]; end
220
+ # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
221
+ # @rbs return: ::Integer
222
+ # @return [Integer]
223
+ def tx_id; self[:"tx_id"]; end
224
+ end
225
+ include Definitions
226
+ # Decodes attributes from the decoder into a new attribute set.
227
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
228
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
229
+ super(decoder, BY_TYPE, 0, external_selectors)
628
230
  end
629
231
  end
630
232
  class PeerSetInput < ::Nl::AttributeSet
631
- # Abstract class
632
- class Attribute < ::Nl::AttributeSet::Attribute
633
- end
634
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
635
- class Id < Attribute
636
- TYPE = 1
637
- NAME = :"id"
638
- # @private
639
- ORDER = 0
640
- # @private
641
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
642
- end
643
- # The remote IPv4 address of the peer
644
- class RemoteIpv4 < Attribute
645
- TYPE = 2
646
- NAME = :"remote_ipv4"
647
- # @private
648
- ORDER = 1
649
- # @private
650
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
651
- end
652
- # The remote IPv6 address of the peer
653
- class RemoteIpv6 < Attribute
654
- TYPE = 3
655
- NAME = :"remote_ipv6"
656
- # @private
657
- ORDER = 2
658
- # @private
659
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
660
- end
661
- # The scope id of the remote IPv6 address of the peer (RFC2553)
662
- class RemoteIpv6ScopeId < Attribute
663
- TYPE = 4
664
- NAME = :"remote_ipv6_scope_id"
665
- # @private
666
- ORDER = 3
667
- # @private
668
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
669
- end
670
- # The remote port of the peer
671
- class RemotePort < Attribute
672
- TYPE = 5
673
- NAME = :"remote_port"
674
- # @private
675
- ORDER = 4
676
- # @private
677
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
678
- end
679
- # The IPv4 address assigned to the peer by the server
680
- class VpnIpv4 < Attribute
681
- TYPE = 8
682
- NAME = :"vpn_ipv4"
683
- # @private
684
- ORDER = 5
685
- # @private
686
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
687
- end
688
- # The IPv6 address assigned to the peer by the server
689
- class VpnIpv6 < Attribute
690
- TYPE = 9
691
- NAME = :"vpn_ipv6"
692
- # @private
693
- ORDER = 6
694
- # @private
695
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
696
- end
697
- # The local IPv4 to be used to send packets to the peer (UDP only)
698
- class LocalIpv4 < Attribute
699
- TYPE = 10
700
- NAME = :"local_ipv4"
701
- # @private
702
- ORDER = 7
703
- # @private
704
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
705
- end
706
- # The local IPv6 to be used to send packets to the peer (UDP only)
707
- class LocalIpv6 < Attribute
708
- TYPE = 11
709
- NAME = :"local_ipv6"
710
- # @private
711
- ORDER = 8
712
- # @private
713
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
714
- end
715
- # The number of seconds after which a keep alive message is sent to the peer
716
- class KeepaliveInterval < Attribute
717
- TYPE = 13
718
- NAME = :"keepalive_interval"
719
- # @private
720
- ORDER = 9
721
- # @private
722
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
723
- end
724
- # The number of seconds from the last activity after which the peer is assumed dead
725
- class KeepaliveTimeout < Attribute
726
- TYPE = 14
727
- NAME = :"keepalive_timeout"
728
- # @private
729
- ORDER = 10
730
- # @private
731
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400" unless it <= 86400 })
732
- end
733
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
734
- class TxId < Attribute
735
- TYPE = 24
736
- NAME = :"tx_id"
737
- # @private
738
- ORDER = 11
739
- # @private
740
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
741
- end
742
- # @private
743
- 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, :"tx_id" => TxId}) #: Hash[::Symbol, Attribute]
744
- # @private
745
- 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, 24 => TxId}) #: Hash[::Integer, Attribute]
746
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
747
- # @rbs return: ::Integer
748
- # @return [Integer]
749
- # @see Id
750
- def id; self[:"id"]&.value; end
751
- # The remote IPv4 address of the peer
752
- # @rbs return: ::Integer
753
- # @return [Integer]
754
- # @see RemoteIpv4
755
- def remote_ipv4; self[:"remote_ipv4"]&.value; end
756
- # The remote IPv6 address of the peer
757
- # @rbs return: ::String
758
- # @return [String]
759
- # @see RemoteIpv6
760
- def remote_ipv6; self[:"remote_ipv6"]&.value; end
761
- # The scope id of the remote IPv6 address of the peer (RFC2553)
762
- # @rbs return: ::Integer
763
- # @return [Integer]
764
- # @see RemoteIpv6ScopeId
765
- def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]&.value; end
766
- # The remote port of the peer
767
- # @rbs return: ::Integer
768
- # @return [Integer]
769
- # @see RemotePort
770
- def remote_port; self[:"remote_port"]&.value; end
771
- # The IPv4 address assigned to the peer by the server
772
- # @rbs return: ::Integer
773
- # @return [Integer]
774
- # @see VpnIpv4
775
- def vpn_ipv4; self[:"vpn_ipv4"]&.value; end
776
- # The IPv6 address assigned to the peer by the server
777
- # @rbs return: ::String
778
- # @return [String]
779
- # @see VpnIpv6
780
- def vpn_ipv6; self[:"vpn_ipv6"]&.value; end
781
- # The local IPv4 to be used to send packets to the peer (UDP only)
782
- # @rbs return: ::Integer
783
- # @return [Integer]
784
- # @see LocalIpv4
785
- def local_ipv4; self[:"local_ipv4"]&.value; end
786
- # The local IPv6 to be used to send packets to the peer (UDP only)
787
- # @rbs return: ::String
788
- # @return [String]
789
- # @see LocalIpv6
790
- def local_ipv6; self[:"local_ipv6"]&.value; end
791
- # The number of seconds after which a keep alive message is sent to the peer
792
- # @rbs return: ::Integer
793
- # @return [Integer]
794
- # @see KeepaliveInterval
795
- def keepalive_interval; self[:"keepalive_interval"]&.value; end
796
- # The number of seconds from the last activity after which the peer is assumed dead
797
- # @rbs return: ::Integer
798
- # @return [Integer]
799
- # @see KeepaliveTimeout
800
- def keepalive_timeout; self[:"keepalive_timeout"]&.value; end
801
- # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
802
- # @rbs return: ::Integer
803
- # @return [Integer]
804
- # @see TxId
805
- def tx_id; self[:"tx_id"]&.value; end
806
- class << self
807
- # Looks up Attribute class by name.
808
- # @rbs name: Symbol
809
- # @rbs return: Attribute
810
- # @param [Symbol] name
811
- # @return [Attribute]
812
- def by_name(name); BY_NAME.fetch(name); end
813
- # Looks up Attribute class by type value.
814
- # @rbs type: Integer
815
- # @rbs return: Attribute
816
- # @param [Integer] type
817
- # @return [Attribute]
818
- def by_type(type); BY_TYPE.fetch(type); end
233
+ module Definitions
234
+ # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
235
+ # @rbs return: ::Integer
236
+ # @return [Integer]
237
+ def id; self[:"id"]; end
238
+ # The remote IPv4 address of the peer
239
+ # @rbs return: ::Integer
240
+ # @return [Integer]
241
+ def remote_ipv4; self[:"remote_ipv4"]; end
242
+ # The remote IPv6 address of the peer
243
+ # @rbs return: ::String
244
+ # @return [String]
245
+ def remote_ipv6; self[:"remote_ipv6"]; end
246
+ # The scope id of the remote IPv6 address of the peer (RFC2553)
247
+ # @rbs return: ::Integer
248
+ # @return [Integer]
249
+ def remote_ipv6_scope_id; self[:"remote_ipv6_scope_id"]; end
250
+ # The remote port of the peer
251
+ # @rbs return: ::Integer
252
+ # @return [Integer]
253
+ def remote_port; self[:"remote_port"]; end
254
+ # The IPv4 address assigned to the peer by the server
255
+ # @rbs return: ::Integer
256
+ # @return [Integer]
257
+ def vpn_ipv4; self[:"vpn_ipv4"]; end
258
+ # The IPv6 address assigned to the peer by the server
259
+ # @rbs return: ::String
260
+ # @return [String]
261
+ def vpn_ipv6; self[:"vpn_ipv6"]; end
262
+ # The local IPv4 to be used to send packets to the peer (UDP only)
263
+ # @rbs return: ::Integer
264
+ # @return [Integer]
265
+ def local_ipv4; self[:"local_ipv4"]; end
266
+ # The local IPv6 to be used to send packets to the peer (UDP only)
267
+ # @rbs return: ::String
268
+ # @return [String]
269
+ def local_ipv6; self[:"local_ipv6"]; end
270
+ # The number of seconds after which a keep alive message is sent to the peer
271
+ # @rbs return: ::Integer
272
+ # @return [Integer]
273
+ def keepalive_interval; self[:"keepalive_interval"]; end
274
+ # The number of seconds from the last activity after which the peer is assumed dead
275
+ # @rbs return: ::Integer
276
+ # @return [Integer]
277
+ def keepalive_timeout; self[:"keepalive_timeout"]; end
278
+ # The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.
279
+ # @rbs return: ::Integer
280
+ # @return [Integer]
281
+ def tx_id; self[:"tx_id"]; end
282
+ end
283
+ include Definitions
284
+ # Decodes attributes from the decoder into a new attribute set.
285
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
286
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
287
+ super(decoder, BY_TYPE, 0, external_selectors)
819
288
  end
820
289
  end
821
290
  class PeerDelInput < ::Nl::AttributeSet
822
- # Abstract class
823
- class Attribute < ::Nl::AttributeSet::Attribute
824
- end
825
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
826
- class Id < Attribute
827
- TYPE = 1
828
- NAME = :"id"
829
- # @private
830
- ORDER = 0
831
- # @private
832
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
833
- end
834
- # @private
835
- BY_NAME = Ractor.make_shareable({:"id" => Id}) #: Hash[::Symbol, Attribute]
836
- # @private
837
- BY_TYPE = Ractor.make_shareable({1 => Id}) #: Hash[::Integer, Attribute]
838
- # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
839
- # @rbs return: ::Integer
840
- # @return [Integer]
841
- # @see Id
842
- def id; self[:"id"]&.value; end
843
- class << self
844
- # Looks up Attribute class by name.
845
- # @rbs name: Symbol
846
- # @rbs return: Attribute
847
- # @param [Symbol] name
848
- # @return [Attribute]
849
- def by_name(name); BY_NAME.fetch(name); end
850
- # Looks up Attribute class by type value.
851
- # @rbs type: Integer
852
- # @rbs return: Attribute
853
- # @param [Integer] type
854
- # @return [Attribute]
855
- def by_type(type); BY_TYPE.fetch(type); end
856
- end
857
- end
858
- class Keyconf < ::Nl::AttributeSet
859
- # Abstract class
860
- class Attribute < ::Nl::AttributeSet::Attribute
861
- end
862
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
863
- class PeerId < Attribute
864
- TYPE = 1
865
- NAME = :"peer_id"
866
- # @private
867
- ORDER = 0
868
- # @private
869
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
870
- end
871
- # The slot where the key should be stored
872
- #
873
- # Known enum values are defined in {Enums::KeySlot}.
874
- class Slot < Attribute
875
- TYPE = 2
876
- NAME = :"slot"
877
- # @private
878
- ORDER = 1
879
- # @private
880
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
881
- end
882
- # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
883
- class KeyId < Attribute
884
- TYPE = 3
885
- NAME = :"key_id"
886
- # @private
887
- ORDER = 2
888
- # @private
889
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 7" unless it <= 7 })
890
- end
891
- # The cipher to be used when communicating with the peer
892
- #
893
- # Known enum values are defined in {Enums::CipherAlg}.
894
- class CipherAlg < Attribute
895
- TYPE = 4
896
- NAME = :"cipher_alg"
897
- # @private
898
- ORDER = 3
899
- # @private
900
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
901
- end
902
- # Key material for encrypt direction
903
- class EncryptDir < Attribute
904
- TYPE = 5
905
- NAME = :"encrypt_dir"
906
- # @private
907
- ORDER = 4
908
- end
909
- # Key material for decrypt direction
910
- class DecryptDir < Attribute
911
- TYPE = 6
912
- NAME = :"decrypt_dir"
913
- # @private
914
- ORDER = 5
915
- end
916
- # @private
917
- 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]
918
- # @private
919
- BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot, 3 => KeyId, 4 => CipherAlg, 5 => EncryptDir, 6 => DecryptDir}) #: Hash[::Integer, Attribute]
920
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
921
- # @rbs return: ::Integer
922
- # @return [Integer]
923
- # @see PeerId
924
- def peer_id; self[:"peer_id"]&.value; end
925
- # The slot where the key should be stored
926
- #
927
- # Known enum values are defined in {Enums::KeySlot}.
928
- # @rbs return: ::Integer
929
- # @return [Integer]
930
- # @see Slot
931
- def slot; self[:"slot"]&.value; end
932
- # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
933
- # @rbs return: ::Integer
934
- # @return [Integer]
935
- # @see KeyId
936
- def key_id; self[:"key_id"]&.value; end
937
- # The cipher to be used when communicating with the peer
938
- #
939
- # Known enum values are defined in {Enums::CipherAlg}.
940
- # @rbs return: ::Integer
941
- # @return [Integer]
942
- # @see CipherAlg
943
- def cipher_alg; self[:"cipher_alg"]&.value; end
944
- # Key material for encrypt direction
945
- # @rbs return: AttributeSets::Keydir
946
- # @return [AttributeSets::Keydir]
947
- # @see EncryptDir
948
- def encrypt_dir; self[:"encrypt_dir"]&.value; end
949
- # Key material for decrypt direction
950
- # @rbs return: AttributeSets::Keydir
951
- # @return [AttributeSets::Keydir]
952
- # @see DecryptDir
953
- def decrypt_dir; self[:"decrypt_dir"]&.value; end
954
- class << self
955
- # Looks up Attribute class by name.
956
- # @rbs name: Symbol
957
- # @rbs return: Attribute
958
- # @param [Symbol] name
959
- # @return [Attribute]
960
- def by_name(name); BY_NAME.fetch(name); end
961
- # Looks up Attribute class by type value.
962
- # @rbs type: Integer
963
- # @rbs return: Attribute
964
- # @param [Integer] type
965
- # @return [Attribute]
966
- def by_type(type); BY_TYPE.fetch(type); end
967
- end
968
- end
969
- class Keydir < ::Nl::AttributeSet
970
- # Abstract class
971
- class Attribute < ::Nl::AttributeSet::Attribute
972
- end
973
- # The actual key to be used by the cipher
974
- class CipherKey < Attribute
975
- TYPE = 1
976
- NAME = :"cipher_key"
977
- # @private
978
- ORDER = 0
979
- # @private
980
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length 256" unless it.bytesize <= 256 })
981
- end
982
- # Random nonce to be concatenated to the packet ID, in order to obtain the actual cipher IV
983
- class NonceTail < Attribute
984
- TYPE = 2
985
- NAME = :"nonce_tail"
986
- # @private
987
- ORDER = 1
988
- # @private
989
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length #{Constants::NONCE_TAIL_SIZE}" unless it.bytesize == Constants::NONCE_TAIL_SIZE })
990
- end
991
- # @private
992
- BY_NAME = Ractor.make_shareable({:"cipher_key" => CipherKey, :"nonce_tail" => NonceTail}) #: Hash[::Symbol, Attribute]
993
- # @private
994
- BY_TYPE = Ractor.make_shareable({1 => CipherKey, 2 => NonceTail}) #: Hash[::Integer, Attribute]
995
- # The actual key to be used by the cipher
996
- # @rbs return: ::String
997
- # @return [String]
998
- # @see CipherKey
999
- def cipher_key; self[:"cipher_key"]&.value; end
1000
- # Random nonce to be concatenated to the packet ID, in order to obtain the actual cipher IV
1001
- # @rbs return: ::String
1002
- # @return [String]
1003
- # @see NonceTail
1004
- def nonce_tail; self[:"nonce_tail"]&.value; end
1005
- class << self
1006
- # Looks up Attribute class by name.
1007
- # @rbs name: Symbol
1008
- # @rbs return: Attribute
1009
- # @param [Symbol] name
1010
- # @return [Attribute]
1011
- def by_name(name); BY_NAME.fetch(name); end
1012
- # Looks up Attribute class by type value.
1013
- # @rbs type: Integer
1014
- # @rbs return: Attribute
1015
- # @param [Integer] type
1016
- # @return [Attribute]
1017
- def by_type(type); BY_TYPE.fetch(type); end
291
+ module Definitions
292
+ # The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.
293
+ # @rbs return: ::Integer
294
+ # @return [Integer]
295
+ def id; self[:"id"]; end
296
+ end
297
+ include Definitions
298
+ # Decodes attributes from the decoder into a new attribute set.
299
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
300
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
301
+ super(decoder, BY_TYPE, 0, external_selectors)
1018
302
  end
1019
303
  end
1020
- class KeyconfGet < ::Nl::AttributeSet
1021
- # Abstract class
1022
- class Attribute < ::Nl::AttributeSet::Attribute
1023
- end
1024
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1025
- class PeerId < Attribute
1026
- TYPE = 1
1027
- NAME = :"peer_id"
1028
- # @private
1029
- ORDER = 0
1030
- # @private
1031
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
1032
- end
1033
- # The slot where the key should be stored
1034
- #
1035
- # Known enum values are defined in {Enums::KeySlot}.
1036
- class Slot < Attribute
1037
- TYPE = 2
1038
- NAME = :"slot"
1039
- # @private
1040
- ORDER = 1
1041
- # @private
1042
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
304
+ class Keyconf < ::Nl::AttributeSet
305
+ module Definitions
306
+ # The unique ID of the peer in the device context. To be used to identify peers during key operations
307
+ # @rbs return: ::Integer
308
+ # @return [Integer]
309
+ def peer_id; self[:"peer_id"]; end
310
+ # The slot where the key should be stored
311
+ #
312
+ # Known enum values are defined in {Enums::KeySlot}.
313
+ # @rbs return: ::Integer
314
+ # @return [Integer]
315
+ def slot; self[:"slot"]; end
316
+ # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
317
+ # @rbs return: ::Integer
318
+ # @return [Integer]
319
+ def key_id; self[:"key_id"]; end
320
+ # The cipher to be used when communicating with the peer
321
+ #
322
+ # Known enum values are defined in {Enums::CipherAlg}.
323
+ # @rbs return: ::Integer
324
+ # @return [Integer]
325
+ def cipher_alg; self[:"cipher_alg"]; end
326
+ # Key material for encrypt direction
327
+ # @rbs return: AttributeSets::Keydir
328
+ # @return [AttributeSets::Keydir]
329
+ def encrypt_dir; self[:"encrypt_dir"]; end
330
+ # Key material for decrypt direction
331
+ # @rbs return: AttributeSets::Keydir
332
+ # @return [AttributeSets::Keydir]
333
+ def decrypt_dir; self[:"decrypt_dir"]; end
334
+ end
335
+ include Definitions
336
+ # Decodes attributes from the decoder into a new attribute set.
337
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
338
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
339
+ super(decoder, BY_TYPE, 0, external_selectors)
1043
340
  end
1044
- # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
1045
- class KeyId < Attribute
1046
- TYPE = 3
1047
- NAME = :"key_id"
1048
- # @private
1049
- ORDER = 2
1050
- # @private
1051
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 7" unless it <= 7 })
1052
- end
1053
- # The cipher to be used when communicating with the peer
1054
- #
1055
- # Known enum values are defined in {Enums::CipherAlg}.
1056
- class CipherAlg < Attribute
1057
- TYPE = 4
1058
- NAME = :"cipher_alg"
1059
- # @private
1060
- ORDER = 3
1061
- # @private
1062
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
341
+ end
342
+ class Keydir < ::Nl::AttributeSet
343
+ module Definitions
344
+ # The actual key to be used by the cipher
345
+ # @rbs return: ::String
346
+ # @return [String]
347
+ def cipher_key; self[:"cipher_key"]; end
348
+ # Random nonce to be concatenated to the packet ID, in order to obtain the actual cipher IV
349
+ # @rbs return: ::String
350
+ # @return [String]
351
+ def nonce_tail; self[:"nonce_tail"]; end
352
+ end
353
+ include Definitions
354
+ # Decodes attributes from the decoder into a new attribute set.
355
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
356
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
357
+ super(decoder, BY_TYPE, 0, external_selectors)
1063
358
  end
1064
- # @private
1065
- BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId, :"slot" => Slot, :"key_id" => KeyId, :"cipher_alg" => CipherAlg}) #: Hash[::Symbol, Attribute]
1066
- # @private
1067
- BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot, 3 => KeyId, 4 => CipherAlg}) #: Hash[::Integer, Attribute]
1068
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1069
- # @rbs return: ::Integer
1070
- # @return [Integer]
1071
- # @see PeerId
1072
- def peer_id; self[:"peer_id"]&.value; end
1073
- # The slot where the key should be stored
1074
- #
1075
- # Known enum values are defined in {Enums::KeySlot}.
1076
- # @rbs return: ::Integer
1077
- # @return [Integer]
1078
- # @see Slot
1079
- def slot; self[:"slot"]&.value; end
1080
- # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
1081
- # @rbs return: ::Integer
1082
- # @return [Integer]
1083
- # @see KeyId
1084
- def key_id; self[:"key_id"]&.value; end
1085
- # The cipher to be used when communicating with the peer
1086
- #
1087
- # Known enum values are defined in {Enums::CipherAlg}.
1088
- # @rbs return: ::Integer
1089
- # @return [Integer]
1090
- # @see CipherAlg
1091
- def cipher_alg; self[:"cipher_alg"]&.value; end
1092
- class << self
1093
- # Looks up Attribute class by name.
1094
- # @rbs name: Symbol
1095
- # @rbs return: Attribute
1096
- # @param [Symbol] name
1097
- # @return [Attribute]
1098
- def by_name(name); BY_NAME.fetch(name); end
1099
- # Looks up Attribute class by type value.
1100
- # @rbs type: Integer
1101
- # @rbs return: Attribute
1102
- # @param [Integer] type
1103
- # @return [Attribute]
1104
- def by_type(type); BY_TYPE.fetch(type); end
359
+ end
360
+ class KeyconfGet < ::Nl::AttributeSet
361
+ module Definitions
362
+ # The unique ID of the peer in the device context. To be used to identify peers during key operations
363
+ # @rbs return: ::Integer
364
+ # @return [Integer]
365
+ def peer_id; self[:"peer_id"]; end
366
+ # The slot where the key should be stored
367
+ #
368
+ # Known enum values are defined in {Enums::KeySlot}.
369
+ # @rbs return: ::Integer
370
+ # @return [Integer]
371
+ def slot; self[:"slot"]; end
372
+ # The unique ID of the key in the peer context. Used to fetch the correct key upon decryption
373
+ # @rbs return: ::Integer
374
+ # @return [Integer]
375
+ def key_id; self[:"key_id"]; end
376
+ # The cipher to be used when communicating with the peer
377
+ #
378
+ # Known enum values are defined in {Enums::CipherAlg}.
379
+ # @rbs return: ::Integer
380
+ # @return [Integer]
381
+ def cipher_alg; self[:"cipher_alg"]; end
382
+ end
383
+ include Definitions
384
+ # Decodes attributes from the decoder into a new attribute set.
385
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
386
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
387
+ super(decoder, BY_TYPE, 0, external_selectors)
1105
388
  end
1106
389
  end
1107
390
  class KeyconfSwapInput < ::Nl::AttributeSet
1108
- # Abstract class
1109
- class Attribute < ::Nl::AttributeSet::Attribute
391
+ module Definitions
392
+ # The unique ID of the peer in the device context. To be used to identify peers during key operations
393
+ # @rbs return: ::Integer
394
+ # @return [Integer]
395
+ def peer_id; self[:"peer_id"]; end
396
+ end
397
+ include Definitions
398
+ # Decodes attributes from the decoder into a new attribute set.
399
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
400
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
401
+ super(decoder, BY_TYPE, 0, external_selectors)
1110
402
  end
1111
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1112
- class PeerId < Attribute
1113
- TYPE = 1
1114
- NAME = :"peer_id"
1115
- # @private
1116
- ORDER = 0
1117
- # @private
1118
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
403
+ end
404
+ class KeyconfDelInput < ::Nl::AttributeSet
405
+ module Definitions
406
+ # The unique ID of the peer in the device context. To be used to identify peers during key operations
407
+ # @rbs return: ::Integer
408
+ # @return [Integer]
409
+ def peer_id; self[:"peer_id"]; end
410
+ # The slot where the key should be stored
411
+ #
412
+ # Known enum values are defined in {Enums::KeySlot}.
413
+ # @rbs return: ::Integer
414
+ # @return [Integer]
415
+ def slot; self[:"slot"]; end
416
+ end
417
+ include Definitions
418
+ # Decodes attributes from the decoder into a new attribute set.
419
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
420
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
421
+ super(decoder, BY_TYPE, 0, external_selectors)
1119
422
  end
1120
- # @private
1121
- BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId}) #: Hash[::Symbol, Attribute]
1122
- # @private
1123
- BY_TYPE = Ractor.make_shareable({1 => PeerId}) #: Hash[::Integer, Attribute]
1124
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1125
- # @rbs return: ::Integer
1126
- # @return [Integer]
1127
- # @see PeerId
1128
- def peer_id; self[:"peer_id"]&.value; end
1129
- class << self
1130
- # Looks up Attribute class by name.
1131
- # @rbs name: Symbol
1132
- # @rbs return: Attribute
1133
- # @param [Symbol] name
1134
- # @return [Attribute]
1135
- def by_name(name); BY_NAME.fetch(name); end
1136
- # Looks up Attribute class by type value.
1137
- # @rbs type: Integer
1138
- # @rbs return: Attribute
1139
- # @param [Integer] type
1140
- # @return [Attribute]
1141
- def by_type(type); BY_TYPE.fetch(type); end
423
+ end
424
+ class Ovpn < ::Nl::AttributeSet
425
+ module Definitions
426
+ # Index of the ovpn interface to operate on
427
+ # @rbs return: ::Integer
428
+ # @return [Integer]
429
+ def ifindex; self[:"ifindex"]; end
430
+ # The peer object containing the attributed of interest for the specific operation
431
+ # @rbs return: AttributeSets::Peer
432
+ # @return [AttributeSets::Peer]
433
+ def peer; self[:"peer"]; end
434
+ # Peer specific cipher configuration
435
+ # @rbs return: AttributeSets::Keyconf
436
+ # @return [AttributeSets::Keyconf]
437
+ def keyconf; self[:"keyconf"]; end
438
+ end
439
+ include Definitions
440
+ # Decodes attributes from the decoder into a new attribute set.
441
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
442
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
443
+ super(decoder, BY_TYPE, 0, external_selectors)
1142
444
  end
1143
445
  end
1144
- class KeyconfDelInput < ::Nl::AttributeSet
1145
- # Abstract class
1146
- class Attribute < ::Nl::AttributeSet::Attribute
446
+ class OvpnPeerNewInput < ::Nl::AttributeSet
447
+ module Definitions
448
+ # Index of the ovpn interface to operate on
449
+ # @rbs return: ::Integer
450
+ # @return [Integer]
451
+ def ifindex; self[:"ifindex"]; end
452
+ # The peer object containing the attributed of interest for the specific operation
453
+ # @rbs return: AttributeSets::PeerNewInput
454
+ # @return [AttributeSets::PeerNewInput]
455
+ def peer; self[:"peer"]; end
456
+ end
457
+ include Definitions
458
+ # Decodes attributes from the decoder into a new attribute set.
459
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
460
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
461
+ super(decoder, BY_TYPE, 0, external_selectors)
1147
462
  end
1148
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1149
- class PeerId < Attribute
1150
- TYPE = 1
1151
- NAME = :"peer_id"
1152
- # @private
1153
- ORDER = 0
1154
- # @private
1155
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is greater than maximum 16777215" unless it <= 16777215 })
1156
- end
1157
- # The slot where the key should be stored
1158
- #
1159
- # Known enum values are defined in {Enums::KeySlot}.
1160
- class Slot < Attribute
1161
- TYPE = 2
1162
- NAME = :"slot"
1163
- # @private
1164
- ORDER = 1
1165
- # @private
1166
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
463
+ end
464
+ class OvpnPeerSetInput < ::Nl::AttributeSet
465
+ module Definitions
466
+ # Index of the ovpn interface to operate on
467
+ # @rbs return: ::Integer
468
+ # @return [Integer]
469
+ def ifindex; self[:"ifindex"]; end
470
+ # The peer object containing the attributed of interest for the specific operation
471
+ # @rbs return: AttributeSets::PeerSetInput
472
+ # @return [AttributeSets::PeerSetInput]
473
+ def peer; self[:"peer"]; end
474
+ end
475
+ include Definitions
476
+ # Decodes attributes from the decoder into a new attribute set.
477
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
478
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
479
+ super(decoder, BY_TYPE, 0, external_selectors)
1167
480
  end
1168
- # @private
1169
- BY_NAME = Ractor.make_shareable({:"peer_id" => PeerId, :"slot" => Slot}) #: Hash[::Symbol, Attribute]
1170
- # @private
1171
- BY_TYPE = Ractor.make_shareable({1 => PeerId, 2 => Slot}) #: Hash[::Integer, Attribute]
1172
- # The unique ID of the peer in the device context. To be used to identify peers during key operations
1173
- # @rbs return: ::Integer
1174
- # @return [Integer]
1175
- # @see PeerId
1176
- def peer_id; self[:"peer_id"]&.value; end
1177
- # The slot where the key should be stored
1178
- #
1179
- # Known enum values are defined in {Enums::KeySlot}.
1180
- # @rbs return: ::Integer
1181
- # @return [Integer]
1182
- # @see Slot
1183
- def slot; self[:"slot"]&.value; end
1184
- class << self
1185
- # Looks up Attribute class by name.
1186
- # @rbs name: Symbol
1187
- # @rbs return: Attribute
1188
- # @param [Symbol] name
1189
- # @return [Attribute]
1190
- def by_name(name); BY_NAME.fetch(name); end
1191
- # Looks up Attribute class by type value.
1192
- # @rbs type: Integer
1193
- # @rbs return: Attribute
1194
- # @param [Integer] type
1195
- # @return [Attribute]
1196
- def by_type(type); BY_TYPE.fetch(type); end
481
+ end
482
+ class OvpnPeerDelInput < ::Nl::AttributeSet
483
+ module Definitions
484
+ # Index of the ovpn interface to operate on
485
+ # @rbs return: ::Integer
486
+ # @return [Integer]
487
+ def ifindex; self[:"ifindex"]; end
488
+ # The peer object containing the attributed of interest for the specific operation
489
+ # @rbs return: AttributeSets::PeerDelInput
490
+ # @return [AttributeSets::PeerDelInput]
491
+ def peer; self[:"peer"]; end
492
+ end
493
+ include Definitions
494
+ # Decodes attributes from the decoder into a new attribute set.
495
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
496
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
497
+ super(decoder, BY_TYPE, 0, external_selectors)
1197
498
  end
1198
499
  end
1199
- class Ovpn < ::Nl::AttributeSet
1200
- # Abstract class
1201
- class Attribute < ::Nl::AttributeSet::Attribute
500
+ class OvpnKeyconfGet < ::Nl::AttributeSet
501
+ module Definitions
502
+ # Index of the ovpn interface to operate on
503
+ # @rbs return: ::Integer
504
+ # @return [Integer]
505
+ def ifindex; self[:"ifindex"]; end
506
+ # Peer specific cipher configuration
507
+ # @rbs return: AttributeSets::KeyconfGet
508
+ # @return [AttributeSets::KeyconfGet]
509
+ def keyconf; self[:"keyconf"]; end
510
+ end
511
+ include Definitions
512
+ # Decodes attributes from the decoder into a new attribute set.
513
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
514
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
515
+ super(decoder, BY_TYPE, 0, external_selectors)
1202
516
  end
1203
- # Index of the ovpn interface to operate on
1204
- class Ifindex < Attribute
1205
- TYPE = 1
1206
- NAME = :"ifindex"
1207
- # @private
1208
- ORDER = 0
1209
- # @private
1210
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
517
+ end
518
+ class OvpnKeyconfSwapInput < ::Nl::AttributeSet
519
+ module Definitions
520
+ # Index of the ovpn interface to operate on
521
+ # @rbs return: ::Integer
522
+ # @return [Integer]
523
+ def ifindex; self[:"ifindex"]; end
524
+ # Peer specific cipher configuration
525
+ # @rbs return: AttributeSets::KeyconfSwapInput
526
+ # @return [AttributeSets::KeyconfSwapInput]
527
+ def keyconf; self[:"keyconf"]; end
528
+ end
529
+ include Definitions
530
+ # Decodes attributes from the decoder into a new attribute set.
531
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
532
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
533
+ super(decoder, BY_TYPE, 0, external_selectors)
1211
534
  end
1212
- # The peer object containing the attributed of interest for the specific operation
1213
- class Peer < Attribute
1214
- TYPE = 2
1215
- NAME = :"peer"
1216
- # @private
1217
- ORDER = 1
535
+ end
536
+ class OvpnKeyconfDelInput < ::Nl::AttributeSet
537
+ module Definitions
538
+ # Index of the ovpn interface to operate on
539
+ # @rbs return: ::Integer
540
+ # @return [Integer]
541
+ def ifindex; self[:"ifindex"]; end
542
+ # Peer specific cipher configuration
543
+ # @rbs return: AttributeSets::KeyconfDelInput
544
+ # @return [AttributeSets::KeyconfDelInput]
545
+ def keyconf; self[:"keyconf"]; end
546
+ end
547
+ include Definitions
548
+ # Decodes attributes from the decoder into a new attribute set.
549
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
550
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
551
+ super(decoder, BY_TYPE, 0, external_selectors)
1218
552
  end
1219
- # Peer specific cipher configuration
1220
- class Keyconf < Attribute
1221
- TYPE = 3
1222
- NAME = :"keyconf"
1223
- # @private
1224
- ORDER = 2
553
+ end
554
+ end
555
+ module AttributeSets
556
+ class Peer
557
+ module Definitions
558
+ # @private
559
+ BY_TYPE = ::Array.new(25).tap do |definitions|
560
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
561
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"remote_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
562
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"remote_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 2, selector_slot: nil)
563
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"remote_ipv6_scope_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
564
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"remote_port", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 4, selector_slot: nil)
565
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"socket", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
566
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"socket_netnsid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 6, selector_slot: nil)
567
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"vpn_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 7, selector_slot: nil)
568
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"vpn_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 8, selector_slot: nil)
569
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"local_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 9, selector_slot: nil)
570
+ definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"local_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 10, selector_slot: nil)
571
+ definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"local_port", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 11, selector_slot: nil)
572
+ definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"keepalive_interval", 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 86400" unless it <= 86400 } }), multi: false, order: 12, selector_slot: nil)
573
+ definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"keepalive_timeout", 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 86400" unless it <= 86400 } }), multi: false, order: 13, selector_slot: nil)
574
+ definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"del_reason", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 14, selector_slot: nil)
575
+ definitions[16] = ::Nl::AttributeSet::Definition.new(id: 16, name: :"vpn_rx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 15, selector_slot: nil)
576
+ definitions[17] = ::Nl::AttributeSet::Definition.new(id: 17, name: :"vpn_tx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 16, selector_slot: nil)
577
+ definitions[18] = ::Nl::AttributeSet::Definition.new(id: 18, name: :"vpn_rx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 17, selector_slot: nil)
578
+ definitions[19] = ::Nl::AttributeSet::Definition.new(id: 19, name: :"vpn_tx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 18, selector_slot: nil)
579
+ definitions[20] = ::Nl::AttributeSet::Definition.new(id: 20, name: :"link_rx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 19, selector_slot: nil)
580
+ definitions[21] = ::Nl::AttributeSet::Definition.new(id: 21, name: :"link_tx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 20, selector_slot: nil)
581
+ definitions[22] = ::Nl::AttributeSet::Definition.new(id: 22, name: :"link_rx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 21, selector_slot: nil)
582
+ definitions[23] = ::Nl::AttributeSet::Definition.new(id: 23, name: :"link_tx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 22, selector_slot: nil)
583
+ definitions[24] = ::Nl::AttributeSet::Definition.new(id: 24, name: :"tx_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 23, selector_slot: nil)
584
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
585
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
586
+ # @private
587
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1225
588
  end
1226
- # @private
1227
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
1228
- # @private
1229
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer, 3 => Keyconf}) #: Hash[::Integer, Attribute]
1230
- # Index of the ovpn interface to operate on
1231
- # @rbs return: ::Integer
1232
- # @return [Integer]
1233
- # @see Ifindex
1234
- def ifindex; self[:"ifindex"]&.value; end
1235
- # The peer object containing the attributed of interest for the specific operation
1236
- # @rbs return: AttributeSets::Peer
1237
- # @return [AttributeSets::Peer]
1238
- # @see Peer
1239
- def peer; self[:"peer"]&.value; end
1240
- # Peer specific cipher configuration
1241
- # @rbs return: AttributeSets::Keyconf
1242
- # @return [AttributeSets::Keyconf]
1243
- # @see Keyconf
1244
- def keyconf; self[:"keyconf"]&.value; end
1245
- class << self
1246
- # Looks up Attribute class by name.
1247
- # @rbs name: Symbol
1248
- # @rbs return: Attribute
1249
- # @param [Symbol] name
1250
- # @return [Attribute]
1251
- def by_name(name); BY_NAME.fetch(name); end
1252
- # Looks up Attribute class by type value.
1253
- # @rbs type: Integer
1254
- # @rbs return: Attribute
1255
- # @param [Integer] type
1256
- # @return [Attribute]
1257
- def by_type(type); BY_TYPE.fetch(type); end
589
+ end
590
+ class PeerNewInput
591
+ module Definitions
592
+ # @private
593
+ BY_TYPE = ::Array.new(25).tap do |definitions|
594
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
595
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"remote_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
596
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"remote_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 2, selector_slot: nil)
597
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"remote_ipv6_scope_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
598
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"remote_port", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 4, selector_slot: nil)
599
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"socket", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
600
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"vpn_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 6, selector_slot: nil)
601
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"vpn_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 7, selector_slot: nil)
602
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"local_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 8, selector_slot: nil)
603
+ definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"local_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 9, selector_slot: nil)
604
+ definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"keepalive_interval", 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 86400" unless it <= 86400 } }), multi: false, order: 10, selector_slot: nil)
605
+ definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"keepalive_timeout", 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 86400" unless it <= 86400 } }), multi: false, order: 11, selector_slot: nil)
606
+ definitions[24] = ::Nl::AttributeSet::Definition.new(id: 24, name: :"tx_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 12, selector_slot: nil)
607
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
608
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
609
+ # @private
610
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1258
611
  end
1259
612
  end
1260
- class OvpnPeerNewInput < ::Nl::AttributeSet
1261
- # Abstract class
1262
- class Attribute < ::Nl::AttributeSet::Attribute
613
+ class PeerSetInput
614
+ module Definitions
615
+ # @private
616
+ BY_TYPE = ::Array.new(25).tap do |definitions|
617
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
618
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"remote_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
619
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"remote_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 2, selector_slot: nil)
620
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"remote_ipv6_scope_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
621
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"remote_port", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 4, selector_slot: nil)
622
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"vpn_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 5, selector_slot: nil)
623
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"vpn_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 6, selector_slot: nil)
624
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"local_ipv4", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 7, selector_slot: nil)
625
+ definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"local_ipv6", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 } }), multi: false, order: 8, selector_slot: nil)
626
+ definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"keepalive_interval", 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 86400" unless it <= 86400 } }), multi: false, order: 9, selector_slot: nil)
627
+ definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"keepalive_timeout", 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 86400" unless it <= 86400 } }), multi: false, order: 10, selector_slot: nil)
628
+ definitions[24] = ::Nl::AttributeSet::Definition.new(id: 24, name: :"tx_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 11, selector_slot: nil)
629
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
630
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
631
+ # @private
632
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1263
633
  end
1264
- # Index of the ovpn interface to operate on
1265
- class Ifindex < Attribute
1266
- TYPE = 1
1267
- NAME = :"ifindex"
634
+ end
635
+ class PeerDelInput
636
+ module Definitions
1268
637
  # @private
1269
- ORDER = 0
638
+ BY_TYPE = ::Array.new(2).tap do |definitions|
639
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
640
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
641
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1270
642
  # @private
1271
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
643
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1272
644
  end
1273
- # The peer object containing the attributed of interest for the specific operation
1274
- class Peer < Attribute
1275
- TYPE = 2
1276
- NAME = :"peer"
645
+ end
646
+ class Keyconf
647
+ module Definitions
1277
648
  # @private
1278
- ORDER = 1
1279
- end
1280
- # @private
1281
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
1282
- # @private
1283
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
1284
- # Index of the ovpn interface to operate on
1285
- # @rbs return: ::Integer
1286
- # @return [Integer]
1287
- # @see Ifindex
1288
- def ifindex; self[:"ifindex"]&.value; end
1289
- # The peer object containing the attributed of interest for the specific operation
1290
- # @rbs return: AttributeSets::PeerNewInput
1291
- # @return [AttributeSets::PeerNewInput]
1292
- # @see Peer
1293
- def peer; self[:"peer"]&.value; end
1294
- class << self
1295
- # Looks up Attribute class by name.
1296
- # @rbs name: Symbol
1297
- # @rbs return: Attribute
1298
- # @param [Symbol] name
1299
- # @return [Attribute]
1300
- def by_name(name); BY_NAME.fetch(name); end
1301
- # Looks up Attribute class by type value.
1302
- # @rbs type: Integer
1303
- # @rbs return: Attribute
1304
- # @param [Integer] type
1305
- # @return [Attribute]
1306
- def by_type(type); BY_TYPE.fetch(type); end
649
+ BY_TYPE = ::Array.new(7).tap do |definitions|
650
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"peer_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
651
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"slot", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
652
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"key_id", 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 7" unless it <= 7 } }), multi: false, order: 2, selector_slot: nil)
653
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"cipher_alg", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
654
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"encrypt_dir", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keydir, selector_bindings: []), multi: false, order: 4, selector_slot: nil)
655
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"decrypt_dir", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keydir, selector_bindings: []), multi: false, order: 5, selector_slot: nil)
656
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
657
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
658
+ # @private
659
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1307
660
  end
1308
661
  end
1309
- class OvpnPeerSetInput < ::Nl::AttributeSet
1310
- # Abstract class
1311
- class Attribute < ::Nl::AttributeSet::Attribute
1312
- end
1313
- # Index of the ovpn interface to operate on
1314
- class Ifindex < Attribute
1315
- TYPE = 1
1316
- NAME = :"ifindex"
662
+ class Keydir
663
+ module Definitions
1317
664
  # @private
1318
- ORDER = 0
665
+ BY_TYPE = ::Array.new(3).tap do |definitions|
666
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"cipher_key", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length 256" unless it.bytesize <= 256 } }), multi: false, order: 0, selector_slot: nil)
667
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"nonce_tail", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is not equal to length #{Constants::NONCE_TAIL_SIZE}" unless it.bytesize == Constants::NONCE_TAIL_SIZE } }), multi: false, order: 1, selector_slot: nil)
668
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
669
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1319
670
  # @private
1320
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
671
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1321
672
  end
1322
- # The peer object containing the attributed of interest for the specific operation
1323
- class Peer < Attribute
1324
- TYPE = 2
1325
- NAME = :"peer"
673
+ end
674
+ class KeyconfGet
675
+ module Definitions
1326
676
  # @private
1327
- ORDER = 1
1328
- end
1329
- # @private
1330
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
1331
- # @private
1332
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
1333
- # Index of the ovpn interface to operate on
1334
- # @rbs return: ::Integer
1335
- # @return [Integer]
1336
- # @see Ifindex
1337
- def ifindex; self[:"ifindex"]&.value; end
1338
- # The peer object containing the attributed of interest for the specific operation
1339
- # @rbs return: AttributeSets::PeerSetInput
1340
- # @return [AttributeSets::PeerSetInput]
1341
- # @see Peer
1342
- def peer; self[:"peer"]&.value; end
1343
- class << self
1344
- # Looks up Attribute class by name.
1345
- # @rbs name: Symbol
1346
- # @rbs return: Attribute
1347
- # @param [Symbol] name
1348
- # @return [Attribute]
1349
- def by_name(name); BY_NAME.fetch(name); end
1350
- # Looks up Attribute class by type value.
1351
- # @rbs type: Integer
1352
- # @rbs return: Attribute
1353
- # @param [Integer] type
1354
- # @return [Attribute]
1355
- def by_type(type); BY_TYPE.fetch(type); end
677
+ BY_TYPE = ::Array.new(5).tap do |definitions|
678
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"peer_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
679
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"slot", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
680
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"key_id", 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 7" unless it <= 7 } }), multi: false, order: 2, selector_slot: nil)
681
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"cipher_alg", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
682
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
683
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
684
+ # @private
685
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1356
686
  end
1357
687
  end
1358
- class OvpnPeerDelInput < ::Nl::AttributeSet
1359
- # Abstract class
1360
- class Attribute < ::Nl::AttributeSet::Attribute
1361
- end
1362
- # Index of the ovpn interface to operate on
1363
- class Ifindex < Attribute
1364
- TYPE = 1
1365
- NAME = :"ifindex"
688
+ class KeyconfSwapInput
689
+ module Definitions
1366
690
  # @private
1367
- ORDER = 0
691
+ BY_TYPE = ::Array.new(2).tap do |definitions|
692
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"peer_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
693
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
694
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1368
695
  # @private
1369
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
696
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1370
697
  end
1371
- # The peer object containing the attributed of interest for the specific operation
1372
- class Peer < Attribute
1373
- TYPE = 2
1374
- NAME = :"peer"
698
+ end
699
+ class KeyconfDelInput
700
+ module Definitions
1375
701
  # @private
1376
- ORDER = 1
1377
- end
1378
- # @private
1379
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"peer" => Peer}) #: Hash[::Symbol, Attribute]
1380
- # @private
1381
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Peer}) #: Hash[::Integer, Attribute]
1382
- # Index of the ovpn interface to operate on
1383
- # @rbs return: ::Integer
1384
- # @return [Integer]
1385
- # @see Ifindex
1386
- def ifindex; self[:"ifindex"]&.value; end
1387
- # The peer object containing the attributed of interest for the specific operation
1388
- # @rbs return: AttributeSets::PeerDelInput
1389
- # @return [AttributeSets::PeerDelInput]
1390
- # @see Peer
1391
- def peer; self[:"peer"]&.value; end
1392
- class << self
1393
- # Looks up Attribute class by name.
1394
- # @rbs name: Symbol
1395
- # @rbs return: Attribute
1396
- # @param [Symbol] name
1397
- # @return [Attribute]
1398
- def by_name(name); BY_NAME.fetch(name); end
1399
- # Looks up Attribute class by type value.
1400
- # @rbs type: Integer
1401
- # @rbs return: Attribute
1402
- # @param [Integer] type
1403
- # @return [Attribute]
1404
- def by_type(type); BY_TYPE.fetch(type); end
702
+ BY_TYPE = ::Array.new(3).tap do |definitions|
703
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"peer_id", 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 16777215" unless it <= 16777215 } }), multi: false, order: 0, selector_slot: nil)
704
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"slot", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
705
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
706
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
707
+ # @private
708
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1405
709
  end
1406
710
  end
1407
- class OvpnKeyconfGet < ::Nl::AttributeSet
1408
- # Abstract class
1409
- class Attribute < ::Nl::AttributeSet::Attribute
1410
- end
1411
- # Index of the ovpn interface to operate on
1412
- class Ifindex < Attribute
1413
- TYPE = 1
1414
- NAME = :"ifindex"
711
+ class Ovpn
712
+ module Definitions
1415
713
  # @private
1416
- ORDER = 0
714
+ BY_TYPE = ::Array.new(4).tap do |definitions|
715
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
716
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"peer", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Peer, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
717
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"keyconf", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keyconf, selector_bindings: []), multi: false, order: 2, selector_slot: nil)
718
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
719
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1417
720
  # @private
1418
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
721
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1419
722
  end
1420
- # Peer specific cipher configuration
1421
- class Keyconf < Attribute
1422
- TYPE = 3
1423
- NAME = :"keyconf"
723
+ end
724
+ class OvpnPeerNewInput
725
+ module Definitions
1424
726
  # @private
1425
- ORDER = 1
1426
- end
1427
- # @private
1428
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
1429
- # @private
1430
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
1431
- # Index of the ovpn interface to operate on
1432
- # @rbs return: ::Integer
1433
- # @return [Integer]
1434
- # @see Ifindex
1435
- def ifindex; self[:"ifindex"]&.value; end
1436
- # Peer specific cipher configuration
1437
- # @rbs return: AttributeSets::KeyconfGet
1438
- # @return [AttributeSets::KeyconfGet]
1439
- # @see Keyconf
1440
- def keyconf; self[:"keyconf"]&.value; end
1441
- class << self
1442
- # Looks up Attribute class by name.
1443
- # @rbs name: Symbol
1444
- # @rbs return: Attribute
1445
- # @param [Symbol] name
1446
- # @return [Attribute]
1447
- def by_name(name); BY_NAME.fetch(name); end
1448
- # Looks up Attribute class by type value.
1449
- # @rbs type: Integer
1450
- # @rbs return: Attribute
1451
- # @param [Integer] type
1452
- # @return [Attribute]
1453
- def by_type(type); BY_TYPE.fetch(type); end
727
+ BY_TYPE = ::Array.new(3).tap do |definitions|
728
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
729
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"peer", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerNewInput, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
730
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
731
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
732
+ # @private
733
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1454
734
  end
1455
735
  end
1456
- class OvpnKeyconfSwapInput < ::Nl::AttributeSet
1457
- # Abstract class
1458
- class Attribute < ::Nl::AttributeSet::Attribute
1459
- end
1460
- # Index of the ovpn interface to operate on
1461
- class Ifindex < Attribute
1462
- TYPE = 1
1463
- NAME = :"ifindex"
736
+ class OvpnPeerSetInput
737
+ module Definitions
1464
738
  # @private
1465
- ORDER = 0
739
+ BY_TYPE = ::Array.new(3).tap do |definitions|
740
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
741
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"peer", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerSetInput, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
742
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
743
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1466
744
  # @private
1467
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
745
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1468
746
  end
1469
- # Peer specific cipher configuration
1470
- class Keyconf < Attribute
1471
- TYPE = 3
1472
- NAME = :"keyconf"
747
+ end
748
+ class OvpnPeerDelInput
749
+ module Definitions
1473
750
  # @private
1474
- ORDER = 1
1475
- end
1476
- # @private
1477
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
1478
- # @private
1479
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
1480
- # Index of the ovpn interface to operate on
1481
- # @rbs return: ::Integer
1482
- # @return [Integer]
1483
- # @see Ifindex
1484
- def ifindex; self[:"ifindex"]&.value; end
1485
- # Peer specific cipher configuration
1486
- # @rbs return: AttributeSets::KeyconfSwapInput
1487
- # @return [AttributeSets::KeyconfSwapInput]
1488
- # @see Keyconf
1489
- def keyconf; self[:"keyconf"]&.value; end
1490
- class << self
1491
- # Looks up Attribute class by name.
1492
- # @rbs name: Symbol
1493
- # @rbs return: Attribute
1494
- # @param [Symbol] name
1495
- # @return [Attribute]
1496
- def by_name(name); BY_NAME.fetch(name); end
1497
- # Looks up Attribute class by type value.
1498
- # @rbs type: Integer
1499
- # @rbs return: Attribute
1500
- # @param [Integer] type
1501
- # @return [Attribute]
1502
- def by_type(type); BY_TYPE.fetch(type); end
751
+ BY_TYPE = ::Array.new(3).tap do |definitions|
752
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
753
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"peer", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerDelInput, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
754
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
755
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
756
+ # @private
757
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1503
758
  end
1504
759
  end
1505
- class OvpnKeyconfDelInput < ::Nl::AttributeSet
1506
- # Abstract class
1507
- class Attribute < ::Nl::AttributeSet::Attribute
1508
- end
1509
- # Index of the ovpn interface to operate on
1510
- class Ifindex < Attribute
1511
- TYPE = 1
1512
- NAME = :"ifindex"
760
+ class OvpnKeyconfGet
761
+ module Definitions
1513
762
  # @private
1514
- ORDER = 0
763
+ BY_TYPE = ::Array.new(4).tap do |definitions|
764
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
765
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"keyconf", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfGet, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
766
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
767
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1515
768
  # @private
1516
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
769
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1517
770
  end
1518
- # Peer specific cipher configuration
1519
- class Keyconf < Attribute
1520
- TYPE = 3
1521
- NAME = :"keyconf"
771
+ end
772
+ class OvpnKeyconfSwapInput
773
+ module Definitions
774
+ # @private
775
+ BY_TYPE = ::Array.new(4).tap do |definitions|
776
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
777
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"keyconf", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfSwapInput, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
778
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
779
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1522
780
  # @private
1523
- ORDER = 1
781
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1524
782
  end
1525
- # @private
1526
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"keyconf" => Keyconf}) #: Hash[::Symbol, Attribute]
1527
- # @private
1528
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 3 => Keyconf}) #: Hash[::Integer, Attribute]
1529
- # Index of the ovpn interface to operate on
1530
- # @rbs return: ::Integer
1531
- # @return [Integer]
1532
- # @see Ifindex
1533
- def ifindex; self[:"ifindex"]&.value; end
1534
- # Peer specific cipher configuration
1535
- # @rbs return: AttributeSets::KeyconfDelInput
1536
- # @return [AttributeSets::KeyconfDelInput]
1537
- # @see Keyconf
1538
- def keyconf; self[:"keyconf"]&.value; end
1539
- class << self
1540
- # Looks up Attribute class by name.
1541
- # @rbs name: Symbol
1542
- # @rbs return: Attribute
1543
- # @param [Symbol] name
1544
- # @return [Attribute]
1545
- def by_name(name); BY_NAME.fetch(name); end
1546
- # Looks up Attribute class by type value.
1547
- # @rbs type: Integer
1548
- # @rbs return: Attribute
1549
- # @param [Integer] type
1550
- # @return [Attribute]
1551
- def by_type(type); BY_TYPE.fetch(type); end
783
+ end
784
+ class OvpnKeyconfDelInput
785
+ module Definitions
786
+ # @private
787
+ BY_TYPE = ::Array.new(4).tap do |definitions|
788
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
789
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"keyconf", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfDelInput, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
790
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
791
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
792
+ # @private
793
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1552
794
  end
1553
795
  end
1554
- # @private
1555
- Keyconf::EncryptDir::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keydir, selector_bindings: Ractor.make_shareable([]))
1556
- # @private
1557
- Keyconf::DecryptDir::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keydir, selector_bindings: Ractor.make_shareable([]))
1558
- # @private
1559
- Ovpn::Peer::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Peer, selector_bindings: Ractor.make_shareable([]))
1560
- # @private
1561
- Ovpn::Keyconf::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keyconf, selector_bindings: Ractor.make_shareable([]))
1562
- # @private
1563
- OvpnPeerNewInput::Peer::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerNewInput, selector_bindings: Ractor.make_shareable([]))
1564
- # @private
1565
- OvpnPeerSetInput::Peer::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerSetInput, selector_bindings: Ractor.make_shareable([]))
1566
- # @private
1567
- OvpnPeerDelInput::Peer::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::PeerDelInput, selector_bindings: Ractor.make_shareable([]))
1568
- # @private
1569
- OvpnKeyconfGet::Keyconf::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfGet, selector_bindings: Ractor.make_shareable([]))
1570
- # @private
1571
- OvpnKeyconfSwapInput::Keyconf::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfSwapInput, selector_bindings: Ractor.make_shareable([]))
1572
- # @private
1573
- OvpnKeyconfDelInput::Keyconf::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::KeyconfDelInput, selector_bindings: Ractor.make_shareable([]))
1574
796
  end
1575
797
  module Messages
1576
798
  # Add a remote peer
1577
799
  #
1578
800
  # Requires CAP_NET_ADMIN in the initial user namespace.
1579
- class DoPeerNewRequest < ::Nl::Genl::Message
801
+ class DoPeerNewRequest < ::Nl::Message
1580
802
  TYPE = 1
1581
803
  FIXED_HEADER = nil
1582
804
  ATTRIBUTE_SET = AttributeSets::OvpnPeerNewInput
1583
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
805
+ ATTRIBUTES = %i[ifindex peer].freeze
806
+ include ATTRIBUTE_SET::Definitions
807
+ def initialize(attributes = [])
808
+ @attributes = attributes
809
+ end
810
+ # @private
811
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
812
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
813
+ new(
814
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
815
+ )
816
+ end
817
+ # Decodes a message payload from the decoder into a new instance.
818
+ # @rbs (::Nl::Decoder decoder) -> instance
819
+ def self.decode(decoder)
820
+ new(decode_attributes(decoder, BY_TYPE, 0))
821
+ end
822
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
823
+ encode_attributes(encoder, external_selectors:)
824
+ end
1584
825
  # Index of the ovpn interface to operate on
1585
826
  # @rbs return: ::Integer
1586
827
  # @return [Integer]
1587
- # @see AttributeSets::OvpnPeerNewInput::Ifindex
1588
- def ifindex; attributes[:"ifindex"]&.value; end
828
+ def ifindex; self[:"ifindex"]; end
1589
829
  # The peer object containing the attributed of interest for the specific operation
1590
830
  # @rbs return: AttributeSets::PeerNewInput
1591
831
  # @return [AttributeSets::PeerNewInput]
1592
- # @see AttributeSets::OvpnPeerNewInput::Peer
1593
- def peer; attributes[:"peer"]&.value; end
832
+ def peer; self[:"peer"]; end
1594
833
  end
1595
834
  # modify a remote peer
1596
835
  #
1597
836
  # Requires CAP_NET_ADMIN in the initial user namespace.
1598
- class DoPeerSetRequest < ::Nl::Genl::Message
837
+ class DoPeerSetRequest < ::Nl::Message
1599
838
  TYPE = 2
1600
839
  FIXED_HEADER = nil
1601
840
  ATTRIBUTE_SET = AttributeSets::OvpnPeerSetInput
1602
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
841
+ ATTRIBUTES = %i[ifindex peer].freeze
842
+ include ATTRIBUTE_SET::Definitions
843
+ def initialize(attributes = [])
844
+ @attributes = attributes
845
+ end
846
+ # @private
847
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
848
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
849
+ new(
850
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
851
+ )
852
+ end
853
+ # Decodes a message payload from the decoder into a new instance.
854
+ # @rbs (::Nl::Decoder decoder) -> instance
855
+ def self.decode(decoder)
856
+ new(decode_attributes(decoder, BY_TYPE, 0))
857
+ end
858
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
859
+ encode_attributes(encoder, external_selectors:)
860
+ end
1603
861
  # Index of the ovpn interface to operate on
1604
862
  # @rbs return: ::Integer
1605
863
  # @return [Integer]
1606
- # @see AttributeSets::OvpnPeerSetInput::Ifindex
1607
- def ifindex; attributes[:"ifindex"]&.value; end
864
+ def ifindex; self[:"ifindex"]; end
1608
865
  # The peer object containing the attributed of interest for the specific operation
1609
866
  # @rbs return: AttributeSets::PeerSetInput
1610
867
  # @return [AttributeSets::PeerSetInput]
1611
- # @see AttributeSets::OvpnPeerSetInput::Peer
1612
- def peer; attributes[:"peer"]&.value; end
868
+ def peer; self[:"peer"]; end
1613
869
  end
1614
870
  # Retrieve data about existing remote peers (or a specific one)
1615
871
  #
1616
872
  # Requires CAP_NET_ADMIN in the initial user namespace.
1617
- class DoPeerGetRequest < ::Nl::Genl::Message
873
+ class DoPeerGetRequest < ::Nl::Message
1618
874
  TYPE = 3
1619
875
  FIXED_HEADER = nil
1620
876
  ATTRIBUTE_SET = AttributeSets::Ovpn
1621
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
877
+ ATTRIBUTES = %i[ifindex peer].freeze
878
+ include ATTRIBUTE_SET::Definitions
879
+ def initialize(attributes = [])
880
+ @attributes = attributes
881
+ end
882
+ # @private
883
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
884
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
885
+ new(
886
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
887
+ )
888
+ end
889
+ # Decodes a message payload from the decoder into a new instance.
890
+ # @rbs (::Nl::Decoder decoder) -> instance
891
+ def self.decode(decoder)
892
+ new(decode_attributes(decoder, BY_TYPE, 0))
893
+ end
894
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
895
+ encode_attributes(encoder, external_selectors:)
896
+ end
1622
897
  # Index of the ovpn interface to operate on
1623
898
  # @rbs return: ::Integer
1624
899
  # @return [Integer]
1625
- # @see AttributeSets::Ovpn::Ifindex
1626
- def ifindex; attributes[:"ifindex"]&.value; end
900
+ def ifindex; self[:"ifindex"]; end
1627
901
  # The peer object containing the attributed of interest for the specific operation
1628
902
  # @rbs return: AttributeSets::Peer
1629
903
  # @return [AttributeSets::Peer]
1630
- # @see AttributeSets::Ovpn::Peer
1631
- def peer; attributes[:"peer"]&.value; end
904
+ def peer; self[:"peer"]; end
1632
905
  end
1633
906
  # Retrieve data about existing remote peers (or a specific one)
1634
907
  #
1635
908
  # Requires CAP_NET_ADMIN in the initial user namespace.
1636
- class DoPeerGetReply < ::Nl::Genl::Message
909
+ class DoPeerGetReply < ::Nl::Message
1637
910
  TYPE = 3
1638
911
  FIXED_HEADER = nil
1639
912
  ATTRIBUTE_SET = AttributeSets::Ovpn
1640
- ATTRIBUTES = Ractor.make_shareable(%i[peer])
913
+ ATTRIBUTES = %i[peer].freeze
914
+ include ATTRIBUTE_SET::Definitions
915
+ def initialize(attributes = [])
916
+ @attributes = attributes
917
+ end
918
+ # @private
919
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
920
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
921
+ new(
922
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
923
+ )
924
+ end
925
+ # Decodes a message payload from the decoder into a new instance.
926
+ # @rbs (::Nl::Decoder decoder) -> instance
927
+ def self.decode(decoder)
928
+ new(decode_attributes(decoder, BY_TYPE, 0))
929
+ end
930
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
931
+ encode_attributes(encoder, external_selectors:)
932
+ end
1641
933
  # The peer object containing the attributed of interest for the specific operation
1642
934
  # @rbs return: AttributeSets::Peer
1643
935
  # @return [AttributeSets::Peer]
1644
- # @see AttributeSets::Ovpn::Peer
1645
- def peer; attributes[:"peer"]&.value; end
936
+ def peer; self[:"peer"]; end
1646
937
  end
1647
938
  # Retrieve data about existing remote peers (or a specific one)
1648
939
  #
1649
940
  # Requires CAP_NET_ADMIN in the initial user namespace.
1650
- class DumpPeerGetRequest < ::Nl::Genl::Message
941
+ class DumpPeerGetRequest < ::Nl::Message
1651
942
  TYPE = 3
1652
943
  FIXED_HEADER = nil
1653
944
  ATTRIBUTE_SET = AttributeSets::Ovpn
1654
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
945
+ ATTRIBUTES = %i[ifindex].freeze
946
+ include ATTRIBUTE_SET::Definitions
947
+ def initialize(attributes = [])
948
+ @attributes = attributes
949
+ end
950
+ # @private
951
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
952
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
953
+ new(
954
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
955
+ )
956
+ end
957
+ # Decodes a message payload from the decoder into a new instance.
958
+ # @rbs (::Nl::Decoder decoder) -> instance
959
+ def self.decode(decoder)
960
+ new(decode_attributes(decoder, BY_TYPE, 0))
961
+ end
962
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
963
+ encode_attributes(encoder, external_selectors:)
964
+ end
1655
965
  # Index of the ovpn interface to operate on
1656
966
  # @rbs return: ::Integer
1657
967
  # @return [Integer]
1658
- # @see AttributeSets::Ovpn::Ifindex
1659
- def ifindex; attributes[:"ifindex"]&.value; end
968
+ def ifindex; self[:"ifindex"]; end
1660
969
  end
1661
970
  # Retrieve data about existing remote peers (or a specific one)
1662
971
  #
1663
972
  # Requires CAP_NET_ADMIN in the initial user namespace.
1664
- class DumpPeerGetReply < ::Nl::Genl::Message
973
+ class DumpPeerGetReply < ::Nl::Message
1665
974
  TYPE = 3
1666
975
  FIXED_HEADER = nil
1667
976
  ATTRIBUTE_SET = AttributeSets::Ovpn
1668
- ATTRIBUTES = Ractor.make_shareable(%i[peer])
977
+ ATTRIBUTES = %i[peer].freeze
978
+ include ATTRIBUTE_SET::Definitions
979
+ def initialize(attributes = [])
980
+ @attributes = attributes
981
+ end
982
+ # @private
983
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
984
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
985
+ new(
986
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
987
+ )
988
+ end
989
+ # Decodes a message payload from the decoder into a new instance.
990
+ # @rbs (::Nl::Decoder decoder) -> instance
991
+ def self.decode(decoder)
992
+ new(decode_attributes(decoder, BY_TYPE, 0))
993
+ end
994
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
995
+ encode_attributes(encoder, external_selectors:)
996
+ end
1669
997
  # The peer object containing the attributed of interest for the specific operation
1670
998
  # @rbs return: AttributeSets::Peer
1671
999
  # @return [AttributeSets::Peer]
1672
- # @see AttributeSets::Ovpn::Peer
1673
- def peer; attributes[:"peer"]&.value; end
1000
+ def peer; self[:"peer"]; end
1674
1001
  end
1675
1002
  # Delete existing remote peer
1676
1003
  #
1677
1004
  # Requires CAP_NET_ADMIN in the initial user namespace.
1678
- class DoPeerDelRequest < ::Nl::Genl::Message
1005
+ class DoPeerDelRequest < ::Nl::Message
1679
1006
  TYPE = 4
1680
1007
  FIXED_HEADER = nil
1681
1008
  ATTRIBUTE_SET = AttributeSets::OvpnPeerDelInput
1682
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex peer])
1009
+ ATTRIBUTES = %i[ifindex peer].freeze
1010
+ include ATTRIBUTE_SET::Definitions
1011
+ def initialize(attributes = [])
1012
+ @attributes = attributes
1013
+ end
1014
+ # @private
1015
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1016
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1017
+ new(
1018
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1019
+ )
1020
+ end
1021
+ # Decodes a message payload from the decoder into a new instance.
1022
+ # @rbs (::Nl::Decoder decoder) -> instance
1023
+ def self.decode(decoder)
1024
+ new(decode_attributes(decoder, BY_TYPE, 0))
1025
+ end
1026
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1027
+ encode_attributes(encoder, external_selectors:)
1028
+ end
1683
1029
  # Index of the ovpn interface to operate on
1684
1030
  # @rbs return: ::Integer
1685
1031
  # @return [Integer]
1686
- # @see AttributeSets::OvpnPeerDelInput::Ifindex
1687
- def ifindex; attributes[:"ifindex"]&.value; end
1032
+ def ifindex; self[:"ifindex"]; end
1688
1033
  # The peer object containing the attributed of interest for the specific operation
1689
1034
  # @rbs return: AttributeSets::PeerDelInput
1690
1035
  # @return [AttributeSets::PeerDelInput]
1691
- # @see AttributeSets::OvpnPeerDelInput::Peer
1692
- def peer; attributes[:"peer"]&.value; end
1036
+ def peer; self[:"peer"]; end
1693
1037
  end
1694
1038
  # Add a cipher key for a specific peer
1695
1039
  #
1696
1040
  # Requires CAP_NET_ADMIN in the initial user namespace.
1697
- class DoKeyNewRequest < ::Nl::Genl::Message
1041
+ class DoKeyNewRequest < ::Nl::Message
1698
1042
  TYPE = 6
1699
1043
  FIXED_HEADER = nil
1700
1044
  ATTRIBUTE_SET = AttributeSets::Ovpn
1701
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
1045
+ ATTRIBUTES = %i[ifindex keyconf].freeze
1046
+ include ATTRIBUTE_SET::Definitions
1047
+ def initialize(attributes = [])
1048
+ @attributes = attributes
1049
+ end
1050
+ # @private
1051
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1052
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1053
+ new(
1054
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1055
+ )
1056
+ end
1057
+ # Decodes a message payload from the decoder into a new instance.
1058
+ # @rbs (::Nl::Decoder decoder) -> instance
1059
+ def self.decode(decoder)
1060
+ new(decode_attributes(decoder, BY_TYPE, 0))
1061
+ end
1062
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1063
+ encode_attributes(encoder, external_selectors:)
1064
+ end
1702
1065
  # Index of the ovpn interface to operate on
1703
1066
  # @rbs return: ::Integer
1704
1067
  # @return [Integer]
1705
- # @see AttributeSets::Ovpn::Ifindex
1706
- def ifindex; attributes[:"ifindex"]&.value; end
1068
+ def ifindex; self[:"ifindex"]; end
1707
1069
  # Peer specific cipher configuration
1708
1070
  # @rbs return: AttributeSets::Keyconf
1709
1071
  # @return [AttributeSets::Keyconf]
1710
- # @see AttributeSets::Ovpn::Keyconf
1711
- def keyconf; attributes[:"keyconf"]&.value; end
1072
+ def keyconf; self[:"keyconf"]; end
1712
1073
  end
1713
1074
  # Retrieve non-sensitive data about peer key and cipher
1714
1075
  #
1715
1076
  # Requires CAP_NET_ADMIN in the initial user namespace.
1716
- class DoKeyGetRequest < ::Nl::Genl::Message
1077
+ class DoKeyGetRequest < ::Nl::Message
1717
1078
  TYPE = 7
1718
1079
  FIXED_HEADER = nil
1719
1080
  ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
1720
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
1081
+ ATTRIBUTES = %i[ifindex keyconf].freeze
1082
+ include ATTRIBUTE_SET::Definitions
1083
+ def initialize(attributes = [])
1084
+ @attributes = attributes
1085
+ end
1086
+ # @private
1087
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1088
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1089
+ new(
1090
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1091
+ )
1092
+ end
1093
+ # Decodes a message payload from the decoder into a new instance.
1094
+ # @rbs (::Nl::Decoder decoder) -> instance
1095
+ def self.decode(decoder)
1096
+ new(decode_attributes(decoder, BY_TYPE, 0))
1097
+ end
1098
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1099
+ encode_attributes(encoder, external_selectors:)
1100
+ end
1721
1101
  # Index of the ovpn interface to operate on
1722
1102
  # @rbs return: ::Integer
1723
1103
  # @return [Integer]
1724
- # @see AttributeSets::OvpnKeyconfGet::Ifindex
1725
- def ifindex; attributes[:"ifindex"]&.value; end
1104
+ def ifindex; self[:"ifindex"]; end
1726
1105
  # Peer specific cipher configuration
1727
1106
  # @rbs return: AttributeSets::KeyconfGet
1728
1107
  # @return [AttributeSets::KeyconfGet]
1729
- # @see AttributeSets::OvpnKeyconfGet::Keyconf
1730
- def keyconf; attributes[:"keyconf"]&.value; end
1108
+ def keyconf; self[:"keyconf"]; end
1731
1109
  end
1732
1110
  # Retrieve non-sensitive data about peer key and cipher
1733
1111
  #
1734
1112
  # Requires CAP_NET_ADMIN in the initial user namespace.
1735
- class DoKeyGetReply < ::Nl::Genl::Message
1113
+ class DoKeyGetReply < ::Nl::Message
1736
1114
  TYPE = 7
1737
1115
  FIXED_HEADER = nil
1738
1116
  ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
1739
- ATTRIBUTES = Ractor.make_shareable(%i[keyconf])
1117
+ ATTRIBUTES = %i[keyconf].freeze
1118
+ include ATTRIBUTE_SET::Definitions
1119
+ def initialize(attributes = [])
1120
+ @attributes = attributes
1121
+ end
1122
+ # @private
1123
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1124
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1125
+ new(
1126
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1127
+ )
1128
+ end
1129
+ # Decodes a message payload from the decoder into a new instance.
1130
+ # @rbs (::Nl::Decoder decoder) -> instance
1131
+ def self.decode(decoder)
1132
+ new(decode_attributes(decoder, BY_TYPE, 0))
1133
+ end
1134
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1135
+ encode_attributes(encoder, external_selectors:)
1136
+ end
1740
1137
  # Peer specific cipher configuration
1741
1138
  # @rbs return: AttributeSets::KeyconfGet
1742
1139
  # @return [AttributeSets::KeyconfGet]
1743
- # @see AttributeSets::OvpnKeyconfGet::Keyconf
1744
- def keyconf; attributes[:"keyconf"]&.value; end
1140
+ def keyconf; self[:"keyconf"]; end
1745
1141
  end
1746
1142
  # Swap primary and secondary session keys for a specific peer
1747
1143
  #
1748
1144
  # Requires CAP_NET_ADMIN in the initial user namespace.
1749
- class DoKeySwapRequest < ::Nl::Genl::Message
1145
+ class DoKeySwapRequest < ::Nl::Message
1750
1146
  TYPE = 8
1751
1147
  FIXED_HEADER = nil
1752
1148
  ATTRIBUTE_SET = AttributeSets::OvpnKeyconfSwapInput
1753
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
1149
+ ATTRIBUTES = %i[ifindex keyconf].freeze
1150
+ include ATTRIBUTE_SET::Definitions
1151
+ def initialize(attributes = [])
1152
+ @attributes = attributes
1153
+ end
1154
+ # @private
1155
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1156
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1157
+ new(
1158
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1159
+ )
1160
+ end
1161
+ # Decodes a message payload from the decoder into a new instance.
1162
+ # @rbs (::Nl::Decoder decoder) -> instance
1163
+ def self.decode(decoder)
1164
+ new(decode_attributes(decoder, BY_TYPE, 0))
1165
+ end
1166
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1167
+ encode_attributes(encoder, external_selectors:)
1168
+ end
1754
1169
  # Index of the ovpn interface to operate on
1755
1170
  # @rbs return: ::Integer
1756
1171
  # @return [Integer]
1757
- # @see AttributeSets::OvpnKeyconfSwapInput::Ifindex
1758
- def ifindex; attributes[:"ifindex"]&.value; end
1172
+ def ifindex; self[:"ifindex"]; end
1759
1173
  # Peer specific cipher configuration
1760
1174
  # @rbs return: AttributeSets::KeyconfSwapInput
1761
1175
  # @return [AttributeSets::KeyconfSwapInput]
1762
- # @see AttributeSets::OvpnKeyconfSwapInput::Keyconf
1763
- def keyconf; attributes[:"keyconf"]&.value; end
1176
+ def keyconf; self[:"keyconf"]; end
1764
1177
  end
1765
1178
  # Delete cipher key for a specific peer
1766
1179
  #
1767
1180
  # Requires CAP_NET_ADMIN in the initial user namespace.
1768
- class DoKeyDelRequest < ::Nl::Genl::Message
1181
+ class DoKeyDelRequest < ::Nl::Message
1769
1182
  TYPE = 10
1770
1183
  FIXED_HEADER = nil
1771
1184
  ATTRIBUTE_SET = AttributeSets::OvpnKeyconfDelInput
1772
- ATTRIBUTES = Ractor.make_shareable(%i[ifindex keyconf])
1185
+ ATTRIBUTES = %i[ifindex keyconf].freeze
1186
+ include ATTRIBUTE_SET::Definitions
1187
+ def initialize(attributes = [])
1188
+ @attributes = attributes
1189
+ end
1190
+ # @private
1191
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1192
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1193
+ new(
1194
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1195
+ )
1196
+ end
1197
+ # Decodes a message payload from the decoder into a new instance.
1198
+ # @rbs (::Nl::Decoder decoder) -> instance
1199
+ def self.decode(decoder)
1200
+ new(decode_attributes(decoder, BY_TYPE, 0))
1201
+ end
1202
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1203
+ encode_attributes(encoder, external_selectors:)
1204
+ end
1773
1205
  # Index of the ovpn interface to operate on
1774
1206
  # @rbs return: ::Integer
1775
1207
  # @return [Integer]
1776
- # @see AttributeSets::OvpnKeyconfDelInput::Ifindex
1777
- def ifindex; attributes[:"ifindex"]&.value; end
1208
+ def ifindex; self[:"ifindex"]; end
1778
1209
  # Peer specific cipher configuration
1779
1210
  # @rbs return: AttributeSets::KeyconfDelInput
1780
1211
  # @return [AttributeSets::KeyconfDelInput]
1781
- # @see AttributeSets::OvpnKeyconfDelInput::Keyconf
1782
- def keyconf; attributes[:"keyconf"]&.value; end
1212
+ def keyconf; self[:"keyconf"]; end
1783
1213
  end
1784
1214
  end
1785
1215
  module Notifications
1786
1216
  # Notification about a peer being deleted
1787
1217
  #
1788
1218
  # Multicast group: `peers`.
1789
- class PeerDelNtf < ::Nl::Genl::Message
1219
+ class PeerDelNtf < ::Nl::Message
1790
1220
  TYPE = 5
1791
1221
  FIXED_HEADER = nil
1792
1222
  ATTRIBUTE_SET = AttributeSets::Ovpn
1793
- ATTRIBUTES = Ractor.make_shareable(%i[peer])
1223
+ ATTRIBUTES = %i[peer].freeze
1224
+ include ATTRIBUTE_SET::Definitions
1225
+ def initialize(attributes = [])
1226
+ @attributes = attributes
1227
+ end
1228
+ # @private
1229
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1230
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1231
+ new(
1232
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1233
+ )
1234
+ end
1235
+ # Decodes a message payload from the decoder into a new instance.
1236
+ # @rbs (::Nl::Decoder decoder) -> instance
1237
+ def self.decode(decoder)
1238
+ new(decode_attributes(decoder, BY_TYPE, 0))
1239
+ end
1240
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1241
+ encode_attributes(encoder, external_selectors:)
1242
+ end
1794
1243
  # The peer object containing the attributed of interest for the specific operation
1795
1244
  # @rbs return: AttributeSets::Peer
1796
1245
  # @return [AttributeSets::Peer]
1797
- # @see AttributeSets::Ovpn::Peer
1798
- def peer; attributes[:"peer"]&.value; end
1246
+ def peer; self[:"peer"]; end
1799
1247
  end
1800
1248
  # Notification about key having exhausted its IV space and requiring renegotiation
1801
1249
  #
1802
1250
  # Multicast group: `peers`.
1803
- class KeySwapNtf < ::Nl::Genl::Message
1251
+ class KeySwapNtf < ::Nl::Message
1804
1252
  TYPE = 9
1805
1253
  FIXED_HEADER = nil
1806
1254
  ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
1807
- ATTRIBUTES = Ractor.make_shareable(%i[keyconf])
1255
+ ATTRIBUTES = %i[keyconf].freeze
1256
+ include ATTRIBUTE_SET::Definitions
1257
+ def initialize(attributes = [])
1258
+ @attributes = attributes
1259
+ end
1260
+ # @private
1261
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1262
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1263
+ new(
1264
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1265
+ )
1266
+ end
1267
+ # Decodes a message payload from the decoder into a new instance.
1268
+ # @rbs (::Nl::Decoder decoder) -> instance
1269
+ def self.decode(decoder)
1270
+ new(decode_attributes(decoder, BY_TYPE, 0))
1271
+ end
1272
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1273
+ encode_attributes(encoder, external_selectors:)
1274
+ end
1808
1275
  # Peer specific cipher configuration
1809
1276
  # @rbs return: AttributeSets::KeyconfGet
1810
1277
  # @return [AttributeSets::KeyconfGet]
1811
- # @see AttributeSets::OvpnKeyconfGet::Keyconf
1812
- def keyconf; attributes[:"keyconf"]&.value; end
1278
+ def keyconf; self[:"keyconf"]; end
1813
1279
  end
1814
1280
  # Notification about a peer floating (changing its remote UDP endpoint)
1815
1281
  #
1816
1282
  # Multicast group: `peers`.
1817
- class PeerFloatNtf < ::Nl::Genl::Message
1283
+ class PeerFloatNtf < ::Nl::Message
1818
1284
  TYPE = 11
1819
1285
  FIXED_HEADER = nil
1820
1286
  ATTRIBUTE_SET = AttributeSets::Ovpn
1821
- ATTRIBUTES = Ractor.make_shareable(%i[peer])
1287
+ ATTRIBUTES = %i[peer].freeze
1288
+ include ATTRIBUTE_SET::Definitions
1289
+ def initialize(attributes = [])
1290
+ @attributes = attributes
1291
+ end
1292
+ # @private
1293
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1294
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
1295
+ new(
1296
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1297
+ )
1298
+ end
1299
+ # Decodes a message payload from the decoder into a new instance.
1300
+ # @rbs (::Nl::Decoder decoder) -> instance
1301
+ def self.decode(decoder)
1302
+ new(decode_attributes(decoder, BY_TYPE, 0))
1303
+ end
1304
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1305
+ encode_attributes(encoder, external_selectors:)
1306
+ end
1822
1307
  # The peer object containing the attributed of interest for the specific operation
1823
1308
  # @rbs return: AttributeSets::Peer
1824
1309
  # @return [AttributeSets::Peer]
1825
- # @see AttributeSets::Ovpn::Peer
1826
- def peer; attributes[:"peer"]&.value; end
1310
+ def peer; self[:"peer"]; end
1827
1311
  end
1828
1312
  end
1829
1313
  # @private
1830
- NOTIFICATIONS = Ractor.make_shareable({5 => Notifications::PeerDelNtf, 9 => Notifications::KeySwapNtf, 11 => Notifications::PeerFloatNtf}) #: Hash[::Integer, ::Class]
1314
+ NOTIFICATIONS = {5 => Notifications::PeerDelNtf, 9 => Notifications::KeySwapNtf, 11 => Notifications::PeerFloatNtf}.freeze #: Hash[::Integer, ::Class]
1831
1315
  # Add a remote peer
1832
1316
  #
1833
1317
  # Requires CAP_NET_ADMIN in the initial user namespace.