nl-linux 0.3.0 → 0.4.1

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