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