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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
data/generated/nl/linux/ovpn.rb
CHANGED
|
@@ -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.
|
|
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 =
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
# @
|
|
71
|
-
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
# @
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
#
|
|
89
|
-
|
|
90
|
-
# @
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# @
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
# @
|
|
107
|
-
|
|
108
|
-
#
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
# @
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# @
|
|
125
|
-
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
# @
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
#
|
|
143
|
-
|
|
144
|
-
# @
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
# @
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
# @
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
#
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
# @
|
|
434
|
-
|
|
435
|
-
#
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
# @
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
#
|
|
452
|
-
|
|
453
|
-
# @
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
# @
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
# @
|
|
470
|
-
|
|
471
|
-
#
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
# @
|
|
639
|
-
|
|
640
|
-
#
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
# @
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
#
|
|
657
|
-
|
|
658
|
-
# @
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
# @
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
# @
|
|
675
|
-
|
|
676
|
-
#
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
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
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
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
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
#
|
|
1029
|
-
|
|
1030
|
-
# @
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
# @
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
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
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
# @
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
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
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
#
|
|
1090
|
-
# @
|
|
1091
|
-
def
|
|
1092
|
-
|
|
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
|
-
|
|
1109
|
-
|
|
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
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
# @
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
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
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
#
|
|
1132
|
-
# @rbs return:
|
|
1133
|
-
# @
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
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
|
|
1145
|
-
|
|
1146
|
-
|
|
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
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
# @
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
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
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
#
|
|
1182
|
-
# @
|
|
1183
|
-
def
|
|
1184
|
-
|
|
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
|
|
1200
|
-
|
|
1201
|
-
|
|
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
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
# @
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
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
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
# @
|
|
1217
|
-
|
|
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
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
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
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
#
|
|
1247
|
-
|
|
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
|
|
1261
|
-
|
|
1262
|
-
|
|
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
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
NAME = :"ifindex"
|
|
634
|
+
end
|
|
635
|
+
class PeerDelInput
|
|
636
|
+
module Definitions
|
|
1268
637
|
# @private
|
|
1269
|
-
|
|
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
|
-
|
|
643
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1272
644
|
end
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
NAME = :"peer"
|
|
645
|
+
end
|
|
646
|
+
class Keyconf
|
|
647
|
+
module Definitions
|
|
1277
648
|
# @private
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
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
|
|
1310
|
-
|
|
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
|
-
|
|
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
|
-
|
|
671
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1321
672
|
end
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
NAME = :"peer"
|
|
673
|
+
end
|
|
674
|
+
class KeyconfGet
|
|
675
|
+
module Definitions
|
|
1326
676
|
# @private
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
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
|
|
1359
|
-
|
|
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
|
-
|
|
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
|
-
|
|
696
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1370
697
|
end
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
NAME = :"peer"
|
|
698
|
+
end
|
|
699
|
+
class KeyconfDelInput
|
|
700
|
+
module Definitions
|
|
1375
701
|
# @private
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
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
|
|
1408
|
-
|
|
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
|
-
|
|
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
|
-
|
|
721
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1419
722
|
end
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
NAME = :"keyconf"
|
|
723
|
+
end
|
|
724
|
+
class OvpnPeerNewInput
|
|
725
|
+
module Definitions
|
|
1424
726
|
# @private
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
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
|
|
1457
|
-
|
|
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
|
-
|
|
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
|
-
|
|
745
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1468
746
|
end
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
NAME = :"keyconf"
|
|
747
|
+
end
|
|
748
|
+
class OvpnPeerDelInput
|
|
749
|
+
module Definitions
|
|
1473
750
|
# @private
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
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
|
|
1506
|
-
|
|
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
|
-
|
|
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
|
-
|
|
769
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1517
770
|
end
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
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
|
-
|
|
781
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
1524
782
|
end
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
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::
|
|
801
|
+
class DoPeerNewRequest < ::Nl::Message
|
|
1580
802
|
TYPE = 1
|
|
1581
803
|
FIXED_HEADER = nil
|
|
1582
804
|
ATTRIBUTE_SET = AttributeSets::OvpnPeerNewInput
|
|
1583
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
837
|
+
class DoPeerSetRequest < ::Nl::Message
|
|
1599
838
|
TYPE = 2
|
|
1600
839
|
FIXED_HEADER = nil
|
|
1601
840
|
ATTRIBUTE_SET = AttributeSets::OvpnPeerSetInput
|
|
1602
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
873
|
+
class DoPeerGetRequest < ::Nl::Message
|
|
1618
874
|
TYPE = 3
|
|
1619
875
|
FIXED_HEADER = nil
|
|
1620
876
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1621
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
909
|
+
class DoPeerGetReply < ::Nl::Message
|
|
1637
910
|
TYPE = 3
|
|
1638
911
|
FIXED_HEADER = nil
|
|
1639
912
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1640
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
941
|
+
class DumpPeerGetRequest < ::Nl::Message
|
|
1651
942
|
TYPE = 3
|
|
1652
943
|
FIXED_HEADER = nil
|
|
1653
944
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1654
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
973
|
+
class DumpPeerGetReply < ::Nl::Message
|
|
1665
974
|
TYPE = 3
|
|
1666
975
|
FIXED_HEADER = nil
|
|
1667
976
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1668
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
1005
|
+
class DoPeerDelRequest < ::Nl::Message
|
|
1679
1006
|
TYPE = 4
|
|
1680
1007
|
FIXED_HEADER = nil
|
|
1681
1008
|
ATTRIBUTE_SET = AttributeSets::OvpnPeerDelInput
|
|
1682
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
1041
|
+
class DoKeyNewRequest < ::Nl::Message
|
|
1698
1042
|
TYPE = 6
|
|
1699
1043
|
FIXED_HEADER = nil
|
|
1700
1044
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1701
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
1077
|
+
class DoKeyGetRequest < ::Nl::Message
|
|
1717
1078
|
TYPE = 7
|
|
1718
1079
|
FIXED_HEADER = nil
|
|
1719
1080
|
ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
|
|
1720
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
1113
|
+
class DoKeyGetReply < ::Nl::Message
|
|
1736
1114
|
TYPE = 7
|
|
1737
1115
|
FIXED_HEADER = nil
|
|
1738
1116
|
ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
|
|
1739
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
1145
|
+
class DoKeySwapRequest < ::Nl::Message
|
|
1750
1146
|
TYPE = 8
|
|
1751
1147
|
FIXED_HEADER = nil
|
|
1752
1148
|
ATTRIBUTE_SET = AttributeSets::OvpnKeyconfSwapInput
|
|
1753
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
1181
|
+
class DoKeyDelRequest < ::Nl::Message
|
|
1769
1182
|
TYPE = 10
|
|
1770
1183
|
FIXED_HEADER = nil
|
|
1771
1184
|
ATTRIBUTE_SET = AttributeSets::OvpnKeyconfDelInput
|
|
1772
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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
|
-
|
|
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::
|
|
1219
|
+
class PeerDelNtf < ::Nl::Message
|
|
1790
1220
|
TYPE = 5
|
|
1791
1221
|
FIXED_HEADER = nil
|
|
1792
1222
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1793
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
1251
|
+
class KeySwapNtf < ::Nl::Message
|
|
1804
1252
|
TYPE = 9
|
|
1805
1253
|
FIXED_HEADER = nil
|
|
1806
1254
|
ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
|
|
1807
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
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::
|
|
1283
|
+
class PeerFloatNtf < ::Nl::Message
|
|
1818
1284
|
TYPE = 11
|
|
1819
1285
|
FIXED_HEADER = nil
|
|
1820
1286
|
ATTRIBUTE_SET = AttributeSets::Ovpn
|
|
1821
|
-
ATTRIBUTES =
|
|
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
|
-
|
|
1826
|
-
def peer; attributes[:"peer"]&.value; end
|
|
1310
|
+
def peer; self[:"peer"]; end
|
|
1827
1311
|
end
|
|
1828
1312
|
end
|
|
1829
1313
|
# @private
|
|
1830
|
-
NOTIFICATIONS =
|
|
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.
|