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