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