nl-linux 0.2.3 → 0.3.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/.rspec +3 -0
- data/CHANGELOG.md +8 -0
- data/NLSPEC_VERSION +1 -1
- data/Rakefile +13 -3
- data/generated/nl/linux/binder.rb +80 -0
- data/generated/nl/linux/conntrack.rb +39 -2
- data/generated/nl/linux/dev_energymodel.rb +106 -0
- data/generated/nl/linux/devlink.rb +1478 -200
- data/generated/nl/linux/dpll.rb +790 -66
- data/generated/nl/linux/drm_ras.rb +309 -0
- data/generated/nl/linux/ethtool.rb +1597 -248
- data/generated/nl/linux/fou.rb +82 -13
- data/generated/nl/linux/handshake.rb +93 -1
- data/generated/nl/linux/lockd.rb +50 -0
- data/generated/nl/linux/mptcp_pm.rb +159 -0
- data/generated/nl/linux/net_shaper.rb +124 -1
- data/generated/nl/linux/netdev.rb +515 -6
- data/generated/nl/linux/nfsd.rb +878 -10
- data/generated/nl/linux/nftables.rb +2134 -179
- data/generated/nl/linux/nl80211.rb +81 -22
- data/generated/nl/linux/nlctrl.rb +59 -8
- data/generated/nl/linux/ovpn.rb +207 -12
- data/generated/nl/linux/ovs_datapath.rb +59 -10
- data/generated/nl/linux/ovs_flow.rb +63 -20
- data/generated/nl/linux/ovs_packet.rb +277 -0
- data/generated/nl/linux/ovs_vport.rb +59 -10
- data/generated/nl/linux/psp.rb +453 -6
- data/generated/nl/linux/rt_addr.rb +69 -14
- data/generated/nl/linux/rt_link.rb +452 -112
- data/generated/nl/linux/rt_neigh.rb +227 -16
- data/generated/nl/linux/rt_route.rb +92 -49
- data/generated/nl/linux/rt_rule.rb +300 -11
- data/generated/nl/linux/sunrpc_cache.rb +423 -0
- data/generated/nl/linux/tc.rb +168 -54
- data/generated/nl/linux/tcp_metrics.rb +69 -12
- data/generated/nl/linux/team.rb +80 -0
- data/generated/nl/linux/wireguard.rb +99 -7
- data/generated/nl/linux.rb +3 -0
- data/lib/nl/linux/version.rb +1 -1
- data/linux/devlink.yaml +92 -2
- data/linux/dpll.yaml +94 -5
- data/linux/drm_ras.yaml +126 -0
- data/linux/ethtool.yaml +21 -4
- data/linux/handshake.yaml +9 -0
- data/linux/mptcp_pm.yaml +1 -0
- data/linux/net_shaper.yaml +13 -6
- data/linux/netdev.yaml +61 -2
- data/linux/nfsd.yaml +303 -2
- data/linux/nftables.yaml +640 -49
- data/linux/ovpn.yaml +26 -1
- data/linux/ovs_packet.yaml +130 -0
- data/linux/psp.yaml +80 -3
- data/linux/rt-link.yaml +70 -24
- data/linux/sunrpc_cache.yaml +149 -0
- data/linux/tc.yaml +3 -0
- metadata +17 -9
data/generated/nl/linux/psp.rb
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
|
+
#
|
|
3
|
+
# This file is based on Documentation/netlink/specs/psp.yaml from Linux v7.2.
|
|
2
4
|
#--
|
|
3
5
|
# frozen_string_literal: true
|
|
4
6
|
# rbs_inline: enabled
|
|
@@ -9,9 +11,41 @@ module Nl; module Linux
|
|
|
9
11
|
class Psp < ::Nl::Family
|
|
10
12
|
NAME = "psp"
|
|
11
13
|
PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("psp"))
|
|
14
|
+
MCAST_GROUPS = Ractor.make_shareable({:"mgmt" => ::Nl::McastGroup.new("mgmt", nil), :"use" => ::Nl::McastGroup.new("use", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
|
|
12
15
|
module Structs
|
|
13
16
|
end
|
|
14
17
|
module AttributeSets
|
|
18
|
+
class AssocDevInfo < ::Nl::Protocols::Genl::AttributeSet
|
|
19
|
+
# Abstract class
|
|
20
|
+
class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
|
|
21
|
+
end
|
|
22
|
+
class Ifindex < Attribute
|
|
23
|
+
TYPE = 1
|
|
24
|
+
NAME = :"ifindex"
|
|
25
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
26
|
+
end
|
|
27
|
+
class Nsid < Attribute
|
|
28
|
+
TYPE = 2
|
|
29
|
+
NAME = :"nsid"
|
|
30
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
31
|
+
end
|
|
32
|
+
# :nodoc:
|
|
33
|
+
BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"nsid" => Nsid}) #: Hash[::Symbol, Attribute]
|
|
34
|
+
# :nodoc:
|
|
35
|
+
BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Nsid}) #: Hash[::Integer, Attribute]
|
|
36
|
+
class << self
|
|
37
|
+
# Looks up Attribute class by name.
|
|
38
|
+
#--
|
|
39
|
+
# @rbs name: Symbol
|
|
40
|
+
# @rbs return: Attribute
|
|
41
|
+
def by_name(name); BY_NAME.fetch(name); end
|
|
42
|
+
# Looks up Attribute class by type value.
|
|
43
|
+
#--
|
|
44
|
+
# @rbs type: Integer
|
|
45
|
+
# @rbs return: Attribute
|
|
46
|
+
def by_type(type); BY_TYPE.fetch(type); end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
15
49
|
class Dev < ::Nl::Protocols::Genl::AttributeSet
|
|
16
50
|
# Abstract class
|
|
17
51
|
class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
|
|
@@ -36,10 +70,24 @@ class Psp < ::Nl::Family
|
|
|
36
70
|
NAME = :"psp_versions_ena"
|
|
37
71
|
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
38
72
|
end
|
|
73
|
+
class AssocList < Attribute
|
|
74
|
+
TYPE = 5
|
|
75
|
+
NAME = :"assoc_list"
|
|
76
|
+
end
|
|
77
|
+
class Nsid < Attribute
|
|
78
|
+
TYPE = 6
|
|
79
|
+
NAME = :"nsid"
|
|
80
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
81
|
+
end
|
|
82
|
+
class ByAssociation < Attribute
|
|
83
|
+
TYPE = 7
|
|
84
|
+
NAME = :"by_association"
|
|
85
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
|
|
86
|
+
end
|
|
39
87
|
# :nodoc:
|
|
40
|
-
BY_NAME = Ractor.make_shareable({:"id" => Id, :"ifindex" => Ifindex, :"psp_versions_cap" => PspVersionsCap, :"psp_versions_ena" => PspVersionsEna}) #: Hash[::Symbol, Attribute]
|
|
88
|
+
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]
|
|
41
89
|
# :nodoc:
|
|
42
|
-
BY_TYPE = Ractor.make_shareable({1 => Id, 2 => Ifindex, 3 => PspVersionsCap, 4 => PspVersionsEna}) #: Hash[::Integer, Attribute]
|
|
90
|
+
BY_TYPE = Ractor.make_shareable({1 => Id, 2 => Ifindex, 3 => PspVersionsCap, 4 => PspVersionsEna, 5 => AssocList, 6 => Nsid, 7 => ByAssociation}) #: Hash[::Integer, Attribute]
|
|
43
91
|
class << self
|
|
44
92
|
# Looks up Attribute class by name.
|
|
45
93
|
#--
|
|
@@ -204,6 +252,7 @@ class Psp < ::Nl::Family
|
|
|
204
252
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
205
253
|
end
|
|
206
254
|
end
|
|
255
|
+
Dev::AssocList::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(AssocDevInfo)
|
|
207
256
|
Assoc::RxKey::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keys)
|
|
208
257
|
Assoc::TxKey::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Keys)
|
|
209
258
|
end
|
|
@@ -224,7 +273,7 @@ class Psp < ::Nl::Family
|
|
|
224
273
|
TYPE = 1
|
|
225
274
|
FIXED_HEADER = nil
|
|
226
275
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
227
|
-
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex psp_versions_cap psp_versions_ena])
|
|
276
|
+
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association])
|
|
228
277
|
# Gets the value of `id` attribute in the message.
|
|
229
278
|
#--
|
|
230
279
|
# @rbs return: ::Integer
|
|
@@ -241,13 +290,28 @@ class Psp < ::Nl::Family
|
|
|
241
290
|
#--
|
|
242
291
|
# @rbs return: ::Integer
|
|
243
292
|
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
|
|
300
|
+
def by_association; attributes[:"by_association"]&.value; end
|
|
301
|
+
end
|
|
302
|
+
# Get / dump information about PSP capable devices on the system.
|
|
303
|
+
class DumpDevGetRequest < ::Nl::Protocols::Genl::Message
|
|
304
|
+
TYPE = 1
|
|
305
|
+
FIXED_HEADER = nil
|
|
306
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
307
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
244
308
|
end
|
|
245
309
|
# Get / dump information about PSP capable devices on the system.
|
|
246
310
|
class DumpDevGetReply < ::Nl::Protocols::Genl::Message
|
|
247
311
|
TYPE = 1
|
|
248
312
|
FIXED_HEADER = nil
|
|
249
313
|
ATTRIBUTE_SET = AttributeSets::Dev
|
|
250
|
-
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex psp_versions_cap psp_versions_ena])
|
|
314
|
+
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex psp_versions_cap psp_versions_ena assoc_list by_association])
|
|
251
315
|
# Gets the value of `id` attribute in the message.
|
|
252
316
|
#--
|
|
253
317
|
# @rbs return: ::Integer
|
|
@@ -264,8 +328,18 @@ class Psp < ::Nl::Family
|
|
|
264
328
|
#--
|
|
265
329
|
# @rbs return: ::Integer
|
|
266
330
|
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
|
|
338
|
+
def by_association; attributes[:"by_association"]&.value; end
|
|
267
339
|
end
|
|
268
340
|
# Set the configuration of a PSP device.
|
|
341
|
+
#
|
|
342
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
269
343
|
class DoDevSetRequest < ::Nl::Protocols::Genl::Message
|
|
270
344
|
TYPE = 4
|
|
271
345
|
FIXED_HEADER = nil
|
|
@@ -281,6 +355,8 @@ class Psp < ::Nl::Family
|
|
|
281
355
|
def psp_versions_ena; attributes[:"psp_versions_ena"]&.value; end
|
|
282
356
|
end
|
|
283
357
|
# Set the configuration of a PSP device.
|
|
358
|
+
#
|
|
359
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
284
360
|
class DoDevSetReply < ::Nl::Protocols::Genl::Message
|
|
285
361
|
TYPE = 4
|
|
286
362
|
FIXED_HEADER = nil
|
|
@@ -288,6 +364,8 @@ class Psp < ::Nl::Family
|
|
|
288
364
|
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
289
365
|
end
|
|
290
366
|
# Rotate the device key.
|
|
367
|
+
#
|
|
368
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
291
369
|
class DoKeyRotateRequest < ::Nl::Protocols::Genl::Message
|
|
292
370
|
TYPE = 6
|
|
293
371
|
FIXED_HEADER = nil
|
|
@@ -299,6 +377,8 @@ class Psp < ::Nl::Family
|
|
|
299
377
|
def id; attributes[:"id"]&.value; end
|
|
300
378
|
end
|
|
301
379
|
# Rotate the device key.
|
|
380
|
+
#
|
|
381
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
302
382
|
class DoKeyRotateReply < ::Nl::Protocols::Genl::Message
|
|
303
383
|
TYPE = 6
|
|
304
384
|
FIXED_HEADER = nil
|
|
@@ -389,7 +469,7 @@ class Psp < ::Nl::Family
|
|
|
389
469
|
TYPE = 10
|
|
390
470
|
FIXED_HEADER = nil
|
|
391
471
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
392
|
-
ATTRIBUTES = Ractor.make_shareable(%i[dev_id key_rotations stale_events])
|
|
472
|
+
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])
|
|
393
473
|
# Gets the value of `dev-id` attribute in the message.
|
|
394
474
|
#--
|
|
395
475
|
# @rbs return: ::Integer
|
|
@@ -402,13 +482,52 @@ class Psp < ::Nl::Family
|
|
|
402
482
|
#--
|
|
403
483
|
# @rbs return: ::Integer
|
|
404
484
|
def stale_events; attributes[:"stale_events"]&.value; end
|
|
485
|
+
# Gets the value of `rx-packets` attribute in the message.
|
|
486
|
+
#--
|
|
487
|
+
# @rbs return: ::Integer
|
|
488
|
+
def rx_packets; attributes[:"rx_packets"]&.value; end
|
|
489
|
+
# Gets the value of `rx-bytes` attribute in the message.
|
|
490
|
+
#--
|
|
491
|
+
# @rbs return: ::Integer
|
|
492
|
+
def rx_bytes; attributes[:"rx_bytes"]&.value; end
|
|
493
|
+
# Gets the value of `rx-auth-fail` attribute in the message.
|
|
494
|
+
#--
|
|
495
|
+
# @rbs return: ::Integer
|
|
496
|
+
def rx_auth_fail; attributes[:"rx_auth_fail"]&.value; end
|
|
497
|
+
# Gets the value of `rx-error` attribute in the message.
|
|
498
|
+
#--
|
|
499
|
+
# @rbs return: ::Integer
|
|
500
|
+
def rx_error; attributes[:"rx_error"]&.value; end
|
|
501
|
+
# Gets the value of `rx-bad` attribute in the message.
|
|
502
|
+
#--
|
|
503
|
+
# @rbs return: ::Integer
|
|
504
|
+
def rx_bad; attributes[:"rx_bad"]&.value; end
|
|
505
|
+
# Gets the value of `tx-packets` attribute in the message.
|
|
506
|
+
#--
|
|
507
|
+
# @rbs return: ::Integer
|
|
508
|
+
def tx_packets; attributes[:"tx_packets"]&.value; end
|
|
509
|
+
# Gets the value of `tx-bytes` attribute in the message.
|
|
510
|
+
#--
|
|
511
|
+
# @rbs return: ::Integer
|
|
512
|
+
def tx_bytes; attributes[:"tx_bytes"]&.value; end
|
|
513
|
+
# Gets the value of `tx-error` attribute in the message.
|
|
514
|
+
#--
|
|
515
|
+
# @rbs return: ::Integer
|
|
516
|
+
def tx_error; attributes[:"tx_error"]&.value; end
|
|
517
|
+
end
|
|
518
|
+
# Get device statistics.
|
|
519
|
+
class DumpGetStatsRequest < ::Nl::Protocols::Genl::Message
|
|
520
|
+
TYPE = 10
|
|
521
|
+
FIXED_HEADER = nil
|
|
522
|
+
ATTRIBUTE_SET = AttributeSets::Stats
|
|
523
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
405
524
|
end
|
|
406
525
|
# Get device statistics.
|
|
407
526
|
class DumpGetStatsReply < ::Nl::Protocols::Genl::Message
|
|
408
527
|
TYPE = 10
|
|
409
528
|
FIXED_HEADER = nil
|
|
410
529
|
ATTRIBUTE_SET = AttributeSets::Stats
|
|
411
|
-
ATTRIBUTES = Ractor.make_shareable(%i[dev_id key_rotations stale_events])
|
|
530
|
+
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])
|
|
412
531
|
# Gets the value of `dev-id` attribute in the message.
|
|
413
532
|
#--
|
|
414
533
|
# @rbs return: ::Integer
|
|
@@ -421,21 +540,239 @@ class Psp < ::Nl::Family
|
|
|
421
540
|
#--
|
|
422
541
|
# @rbs return: ::Integer
|
|
423
542
|
def stale_events; attributes[:"stale_events"]&.value; end
|
|
543
|
+
# Gets the value of `rx-packets` attribute in the message.
|
|
544
|
+
#--
|
|
545
|
+
# @rbs return: ::Integer
|
|
546
|
+
def rx_packets; attributes[:"rx_packets"]&.value; end
|
|
547
|
+
# Gets the value of `rx-bytes` attribute in the message.
|
|
548
|
+
#--
|
|
549
|
+
# @rbs return: ::Integer
|
|
550
|
+
def rx_bytes; attributes[:"rx_bytes"]&.value; end
|
|
551
|
+
# Gets the value of `rx-auth-fail` attribute in the message.
|
|
552
|
+
#--
|
|
553
|
+
# @rbs return: ::Integer
|
|
554
|
+
def rx_auth_fail; attributes[:"rx_auth_fail"]&.value; end
|
|
555
|
+
# Gets the value of `rx-error` attribute in the message.
|
|
556
|
+
#--
|
|
557
|
+
# @rbs return: ::Integer
|
|
558
|
+
def rx_error; attributes[:"rx_error"]&.value; end
|
|
559
|
+
# Gets the value of `rx-bad` attribute in the message.
|
|
560
|
+
#--
|
|
561
|
+
# @rbs return: ::Integer
|
|
562
|
+
def rx_bad; attributes[:"rx_bad"]&.value; end
|
|
563
|
+
# Gets the value of `tx-packets` attribute in the message.
|
|
564
|
+
#--
|
|
565
|
+
# @rbs return: ::Integer
|
|
566
|
+
def tx_packets; attributes[:"tx_packets"]&.value; end
|
|
567
|
+
# Gets the value of `tx-bytes` attribute in the message.
|
|
568
|
+
#--
|
|
569
|
+
# @rbs return: ::Integer
|
|
570
|
+
def tx_bytes; attributes[:"tx_bytes"]&.value; end
|
|
571
|
+
# Gets the value of `tx-error` attribute in the message.
|
|
572
|
+
#--
|
|
573
|
+
# @rbs return: ::Integer
|
|
574
|
+
def tx_error; attributes[:"tx_error"]&.value; end
|
|
575
|
+
end
|
|
576
|
+
# Associate a network device with a PSP device.
|
|
577
|
+
#
|
|
578
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
579
|
+
class DoDevAssocRequest < ::Nl::Protocols::Genl::Message
|
|
580
|
+
TYPE = 11
|
|
581
|
+
FIXED_HEADER = nil
|
|
582
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
583
|
+
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex nsid])
|
|
584
|
+
# Gets the value of `id` attribute in the message.
|
|
585
|
+
#--
|
|
586
|
+
# @rbs return: ::Integer
|
|
587
|
+
def id; attributes[:"id"]&.value; end
|
|
588
|
+
# Gets the value of `ifindex` attribute in the message.
|
|
589
|
+
#--
|
|
590
|
+
# @rbs return: ::Integer
|
|
591
|
+
def ifindex; attributes[:"ifindex"]&.value; end
|
|
592
|
+
# Gets the value of `nsid` attribute in the message.
|
|
593
|
+
#--
|
|
594
|
+
# @rbs return: ::Integer
|
|
595
|
+
def nsid; attributes[:"nsid"]&.value; end
|
|
596
|
+
end
|
|
597
|
+
# Associate a network device with a PSP device.
|
|
598
|
+
#
|
|
599
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
600
|
+
class DoDevAssocReply < ::Nl::Protocols::Genl::Message
|
|
601
|
+
TYPE = 11
|
|
602
|
+
FIXED_HEADER = nil
|
|
603
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
604
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
605
|
+
end
|
|
606
|
+
# Disassociate a network device from a PSP device.
|
|
607
|
+
#
|
|
608
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
609
|
+
class DoDevDisassocRequest < ::Nl::Protocols::Genl::Message
|
|
610
|
+
TYPE = 12
|
|
611
|
+
FIXED_HEADER = nil
|
|
612
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
613
|
+
ATTRIBUTES = Ractor.make_shareable(%i[id ifindex nsid])
|
|
614
|
+
# Gets the value of `id` attribute in the message.
|
|
615
|
+
#--
|
|
616
|
+
# @rbs return: ::Integer
|
|
617
|
+
def id; attributes[:"id"]&.value; end
|
|
618
|
+
# Gets the value of `ifindex` attribute in the message.
|
|
619
|
+
#--
|
|
620
|
+
# @rbs return: ::Integer
|
|
621
|
+
def ifindex; attributes[:"ifindex"]&.value; end
|
|
622
|
+
# Gets the value of `nsid` attribute in the message.
|
|
623
|
+
#--
|
|
624
|
+
# @rbs return: ::Integer
|
|
625
|
+
def nsid; attributes[:"nsid"]&.value; end
|
|
626
|
+
end
|
|
627
|
+
# Disassociate a network device from a PSP device.
|
|
628
|
+
#
|
|
629
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
630
|
+
class DoDevDisassocReply < ::Nl::Protocols::Genl::Message
|
|
631
|
+
TYPE = 12
|
|
632
|
+
FIXED_HEADER = nil
|
|
633
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
634
|
+
ATTRIBUTES = Ractor.make_shareable(%i[])
|
|
635
|
+
end
|
|
636
|
+
end
|
|
637
|
+
module Notifications
|
|
638
|
+
# Notification about device appearing.
|
|
639
|
+
#
|
|
640
|
+
# Multicast group: `mgmt`.
|
|
641
|
+
class DevAddNtf < ::Nl::Protocols::Genl::Message
|
|
642
|
+
TYPE = 2
|
|
643
|
+
FIXED_HEADER = nil
|
|
644
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
645
|
+
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
|
+
#--
|
|
648
|
+
# @rbs return: ::Integer
|
|
649
|
+
def id; attributes[:"id"]&.value; end
|
|
650
|
+
# Gets the value of `ifindex` attribute in the message.
|
|
651
|
+
#--
|
|
652
|
+
# @rbs return: ::Integer
|
|
653
|
+
def ifindex; attributes[:"ifindex"]&.value; end
|
|
654
|
+
# Gets the value of `psp-versions-cap` attribute in the message.
|
|
655
|
+
#--
|
|
656
|
+
# @rbs return: ::Integer
|
|
657
|
+
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
658
|
+
# Gets the value of `psp-versions-ena` attribute in the message.
|
|
659
|
+
#--
|
|
660
|
+
# @rbs return: ::Integer
|
|
661
|
+
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
|
|
669
|
+
def by_association; attributes[:"by_association"]&.value; end
|
|
670
|
+
end
|
|
671
|
+
# Notification about device disappearing.
|
|
672
|
+
#
|
|
673
|
+
# Multicast group: `mgmt`.
|
|
674
|
+
class DevDelNtf < ::Nl::Protocols::Genl::Message
|
|
675
|
+
TYPE = 3
|
|
676
|
+
FIXED_HEADER = nil
|
|
677
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
678
|
+
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
|
+
#--
|
|
681
|
+
# @rbs return: ::Integer
|
|
682
|
+
def id; attributes[:"id"]&.value; end
|
|
683
|
+
# Gets the value of `ifindex` attribute in the message.
|
|
684
|
+
#--
|
|
685
|
+
# @rbs return: ::Integer
|
|
686
|
+
def ifindex; attributes[:"ifindex"]&.value; end
|
|
687
|
+
# Gets the value of `psp-versions-cap` attribute in the message.
|
|
688
|
+
#--
|
|
689
|
+
# @rbs return: ::Integer
|
|
690
|
+
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
691
|
+
# Gets the value of `psp-versions-ena` attribute in the message.
|
|
692
|
+
#--
|
|
693
|
+
# @rbs return: ::Integer
|
|
694
|
+
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
|
|
702
|
+
def by_association; attributes[:"by_association"]&.value; end
|
|
703
|
+
end
|
|
704
|
+
# Notification about device configuration being changed.
|
|
705
|
+
#
|
|
706
|
+
# Multicast group: `mgmt`.
|
|
707
|
+
class DevChangeNtf < ::Nl::Protocols::Genl::Message
|
|
708
|
+
TYPE = 5
|
|
709
|
+
FIXED_HEADER = nil
|
|
710
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
711
|
+
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
|
+
#--
|
|
714
|
+
# @rbs return: ::Integer
|
|
715
|
+
def id; attributes[:"id"]&.value; end
|
|
716
|
+
# Gets the value of `ifindex` attribute in the message.
|
|
717
|
+
#--
|
|
718
|
+
# @rbs return: ::Integer
|
|
719
|
+
def ifindex; attributes[:"ifindex"]&.value; end
|
|
720
|
+
# Gets the value of `psp-versions-cap` attribute in the message.
|
|
721
|
+
#--
|
|
722
|
+
# @rbs return: ::Integer
|
|
723
|
+
def psp_versions_cap; attributes[:"psp_versions_cap"]&.value; end
|
|
724
|
+
# Gets the value of `psp-versions-ena` attribute in the message.
|
|
725
|
+
#--
|
|
726
|
+
# @rbs return: ::Integer
|
|
727
|
+
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
|
|
735
|
+
def by_association; attributes[:"by_association"]&.value; end
|
|
736
|
+
end
|
|
737
|
+
# Notification about device key getting rotated.
|
|
738
|
+
#
|
|
739
|
+
# Multicast group: `use`.
|
|
740
|
+
class KeyRotateNtf < ::Nl::Protocols::Genl::Message
|
|
741
|
+
TYPE = 7
|
|
742
|
+
FIXED_HEADER = nil
|
|
743
|
+
ATTRIBUTE_SET = AttributeSets::Dev
|
|
744
|
+
ATTRIBUTES = Ractor.make_shareable(%i[id])
|
|
745
|
+
# Gets the value of `id` attribute in the message.
|
|
746
|
+
#--
|
|
747
|
+
# @rbs return: ::Integer
|
|
748
|
+
def id; attributes[:"id"]&.value; end
|
|
424
749
|
end
|
|
425
750
|
end
|
|
751
|
+
NOTIFICATIONS = Ractor.make_shareable({2 => Notifications::DevAddNtf, 3 => Notifications::DevDelNtf, 5 => Notifications::DevChangeNtf, 7 => Notifications::KeyRotateNtf}) #: Hash[::Integer, ::Class]
|
|
426
752
|
# Get / dump information about PSP capable devices on the system.
|
|
427
753
|
#--
|
|
428
754
|
# @rbs (?id: ::Integer) -> Messages::DoDevGetReply
|
|
429
755
|
def do_dev_get(**args)
|
|
430
756
|
exchange_message(:"do", Messages::DoDevGetRequest, Messages::DoDevGetReply, args)
|
|
431
757
|
end
|
|
758
|
+
# Get / dump information about PSP capable devices on the system.
|
|
759
|
+
#--
|
|
760
|
+
# @rbs () -> Enumerable[Messages::DumpDevGetReply]
|
|
761
|
+
# | () { (Messages::DumpDevGetReply) -> void } -> void
|
|
762
|
+
def dump_dev_get(**args, &block)
|
|
763
|
+
exchange_message(:"dump", Messages::DumpDevGetRequest, Messages::DumpDevGetReply, args, &block)
|
|
764
|
+
end
|
|
432
765
|
# Set the configuration of a PSP device.
|
|
766
|
+
#
|
|
767
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
433
768
|
#--
|
|
434
769
|
# @rbs (?id: ::Integer, ?psp_versions_ena: ::Integer) -> Messages::DoDevSetReply
|
|
435
770
|
def do_dev_set(**args)
|
|
436
771
|
exchange_message(:"do", Messages::DoDevSetRequest, Messages::DoDevSetReply, args)
|
|
437
772
|
end
|
|
438
773
|
# Rotate the device key.
|
|
774
|
+
#
|
|
775
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
439
776
|
#--
|
|
440
777
|
# @rbs (?id: ::Integer) -> Messages::DoKeyRotateReply
|
|
441
778
|
def do_key_rotate(**args)
|
|
@@ -459,5 +796,115 @@ class Psp < ::Nl::Family
|
|
|
459
796
|
def do_get_stats(**args)
|
|
460
797
|
exchange_message(:"do", Messages::DoGetStatsRequest, Messages::DoGetStatsReply, args)
|
|
461
798
|
end
|
|
799
|
+
# Get device statistics.
|
|
800
|
+
#--
|
|
801
|
+
# @rbs () -> Enumerable[Messages::DumpGetStatsReply]
|
|
802
|
+
# | () { (Messages::DumpGetStatsReply) -> void } -> void
|
|
803
|
+
def dump_get_stats(**args, &block)
|
|
804
|
+
exchange_message(:"dump", Messages::DumpGetStatsRequest, Messages::DumpGetStatsReply, args, &block)
|
|
805
|
+
end
|
|
806
|
+
# Associate a network device with a PSP device.
|
|
807
|
+
#
|
|
808
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
809
|
+
#--
|
|
810
|
+
# @rbs (?id: ::Integer, ?ifindex: ::Integer, ?nsid: ::Integer) -> Messages::DoDevAssocReply
|
|
811
|
+
def do_dev_assoc(**args)
|
|
812
|
+
exchange_message(:"do", Messages::DoDevAssocRequest, Messages::DoDevAssocReply, args)
|
|
813
|
+
end
|
|
814
|
+
# Disassociate a network device from a PSP device.
|
|
815
|
+
#
|
|
816
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
817
|
+
#--
|
|
818
|
+
# @rbs (?id: ::Integer, ?ifindex: ::Integer, ?nsid: ::Integer) -> Messages::DoDevDisassocReply
|
|
819
|
+
def do_dev_disassoc(**args)
|
|
820
|
+
exchange_message(:"do", Messages::DoDevDisassocRequest, Messages::DoDevDisassocReply, args)
|
|
821
|
+
end
|
|
822
|
+
class AsyncOperations
|
|
823
|
+
# :nodoc:
|
|
824
|
+
def initialize(&exchange)
|
|
825
|
+
@exchange = exchange
|
|
826
|
+
end
|
|
827
|
+
# Get / dump information about PSP capable devices on the system.
|
|
828
|
+
#--
|
|
829
|
+
# @rbs (?id: ::Integer) -> ::Nl::Async::Future[Messages::DoDevGetReply]
|
|
830
|
+
def do_dev_get(**args)
|
|
831
|
+
@exchange.call(:"do", Messages::DoDevGetRequest, Messages::DoDevGetReply, args)
|
|
832
|
+
end
|
|
833
|
+
# Get / dump information about PSP capable devices on the system.
|
|
834
|
+
#--
|
|
835
|
+
# @rbs () -> ::Nl::Async::Stream[Messages::DumpDevGetReply]
|
|
836
|
+
def dump_dev_get(**args)
|
|
837
|
+
@exchange.call(:"dump", Messages::DumpDevGetRequest, Messages::DumpDevGetReply, args)
|
|
838
|
+
end
|
|
839
|
+
# Set the configuration of a PSP device.
|
|
840
|
+
#
|
|
841
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
842
|
+
#--
|
|
843
|
+
# @rbs (?id: ::Integer, ?psp_versions_ena: ::Integer) -> ::Nl::Async::Future[Messages::DoDevSetReply]
|
|
844
|
+
def do_dev_set(**args)
|
|
845
|
+
@exchange.call(:"do", Messages::DoDevSetRequest, Messages::DoDevSetReply, args)
|
|
846
|
+
end
|
|
847
|
+
# Rotate the device key.
|
|
848
|
+
#
|
|
849
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
850
|
+
#--
|
|
851
|
+
# @rbs (?id: ::Integer) -> ::Nl::Async::Future[Messages::DoKeyRotateReply]
|
|
852
|
+
def do_key_rotate(**args)
|
|
853
|
+
@exchange.call(:"do", Messages::DoKeyRotateRequest, Messages::DoKeyRotateReply, args)
|
|
854
|
+
end
|
|
855
|
+
# Allocate a new Rx key + SPI pair, associate it with a socket.
|
|
856
|
+
#--
|
|
857
|
+
# @rbs (?dev_id: ::Integer, ?version: ::Integer, ?sock_fd: ::Integer) -> ::Nl::Async::Future[Messages::DoRxAssocReply]
|
|
858
|
+
def do_rx_assoc(**args)
|
|
859
|
+
@exchange.call(:"do", Messages::DoRxAssocRequest, Messages::DoRxAssocReply, args)
|
|
860
|
+
end
|
|
861
|
+
# 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]
|
|
864
|
+
def do_tx_assoc(**args)
|
|
865
|
+
@exchange.call(:"do", Messages::DoTxAssocRequest, Messages::DoTxAssocReply, args)
|
|
866
|
+
end
|
|
867
|
+
# Get device statistics.
|
|
868
|
+
#--
|
|
869
|
+
# @rbs (?dev_id: ::Integer) -> ::Nl::Async::Future[Messages::DoGetStatsReply]
|
|
870
|
+
def do_get_stats(**args)
|
|
871
|
+
@exchange.call(:"do", Messages::DoGetStatsRequest, Messages::DoGetStatsReply, args)
|
|
872
|
+
end
|
|
873
|
+
# Get device statistics.
|
|
874
|
+
#--
|
|
875
|
+
# @rbs () -> ::Nl::Async::Stream[Messages::DumpGetStatsReply]
|
|
876
|
+
def dump_get_stats(**args)
|
|
877
|
+
@exchange.call(:"dump", Messages::DumpGetStatsRequest, Messages::DumpGetStatsReply, args)
|
|
878
|
+
end
|
|
879
|
+
# Associate a network device with a PSP device.
|
|
880
|
+
#
|
|
881
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
882
|
+
#--
|
|
883
|
+
# @rbs (?id: ::Integer, ?ifindex: ::Integer, ?nsid: ::Integer) -> ::Nl::Async::Future[Messages::DoDevAssocReply]
|
|
884
|
+
def do_dev_assoc(**args)
|
|
885
|
+
@exchange.call(:"do", Messages::DoDevAssocRequest, Messages::DoDevAssocReply, args)
|
|
886
|
+
end
|
|
887
|
+
# Disassociate a network device from a PSP device.
|
|
888
|
+
#
|
|
889
|
+
# Requires CAP_NET_ADMIN in the initial user namespace.
|
|
890
|
+
#--
|
|
891
|
+
# @rbs (?id: ::Integer, ?ifindex: ::Integer, ?nsid: ::Integer) -> ::Nl::Async::Future[Messages::DoDevDisassocReply]
|
|
892
|
+
def do_dev_disassoc(**args)
|
|
893
|
+
@exchange.call(:"do", Messages::DoDevDisassocRequest, Messages::DoDevDisassocReply, args)
|
|
894
|
+
end
|
|
895
|
+
end
|
|
896
|
+
# Returns the asynchronous operation facade for this family.
|
|
897
|
+
#--
|
|
898
|
+
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
899
|
+
def async(stream_capacity: nil)
|
|
900
|
+
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
901
|
+
build_async_facade(AsyncOperations, stream_capacity:)
|
|
902
|
+
end
|
|
903
|
+
#--
|
|
904
|
+
# @rbs (*(:mgmt | :use) groups) -> self
|
|
905
|
+
def subscribe(*groups) = super
|
|
906
|
+
#--
|
|
907
|
+
# @rbs (*(:mgmt | :use) groups) -> self
|
|
908
|
+
def unsubscribe(*groups) = super
|
|
462
909
|
end
|
|
463
910
|
end; end
|