nl-linux 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
data/generated/nl/linux/psp.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
2
|
#
|
|
3
|
-
# This file is based on Documentation/netlink/specs/psp.yaml from Linux v7.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/psp.yaml from Linux v7.3.
|
|
4
4
|
#--
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
@@ -27,7 +27,7 @@ class Psp < ::Nl::Genl::Family
|
|
|
27
27
|
super
|
|
28
28
|
end
|
|
29
29
|
# @private
|
|
30
|
-
MCAST_GROUPS =
|
|
30
|
+
MCAST_GROUPS = {:"mgmt" => ::Nl::McastGroup.new("mgmt", nil), :"use" => ::Nl::McastGroup.new("use", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
31
31
|
module Enums
|
|
32
32
|
module Version
|
|
33
33
|
Hdr0AesGcm128 = 0
|
|
@@ -48,738 +48,604 @@ class Psp < ::Nl::Genl::Family
|
|
|
48
48
|
end
|
|
49
49
|
module AttributeSets
|
|
50
50
|
class AssocDevInfo < ::Nl::AttributeSet
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
module Definitions
|
|
52
|
+
# ifindex of an associated network device.
|
|
53
|
+
# @rbs return: ::Integer
|
|
54
|
+
# @return [Integer]
|
|
55
|
+
def ifindex; self[:"ifindex"]; end
|
|
56
|
+
# Network namespace ID of the associated device.
|
|
57
|
+
# @rbs return: ::Integer
|
|
58
|
+
# @return [Integer]
|
|
59
|
+
def nsid; self[:"nsid"]; end
|
|
53
60
|
end
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
ORDER = 0
|
|
60
|
-
# @private
|
|
61
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
62
|
-
end
|
|
63
|
-
# Network namespace ID of the associated device.
|
|
64
|
-
class Nsid < Attribute
|
|
65
|
-
TYPE = 2
|
|
66
|
-
NAME = :"nsid"
|
|
67
|
-
# @private
|
|
68
|
-
ORDER = 1
|
|
69
|
-
# @private
|
|
70
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
71
|
-
end
|
|
72
|
-
# @private
|
|
73
|
-
BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"nsid" => Nsid}) #: Hash[::Symbol, Attribute]
|
|
74
|
-
# @private
|
|
75
|
-
BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Nsid}) #: Hash[::Integer, Attribute]
|
|
76
|
-
# ifindex of an associated network device.
|
|
77
|
-
# @rbs return: ::Integer
|
|
78
|
-
# @return [Integer]
|
|
79
|
-
# @see Ifindex
|
|
80
|
-
def ifindex; self[:"ifindex"]&.value; end
|
|
81
|
-
# Network namespace ID of the associated device.
|
|
82
|
-
# @rbs return: ::Integer
|
|
83
|
-
# @return [Integer]
|
|
84
|
-
# @see Nsid
|
|
85
|
-
def nsid; self[:"nsid"]&.value; end
|
|
86
|
-
class << self
|
|
87
|
-
# Looks up Attribute class by name.
|
|
88
|
-
# @rbs name: Symbol
|
|
89
|
-
# @rbs return: Attribute
|
|
90
|
-
# @param [Symbol] name
|
|
91
|
-
# @return [Attribute]
|
|
92
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
93
|
-
# Looks up Attribute class by type value.
|
|
94
|
-
# @rbs type: Integer
|
|
95
|
-
# @rbs return: Attribute
|
|
96
|
-
# @param [Integer] type
|
|
97
|
-
# @return [Attribute]
|
|
98
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
61
|
+
include Definitions
|
|
62
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
63
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
64
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
65
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
99
66
|
end
|
|
100
67
|
end
|
|
101
68
|
class Dev < ::Nl::AttributeSet
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
# @
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
#
|
|
120
|
-
|
|
121
|
-
# @
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
#
|
|
131
|
-
|
|
132
|
-
# @
|
|
133
|
-
|
|
69
|
+
module Definitions
|
|
70
|
+
# PSP device ID.
|
|
71
|
+
# @rbs return: ::Integer
|
|
72
|
+
# @return [Integer]
|
|
73
|
+
def id; self[:"id"]; end
|
|
74
|
+
# ifindex of the main netdevice linked to the PSP device,
|
|
75
|
+
# or the ifindex to associate with the PSP device.
|
|
76
|
+
# @rbs return: ::Integer
|
|
77
|
+
# @return [Integer]
|
|
78
|
+
def ifindex; self[:"ifindex"]; end
|
|
79
|
+
# Bitmask of PSP versions supported by the device.
|
|
80
|
+
#
|
|
81
|
+
# Known flags are defined in {Flags::Version}.
|
|
82
|
+
# @rbs return: ::Integer
|
|
83
|
+
# @return [Integer]
|
|
84
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
85
|
+
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
86
|
+
#
|
|
87
|
+
# Known flags are defined in {Flags::Version}.
|
|
88
|
+
# @rbs return: ::Integer
|
|
89
|
+
# @return [Integer]
|
|
90
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
91
|
+
# List of associated virtual devices.
|
|
92
|
+
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
93
|
+
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
94
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
95
|
+
# Network namespace ID for the device to associate/disassociate.
|
|
96
|
+
# Optional for dev-assoc and dev-disassoc; if not present, the
|
|
97
|
+
# device is looked up in the caller's network namespace.
|
|
98
|
+
# @rbs return: ::Integer
|
|
99
|
+
# @return [Integer]
|
|
100
|
+
def nsid; self[:"nsid"]; end
|
|
101
|
+
# Flag indicating the PSP device is an associated device from a
|
|
102
|
+
# different network namespace.
|
|
103
|
+
# Present when in associated namespace, absent when in primary/host
|
|
104
|
+
# namespace.
|
|
105
|
+
# @rbs return: ::Integer
|
|
106
|
+
# @return [Integer]
|
|
107
|
+
def by_association; self[:"by_association"]; end
|
|
134
108
|
end
|
|
135
|
-
|
|
136
|
-
#
|
|
137
|
-
#
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
NAME = :"psp_versions_ena"
|
|
141
|
-
# @private
|
|
142
|
-
ORDER = 3
|
|
143
|
-
# @private
|
|
144
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
145
|
-
end
|
|
146
|
-
# List of associated virtual devices.
|
|
147
|
-
class AssocList < Attribute
|
|
148
|
-
TYPE = 5
|
|
149
|
-
NAME = :"assoc_list"
|
|
150
|
-
# @private
|
|
151
|
-
MULTI = true
|
|
152
|
-
# @private
|
|
153
|
-
ORDER = 4
|
|
154
|
-
end
|
|
155
|
-
# Network namespace ID for the device to associate/disassociate.
|
|
156
|
-
# Optional for dev-assoc and dev-disassoc; if not present, the
|
|
157
|
-
# device is looked up in the caller's network namespace.
|
|
158
|
-
class Nsid < Attribute
|
|
159
|
-
TYPE = 6
|
|
160
|
-
NAME = :"nsid"
|
|
161
|
-
# @private
|
|
162
|
-
ORDER = 5
|
|
163
|
-
# @private
|
|
164
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
165
|
-
end
|
|
166
|
-
# Flag indicating the PSP device is an associated device from a
|
|
167
|
-
# different network namespace.
|
|
168
|
-
# Present when in associated namespace, absent when in primary/host
|
|
169
|
-
# namespace.
|
|
170
|
-
class ByAssociation < Attribute
|
|
171
|
-
TYPE = 7
|
|
172
|
-
NAME = :"by_association"
|
|
173
|
-
# @private
|
|
174
|
-
ORDER = 6
|
|
175
|
-
# @private
|
|
176
|
-
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
177
|
-
end
|
|
178
|
-
# @private
|
|
179
|
-
BY_NAME = Ractor.make_shareable({:"id" => Id, :"ifindex" => Ifindex, :"psp_versions_cap" => PspVersionsCap, :"psp_versions_ena" => PspVersionsEna, :"assoc_list" => AssocList, :"nsid" => Nsid, :"by_association" => ByAssociation}) #: Hash[::Symbol, Attribute]
|
|
180
|
-
# @private
|
|
181
|
-
BY_TYPE = Ractor.make_shareable({1 => Id, 2 => Ifindex, 3 => PspVersionsCap, 4 => PspVersionsEna, 5 => AssocList, 6 => Nsid, 7 => ByAssociation}) #: Hash[::Integer, Attribute]
|
|
182
|
-
# PSP device ID.
|
|
183
|
-
# @rbs return: ::Integer
|
|
184
|
-
# @return [Integer]
|
|
185
|
-
# @see Id
|
|
186
|
-
def id; self[:"id"]&.value; end
|
|
187
|
-
# ifindex of the main netdevice linked to the PSP device,
|
|
188
|
-
# or the ifindex to associate with the PSP device.
|
|
189
|
-
# @rbs return: ::Integer
|
|
190
|
-
# @return [Integer]
|
|
191
|
-
# @see Ifindex
|
|
192
|
-
def ifindex; self[:"ifindex"]&.value; end
|
|
193
|
-
# Bitmask of PSP versions supported by the device.
|
|
194
|
-
#
|
|
195
|
-
# Known flags are defined in {Flags::Version}.
|
|
196
|
-
# @rbs return: ::Integer
|
|
197
|
-
# @return [Integer]
|
|
198
|
-
# @see PspVersionsCap
|
|
199
|
-
def psp_versions_cap; self[:"psp_versions_cap"]&.value; end
|
|
200
|
-
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
201
|
-
#
|
|
202
|
-
# Known flags are defined in {Flags::Version}.
|
|
203
|
-
# @rbs return: ::Integer
|
|
204
|
-
# @return [Integer]
|
|
205
|
-
# @see PspVersionsEna
|
|
206
|
-
def psp_versions_ena; self[:"psp_versions_ena"]&.value; end
|
|
207
|
-
# List of associated virtual devices.
|
|
208
|
-
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
209
|
-
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
210
|
-
# @see AssocList
|
|
211
|
-
def assoc_list; self[:"assoc_list"].map(&:value); end
|
|
212
|
-
# Network namespace ID for the device to associate/disassociate.
|
|
213
|
-
# Optional for dev-assoc and dev-disassoc; if not present, the
|
|
214
|
-
# device is looked up in the caller's network namespace.
|
|
215
|
-
# @rbs return: ::Integer
|
|
216
|
-
# @return [Integer]
|
|
217
|
-
# @see Nsid
|
|
218
|
-
def nsid; self[:"nsid"]&.value; end
|
|
219
|
-
# Flag indicating the PSP device is an associated device from a
|
|
220
|
-
# different network namespace.
|
|
221
|
-
# Present when in associated namespace, absent when in primary/host
|
|
222
|
-
# namespace.
|
|
223
|
-
# @rbs return: ::Integer
|
|
224
|
-
# @return [Integer]
|
|
225
|
-
# @see ByAssociation
|
|
226
|
-
def by_association; self[:"by_association"]&.value; end
|
|
227
|
-
class << self
|
|
228
|
-
# Looks up Attribute class by name.
|
|
229
|
-
# @rbs name: Symbol
|
|
230
|
-
# @rbs return: Attribute
|
|
231
|
-
# @param [Symbol] name
|
|
232
|
-
# @return [Attribute]
|
|
233
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
234
|
-
# Looks up Attribute class by type value.
|
|
235
|
-
# @rbs type: Integer
|
|
236
|
-
# @rbs return: Attribute
|
|
237
|
-
# @param [Integer] type
|
|
238
|
-
# @return [Attribute]
|
|
239
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
109
|
+
include Definitions
|
|
110
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
111
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
112
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
113
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
240
114
|
end
|
|
241
115
|
end
|
|
242
116
|
class Assoc < ::Nl::AttributeSet
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
#
|
|
251
|
-
|
|
252
|
-
#
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
# @
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
267
|
-
end
|
|
268
|
-
class RxKey < Attribute
|
|
269
|
-
TYPE = 3
|
|
270
|
-
NAME = :"rx_key"
|
|
271
|
-
# @private
|
|
272
|
-
ORDER = 2
|
|
273
|
-
end
|
|
274
|
-
class TxKey < Attribute
|
|
275
|
-
TYPE = 4
|
|
276
|
-
NAME = :"tx_key"
|
|
277
|
-
# @private
|
|
278
|
-
ORDER = 3
|
|
117
|
+
module Definitions
|
|
118
|
+
# PSP device ID.
|
|
119
|
+
# @rbs return: ::Integer
|
|
120
|
+
# @return [Integer]
|
|
121
|
+
def dev_id; self[:"dev_id"]; end
|
|
122
|
+
# PSP versions (AEAD and protocol version) used by this association,
|
|
123
|
+
# dictates the size of the key.
|
|
124
|
+
#
|
|
125
|
+
#
|
|
126
|
+
# Known enum values are defined in {Enums::Version}.
|
|
127
|
+
# @rbs return: ::Integer
|
|
128
|
+
# @return [Integer]
|
|
129
|
+
def version; self[:"version"]; end
|
|
130
|
+
# @rbs return: AttributeSets::Keys
|
|
131
|
+
# @return [AttributeSets::Keys]
|
|
132
|
+
def rx_key; self[:"rx_key"]; end
|
|
133
|
+
# @rbs return: AttributeSets::Keys
|
|
134
|
+
# @return [AttributeSets::Keys]
|
|
135
|
+
def tx_key; self[:"tx_key"]; end
|
|
136
|
+
# Sockets which should be bound to the association immediately.
|
|
137
|
+
# @rbs return: ::Integer
|
|
138
|
+
# @return [Integer]
|
|
139
|
+
def sock_fd; self[:"sock_fd"]; end
|
|
279
140
|
end
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
ORDER = 4
|
|
286
|
-
# @private
|
|
287
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
288
|
-
end
|
|
289
|
-
# @private
|
|
290
|
-
BY_NAME = Ractor.make_shareable({:"dev_id" => DevId, :"version" => Version, :"rx_key" => RxKey, :"tx_key" => TxKey, :"sock_fd" => SockFd}) #: Hash[::Symbol, Attribute]
|
|
291
|
-
# @private
|
|
292
|
-
BY_TYPE = Ractor.make_shareable({1 => DevId, 2 => Version, 3 => RxKey, 4 => TxKey, 5 => SockFd}) #: Hash[::Integer, Attribute]
|
|
293
|
-
# PSP device ID.
|
|
294
|
-
# @rbs return: ::Integer
|
|
295
|
-
# @return [Integer]
|
|
296
|
-
# @see DevId
|
|
297
|
-
def dev_id; self[:"dev_id"]&.value; end
|
|
298
|
-
# PSP versions (AEAD and protocol version) used by this association,
|
|
299
|
-
# dictates the size of the key.
|
|
300
|
-
#
|
|
301
|
-
#
|
|
302
|
-
# Known enum values are defined in {Enums::Version}.
|
|
303
|
-
# @rbs return: ::Integer
|
|
304
|
-
# @return [Integer]
|
|
305
|
-
# @see Version
|
|
306
|
-
def version; self[:"version"]&.value; end
|
|
307
|
-
# @rbs return: AttributeSets::Keys
|
|
308
|
-
# @return [AttributeSets::Keys]
|
|
309
|
-
# @see RxKey
|
|
310
|
-
def rx_key; self[:"rx_key"]&.value; end
|
|
311
|
-
# @rbs return: AttributeSets::Keys
|
|
312
|
-
# @return [AttributeSets::Keys]
|
|
313
|
-
# @see TxKey
|
|
314
|
-
def tx_key; self[:"tx_key"]&.value; end
|
|
315
|
-
# Sockets which should be bound to the association immediately.
|
|
316
|
-
# @rbs return: ::Integer
|
|
317
|
-
# @return [Integer]
|
|
318
|
-
# @see SockFd
|
|
319
|
-
def sock_fd; self[:"sock_fd"]&.value; end
|
|
320
|
-
class << self
|
|
321
|
-
# Looks up Attribute class by name.
|
|
322
|
-
# @rbs name: Symbol
|
|
323
|
-
# @rbs return: Attribute
|
|
324
|
-
# @param [Symbol] name
|
|
325
|
-
# @return [Attribute]
|
|
326
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
327
|
-
# Looks up Attribute class by type value.
|
|
328
|
-
# @rbs type: Integer
|
|
329
|
-
# @rbs return: Attribute
|
|
330
|
-
# @param [Integer] type
|
|
331
|
-
# @return [Attribute]
|
|
332
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
141
|
+
include Definitions
|
|
142
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
143
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
144
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
145
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
333
146
|
end
|
|
334
147
|
end
|
|
335
148
|
class Keys < ::Nl::AttributeSet
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
# @
|
|
343
|
-
|
|
344
|
-
# @private
|
|
345
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
346
|
-
end
|
|
347
|
-
# Security Parameters Index (SPI) of the association.
|
|
348
|
-
class Spi < Attribute
|
|
349
|
-
TYPE = 2
|
|
350
|
-
NAME = :"spi"
|
|
351
|
-
# @private
|
|
352
|
-
ORDER = 1
|
|
353
|
-
# @private
|
|
354
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
149
|
+
module Definitions
|
|
150
|
+
# @rbs return: ::String
|
|
151
|
+
# @return [String]
|
|
152
|
+
def key; self[:"key"]; end
|
|
153
|
+
# Security Parameters Index (SPI) of the association.
|
|
154
|
+
# @rbs return: ::Integer
|
|
155
|
+
# @return [Integer]
|
|
156
|
+
def spi; self[:"spi"]; end
|
|
355
157
|
end
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
# @
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
# @return [String]
|
|
362
|
-
# @see Key
|
|
363
|
-
def key; self[:"key"]&.value; end
|
|
364
|
-
# Security Parameters Index (SPI) of the association.
|
|
365
|
-
# @rbs return: ::Integer
|
|
366
|
-
# @return [Integer]
|
|
367
|
-
# @see Spi
|
|
368
|
-
def spi; self[:"spi"]&.value; end
|
|
369
|
-
class << self
|
|
370
|
-
# Looks up Attribute class by name.
|
|
371
|
-
# @rbs name: Symbol
|
|
372
|
-
# @rbs return: Attribute
|
|
373
|
-
# @param [Symbol] name
|
|
374
|
-
# @return [Attribute]
|
|
375
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
376
|
-
# Looks up Attribute class by type value.
|
|
377
|
-
# @rbs type: Integer
|
|
378
|
-
# @rbs return: Attribute
|
|
379
|
-
# @param [Integer] type
|
|
380
|
-
# @return [Attribute]
|
|
381
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
158
|
+
include Definitions
|
|
159
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
160
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
161
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
162
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
382
163
|
end
|
|
383
164
|
end
|
|
384
165
|
class Stats < ::Nl::AttributeSet
|
|
385
|
-
|
|
386
|
-
|
|
166
|
+
module Definitions
|
|
167
|
+
# PSP device ID.
|
|
168
|
+
# @rbs return: ::Integer
|
|
169
|
+
# @return [Integer]
|
|
170
|
+
def dev_id; self[:"dev_id"]; end
|
|
171
|
+
# Number of key rotations during the lifetime of the device.
|
|
172
|
+
# Kernel statistic.
|
|
173
|
+
# @rbs return: ::Integer
|
|
174
|
+
# @return [Integer]
|
|
175
|
+
def key_rotations; self[:"key_rotations"]; end
|
|
176
|
+
# Number of times a socket's Rx got shut down due to using
|
|
177
|
+
# a key which went stale (fully rotated out).
|
|
178
|
+
# Kernel statistic.
|
|
179
|
+
# @rbs return: ::Integer
|
|
180
|
+
# @return [Integer]
|
|
181
|
+
def stale_events; self[:"stale_events"]; end
|
|
182
|
+
# Number of successfully processed and authenticated PSP packets.
|
|
183
|
+
# Device statistic (from the PSP spec).
|
|
184
|
+
# @rbs return: ::Integer
|
|
185
|
+
# @return [Integer]
|
|
186
|
+
def rx_packets; self[:"rx_packets"]; end
|
|
187
|
+
# Number of successfully authenticated PSP bytes received, counting from
|
|
188
|
+
# the first byte after the IV through the last byte of payload.
|
|
189
|
+
# The fixed initial portion of the PSP header (16 bytes)
|
|
190
|
+
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
191
|
+
# Device statistic (from the PSP spec).
|
|
192
|
+
# @rbs return: ::Integer
|
|
193
|
+
# @return [Integer]
|
|
194
|
+
def rx_bytes; self[:"rx_bytes"]; end
|
|
195
|
+
# Number of received PSP packets with unsuccessful authentication.
|
|
196
|
+
# Device statistic (from the PSP spec).
|
|
197
|
+
# @rbs return: ::Integer
|
|
198
|
+
# @return [Integer]
|
|
199
|
+
def rx_auth_fail; self[:"rx_auth_fail"]; end
|
|
200
|
+
# Number of received PSP packets with length/framing errors.
|
|
201
|
+
# Device statistic (from the PSP spec).
|
|
202
|
+
# @rbs return: ::Integer
|
|
203
|
+
# @return [Integer]
|
|
204
|
+
def rx_error; self[:"rx_error"]; end
|
|
205
|
+
# Number of received PSP packets with miscellaneous errors
|
|
206
|
+
# (invalid master key indicated by SPI, unsupported version, etc.)
|
|
207
|
+
# Device statistic (from the PSP spec).
|
|
208
|
+
# @rbs return: ::Integer
|
|
209
|
+
# @return [Integer]
|
|
210
|
+
def rx_bad; self[:"rx_bad"]; end
|
|
211
|
+
# Number of successfully processed PSP packets for transmission.
|
|
212
|
+
# Device statistic (from the PSP spec).
|
|
213
|
+
# @rbs return: ::Integer
|
|
214
|
+
# @return [Integer]
|
|
215
|
+
def tx_packets; self[:"tx_packets"]; end
|
|
216
|
+
# Number of successfully processed PSP bytes for transmit, counting from
|
|
217
|
+
# the first byte after the IV through the last byte of payload.
|
|
218
|
+
# The fixed initial portion of the PSP header (16 bytes)
|
|
219
|
+
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
220
|
+
# Device statistic (from the PSP spec).
|
|
221
|
+
# @rbs return: ::Integer
|
|
222
|
+
# @return [Integer]
|
|
223
|
+
def tx_bytes; self[:"tx_bytes"]; end
|
|
224
|
+
# Number of PSP packets for transmission with errors.
|
|
225
|
+
# Device statistic (from the PSP spec).
|
|
226
|
+
# @rbs return: ::Integer
|
|
227
|
+
# @return [Integer]
|
|
228
|
+
def tx_error; self[:"tx_error"]; end
|
|
387
229
|
end
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
ORDER = 0
|
|
394
|
-
# @private
|
|
395
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
|
|
396
|
-
end
|
|
397
|
-
# Number of key rotations during the lifetime of the device.
|
|
398
|
-
# Kernel statistic.
|
|
399
|
-
class KeyRotations < Attribute
|
|
400
|
-
TYPE = 2
|
|
401
|
-
NAME = :"key_rotations"
|
|
402
|
-
# @private
|
|
403
|
-
ORDER = 1
|
|
404
|
-
# @private
|
|
405
|
-
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
230
|
+
include Definitions
|
|
231
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
232
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
233
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
234
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
406
235
|
end
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
NAME = :"stale_events"
|
|
413
|
-
# @private
|
|
414
|
-
ORDER = 2
|
|
415
|
-
# @private
|
|
416
|
-
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
417
|
-
end
|
|
418
|
-
# Number of successfully processed and authenticated PSP packets.
|
|
419
|
-
# Device statistic (from the PSP spec).
|
|
420
|
-
class RxPackets < Attribute
|
|
421
|
-
TYPE = 4
|
|
422
|
-
NAME = :"rx_packets"
|
|
423
|
-
# @private
|
|
424
|
-
ORDER = 3
|
|
425
|
-
# @private
|
|
426
|
-
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
427
|
-
end
|
|
428
|
-
# Number of successfully authenticated PSP bytes received, counting from
|
|
429
|
-
# the first byte after the IV through the last byte of payload.
|
|
430
|
-
# The fixed initial portion of the PSP header (16 bytes)
|
|
431
|
-
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
432
|
-
# Device statistic (from the PSP spec).
|
|
433
|
-
class RxBytes < Attribute
|
|
434
|
-
TYPE = 5
|
|
435
|
-
NAME = :"rx_bytes"
|
|
436
|
-
# @private
|
|
437
|
-
ORDER = 4
|
|
438
|
-
# @private
|
|
439
|
-
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
440
|
-
end
|
|
441
|
-
# Number of received PSP packets with unsuccessful authentication.
|
|
442
|
-
# Device statistic (from the PSP spec).
|
|
443
|
-
class RxAuthFail < Attribute
|
|
444
|
-
TYPE = 6
|
|
445
|
-
NAME = :"rx_auth_fail"
|
|
446
|
-
# @private
|
|
447
|
-
ORDER = 5
|
|
448
|
-
# @private
|
|
449
|
-
DATATYPE = ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false, check: nil)
|
|
450
|
-
end
|
|
451
|
-
# Number of received PSP packets with length/framing errors.
|
|
452
|
-
# Device statistic (from the PSP spec).
|
|
453
|
-
class RxError < Attribute
|
|
454
|
-
TYPE = 7
|
|
455
|
-
NAME = :"rx_error"
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
module AttributeSets
|
|
239
|
+
class AssocDevInfo
|
|
240
|
+
module Definitions
|
|
456
241
|
# @private
|
|
457
|
-
|
|
242
|
+
BY_TYPE = ::Array.new(3).tap do |definitions|
|
|
243
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
|
|
244
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"nsid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 1, selector_slot: nil)
|
|
245
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
246
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
458
247
|
# @private
|
|
459
|
-
|
|
248
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
460
249
|
end
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
class RxBad < Attribute
|
|
465
|
-
TYPE = 8
|
|
466
|
-
NAME = :"rx_bad"
|
|
250
|
+
end
|
|
251
|
+
class Dev
|
|
252
|
+
module Definitions
|
|
467
253
|
# @private
|
|
468
|
-
|
|
254
|
+
BY_TYPE = ::Array.new(8).tap do |definitions|
|
|
255
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"id", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 0, selector_slot: nil)
|
|
256
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
257
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"psp_versions_cap", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 2, selector_slot: nil)
|
|
258
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"psp_versions_ena", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
|
|
259
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"assoc_list", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AssocDevInfo, selector_bindings: []), multi: true, order: 4, selector_slot: nil)
|
|
260
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"nsid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 5, selector_slot: nil)
|
|
261
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"by_association", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 6, selector_slot: nil)
|
|
262
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
263
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
469
264
|
# @private
|
|
470
|
-
|
|
265
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
471
266
|
end
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
TYPE = 9
|
|
476
|
-
NAME = :"tx_packets"
|
|
267
|
+
end
|
|
268
|
+
class Assoc
|
|
269
|
+
module Definitions
|
|
477
270
|
# @private
|
|
478
|
-
|
|
271
|
+
BY_TYPE = ::Array.new(6).tap do |definitions|
|
|
272
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dev_id", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 0, selector_slot: nil)
|
|
273
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"version", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
274
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"rx_key", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keys, selector_bindings: []), multi: false, order: 2, selector_slot: nil)
|
|
275
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"tx_key", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keys, selector_bindings: []), multi: false, order: 3, selector_slot: nil)
|
|
276
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"sock_fd", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 4, selector_slot: nil)
|
|
277
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
278
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
479
279
|
# @private
|
|
480
|
-
|
|
280
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
481
281
|
end
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
486
|
-
# Device statistic (from the PSP spec).
|
|
487
|
-
class TxBytes < Attribute
|
|
488
|
-
TYPE = 10
|
|
489
|
-
NAME = :"tx_bytes"
|
|
282
|
+
end
|
|
283
|
+
class Keys
|
|
284
|
+
module Definitions
|
|
490
285
|
# @private
|
|
491
|
-
|
|
286
|
+
BY_TYPE = ::Array.new(3).tap do |definitions|
|
|
287
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"key", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 0, selector_slot: nil)
|
|
288
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"spi", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
289
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
290
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
492
291
|
# @private
|
|
493
|
-
|
|
292
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
494
293
|
end
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
TYPE = 11
|
|
499
|
-
NAME = :"tx_error"
|
|
294
|
+
end
|
|
295
|
+
class Stats
|
|
296
|
+
module Definitions
|
|
500
297
|
# @private
|
|
501
|
-
|
|
298
|
+
BY_TYPE = ::Array.new(12).tap do |definitions|
|
|
299
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dev_id", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 } }), multi: false, order: 0, selector_slot: nil)
|
|
300
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"key_rotations", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 1, selector_slot: nil)
|
|
301
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"stale_events", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 2, selector_slot: nil)
|
|
302
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"rx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 3, selector_slot: nil)
|
|
303
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"rx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 4, selector_slot: nil)
|
|
304
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"rx_auth_fail", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 5, selector_slot: nil)
|
|
305
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"rx_error", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 6, selector_slot: nil)
|
|
306
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"rx_bad", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 7, selector_slot: nil)
|
|
307
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"tx_packets", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 8, selector_slot: nil)
|
|
308
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"tx_bytes", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 9, selector_slot: nil)
|
|
309
|
+
definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"tx_error", datatype: ::Nl::DataTypes::VariableInteger.new(::Nl::Endian::Host, signed: false), multi: false, order: 10, selector_slot: nil)
|
|
310
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
311
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
502
312
|
# @private
|
|
503
|
-
|
|
504
|
-
end
|
|
505
|
-
# @private
|
|
506
|
-
BY_NAME = Ractor.make_shareable({:"dev_id" => DevId, :"key_rotations" => KeyRotations, :"stale_events" => StaleEvents, :"rx_packets" => RxPackets, :"rx_bytes" => RxBytes, :"rx_auth_fail" => RxAuthFail, :"rx_error" => RxError, :"rx_bad" => RxBad, :"tx_packets" => TxPackets, :"tx_bytes" => TxBytes, :"tx_error" => TxError}) #: Hash[::Symbol, Attribute]
|
|
507
|
-
# @private
|
|
508
|
-
BY_TYPE = Ractor.make_shareable({1 => DevId, 2 => KeyRotations, 3 => StaleEvents, 4 => RxPackets, 5 => RxBytes, 6 => RxAuthFail, 7 => RxError, 8 => RxBad, 9 => TxPackets, 10 => TxBytes, 11 => TxError}) #: Hash[::Integer, Attribute]
|
|
509
|
-
# PSP device ID.
|
|
510
|
-
# @rbs return: ::Integer
|
|
511
|
-
# @return [Integer]
|
|
512
|
-
# @see DevId
|
|
513
|
-
def dev_id; self[:"dev_id"]&.value; end
|
|
514
|
-
# Number of key rotations during the lifetime of the device.
|
|
515
|
-
# Kernel statistic.
|
|
516
|
-
# @rbs return: ::Integer
|
|
517
|
-
# @return [Integer]
|
|
518
|
-
# @see KeyRotations
|
|
519
|
-
def key_rotations; self[:"key_rotations"]&.value; end
|
|
520
|
-
# Number of times a socket's Rx got shut down due to using
|
|
521
|
-
# a key which went stale (fully rotated out).
|
|
522
|
-
# Kernel statistic.
|
|
523
|
-
# @rbs return: ::Integer
|
|
524
|
-
# @return [Integer]
|
|
525
|
-
# @see StaleEvents
|
|
526
|
-
def stale_events; self[:"stale_events"]&.value; end
|
|
527
|
-
# Number of successfully processed and authenticated PSP packets.
|
|
528
|
-
# Device statistic (from the PSP spec).
|
|
529
|
-
# @rbs return: ::Integer
|
|
530
|
-
# @return [Integer]
|
|
531
|
-
# @see RxPackets
|
|
532
|
-
def rx_packets; self[:"rx_packets"]&.value; end
|
|
533
|
-
# Number of successfully authenticated PSP bytes received, counting from
|
|
534
|
-
# the first byte after the IV through the last byte of payload.
|
|
535
|
-
# The fixed initial portion of the PSP header (16 bytes)
|
|
536
|
-
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
537
|
-
# Device statistic (from the PSP spec).
|
|
538
|
-
# @rbs return: ::Integer
|
|
539
|
-
# @return [Integer]
|
|
540
|
-
# @see RxBytes
|
|
541
|
-
def rx_bytes; self[:"rx_bytes"]&.value; end
|
|
542
|
-
# Number of received PSP packets with unsuccessful authentication.
|
|
543
|
-
# Device statistic (from the PSP spec).
|
|
544
|
-
# @rbs return: ::Integer
|
|
545
|
-
# @return [Integer]
|
|
546
|
-
# @see RxAuthFail
|
|
547
|
-
def rx_auth_fail; self[:"rx_auth_fail"]&.value; end
|
|
548
|
-
# Number of received PSP packets with length/framing errors.
|
|
549
|
-
# Device statistic (from the PSP spec).
|
|
550
|
-
# @rbs return: ::Integer
|
|
551
|
-
# @return [Integer]
|
|
552
|
-
# @see RxError
|
|
553
|
-
def rx_error; self[:"rx_error"]&.value; end
|
|
554
|
-
# Number of received PSP packets with miscellaneous errors
|
|
555
|
-
# (invalid master key indicated by SPI, unsupported version, etc.)
|
|
556
|
-
# Device statistic (from the PSP spec).
|
|
557
|
-
# @rbs return: ::Integer
|
|
558
|
-
# @return [Integer]
|
|
559
|
-
# @see RxBad
|
|
560
|
-
def rx_bad; self[:"rx_bad"]&.value; end
|
|
561
|
-
# Number of successfully processed PSP packets for transmission.
|
|
562
|
-
# Device statistic (from the PSP spec).
|
|
563
|
-
# @rbs return: ::Integer
|
|
564
|
-
# @return [Integer]
|
|
565
|
-
# @see TxPackets
|
|
566
|
-
def tx_packets; self[:"tx_packets"]&.value; end
|
|
567
|
-
# Number of successfully processed PSP bytes for transmit, counting from
|
|
568
|
-
# the first byte after the IV through the last byte of payload.
|
|
569
|
-
# The fixed initial portion of the PSP header (16 bytes)
|
|
570
|
-
# and the PSP trailer/ICV (16 bytes) are not included in this count.
|
|
571
|
-
# Device statistic (from the PSP spec).
|
|
572
|
-
# @rbs return: ::Integer
|
|
573
|
-
# @return [Integer]
|
|
574
|
-
# @see TxBytes
|
|
575
|
-
def tx_bytes; self[:"tx_bytes"]&.value; end
|
|
576
|
-
# Number of PSP packets for transmission with errors.
|
|
577
|
-
# Device statistic (from the PSP spec).
|
|
578
|
-
# @rbs return: ::Integer
|
|
579
|
-
# @return [Integer]
|
|
580
|
-
# @see TxError
|
|
581
|
-
def tx_error; self[:"tx_error"]&.value; end
|
|
582
|
-
class << self
|
|
583
|
-
# Looks up Attribute class by name.
|
|
584
|
-
# @rbs name: Symbol
|
|
585
|
-
# @rbs return: Attribute
|
|
586
|
-
# @param [Symbol] name
|
|
587
|
-
# @return [Attribute]
|
|
588
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
589
|
-
# Looks up Attribute class by type value.
|
|
590
|
-
# @rbs type: Integer
|
|
591
|
-
# @rbs return: Attribute
|
|
592
|
-
# @param [Integer] type
|
|
593
|
-
# @return [Attribute]
|
|
594
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
313
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
595
314
|
end
|
|
596
315
|
end
|
|
597
|
-
# @private
|
|
598
|
-
Dev::AssocList::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AssocDevInfo, selector_bindings: Ractor.make_shareable([]))
|
|
599
|
-
# @private
|
|
600
|
-
Assoc::RxKey::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keys, selector_bindings: Ractor.make_shareable([]))
|
|
601
|
-
# @private
|
|
602
|
-
Assoc::TxKey::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::Keys, selector_bindings: Ractor.make_shareable([]))
|
|
603
316
|
end
|
|
604
317
|
module Messages
|
|
605
318
|
# Get / dump information about PSP capable devices on the system.
|
|
606
|
-
class DoDevGetRequest < ::Nl::
|
|
319
|
+
class DoDevGetRequest < ::Nl::Message
|
|
607
320
|
TYPE = 1
|
|
608
321
|
FIXED_HEADER = nil
|
|
609
322
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
610
|
-
ATTRIBUTES =
|
|
323
|
+
ATTRIBUTES = %i[id].freeze
|
|
324
|
+
include ATTRIBUTE_SET::Definitions
|
|
325
|
+
def initialize(attributes = [])
|
|
326
|
+
@attributes = attributes
|
|
327
|
+
end
|
|
328
|
+
# @private
|
|
329
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
330
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
331
|
+
new(
|
|
332
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
333
|
+
)
|
|
334
|
+
end
|
|
335
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
336
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
337
|
+
def self.decode(decoder)
|
|
338
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
339
|
+
end
|
|
340
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
341
|
+
encode_attributes(encoder, external_selectors:)
|
|
342
|
+
end
|
|
611
343
|
# PSP device ID.
|
|
612
344
|
# @rbs return: ::Integer
|
|
613
345
|
# @return [Integer]
|
|
614
|
-
|
|
615
|
-
def id; attributes[:"id"]&.value; end
|
|
346
|
+
def id; self[:"id"]; end
|
|
616
347
|
end
|
|
617
348
|
# Get / dump information about PSP capable devices on the system.
|
|
618
|
-
class DoDevGetReply < ::Nl::
|
|
349
|
+
class DoDevGetReply < ::Nl::Message
|
|
619
350
|
TYPE = 1
|
|
620
351
|
FIXED_HEADER = nil
|
|
621
352
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
622
|
-
ATTRIBUTES =
|
|
353
|
+
ATTRIBUTES = %i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association].freeze
|
|
354
|
+
include ATTRIBUTE_SET::Definitions
|
|
355
|
+
def initialize(attributes = [])
|
|
356
|
+
@attributes = attributes
|
|
357
|
+
end
|
|
358
|
+
# @private
|
|
359
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
360
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
361
|
+
new(
|
|
362
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
363
|
+
)
|
|
364
|
+
end
|
|
365
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
366
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
367
|
+
def self.decode(decoder)
|
|
368
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
369
|
+
end
|
|
370
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
371
|
+
encode_attributes(encoder, external_selectors:)
|
|
372
|
+
end
|
|
623
373
|
# PSP device ID.
|
|
624
374
|
# @rbs return: ::Integer
|
|
625
375
|
# @return [Integer]
|
|
626
|
-
|
|
627
|
-
def id; attributes[:"id"]&.value; end
|
|
376
|
+
def id; self[:"id"]; end
|
|
628
377
|
# ifindex of the main netdevice linked to the PSP device,
|
|
629
378
|
# or the ifindex to associate with the PSP device.
|
|
630
379
|
# @rbs return: ::Integer
|
|
631
380
|
# @return [Integer]
|
|
632
|
-
|
|
633
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
381
|
+
def ifindex; self[:"ifindex"]; end
|
|
634
382
|
# Bitmask of PSP versions supported by the device.
|
|
635
383
|
#
|
|
636
384
|
# Known flags are defined in {Flags::Version}.
|
|
637
385
|
# @rbs return: ::Integer
|
|
638
386
|
# @return [Integer]
|
|
639
|
-
|
|
640
|
-
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
387
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
641
388
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
642
389
|
#
|
|
643
390
|
# Known flags are defined in {Flags::Version}.
|
|
644
391
|
# @rbs return: ::Integer
|
|
645
392
|
# @return [Integer]
|
|
646
|
-
|
|
647
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
393
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
648
394
|
# List of associated virtual devices.
|
|
649
395
|
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
650
396
|
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
651
|
-
|
|
652
|
-
def assoc_list; attributes[:"assoc_list"].map(&:value); end
|
|
397
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
653
398
|
# Flag indicating the PSP device is an associated device from a
|
|
654
399
|
# different network namespace.
|
|
655
400
|
# Present when in associated namespace, absent when in primary/host
|
|
656
401
|
# namespace.
|
|
657
402
|
# @rbs return: ::Integer
|
|
658
403
|
# @return [Integer]
|
|
659
|
-
|
|
660
|
-
def by_association; attributes[:"by_association"]&.value; end
|
|
404
|
+
def by_association; self[:"by_association"]; end
|
|
661
405
|
end
|
|
662
406
|
# Get / dump information about PSP capable devices on the system.
|
|
663
|
-
class DumpDevGetRequest < ::Nl::
|
|
407
|
+
class DumpDevGetRequest < ::Nl::Message
|
|
664
408
|
TYPE = 1
|
|
665
409
|
FIXED_HEADER = nil
|
|
666
410
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
667
|
-
ATTRIBUTES =
|
|
411
|
+
ATTRIBUTES = %i[].freeze
|
|
412
|
+
include ATTRIBUTE_SET::Definitions
|
|
413
|
+
def initialize(attributes = [])
|
|
414
|
+
@attributes = attributes
|
|
415
|
+
end
|
|
416
|
+
# @private
|
|
417
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
418
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
419
|
+
new(
|
|
420
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
421
|
+
)
|
|
422
|
+
end
|
|
423
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
424
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
425
|
+
def self.decode(decoder)
|
|
426
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
427
|
+
end
|
|
428
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
429
|
+
encode_attributes(encoder, external_selectors:)
|
|
430
|
+
end
|
|
668
431
|
end
|
|
669
432
|
# Get / dump information about PSP capable devices on the system.
|
|
670
|
-
class DumpDevGetReply < ::Nl::
|
|
433
|
+
class DumpDevGetReply < ::Nl::Message
|
|
671
434
|
TYPE = 1
|
|
672
435
|
FIXED_HEADER = nil
|
|
673
436
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
674
|
-
ATTRIBUTES =
|
|
437
|
+
ATTRIBUTES = %i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association].freeze
|
|
438
|
+
include ATTRIBUTE_SET::Definitions
|
|
439
|
+
def initialize(attributes = [])
|
|
440
|
+
@attributes = attributes
|
|
441
|
+
end
|
|
442
|
+
# @private
|
|
443
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
444
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
445
|
+
new(
|
|
446
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
447
|
+
)
|
|
448
|
+
end
|
|
449
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
450
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
451
|
+
def self.decode(decoder)
|
|
452
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
453
|
+
end
|
|
454
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
455
|
+
encode_attributes(encoder, external_selectors:)
|
|
456
|
+
end
|
|
675
457
|
# PSP device ID.
|
|
676
458
|
# @rbs return: ::Integer
|
|
677
459
|
# @return [Integer]
|
|
678
|
-
|
|
679
|
-
def id; attributes[:"id"]&.value; end
|
|
460
|
+
def id; self[:"id"]; end
|
|
680
461
|
# ifindex of the main netdevice linked to the PSP device,
|
|
681
462
|
# or the ifindex to associate with the PSP device.
|
|
682
463
|
# @rbs return: ::Integer
|
|
683
464
|
# @return [Integer]
|
|
684
|
-
|
|
685
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
465
|
+
def ifindex; self[:"ifindex"]; end
|
|
686
466
|
# Bitmask of PSP versions supported by the device.
|
|
687
467
|
#
|
|
688
468
|
# Known flags are defined in {Flags::Version}.
|
|
689
469
|
# @rbs return: ::Integer
|
|
690
470
|
# @return [Integer]
|
|
691
|
-
|
|
692
|
-
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
471
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
693
472
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
694
473
|
#
|
|
695
474
|
# Known flags are defined in {Flags::Version}.
|
|
696
475
|
# @rbs return: ::Integer
|
|
697
476
|
# @return [Integer]
|
|
698
|
-
|
|
699
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
477
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
700
478
|
# List of associated virtual devices.
|
|
701
479
|
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
702
480
|
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
703
|
-
|
|
704
|
-
def assoc_list; attributes[:"assoc_list"].map(&:value); end
|
|
481
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
705
482
|
# Flag indicating the PSP device is an associated device from a
|
|
706
483
|
# different network namespace.
|
|
707
484
|
# Present when in associated namespace, absent when in primary/host
|
|
708
485
|
# namespace.
|
|
709
486
|
# @rbs return: ::Integer
|
|
710
487
|
# @return [Integer]
|
|
711
|
-
|
|
712
|
-
def by_association; attributes[:"by_association"]&.value; end
|
|
488
|
+
def by_association; self[:"by_association"]; end
|
|
713
489
|
end
|
|
714
490
|
# Set the configuration of a PSP device.
|
|
715
491
|
#
|
|
716
492
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
717
|
-
class DoDevSetRequest < ::Nl::
|
|
493
|
+
class DoDevSetRequest < ::Nl::Message
|
|
718
494
|
TYPE = 4
|
|
719
495
|
FIXED_HEADER = nil
|
|
720
496
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
721
|
-
ATTRIBUTES =
|
|
497
|
+
ATTRIBUTES = %i[id psp_versions_ena].freeze
|
|
498
|
+
include ATTRIBUTE_SET::Definitions
|
|
499
|
+
def initialize(attributes = [])
|
|
500
|
+
@attributes = attributes
|
|
501
|
+
end
|
|
502
|
+
# @private
|
|
503
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
504
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
505
|
+
new(
|
|
506
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
507
|
+
)
|
|
508
|
+
end
|
|
509
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
510
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
511
|
+
def self.decode(decoder)
|
|
512
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
513
|
+
end
|
|
514
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
515
|
+
encode_attributes(encoder, external_selectors:)
|
|
516
|
+
end
|
|
722
517
|
# PSP device ID.
|
|
723
518
|
# @rbs return: ::Integer
|
|
724
519
|
# @return [Integer]
|
|
725
|
-
|
|
726
|
-
def id; attributes[:"id"]&.value; end
|
|
520
|
+
def id; self[:"id"]; end
|
|
727
521
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
728
522
|
#
|
|
729
523
|
# Known flags are defined in {Flags::Version}.
|
|
730
524
|
# @rbs return: ::Integer
|
|
731
525
|
# @return [Integer]
|
|
732
|
-
|
|
733
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
526
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
734
527
|
end
|
|
735
528
|
# Set the configuration of a PSP device.
|
|
736
529
|
#
|
|
737
530
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
738
|
-
class DoDevSetReply < ::Nl::
|
|
531
|
+
class DoDevSetReply < ::Nl::Message
|
|
739
532
|
TYPE = 4
|
|
740
533
|
FIXED_HEADER = nil
|
|
741
534
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
742
|
-
ATTRIBUTES =
|
|
535
|
+
ATTRIBUTES = %i[].freeze
|
|
536
|
+
include ATTRIBUTE_SET::Definitions
|
|
537
|
+
def initialize(attributes = [])
|
|
538
|
+
@attributes = attributes
|
|
539
|
+
end
|
|
540
|
+
# @private
|
|
541
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
542
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
543
|
+
new(
|
|
544
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
545
|
+
)
|
|
546
|
+
end
|
|
547
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
548
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
549
|
+
def self.decode(decoder)
|
|
550
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
551
|
+
end
|
|
552
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
553
|
+
encode_attributes(encoder, external_selectors:)
|
|
554
|
+
end
|
|
743
555
|
end
|
|
744
556
|
# Rotate the device key.
|
|
745
557
|
#
|
|
746
558
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
747
|
-
class DoKeyRotateRequest < ::Nl::
|
|
559
|
+
class DoKeyRotateRequest < ::Nl::Message
|
|
748
560
|
TYPE = 6
|
|
749
561
|
FIXED_HEADER = nil
|
|
750
562
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
751
|
-
ATTRIBUTES =
|
|
563
|
+
ATTRIBUTES = %i[id].freeze
|
|
564
|
+
include ATTRIBUTE_SET::Definitions
|
|
565
|
+
def initialize(attributes = [])
|
|
566
|
+
@attributes = attributes
|
|
567
|
+
end
|
|
568
|
+
# @private
|
|
569
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
570
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
571
|
+
new(
|
|
572
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
573
|
+
)
|
|
574
|
+
end
|
|
575
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
576
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
577
|
+
def self.decode(decoder)
|
|
578
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
579
|
+
end
|
|
580
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
581
|
+
encode_attributes(encoder, external_selectors:)
|
|
582
|
+
end
|
|
752
583
|
# PSP device ID.
|
|
753
584
|
# @rbs return: ::Integer
|
|
754
585
|
# @return [Integer]
|
|
755
|
-
|
|
756
|
-
def id; attributes[:"id"]&.value; end
|
|
586
|
+
def id; self[:"id"]; end
|
|
757
587
|
end
|
|
758
588
|
# Rotate the device key.
|
|
759
589
|
#
|
|
760
590
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
761
|
-
class DoKeyRotateReply < ::Nl::
|
|
591
|
+
class DoKeyRotateReply < ::Nl::Message
|
|
762
592
|
TYPE = 6
|
|
763
593
|
FIXED_HEADER = nil
|
|
764
594
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
765
|
-
ATTRIBUTES =
|
|
595
|
+
ATTRIBUTES = %i[id].freeze
|
|
596
|
+
include ATTRIBUTE_SET::Definitions
|
|
597
|
+
def initialize(attributes = [])
|
|
598
|
+
@attributes = attributes
|
|
599
|
+
end
|
|
600
|
+
# @private
|
|
601
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
602
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
603
|
+
new(
|
|
604
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
605
|
+
)
|
|
606
|
+
end
|
|
607
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
608
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
609
|
+
def self.decode(decoder)
|
|
610
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
611
|
+
end
|
|
612
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
613
|
+
encode_attributes(encoder, external_selectors:)
|
|
614
|
+
end
|
|
766
615
|
# PSP device ID.
|
|
767
616
|
# @rbs return: ::Integer
|
|
768
617
|
# @return [Integer]
|
|
769
|
-
|
|
770
|
-
def id; attributes[:"id"]&.value; end
|
|
618
|
+
def id; self[:"id"]; end
|
|
771
619
|
end
|
|
772
620
|
# Allocate a new Rx key + SPI pair, associate it with a socket.
|
|
773
|
-
class DoRxAssocRequest < ::Nl::
|
|
621
|
+
class DoRxAssocRequest < ::Nl::Message
|
|
774
622
|
TYPE = 8
|
|
775
623
|
FIXED_HEADER = nil
|
|
776
624
|
ATTRIBUTE_SET = AttributeSets::Assoc
|
|
777
|
-
ATTRIBUTES =
|
|
625
|
+
ATTRIBUTES = %i[dev_id version sock_fd].freeze
|
|
626
|
+
include ATTRIBUTE_SET::Definitions
|
|
627
|
+
def initialize(attributes = [])
|
|
628
|
+
@attributes = attributes
|
|
629
|
+
end
|
|
630
|
+
# @private
|
|
631
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
632
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
633
|
+
new(
|
|
634
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
635
|
+
)
|
|
636
|
+
end
|
|
637
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
638
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
639
|
+
def self.decode(decoder)
|
|
640
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
641
|
+
end
|
|
642
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
643
|
+
encode_attributes(encoder, external_selectors:)
|
|
644
|
+
end
|
|
778
645
|
# PSP device ID.
|
|
779
646
|
# @rbs return: ::Integer
|
|
780
647
|
# @return [Integer]
|
|
781
|
-
|
|
782
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
648
|
+
def dev_id; self[:"dev_id"]; end
|
|
783
649
|
# PSP versions (AEAD and protocol version) used by this association,
|
|
784
650
|
# dictates the size of the key.
|
|
785
651
|
#
|
|
@@ -787,41 +653,74 @@ class Psp < ::Nl::Genl::Family
|
|
|
787
653
|
# Known enum values are defined in {Enums::Version}.
|
|
788
654
|
# @rbs return: ::Integer
|
|
789
655
|
# @return [Integer]
|
|
790
|
-
|
|
791
|
-
def version; attributes[:"version"]&.value; end
|
|
656
|
+
def version; self[:"version"]; end
|
|
792
657
|
# Sockets which should be bound to the association immediately.
|
|
793
658
|
# @rbs return: ::Integer
|
|
794
659
|
# @return [Integer]
|
|
795
|
-
|
|
796
|
-
def sock_fd; attributes[:"sock_fd"]&.value; end
|
|
660
|
+
def sock_fd; self[:"sock_fd"]; end
|
|
797
661
|
end
|
|
798
662
|
# Allocate a new Rx key + SPI pair, associate it with a socket.
|
|
799
|
-
class DoRxAssocReply < ::Nl::
|
|
663
|
+
class DoRxAssocReply < ::Nl::Message
|
|
800
664
|
TYPE = 8
|
|
801
665
|
FIXED_HEADER = nil
|
|
802
666
|
ATTRIBUTE_SET = AttributeSets::Assoc
|
|
803
|
-
ATTRIBUTES =
|
|
667
|
+
ATTRIBUTES = %i[dev_id rx_key].freeze
|
|
668
|
+
include ATTRIBUTE_SET::Definitions
|
|
669
|
+
def initialize(attributes = [])
|
|
670
|
+
@attributes = attributes
|
|
671
|
+
end
|
|
672
|
+
# @private
|
|
673
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
674
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
675
|
+
new(
|
|
676
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
677
|
+
)
|
|
678
|
+
end
|
|
679
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
680
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
681
|
+
def self.decode(decoder)
|
|
682
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
683
|
+
end
|
|
684
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
685
|
+
encode_attributes(encoder, external_selectors:)
|
|
686
|
+
end
|
|
804
687
|
# PSP device ID.
|
|
805
688
|
# @rbs return: ::Integer
|
|
806
689
|
# @return [Integer]
|
|
807
|
-
|
|
808
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
690
|
+
def dev_id; self[:"dev_id"]; end
|
|
809
691
|
# @rbs return: AttributeSets::Keys
|
|
810
692
|
# @return [AttributeSets::Keys]
|
|
811
|
-
|
|
812
|
-
def rx_key; attributes[:"rx_key"]&.value; end
|
|
693
|
+
def rx_key; self[:"rx_key"]; end
|
|
813
694
|
end
|
|
814
695
|
# Add a PSP Tx association.
|
|
815
|
-
class DoTxAssocRequest < ::Nl::
|
|
696
|
+
class DoTxAssocRequest < ::Nl::Message
|
|
816
697
|
TYPE = 9
|
|
817
698
|
FIXED_HEADER = nil
|
|
818
699
|
ATTRIBUTE_SET = AttributeSets::Assoc
|
|
819
|
-
ATTRIBUTES =
|
|
700
|
+
ATTRIBUTES = %i[dev_id version tx_key sock_fd].freeze
|
|
701
|
+
include ATTRIBUTE_SET::Definitions
|
|
702
|
+
def initialize(attributes = [])
|
|
703
|
+
@attributes = attributes
|
|
704
|
+
end
|
|
705
|
+
# @private
|
|
706
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
707
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
708
|
+
new(
|
|
709
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
710
|
+
)
|
|
711
|
+
end
|
|
712
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
713
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
714
|
+
def self.decode(decoder)
|
|
715
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
716
|
+
end
|
|
717
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
718
|
+
encode_attributes(encoder, external_selectors:)
|
|
719
|
+
end
|
|
820
720
|
# PSP device ID.
|
|
821
721
|
# @rbs return: ::Integer
|
|
822
722
|
# @return [Integer]
|
|
823
|
-
|
|
824
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
723
|
+
def dev_id; self[:"dev_id"]; end
|
|
825
724
|
# PSP versions (AEAD and protocol version) used by this association,
|
|
826
725
|
# dictates the size of the key.
|
|
827
726
|
#
|
|
@@ -829,67 +728,116 @@ class Psp < ::Nl::Genl::Family
|
|
|
829
728
|
# Known enum values are defined in {Enums::Version}.
|
|
830
729
|
# @rbs return: ::Integer
|
|
831
730
|
# @return [Integer]
|
|
832
|
-
|
|
833
|
-
def version; attributes[:"version"]&.value; end
|
|
731
|
+
def version; self[:"version"]; end
|
|
834
732
|
# @rbs return: AttributeSets::Keys
|
|
835
733
|
# @return [AttributeSets::Keys]
|
|
836
|
-
|
|
837
|
-
def tx_key; attributes[:"tx_key"]&.value; end
|
|
734
|
+
def tx_key; self[:"tx_key"]; end
|
|
838
735
|
# Sockets which should be bound to the association immediately.
|
|
839
736
|
# @rbs return: ::Integer
|
|
840
737
|
# @return [Integer]
|
|
841
|
-
|
|
842
|
-
def sock_fd; attributes[:"sock_fd"]&.value; end
|
|
738
|
+
def sock_fd; self[:"sock_fd"]; end
|
|
843
739
|
end
|
|
844
740
|
# Add a PSP Tx association.
|
|
845
|
-
class DoTxAssocReply < ::Nl::
|
|
741
|
+
class DoTxAssocReply < ::Nl::Message
|
|
846
742
|
TYPE = 9
|
|
847
743
|
FIXED_HEADER = nil
|
|
848
744
|
ATTRIBUTE_SET = AttributeSets::Assoc
|
|
849
|
-
ATTRIBUTES =
|
|
745
|
+
ATTRIBUTES = %i[].freeze
|
|
746
|
+
include ATTRIBUTE_SET::Definitions
|
|
747
|
+
def initialize(attributes = [])
|
|
748
|
+
@attributes = attributes
|
|
749
|
+
end
|
|
750
|
+
# @private
|
|
751
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
752
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
753
|
+
new(
|
|
754
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
755
|
+
)
|
|
756
|
+
end
|
|
757
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
758
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
759
|
+
def self.decode(decoder)
|
|
760
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
761
|
+
end
|
|
762
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
763
|
+
encode_attributes(encoder, external_selectors:)
|
|
764
|
+
end
|
|
850
765
|
end
|
|
851
766
|
# Get device statistics.
|
|
852
|
-
class DoGetStatsRequest < ::Nl::
|
|
767
|
+
class DoGetStatsRequest < ::Nl::Message
|
|
853
768
|
TYPE = 10
|
|
854
769
|
FIXED_HEADER = nil
|
|
855
770
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
856
|
-
ATTRIBUTES =
|
|
771
|
+
ATTRIBUTES = %i[dev_id].freeze
|
|
772
|
+
include ATTRIBUTE_SET::Definitions
|
|
773
|
+
def initialize(attributes = [])
|
|
774
|
+
@attributes = attributes
|
|
775
|
+
end
|
|
776
|
+
# @private
|
|
777
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
778
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
779
|
+
new(
|
|
780
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
781
|
+
)
|
|
782
|
+
end
|
|
783
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
784
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
785
|
+
def self.decode(decoder)
|
|
786
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
787
|
+
end
|
|
788
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
789
|
+
encode_attributes(encoder, external_selectors:)
|
|
790
|
+
end
|
|
857
791
|
# PSP device ID.
|
|
858
792
|
# @rbs return: ::Integer
|
|
859
793
|
# @return [Integer]
|
|
860
|
-
|
|
861
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
794
|
+
def dev_id; self[:"dev_id"]; end
|
|
862
795
|
end
|
|
863
796
|
# Get device statistics.
|
|
864
|
-
class DoGetStatsReply < ::Nl::
|
|
797
|
+
class DoGetStatsReply < ::Nl::Message
|
|
865
798
|
TYPE = 10
|
|
866
799
|
FIXED_HEADER = nil
|
|
867
800
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
868
|
-
ATTRIBUTES =
|
|
801
|
+
ATTRIBUTES = %i[dev_id key_rotations stale_events rx_packets rx_bytes rx_auth_fail rx_error rx_bad tx_packets tx_bytes tx_error].freeze
|
|
802
|
+
include ATTRIBUTE_SET::Definitions
|
|
803
|
+
def initialize(attributes = [])
|
|
804
|
+
@attributes = attributes
|
|
805
|
+
end
|
|
806
|
+
# @private
|
|
807
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
808
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
809
|
+
new(
|
|
810
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
811
|
+
)
|
|
812
|
+
end
|
|
813
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
814
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
815
|
+
def self.decode(decoder)
|
|
816
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
817
|
+
end
|
|
818
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
819
|
+
encode_attributes(encoder, external_selectors:)
|
|
820
|
+
end
|
|
869
821
|
# PSP device ID.
|
|
870
822
|
# @rbs return: ::Integer
|
|
871
823
|
# @return [Integer]
|
|
872
|
-
|
|
873
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
824
|
+
def dev_id; self[:"dev_id"]; end
|
|
874
825
|
# Number of key rotations during the lifetime of the device.
|
|
875
826
|
# Kernel statistic.
|
|
876
827
|
# @rbs return: ::Integer
|
|
877
828
|
# @return [Integer]
|
|
878
|
-
|
|
879
|
-
def key_rotations; attributes[:"key_rotations"]&.value; end
|
|
829
|
+
def key_rotations; self[:"key_rotations"]; end
|
|
880
830
|
# Number of times a socket's Rx got shut down due to using
|
|
881
831
|
# a key which went stale (fully rotated out).
|
|
882
832
|
# Kernel statistic.
|
|
883
833
|
# @rbs return: ::Integer
|
|
884
834
|
# @return [Integer]
|
|
885
|
-
|
|
886
|
-
def stale_events; attributes[:"stale_events"]&.value; end
|
|
835
|
+
def stale_events; self[:"stale_events"]; end
|
|
887
836
|
# Number of successfully processed and authenticated PSP packets.
|
|
888
837
|
# Device statistic (from the PSP spec).
|
|
889
838
|
# @rbs return: ::Integer
|
|
890
839
|
# @return [Integer]
|
|
891
|
-
|
|
892
|
-
def rx_packets; attributes[:"rx_packets"]&.value; end
|
|
840
|
+
def rx_packets; self[:"rx_packets"]; end
|
|
893
841
|
# Number of successfully authenticated PSP bytes received, counting from
|
|
894
842
|
# the first byte after the IV through the last byte of payload.
|
|
895
843
|
# The fixed initial portion of the PSP header (16 bytes)
|
|
@@ -897,33 +845,28 @@ class Psp < ::Nl::Genl::Family
|
|
|
897
845
|
# Device statistic (from the PSP spec).
|
|
898
846
|
# @rbs return: ::Integer
|
|
899
847
|
# @return [Integer]
|
|
900
|
-
|
|
901
|
-
def rx_bytes; attributes[:"rx_bytes"]&.value; end
|
|
848
|
+
def rx_bytes; self[:"rx_bytes"]; end
|
|
902
849
|
# Number of received PSP packets with unsuccessful authentication.
|
|
903
850
|
# Device statistic (from the PSP spec).
|
|
904
851
|
# @rbs return: ::Integer
|
|
905
852
|
# @return [Integer]
|
|
906
|
-
|
|
907
|
-
def rx_auth_fail; attributes[:"rx_auth_fail"]&.value; end
|
|
853
|
+
def rx_auth_fail; self[:"rx_auth_fail"]; end
|
|
908
854
|
# Number of received PSP packets with length/framing errors.
|
|
909
855
|
# Device statistic (from the PSP spec).
|
|
910
856
|
# @rbs return: ::Integer
|
|
911
857
|
# @return [Integer]
|
|
912
|
-
|
|
913
|
-
def rx_error; attributes[:"rx_error"]&.value; end
|
|
858
|
+
def rx_error; self[:"rx_error"]; end
|
|
914
859
|
# Number of received PSP packets with miscellaneous errors
|
|
915
860
|
# (invalid master key indicated by SPI, unsupported version, etc.)
|
|
916
861
|
# Device statistic (from the PSP spec).
|
|
917
862
|
# @rbs return: ::Integer
|
|
918
863
|
# @return [Integer]
|
|
919
|
-
|
|
920
|
-
def rx_bad; attributes[:"rx_bad"]&.value; end
|
|
864
|
+
def rx_bad; self[:"rx_bad"]; end
|
|
921
865
|
# Number of successfully processed PSP packets for transmission.
|
|
922
866
|
# Device statistic (from the PSP spec).
|
|
923
867
|
# @rbs return: ::Integer
|
|
924
868
|
# @return [Integer]
|
|
925
|
-
|
|
926
|
-
def tx_packets; attributes[:"tx_packets"]&.value; end
|
|
869
|
+
def tx_packets; self[:"tx_packets"]; end
|
|
927
870
|
# Number of successfully processed PSP bytes for transmit, counting from
|
|
928
871
|
# the first byte after the IV through the last byte of payload.
|
|
929
872
|
# The fixed initial portion of the PSP header (16 bytes)
|
|
@@ -931,52 +874,84 @@ class Psp < ::Nl::Genl::Family
|
|
|
931
874
|
# Device statistic (from the PSP spec).
|
|
932
875
|
# @rbs return: ::Integer
|
|
933
876
|
# @return [Integer]
|
|
934
|
-
|
|
935
|
-
def tx_bytes; attributes[:"tx_bytes"]&.value; end
|
|
877
|
+
def tx_bytes; self[:"tx_bytes"]; end
|
|
936
878
|
# Number of PSP packets for transmission with errors.
|
|
937
879
|
# Device statistic (from the PSP spec).
|
|
938
880
|
# @rbs return: ::Integer
|
|
939
881
|
# @return [Integer]
|
|
940
|
-
|
|
941
|
-
def tx_error; attributes[:"tx_error"]&.value; end
|
|
882
|
+
def tx_error; self[:"tx_error"]; end
|
|
942
883
|
end
|
|
943
884
|
# Get device statistics.
|
|
944
|
-
class DumpGetStatsRequest < ::Nl::
|
|
885
|
+
class DumpGetStatsRequest < ::Nl::Message
|
|
945
886
|
TYPE = 10
|
|
946
887
|
FIXED_HEADER = nil
|
|
947
888
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
948
|
-
ATTRIBUTES =
|
|
889
|
+
ATTRIBUTES = %i[].freeze
|
|
890
|
+
include ATTRIBUTE_SET::Definitions
|
|
891
|
+
def initialize(attributes = [])
|
|
892
|
+
@attributes = attributes
|
|
893
|
+
end
|
|
894
|
+
# @private
|
|
895
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
896
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
897
|
+
new(
|
|
898
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
899
|
+
)
|
|
900
|
+
end
|
|
901
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
902
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
903
|
+
def self.decode(decoder)
|
|
904
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
905
|
+
end
|
|
906
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
907
|
+
encode_attributes(encoder, external_selectors:)
|
|
908
|
+
end
|
|
949
909
|
end
|
|
950
910
|
# Get device statistics.
|
|
951
|
-
class DumpGetStatsReply < ::Nl::
|
|
911
|
+
class DumpGetStatsReply < ::Nl::Message
|
|
952
912
|
TYPE = 10
|
|
953
913
|
FIXED_HEADER = nil
|
|
954
914
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
955
|
-
ATTRIBUTES =
|
|
915
|
+
ATTRIBUTES = %i[dev_id key_rotations stale_events rx_packets rx_bytes rx_auth_fail rx_error rx_bad tx_packets tx_bytes tx_error].freeze
|
|
916
|
+
include ATTRIBUTE_SET::Definitions
|
|
917
|
+
def initialize(attributes = [])
|
|
918
|
+
@attributes = attributes
|
|
919
|
+
end
|
|
920
|
+
# @private
|
|
921
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
922
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
923
|
+
new(
|
|
924
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
925
|
+
)
|
|
926
|
+
end
|
|
927
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
928
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
929
|
+
def self.decode(decoder)
|
|
930
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
931
|
+
end
|
|
932
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
933
|
+
encode_attributes(encoder, external_selectors:)
|
|
934
|
+
end
|
|
956
935
|
# PSP device ID.
|
|
957
936
|
# @rbs return: ::Integer
|
|
958
937
|
# @return [Integer]
|
|
959
|
-
|
|
960
|
-
def dev_id; attributes[:"dev_id"]&.value; end
|
|
938
|
+
def dev_id; self[:"dev_id"]; end
|
|
961
939
|
# Number of key rotations during the lifetime of the device.
|
|
962
940
|
# Kernel statistic.
|
|
963
941
|
# @rbs return: ::Integer
|
|
964
942
|
# @return [Integer]
|
|
965
|
-
|
|
966
|
-
def key_rotations; attributes[:"key_rotations"]&.value; end
|
|
943
|
+
def key_rotations; self[:"key_rotations"]; end
|
|
967
944
|
# Number of times a socket's Rx got shut down due to using
|
|
968
945
|
# a key which went stale (fully rotated out).
|
|
969
946
|
# Kernel statistic.
|
|
970
947
|
# @rbs return: ::Integer
|
|
971
948
|
# @return [Integer]
|
|
972
|
-
|
|
973
|
-
def stale_events; attributes[:"stale_events"]&.value; end
|
|
949
|
+
def stale_events; self[:"stale_events"]; end
|
|
974
950
|
# Number of successfully processed and authenticated PSP packets.
|
|
975
951
|
# Device statistic (from the PSP spec).
|
|
976
952
|
# @rbs return: ::Integer
|
|
977
953
|
# @return [Integer]
|
|
978
|
-
|
|
979
|
-
def rx_packets; attributes[:"rx_packets"]&.value; end
|
|
954
|
+
def rx_packets; self[:"rx_packets"]; end
|
|
980
955
|
# Number of successfully authenticated PSP bytes received, counting from
|
|
981
956
|
# the first byte after the IV through the last byte of payload.
|
|
982
957
|
# The fixed initial portion of the PSP header (16 bytes)
|
|
@@ -984,33 +959,28 @@ class Psp < ::Nl::Genl::Family
|
|
|
984
959
|
# Device statistic (from the PSP spec).
|
|
985
960
|
# @rbs return: ::Integer
|
|
986
961
|
# @return [Integer]
|
|
987
|
-
|
|
988
|
-
def rx_bytes; attributes[:"rx_bytes"]&.value; end
|
|
962
|
+
def rx_bytes; self[:"rx_bytes"]; end
|
|
989
963
|
# Number of received PSP packets with unsuccessful authentication.
|
|
990
964
|
# Device statistic (from the PSP spec).
|
|
991
965
|
# @rbs return: ::Integer
|
|
992
966
|
# @return [Integer]
|
|
993
|
-
|
|
994
|
-
def rx_auth_fail; attributes[:"rx_auth_fail"]&.value; end
|
|
967
|
+
def rx_auth_fail; self[:"rx_auth_fail"]; end
|
|
995
968
|
# Number of received PSP packets with length/framing errors.
|
|
996
969
|
# Device statistic (from the PSP spec).
|
|
997
970
|
# @rbs return: ::Integer
|
|
998
971
|
# @return [Integer]
|
|
999
|
-
|
|
1000
|
-
def rx_error; attributes[:"rx_error"]&.value; end
|
|
972
|
+
def rx_error; self[:"rx_error"]; end
|
|
1001
973
|
# Number of received PSP packets with miscellaneous errors
|
|
1002
974
|
# (invalid master key indicated by SPI, unsupported version, etc.)
|
|
1003
975
|
# Device statistic (from the PSP spec).
|
|
1004
976
|
# @rbs return: ::Integer
|
|
1005
977
|
# @return [Integer]
|
|
1006
|
-
|
|
1007
|
-
def rx_bad; attributes[:"rx_bad"]&.value; end
|
|
978
|
+
def rx_bad; self[:"rx_bad"]; end
|
|
1008
979
|
# Number of successfully processed PSP packets for transmission.
|
|
1009
980
|
# Device statistic (from the PSP spec).
|
|
1010
981
|
# @rbs return: ::Integer
|
|
1011
982
|
# @return [Integer]
|
|
1012
|
-
|
|
1013
|
-
def tx_packets; attributes[:"tx_packets"]&.value; end
|
|
983
|
+
def tx_packets; self[:"tx_packets"]; end
|
|
1014
984
|
# Number of successfully processed PSP bytes for transmit, counting from
|
|
1015
985
|
# the first byte after the IV through the last byte of payload.
|
|
1016
986
|
# The fixed initial portion of the PSP header (16 bytes)
|
|
@@ -1018,247 +988,372 @@ class Psp < ::Nl::Genl::Family
|
|
|
1018
988
|
# Device statistic (from the PSP spec).
|
|
1019
989
|
# @rbs return: ::Integer
|
|
1020
990
|
# @return [Integer]
|
|
1021
|
-
|
|
1022
|
-
def tx_bytes; attributes[:"tx_bytes"]&.value; end
|
|
991
|
+
def tx_bytes; self[:"tx_bytes"]; end
|
|
1023
992
|
# Number of PSP packets for transmission with errors.
|
|
1024
993
|
# Device statistic (from the PSP spec).
|
|
1025
994
|
# @rbs return: ::Integer
|
|
1026
995
|
# @return [Integer]
|
|
1027
|
-
|
|
1028
|
-
def tx_error; attributes[:"tx_error"]&.value; end
|
|
996
|
+
def tx_error; self[:"tx_error"]; end
|
|
1029
997
|
end
|
|
1030
998
|
# Associate a network device with a PSP device.
|
|
1031
999
|
#
|
|
1032
1000
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
1033
|
-
class DoDevAssocRequest < ::Nl::
|
|
1001
|
+
class DoDevAssocRequest < ::Nl::Message
|
|
1034
1002
|
TYPE = 11
|
|
1035
1003
|
FIXED_HEADER = nil
|
|
1036
1004
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1037
|
-
ATTRIBUTES =
|
|
1005
|
+
ATTRIBUTES = %i[id ifindex nsid].freeze
|
|
1006
|
+
include ATTRIBUTE_SET::Definitions
|
|
1007
|
+
def initialize(attributes = [])
|
|
1008
|
+
@attributes = attributes
|
|
1009
|
+
end
|
|
1010
|
+
# @private
|
|
1011
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1012
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1013
|
+
new(
|
|
1014
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1015
|
+
)
|
|
1016
|
+
end
|
|
1017
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1018
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1019
|
+
def self.decode(decoder)
|
|
1020
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1021
|
+
end
|
|
1022
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1023
|
+
encode_attributes(encoder, external_selectors:)
|
|
1024
|
+
end
|
|
1038
1025
|
# PSP device ID.
|
|
1039
1026
|
# @rbs return: ::Integer
|
|
1040
1027
|
# @return [Integer]
|
|
1041
|
-
|
|
1042
|
-
def id; attributes[:"id"]&.value; end
|
|
1028
|
+
def id; self[:"id"]; end
|
|
1043
1029
|
# ifindex of the main netdevice linked to the PSP device,
|
|
1044
1030
|
# or the ifindex to associate with the PSP device.
|
|
1045
1031
|
# @rbs return: ::Integer
|
|
1046
1032
|
# @return [Integer]
|
|
1047
|
-
|
|
1048
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1033
|
+
def ifindex; self[:"ifindex"]; end
|
|
1049
1034
|
# Network namespace ID for the device to associate/disassociate.
|
|
1050
1035
|
# Optional for dev-assoc and dev-disassoc; if not present, the
|
|
1051
1036
|
# device is looked up in the caller's network namespace.
|
|
1052
1037
|
# @rbs return: ::Integer
|
|
1053
1038
|
# @return [Integer]
|
|
1054
|
-
|
|
1055
|
-
def nsid; attributes[:"nsid"]&.value; end
|
|
1039
|
+
def nsid; self[:"nsid"]; end
|
|
1056
1040
|
end
|
|
1057
1041
|
# Associate a network device with a PSP device.
|
|
1058
1042
|
#
|
|
1059
1043
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
1060
|
-
class DoDevAssocReply < ::Nl::
|
|
1044
|
+
class DoDevAssocReply < ::Nl::Message
|
|
1061
1045
|
TYPE = 11
|
|
1062
1046
|
FIXED_HEADER = nil
|
|
1063
1047
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1064
|
-
ATTRIBUTES =
|
|
1048
|
+
ATTRIBUTES = %i[].freeze
|
|
1049
|
+
include ATTRIBUTE_SET::Definitions
|
|
1050
|
+
def initialize(attributes = [])
|
|
1051
|
+
@attributes = attributes
|
|
1052
|
+
end
|
|
1053
|
+
# @private
|
|
1054
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1055
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1056
|
+
new(
|
|
1057
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1058
|
+
)
|
|
1059
|
+
end
|
|
1060
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1061
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1062
|
+
def self.decode(decoder)
|
|
1063
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1064
|
+
end
|
|
1065
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1066
|
+
encode_attributes(encoder, external_selectors:)
|
|
1067
|
+
end
|
|
1065
1068
|
end
|
|
1066
1069
|
# Disassociate a network device from a PSP device.
|
|
1067
1070
|
#
|
|
1068
1071
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
1069
|
-
class DoDevDisassocRequest < ::Nl::
|
|
1072
|
+
class DoDevDisassocRequest < ::Nl::Message
|
|
1070
1073
|
TYPE = 12
|
|
1071
1074
|
FIXED_HEADER = nil
|
|
1072
1075
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1073
|
-
ATTRIBUTES =
|
|
1076
|
+
ATTRIBUTES = %i[id ifindex nsid].freeze
|
|
1077
|
+
include ATTRIBUTE_SET::Definitions
|
|
1078
|
+
def initialize(attributes = [])
|
|
1079
|
+
@attributes = attributes
|
|
1080
|
+
end
|
|
1081
|
+
# @private
|
|
1082
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1083
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1084
|
+
new(
|
|
1085
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1086
|
+
)
|
|
1087
|
+
end
|
|
1088
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1089
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1090
|
+
def self.decode(decoder)
|
|
1091
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1092
|
+
end
|
|
1093
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1094
|
+
encode_attributes(encoder, external_selectors:)
|
|
1095
|
+
end
|
|
1074
1096
|
# PSP device ID.
|
|
1075
1097
|
# @rbs return: ::Integer
|
|
1076
1098
|
# @return [Integer]
|
|
1077
|
-
|
|
1078
|
-
def id; attributes[:"id"]&.value; end
|
|
1099
|
+
def id; self[:"id"]; end
|
|
1079
1100
|
# ifindex of the main netdevice linked to the PSP device,
|
|
1080
1101
|
# or the ifindex to associate with the PSP device.
|
|
1081
1102
|
# @rbs return: ::Integer
|
|
1082
1103
|
# @return [Integer]
|
|
1083
|
-
|
|
1084
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1104
|
+
def ifindex; self[:"ifindex"]; end
|
|
1085
1105
|
# Network namespace ID for the device to associate/disassociate.
|
|
1086
1106
|
# Optional for dev-assoc and dev-disassoc; if not present, the
|
|
1087
1107
|
# device is looked up in the caller's network namespace.
|
|
1088
1108
|
# @rbs return: ::Integer
|
|
1089
1109
|
# @return [Integer]
|
|
1090
|
-
|
|
1091
|
-
def nsid; attributes[:"nsid"]&.value; end
|
|
1110
|
+
def nsid; self[:"nsid"]; end
|
|
1092
1111
|
end
|
|
1093
1112
|
# Disassociate a network device from a PSP device.
|
|
1094
1113
|
#
|
|
1095
1114
|
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
1096
|
-
class DoDevDisassocReply < ::Nl::
|
|
1115
|
+
class DoDevDisassocReply < ::Nl::Message
|
|
1097
1116
|
TYPE = 12
|
|
1098
1117
|
FIXED_HEADER = nil
|
|
1099
1118
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1100
|
-
ATTRIBUTES =
|
|
1119
|
+
ATTRIBUTES = %i[].freeze
|
|
1120
|
+
include ATTRIBUTE_SET::Definitions
|
|
1121
|
+
def initialize(attributes = [])
|
|
1122
|
+
@attributes = attributes
|
|
1123
|
+
end
|
|
1124
|
+
# @private
|
|
1125
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1126
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1127
|
+
new(
|
|
1128
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1129
|
+
)
|
|
1130
|
+
end
|
|
1131
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1132
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1133
|
+
def self.decode(decoder)
|
|
1134
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1135
|
+
end
|
|
1136
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1137
|
+
encode_attributes(encoder, external_selectors:)
|
|
1138
|
+
end
|
|
1101
1139
|
end
|
|
1102
1140
|
end
|
|
1103
1141
|
module Notifications
|
|
1104
1142
|
# Notification about device appearing.
|
|
1105
1143
|
#
|
|
1106
1144
|
# Multicast group: `mgmt`.
|
|
1107
|
-
class DevAddNtf < ::Nl::
|
|
1145
|
+
class DevAddNtf < ::Nl::Message
|
|
1108
1146
|
TYPE = 2
|
|
1109
1147
|
FIXED_HEADER = nil
|
|
1110
1148
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1111
|
-
ATTRIBUTES =
|
|
1149
|
+
ATTRIBUTES = %i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association].freeze
|
|
1150
|
+
include ATTRIBUTE_SET::Definitions
|
|
1151
|
+
def initialize(attributes = [])
|
|
1152
|
+
@attributes = attributes
|
|
1153
|
+
end
|
|
1154
|
+
# @private
|
|
1155
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1156
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1157
|
+
new(
|
|
1158
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1159
|
+
)
|
|
1160
|
+
end
|
|
1161
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1162
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1163
|
+
def self.decode(decoder)
|
|
1164
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1165
|
+
end
|
|
1166
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1167
|
+
encode_attributes(encoder, external_selectors:)
|
|
1168
|
+
end
|
|
1112
1169
|
# PSP device ID.
|
|
1113
1170
|
# @rbs return: ::Integer
|
|
1114
1171
|
# @return [Integer]
|
|
1115
|
-
|
|
1116
|
-
def id; attributes[:"id"]&.value; end
|
|
1172
|
+
def id; self[:"id"]; end
|
|
1117
1173
|
# ifindex of the main netdevice linked to the PSP device,
|
|
1118
1174
|
# or the ifindex to associate with the PSP device.
|
|
1119
1175
|
# @rbs return: ::Integer
|
|
1120
1176
|
# @return [Integer]
|
|
1121
|
-
|
|
1122
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1177
|
+
def ifindex; self[:"ifindex"]; end
|
|
1123
1178
|
# Bitmask of PSP versions supported by the device.
|
|
1124
1179
|
#
|
|
1125
1180
|
# Known flags are defined in {Flags::Version}.
|
|
1126
1181
|
# @rbs return: ::Integer
|
|
1127
1182
|
# @return [Integer]
|
|
1128
|
-
|
|
1129
|
-
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
1183
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
1130
1184
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
1131
1185
|
#
|
|
1132
1186
|
# Known flags are defined in {Flags::Version}.
|
|
1133
1187
|
# @rbs return: ::Integer
|
|
1134
1188
|
# @return [Integer]
|
|
1135
|
-
|
|
1136
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
1189
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
1137
1190
|
# List of associated virtual devices.
|
|
1138
1191
|
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
1139
1192
|
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
1140
|
-
|
|
1141
|
-
def assoc_list; attributes[:"assoc_list"].map(&:value); end
|
|
1193
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
1142
1194
|
# Flag indicating the PSP device is an associated device from a
|
|
1143
1195
|
# different network namespace.
|
|
1144
1196
|
# Present when in associated namespace, absent when in primary/host
|
|
1145
1197
|
# namespace.
|
|
1146
1198
|
# @rbs return: ::Integer
|
|
1147
1199
|
# @return [Integer]
|
|
1148
|
-
|
|
1149
|
-
def by_association; attributes[:"by_association"]&.value; end
|
|
1200
|
+
def by_association; self[:"by_association"]; end
|
|
1150
1201
|
end
|
|
1151
1202
|
# Notification about device disappearing.
|
|
1152
1203
|
#
|
|
1153
1204
|
# Multicast group: `mgmt`.
|
|
1154
|
-
class DevDelNtf < ::Nl::
|
|
1205
|
+
class DevDelNtf < ::Nl::Message
|
|
1155
1206
|
TYPE = 3
|
|
1156
1207
|
FIXED_HEADER = nil
|
|
1157
1208
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1158
|
-
ATTRIBUTES =
|
|
1209
|
+
ATTRIBUTES = %i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association].freeze
|
|
1210
|
+
include ATTRIBUTE_SET::Definitions
|
|
1211
|
+
def initialize(attributes = [])
|
|
1212
|
+
@attributes = attributes
|
|
1213
|
+
end
|
|
1214
|
+
# @private
|
|
1215
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1216
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1217
|
+
new(
|
|
1218
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1219
|
+
)
|
|
1220
|
+
end
|
|
1221
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1222
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1223
|
+
def self.decode(decoder)
|
|
1224
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1225
|
+
end
|
|
1226
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1227
|
+
encode_attributes(encoder, external_selectors:)
|
|
1228
|
+
end
|
|
1159
1229
|
# PSP device ID.
|
|
1160
1230
|
# @rbs return: ::Integer
|
|
1161
1231
|
# @return [Integer]
|
|
1162
|
-
|
|
1163
|
-
def id; attributes[:"id"]&.value; end
|
|
1232
|
+
def id; self[:"id"]; end
|
|
1164
1233
|
# ifindex of the main netdevice linked to the PSP device,
|
|
1165
1234
|
# or the ifindex to associate with the PSP device.
|
|
1166
1235
|
# @rbs return: ::Integer
|
|
1167
1236
|
# @return [Integer]
|
|
1168
|
-
|
|
1169
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1237
|
+
def ifindex; self[:"ifindex"]; end
|
|
1170
1238
|
# Bitmask of PSP versions supported by the device.
|
|
1171
1239
|
#
|
|
1172
1240
|
# Known flags are defined in {Flags::Version}.
|
|
1173
1241
|
# @rbs return: ::Integer
|
|
1174
1242
|
# @return [Integer]
|
|
1175
|
-
|
|
1176
|
-
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
1243
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
1177
1244
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
1178
1245
|
#
|
|
1179
1246
|
# Known flags are defined in {Flags::Version}.
|
|
1180
1247
|
# @rbs return: ::Integer
|
|
1181
1248
|
# @return [Integer]
|
|
1182
|
-
|
|
1183
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
1249
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
1184
1250
|
# List of associated virtual devices.
|
|
1185
1251
|
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
1186
1252
|
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
1187
|
-
|
|
1188
|
-
def assoc_list; attributes[:"assoc_list"].map(&:value); end
|
|
1253
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
1189
1254
|
# Flag indicating the PSP device is an associated device from a
|
|
1190
1255
|
# different network namespace.
|
|
1191
1256
|
# Present when in associated namespace, absent when in primary/host
|
|
1192
1257
|
# namespace.
|
|
1193
1258
|
# @rbs return: ::Integer
|
|
1194
1259
|
# @return [Integer]
|
|
1195
|
-
|
|
1196
|
-
def by_association; attributes[:"by_association"]&.value; end
|
|
1260
|
+
def by_association; self[:"by_association"]; end
|
|
1197
1261
|
end
|
|
1198
1262
|
# Notification about device configuration being changed.
|
|
1199
1263
|
#
|
|
1200
1264
|
# Multicast group: `mgmt`.
|
|
1201
|
-
class DevChangeNtf < ::Nl::
|
|
1265
|
+
class DevChangeNtf < ::Nl::Message
|
|
1202
1266
|
TYPE = 5
|
|
1203
1267
|
FIXED_HEADER = nil
|
|
1204
1268
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1205
|
-
ATTRIBUTES =
|
|
1269
|
+
ATTRIBUTES = %i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association].freeze
|
|
1270
|
+
include ATTRIBUTE_SET::Definitions
|
|
1271
|
+
def initialize(attributes = [])
|
|
1272
|
+
@attributes = attributes
|
|
1273
|
+
end
|
|
1274
|
+
# @private
|
|
1275
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1276
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1277
|
+
new(
|
|
1278
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1279
|
+
)
|
|
1280
|
+
end
|
|
1281
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1282
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1283
|
+
def self.decode(decoder)
|
|
1284
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1285
|
+
end
|
|
1286
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1287
|
+
encode_attributes(encoder, external_selectors:)
|
|
1288
|
+
end
|
|
1206
1289
|
# PSP device ID.
|
|
1207
1290
|
# @rbs return: ::Integer
|
|
1208
1291
|
# @return [Integer]
|
|
1209
|
-
|
|
1210
|
-
def id; attributes[:"id"]&.value; end
|
|
1292
|
+
def id; self[:"id"]; end
|
|
1211
1293
|
# ifindex of the main netdevice linked to the PSP device,
|
|
1212
1294
|
# or the ifindex to associate with the PSP device.
|
|
1213
1295
|
# @rbs return: ::Integer
|
|
1214
1296
|
# @return [Integer]
|
|
1215
|
-
|
|
1216
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1297
|
+
def ifindex; self[:"ifindex"]; end
|
|
1217
1298
|
# Bitmask of PSP versions supported by the device.
|
|
1218
1299
|
#
|
|
1219
1300
|
# Known flags are defined in {Flags::Version}.
|
|
1220
1301
|
# @rbs return: ::Integer
|
|
1221
1302
|
# @return [Integer]
|
|
1222
|
-
|
|
1223
|
-
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
1303
|
+
def psp_versions_cap; self[:"psp_versions_cap"]; end
|
|
1224
1304
|
# Bitmask of currently enabled (accepted on Rx) PSP versions.
|
|
1225
1305
|
#
|
|
1226
1306
|
# Known flags are defined in {Flags::Version}.
|
|
1227
1307
|
# @rbs return: ::Integer
|
|
1228
1308
|
# @return [Integer]
|
|
1229
|
-
|
|
1230
|
-
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
1309
|
+
def psp_versions_ena; self[:"psp_versions_ena"]; end
|
|
1231
1310
|
# List of associated virtual devices.
|
|
1232
1311
|
# @rbs return: ::Array[AttributeSets::AssocDevInfo]
|
|
1233
1312
|
# @return [Array<AttributeSets::AssocDevInfo>]
|
|
1234
|
-
|
|
1235
|
-
def assoc_list; attributes[:"assoc_list"].map(&:value); end
|
|
1313
|
+
def assoc_list; self[:"assoc_list"]; end
|
|
1236
1314
|
# Flag indicating the PSP device is an associated device from a
|
|
1237
1315
|
# different network namespace.
|
|
1238
1316
|
# Present when in associated namespace, absent when in primary/host
|
|
1239
1317
|
# namespace.
|
|
1240
1318
|
# @rbs return: ::Integer
|
|
1241
1319
|
# @return [Integer]
|
|
1242
|
-
|
|
1243
|
-
def by_association; attributes[:"by_association"]&.value; end
|
|
1320
|
+
def by_association; self[:"by_association"]; end
|
|
1244
1321
|
end
|
|
1245
1322
|
# Notification about device key getting rotated.
|
|
1246
1323
|
#
|
|
1247
1324
|
# Multicast group: `use`.
|
|
1248
|
-
class KeyRotateNtf < ::Nl::
|
|
1325
|
+
class KeyRotateNtf < ::Nl::Message
|
|
1249
1326
|
TYPE = 7
|
|
1250
1327
|
FIXED_HEADER = nil
|
|
1251
1328
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
1252
|
-
ATTRIBUTES =
|
|
1329
|
+
ATTRIBUTES = %i[id].freeze
|
|
1330
|
+
include ATTRIBUTE_SET::Definitions
|
|
1331
|
+
def initialize(attributes = [])
|
|
1332
|
+
@attributes = attributes
|
|
1333
|
+
end
|
|
1334
|
+
# @private
|
|
1335
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1336
|
+
validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
|
|
1337
|
+
new(
|
|
1338
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1339
|
+
)
|
|
1340
|
+
end
|
|
1341
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1342
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1343
|
+
def self.decode(decoder)
|
|
1344
|
+
new(decode_attributes(decoder, BY_TYPE, 0))
|
|
1345
|
+
end
|
|
1346
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1347
|
+
encode_attributes(encoder, external_selectors:)
|
|
1348
|
+
end
|
|
1253
1349
|
# PSP device ID.
|
|
1254
1350
|
# @rbs return: ::Integer
|
|
1255
1351
|
# @return [Integer]
|
|
1256
|
-
|
|
1257
|
-
def id; attributes[:"id"]&.value; end
|
|
1352
|
+
def id; self[:"id"]; end
|
|
1258
1353
|
end
|
|
1259
1354
|
end
|
|
1260
1355
|
# @private
|
|
1261
|
-
NOTIFICATIONS =
|
|
1356
|
+
NOTIFICATIONS = {2 => Notifications::DevAddNtf, 3 => Notifications::DevDelNtf, 5 => Notifications::DevChangeNtf, 7 => Notifications::KeyRotateNtf}.freeze #: Hash[::Integer, ::Class]
|
|
1262
1357
|
# Get / dump information about PSP capable devices on the system.
|
|
1263
1358
|
# @rbs (?id: ::Integer) -> Messages::DoDevGetReply
|
|
1264
1359
|
# @param [Hash] args
|