nl-linux 0.2.4 → 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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/CHANGELOG.md +2 -0
  4. data/Rakefile +13 -3
  5. data/generated/nl/linux/binder.rb +80 -0
  6. data/generated/nl/linux/conntrack.rb +39 -2
  7. data/generated/nl/linux/dev_energymodel.rb +106 -0
  8. data/generated/nl/linux/devlink.rb +751 -0
  9. data/generated/nl/linux/dpll.rb +712 -55
  10. data/generated/nl/linux/drm_ras.rb +87 -0
  11. data/generated/nl/linux/ethtool.rb +1569 -259
  12. data/generated/nl/linux/fou.rb +82 -13
  13. data/generated/nl/linux/handshake.rb +92 -0
  14. data/generated/nl/linux/lockd.rb +50 -0
  15. data/generated/nl/linux/mptcp_pm.rb +159 -0
  16. data/generated/nl/linux/net_shaper.rb +123 -0
  17. data/generated/nl/linux/netdev.rb +374 -0
  18. data/generated/nl/linux/nfsd.rb +316 -6
  19. data/generated/nl/linux/nftables.rb +414 -25
  20. data/generated/nl/linux/nl80211.rb +81 -22
  21. data/generated/nl/linux/nlctrl.rb +59 -8
  22. data/generated/nl/linux/ovpn.rb +180 -0
  23. data/generated/nl/linux/ovs_datapath.rb +55 -6
  24. data/generated/nl/linux/ovs_flow.rb +63 -20
  25. data/generated/nl/linux/ovs_packet.rb +115 -4
  26. data/generated/nl/linux/ovs_vport.rb +55 -6
  27. data/generated/nl/linux/psp.rb +257 -0
  28. data/generated/nl/linux/rt_addr.rb +69 -14
  29. data/generated/nl/linux/rt_link.rb +381 -47
  30. data/generated/nl/linux/rt_neigh.rb +227 -16
  31. data/generated/nl/linux/rt_route.rb +92 -49
  32. data/generated/nl/linux/rt_rule.rb +300 -11
  33. data/generated/nl/linux/sunrpc_cache.rb +130 -0
  34. data/generated/nl/linux/tc.rb +161 -52
  35. data/generated/nl/linux/tcp_metrics.rb +69 -12
  36. data/generated/nl/linux/team.rb +80 -0
  37. data/generated/nl/linux/wireguard.rb +99 -7
  38. data/lib/nl/linux/version.rb +1 -1
  39. metadata +11 -9
@@ -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/tc.yaml from Linux v7.2.
2
4
  #--
3
5
  # frozen_string_literal: true
4
6
  # rbs_inline: enabled
@@ -9,6 +11,7 @@ module Nl; module Linux
9
11
  class Tc < ::Nl::Family
10
12
  NAME = "tc"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("tc", 0))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"rtnlgrp_tc" => ::Nl::McastGroup.new("rtnlgrp-tc", 4)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  Tcmsg = Struct.new(
14
17
  :"family", #: ::Integer
@@ -135,8 +138,8 @@ class Tc < ::Nl::Family
135
138
  end
136
139
  end
137
140
  TcHtbOpt = Struct.new(
138
- :"rate", #: untyped
139
- :"ceil", #: untyped
141
+ :"rate", #: ::String
142
+ :"ceil", #: ::String
140
143
  :"buffer", #: ::Integer
141
144
  :"cbuffer", #: ::Integer
142
145
  :"quantum", #: ::Integer
@@ -270,10 +273,10 @@ class Tc < ::Nl::Family
270
273
  end
271
274
  TcMqprioQopt = Struct.new(
272
275
  :"num_tc", #: ::Integer
273
- :"prio_tc_map", #: untyped
276
+ :"prio_tc_map", #: ::String
274
277
  :"hw", #: ::Integer
275
- :"count", #: untyped
276
- :"offset", #: untyped
278
+ :"count", #: ::String
279
+ :"offset", #: ::String
277
280
  )
278
281
  class TcMqprioQopt
279
282
  # :nodoc:
@@ -533,7 +536,7 @@ class Tc < ::Nl::Family
533
536
  end
534
537
  TcPrioQopt = Struct.new(
535
538
  :"bands", #: ::Integer
536
- :"priomap", #: untyped
539
+ :"priomap", #: ::String
537
540
  )
538
541
  class TcPrioQopt
539
542
  # :nodoc:
@@ -661,7 +664,7 @@ class Tc < ::Nl::Family
661
664
  end
662
665
  end
663
666
  TcSfqQoptV1 = Struct.new(
664
- :"v0", #: untyped
667
+ :"v0", #: ::String
665
668
  :"depth", #: ::Integer
666
669
  :"headdrop", #: ::Integer
667
670
  :"limit", #: ::Integer
@@ -672,7 +675,7 @@ class Tc < ::Nl::Family
672
675
  :"Scell_log", #: ::Integer
673
676
  :"flags", #: ::Integer
674
677
  :"max_P", #: ::Integer
675
- :"stats", #: untyped
678
+ :"stats", #: ::String
676
679
  )
677
680
  class TcSfqQoptV1
678
681
  # :nodoc:
@@ -719,8 +722,8 @@ class Tc < ::Nl::Family
719
722
  end
720
723
  end
721
724
  TcTbfQopt = Struct.new(
722
- :"rate", #: untyped
723
- :"peakrate", #: untyped
725
+ :"rate", #: ::String
726
+ :"peakrate", #: ::String
724
727
  :"limit", #: ::Integer
725
728
  :"buffer", #: ::Integer
726
729
  :"mtu", #: ::Integer
@@ -955,8 +958,8 @@ class Tc < ::Nl::Family
955
958
  :"horizon_drops", #: ::Integer
956
959
  :"horizon_caps", #: ::Integer
957
960
  :"fastpath_packets", #: ::Integer
958
- :"band_drops", #: untyped
959
- :"band_pkt_count", #: untyped
961
+ :"band_drops", #: ::String
962
+ :"band_pkt_count", #: ::String
960
963
  :"pad", #: nil
961
964
  )
962
965
  class TcFqQdStats
@@ -1251,7 +1254,7 @@ class Tc < ::Nl::Family
1251
1254
  :"offoff", #: ::Integer
1252
1255
  :"hoff", #: ::Integer
1253
1256
  :"hmask", #: ::Integer
1254
- :"keys", #: untyped
1257
+ :"keys", #: ::String
1255
1258
  )
1256
1259
  class TcU32Sel
1257
1260
  # :nodoc:
@@ -1463,8 +1466,8 @@ class Tc < ::Nl::Family
1463
1466
  :"limit", #: ::Integer
1464
1467
  :"burst", #: ::Integer
1465
1468
  :"mtu", #: ::Integer
1466
- :"rate", #: untyped
1467
- :"peakrate", #: untyped
1469
+ :"rate", #: ::String
1470
+ :"peakrate", #: ::String
1468
1471
  :"refcnt", #: ::Integer
1469
1472
  :"bindcnt", #: ::Integer
1470
1473
  :"capab", #: ::Integer
@@ -1495,7 +1498,7 @@ class Tc < ::Nl::Family
1495
1498
  :"bindcnt", #: ::Integer
1496
1499
  :"nkeys", #: ::Integer
1497
1500
  :"flags", #: ::Integer
1498
- :"keys", #: untyped
1501
+ :"keys", #: ::String
1499
1502
  )
1500
1503
  class TcPeditSel
1501
1504
  # :nodoc:
@@ -6072,11 +6075,11 @@ class Tc < ::Nl::Family
6072
6075
  def kind; attributes[:"kind"]&.value; end
6073
6076
  # Gets the value of `options` attribute in the message.
6074
6077
  #--
6075
- # @rbs return: untyped
6078
+ # @rbs return: ::String
6076
6079
  def options; attributes[:"options"]&.value; end
6077
6080
  # Gets the value of `rate` attribute in the message.
6078
6081
  #--
6079
- # @rbs return: untyped
6082
+ # @rbs return: ::String
6080
6083
  def rate; attributes[:"rate"]&.value; end
6081
6084
  # Gets the value of `chain` attribute in the message.
6082
6085
  #--
@@ -6181,19 +6184,19 @@ class Tc < ::Nl::Family
6181
6184
  def kind; attributes[:"kind"]&.value; end
6182
6185
  # Gets the value of `options` attribute in the message.
6183
6186
  #--
6184
- # @rbs return: untyped
6187
+ # @rbs return: ::String
6185
6188
  def options; attributes[:"options"]&.value; end
6186
6189
  # Gets the value of `stats` attribute in the message.
6187
6190
  #--
6188
- # @rbs return: untyped
6191
+ # @rbs return: ::String
6189
6192
  def stats; attributes[:"stats"]&.value; end
6190
6193
  # Gets the value of `xstats` attribute in the message.
6191
6194
  #--
6192
- # @rbs return: untyped
6195
+ # @rbs return: ::String
6193
6196
  def xstats; attributes[:"xstats"]&.value; end
6194
6197
  # Gets the value of `rate` attribute in the message.
6195
6198
  #--
6196
- # @rbs return: untyped
6199
+ # @rbs return: ::String
6197
6200
  def rate; attributes[:"rate"]&.value; end
6198
6201
  # Gets the value of `fcnt` attribute in the message.
6199
6202
  #--
@@ -6283,19 +6286,19 @@ class Tc < ::Nl::Family
6283
6286
  def kind; attributes[:"kind"]&.value; end
6284
6287
  # Gets the value of `options` attribute in the message.
6285
6288
  #--
6286
- # @rbs return: untyped
6289
+ # @rbs return: ::String
6287
6290
  def options; attributes[:"options"]&.value; end
6288
6291
  # Gets the value of `stats` attribute in the message.
6289
6292
  #--
6290
- # @rbs return: untyped
6293
+ # @rbs return: ::String
6291
6294
  def stats; attributes[:"stats"]&.value; end
6292
6295
  # Gets the value of `xstats` attribute in the message.
6293
6296
  #--
6294
- # @rbs return: untyped
6297
+ # @rbs return: ::String
6295
6298
  def xstats; attributes[:"xstats"]&.value; end
6296
6299
  # Gets the value of `rate` attribute in the message.
6297
6300
  #--
6298
- # @rbs return: untyped
6301
+ # @rbs return: ::String
6299
6302
  def rate; attributes[:"rate"]&.value; end
6300
6303
  # Gets the value of `fcnt` attribute in the message.
6301
6304
  #--
@@ -6354,11 +6357,11 @@ class Tc < ::Nl::Family
6354
6357
  def kind; attributes[:"kind"]&.value; end
6355
6358
  # Gets the value of `options` attribute in the message.
6356
6359
  #--
6357
- # @rbs return: untyped
6360
+ # @rbs return: ::String
6358
6361
  def options; attributes[:"options"]&.value; end
6359
6362
  # Gets the value of `rate` attribute in the message.
6360
6363
  #--
6361
- # @rbs return: untyped
6364
+ # @rbs return: ::String
6362
6365
  def rate; attributes[:"rate"]&.value; end
6363
6366
  # Gets the value of `chain` attribute in the message.
6364
6367
  #--
@@ -6459,19 +6462,19 @@ class Tc < ::Nl::Family
6459
6462
  def kind; attributes[:"kind"]&.value; end
6460
6463
  # Gets the value of `options` attribute in the message.
6461
6464
  #--
6462
- # @rbs return: untyped
6465
+ # @rbs return: ::String
6463
6466
  def options; attributes[:"options"]&.value; end
6464
6467
  # Gets the value of `stats` attribute in the message.
6465
6468
  #--
6466
- # @rbs return: untyped
6469
+ # @rbs return: ::String
6467
6470
  def stats; attributes[:"stats"]&.value; end
6468
6471
  # Gets the value of `xstats` attribute in the message.
6469
6472
  #--
6470
- # @rbs return: untyped
6473
+ # @rbs return: ::String
6471
6474
  def xstats; attributes[:"xstats"]&.value; end
6472
6475
  # Gets the value of `rate` attribute in the message.
6473
6476
  #--
6474
- # @rbs return: untyped
6477
+ # @rbs return: ::String
6475
6478
  def rate; attributes[:"rate"]&.value; end
6476
6479
  # Gets the value of `fcnt` attribute in the message.
6477
6480
  #--
@@ -6530,11 +6533,11 @@ class Tc < ::Nl::Family
6530
6533
  def kind; attributes[:"kind"]&.value; end
6531
6534
  # Gets the value of `options` attribute in the message.
6532
6535
  #--
6533
- # @rbs return: untyped
6536
+ # @rbs return: ::String
6534
6537
  def options; attributes[:"options"]&.value; end
6535
6538
  # Gets the value of `rate` attribute in the message.
6536
6539
  #--
6537
- # @rbs return: untyped
6540
+ # @rbs return: ::String
6538
6541
  def rate; attributes[:"rate"]&.value; end
6539
6542
  # Gets the value of `chain` attribute in the message.
6540
6543
  #--
@@ -6651,19 +6654,19 @@ class Tc < ::Nl::Family
6651
6654
  def kind; attributes[:"kind"]&.value; end
6652
6655
  # Gets the value of `options` attribute in the message.
6653
6656
  #--
6654
- # @rbs return: untyped
6657
+ # @rbs return: ::String
6655
6658
  def options; attributes[:"options"]&.value; end
6656
6659
  # Gets the value of `stats` attribute in the message.
6657
6660
  #--
6658
- # @rbs return: untyped
6661
+ # @rbs return: ::String
6659
6662
  def stats; attributes[:"stats"]&.value; end
6660
6663
  # Gets the value of `xstats` attribute in the message.
6661
6664
  #--
6662
- # @rbs return: untyped
6665
+ # @rbs return: ::String
6663
6666
  def xstats; attributes[:"xstats"]&.value; end
6664
6667
  # Gets the value of `rate` attribute in the message.
6665
6668
  #--
6666
- # @rbs return: untyped
6669
+ # @rbs return: ::String
6667
6670
  def rate; attributes[:"rate"]&.value; end
6668
6671
  # Gets the value of `fcnt` attribute in the message.
6669
6672
  #--
@@ -6757,19 +6760,19 @@ class Tc < ::Nl::Family
6757
6760
  def kind; attributes[:"kind"]&.value; end
6758
6761
  # Gets the value of `options` attribute in the message.
6759
6762
  #--
6760
- # @rbs return: untyped
6763
+ # @rbs return: ::String
6761
6764
  def options; attributes[:"options"]&.value; end
6762
6765
  # Gets the value of `stats` attribute in the message.
6763
6766
  #--
6764
- # @rbs return: untyped
6767
+ # @rbs return: ::String
6765
6768
  def stats; attributes[:"stats"]&.value; end
6766
6769
  # Gets the value of `xstats` attribute in the message.
6767
6770
  #--
6768
- # @rbs return: untyped
6771
+ # @rbs return: ::String
6769
6772
  def xstats; attributes[:"xstats"]&.value; end
6770
6773
  # Gets the value of `rate` attribute in the message.
6771
6774
  #--
6772
- # @rbs return: untyped
6775
+ # @rbs return: ::String
6773
6776
  def rate; attributes[:"rate"]&.value; end
6774
6777
  # Gets the value of `fcnt` attribute in the message.
6775
6778
  #--
@@ -6828,11 +6831,11 @@ class Tc < ::Nl::Family
6828
6831
  def kind; attributes[:"kind"]&.value; end
6829
6832
  # Gets the value of `options` attribute in the message.
6830
6833
  #--
6831
- # @rbs return: untyped
6834
+ # @rbs return: ::String
6832
6835
  def options; attributes[:"options"]&.value; end
6833
6836
  # Gets the value of `rate` attribute in the message.
6834
6837
  #--
6835
- # @rbs return: untyped
6838
+ # @rbs return: ::String
6836
6839
  def rate; attributes[:"rate"]&.value; end
6837
6840
  # Gets the value of `chain` attribute in the message.
6838
6841
  #--
@@ -6941,19 +6944,19 @@ class Tc < ::Nl::Family
6941
6944
  def kind; attributes[:"kind"]&.value; end
6942
6945
  # Gets the value of `options` attribute in the message.
6943
6946
  #--
6944
- # @rbs return: untyped
6947
+ # @rbs return: ::String
6945
6948
  def options; attributes[:"options"]&.value; end
6946
6949
  # Gets the value of `stats` attribute in the message.
6947
6950
  #--
6948
- # @rbs return: untyped
6951
+ # @rbs return: ::String
6949
6952
  def stats; attributes[:"stats"]&.value; end
6950
6953
  # Gets the value of `xstats` attribute in the message.
6951
6954
  #--
6952
- # @rbs return: untyped
6955
+ # @rbs return: ::String
6953
6956
  def xstats; attributes[:"xstats"]&.value; end
6954
6957
  # Gets the value of `rate` attribute in the message.
6955
6958
  #--
6956
- # @rbs return: untyped
6959
+ # @rbs return: ::String
6957
6960
  def rate; attributes[:"rate"]&.value; end
6958
6961
  # Gets the value of `fcnt` attribute in the message.
6959
6962
  #--
@@ -6981,9 +6984,12 @@ class Tc < ::Nl::Family
6981
6984
  def egress_block; attributes[:"egress_block"]&.value; end
6982
6985
  end
6983
6986
  end
6987
+ module Notifications
6988
+ end
6989
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
6984
6990
  # Create new tc qdisc.
6985
6991
  #--
6986
- # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: untyped, ?rate: untyped, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
6992
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
6987
6993
  def do_newqdisc(**args)
6988
6994
  exchange_message(:"do", Messages::DoNewqdiscRequest, nil, args)
6989
6995
  end
@@ -7008,7 +7014,7 @@ class Tc < ::Nl::Family
7008
7014
  end
7009
7015
  # Get / dump tc traffic class information.
7010
7016
  #--
7011
- # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: untyped, ?rate: untyped, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7017
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7012
7018
  def do_newtclass(**args)
7013
7019
  exchange_message(:"do", Messages::DoNewtclassRequest, nil, args)
7014
7020
  end
@@ -7026,7 +7032,7 @@ class Tc < ::Nl::Family
7026
7032
  end
7027
7033
  # Get / dump tc filter information.
7028
7034
  #--
7029
- # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: untyped, ?rate: untyped, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7035
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7030
7036
  def do_newtfilter(**args)
7031
7037
  exchange_message(:"do", Messages::DoNewtfilterRequest, nil, args)
7032
7038
  end
@@ -7051,7 +7057,7 @@ class Tc < ::Nl::Family
7051
7057
  end
7052
7058
  # Get / dump tc chain information.
7053
7059
  #--
7054
- # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: untyped, ?rate: untyped, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7060
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> void
7055
7061
  def do_newchain(**args)
7056
7062
  exchange_message(:"do", Messages::DoNewchainRequest, nil, args)
7057
7063
  end
@@ -7067,5 +7073,108 @@ class Tc < ::Nl::Family
7067
7073
  def do_getchain(**args)
7068
7074
  exchange_message(:"do", Messages::DoGetchainRequest, Messages::DoGetchainReply, args)
7069
7075
  end
7076
+ class AsyncOperations
7077
+ # :nodoc:
7078
+ def initialize(&exchange)
7079
+ @exchange = exchange
7080
+ end
7081
+ # Create new tc qdisc.
7082
+ #--
7083
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> ::Nl::Async::Future[void]
7084
+ def do_newqdisc(**args)
7085
+ @exchange.call(:"do", Messages::DoNewqdiscRequest, nil, args)
7086
+ end
7087
+ # Delete existing tc qdisc.
7088
+ #--
7089
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer) -> ::Nl::Async::Future[void]
7090
+ def do_delqdisc(**args)
7091
+ @exchange.call(:"do", Messages::DoDelqdiscRequest, nil, args)
7092
+ end
7093
+ # Get / dump tc qdisc information.
7094
+ #--
7095
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?dump_invisible: ::Integer) -> ::Nl::Async::Future[Messages::DoGetqdiscReply]
7096
+ def do_getqdisc(**args)
7097
+ @exchange.call(:"do", Messages::DoGetqdiscRequest, Messages::DoGetqdiscReply, args)
7098
+ end
7099
+ # Get / dump tc qdisc information.
7100
+ #--
7101
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?dump_invisible: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetqdiscReply]
7102
+ def dump_getqdisc(**args)
7103
+ @exchange.call(:"dump", Messages::DumpGetqdiscRequest, Messages::DumpGetqdiscReply, args)
7104
+ end
7105
+ # Get / dump tc traffic class information.
7106
+ #--
7107
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> ::Nl::Async::Future[void]
7108
+ def do_newtclass(**args)
7109
+ @exchange.call(:"do", Messages::DoNewtclassRequest, nil, args)
7110
+ end
7111
+ # Get / dump tc traffic class information.
7112
+ #--
7113
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer) -> ::Nl::Async::Future[void]
7114
+ def do_deltclass(**args)
7115
+ @exchange.call(:"do", Messages::DoDeltclassRequest, nil, args)
7116
+ end
7117
+ # Get / dump tc traffic class information.
7118
+ #--
7119
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer) -> ::Nl::Async::Future[Messages::DoGettclassReply]
7120
+ def do_gettclass(**args)
7121
+ @exchange.call(:"do", Messages::DoGettclassRequest, Messages::DoGettclassReply, args)
7122
+ end
7123
+ # Get / dump tc filter information.
7124
+ #--
7125
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> ::Nl::Async::Future[void]
7126
+ def do_newtfilter(**args)
7127
+ @exchange.call(:"do", Messages::DoNewtfilterRequest, nil, args)
7128
+ end
7129
+ # Get / dump tc filter information.
7130
+ #--
7131
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?chain: ::Integer) -> ::Nl::Async::Future[void]
7132
+ def do_deltfilter(**args)
7133
+ @exchange.call(:"do", Messages::DoDeltfilterRequest, nil, args)
7134
+ end
7135
+ # Get / dump tc filter information.
7136
+ #--
7137
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?chain: ::Integer) -> ::Nl::Async::Future[Messages::DoGettfilterReply]
7138
+ def do_gettfilter(**args)
7139
+ @exchange.call(:"do", Messages::DoGettfilterRequest, Messages::DoGettfilterReply, args)
7140
+ end
7141
+ # Get / dump tc filter information.
7142
+ #--
7143
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?chain: ::Integer, ?dump_flags: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGettfilterReply]
7144
+ def dump_gettfilter(**args)
7145
+ @exchange.call(:"dump", Messages::DumpGettfilterRequest, Messages::DumpGettfilterReply, args)
7146
+ end
7147
+ # Get / dump tc chain information.
7148
+ #--
7149
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?kind: ::String, ?options: ::String, ?rate: ::String, ?chain: ::Integer, ?ingress_block: ::Integer, ?egress_block: ::Integer) -> ::Nl::Async::Future[void]
7150
+ def do_newchain(**args)
7151
+ @exchange.call(:"do", Messages::DoNewchainRequest, nil, args)
7152
+ end
7153
+ # Get / dump tc chain information.
7154
+ #--
7155
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?chain: ::Integer) -> ::Nl::Async::Future[void]
7156
+ def do_delchain(**args)
7157
+ @exchange.call(:"do", Messages::DoDelchainRequest, nil, args)
7158
+ end
7159
+ # Get / dump tc chain information.
7160
+ #--
7161
+ # @rbs (?family: ::Integer, ?ifindex: ::Integer, ?handle: ::Integer, ?parent: ::Integer, ?info: ::Integer, ?chain: ::Integer) -> ::Nl::Async::Future[Messages::DoGetchainReply]
7162
+ def do_getchain(**args)
7163
+ @exchange.call(:"do", Messages::DoGetchainRequest, Messages::DoGetchainReply, args)
7164
+ end
7165
+ end
7166
+ # Returns the asynchronous operation facade for this family.
7167
+ #--
7168
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
7169
+ def async(stream_capacity: nil)
7170
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
7171
+ build_async_facade(AsyncOperations, stream_capacity:)
7172
+ end
7173
+ #--
7174
+ # @rbs (*(:rtnlgrp_tc) groups) -> self
7175
+ def subscribe(*groups) = super
7176
+ #--
7177
+ # @rbs (*(:rtnlgrp_tc) groups) -> self
7178
+ def unsubscribe(*groups) = super
7070
7179
  end
7071
7180
  end; end
@@ -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/tcp_metrics.yaml from Linux v7.2.
2
4
  #--
3
5
  # frozen_string_literal: true
4
6
  # rbs_inline: enabled
@@ -9,6 +11,7 @@ module Nl; module Linux
9
11
  class TcpMetrics < ::Nl::Family
10
12
  NAME = "tcp_metrics"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("tcp_metrics"))
14
+ MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  end
14
17
  module AttributeSets
@@ -172,7 +175,7 @@ class TcpMetrics < ::Nl::Family
172
175
  def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
173
176
  # Gets the value of `addr-ipv6` attribute in the message.
174
177
  #--
175
- # @rbs return: untyped
178
+ # @rbs return: ::String
176
179
  def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
177
180
  # Gets the value of `saddr-ipv4` attribute in the message.
178
181
  #--
@@ -180,7 +183,7 @@ class TcpMetrics < ::Nl::Family
180
183
  def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
181
184
  # Gets the value of `saddr-ipv6` attribute in the message.
182
185
  #--
183
- # @rbs return: untyped
186
+ # @rbs return: ::String
184
187
  def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
185
188
  end
186
189
  # Retrieve metrics.
@@ -195,7 +198,7 @@ class TcpMetrics < ::Nl::Family
195
198
  def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
196
199
  # Gets the value of `addr-ipv6` attribute in the message.
197
200
  #--
198
- # @rbs return: untyped
201
+ # @rbs return: ::String
199
202
  def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
200
203
  # Gets the value of `age` attribute in the message.
201
204
  #--
@@ -219,7 +222,7 @@ class TcpMetrics < ::Nl::Family
219
222
  def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
220
223
  # Gets the value of `fopen-cookie` attribute in the message.
221
224
  #--
222
- # @rbs return: untyped
225
+ # @rbs return: ::String
223
226
  def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
224
227
  # Gets the value of `saddr-ipv4` attribute in the message.
225
228
  #--
@@ -227,10 +230,17 @@ class TcpMetrics < ::Nl::Family
227
230
  def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
228
231
  # Gets the value of `saddr-ipv6` attribute in the message.
229
232
  #--
230
- # @rbs return: untyped
233
+ # @rbs return: ::String
231
234
  def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
232
235
  end
233
236
  # Retrieve metrics.
237
+ class DumpGetRequest < ::Nl::Protocols::Genl::Message
238
+ TYPE = 1
239
+ FIXED_HEADER = nil
240
+ ATTRIBUTE_SET = AttributeSets::TcpMetrics
241
+ ATTRIBUTES = Ractor.make_shareable(%i[])
242
+ end
243
+ # Retrieve metrics.
234
244
  class DumpGetReply < ::Nl::Protocols::Genl::Message
235
245
  TYPE = 1
236
246
  FIXED_HEADER = nil
@@ -242,7 +252,7 @@ class TcpMetrics < ::Nl::Family
242
252
  def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
243
253
  # Gets the value of `addr-ipv6` attribute in the message.
244
254
  #--
245
- # @rbs return: untyped
255
+ # @rbs return: ::String
246
256
  def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
247
257
  # Gets the value of `age` attribute in the message.
248
258
  #--
@@ -266,7 +276,7 @@ class TcpMetrics < ::Nl::Family
266
276
  def fopen_syn_drop_ts; attributes[:"fopen_syn_drop_ts"]&.value; end
267
277
  # Gets the value of `fopen-cookie` attribute in the message.
268
278
  #--
269
- # @rbs return: untyped
279
+ # @rbs return: ::String
270
280
  def fopen_cookie; attributes[:"fopen_cookie"]&.value; end
271
281
  # Gets the value of `saddr-ipv4` attribute in the message.
272
282
  #--
@@ -274,10 +284,12 @@ class TcpMetrics < ::Nl::Family
274
284
  def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
275
285
  # Gets the value of `saddr-ipv6` attribute in the message.
276
286
  #--
277
- # @rbs return: untyped
287
+ # @rbs return: ::String
278
288
  def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
279
289
  end
280
290
  # Delete metrics.
291
+ #
292
+ # Requires CAP_NET_ADMIN in the initial user namespace.
281
293
  class DoDelRequest < ::Nl::Protocols::Genl::Message
282
294
  TYPE = 2
283
295
  FIXED_HEADER = nil
@@ -289,7 +301,7 @@ class TcpMetrics < ::Nl::Family
289
301
  def addr_ipv4; attributes[:"addr_ipv4"]&.value; end
290
302
  # Gets the value of `addr-ipv6` attribute in the message.
291
303
  #--
292
- # @rbs return: untyped
304
+ # @rbs return: ::String
293
305
  def addr_ipv6; attributes[:"addr_ipv6"]&.value; end
294
306
  # Gets the value of `saddr-ipv4` attribute in the message.
295
307
  #--
@@ -297,21 +309,66 @@ class TcpMetrics < ::Nl::Family
297
309
  def saddr_ipv4; attributes[:"saddr_ipv4"]&.value; end
298
310
  # Gets the value of `saddr-ipv6` attribute in the message.
299
311
  #--
300
- # @rbs return: untyped
312
+ # @rbs return: ::String
301
313
  def saddr_ipv6; attributes[:"saddr_ipv6"]&.value; end
302
314
  end
303
315
  end
316
+ module Notifications
317
+ end
318
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
304
319
  # Retrieve metrics.
305
320
  #--
306
- # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: untyped, ?saddr_ipv4: ::Integer, ?saddr_ipv6: untyped) -> Messages::DoGetReply
321
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> Messages::DoGetReply
307
322
  def do_get(**args)
308
323
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
309
324
  end
325
+ # Retrieve metrics.
326
+ #--
327
+ # @rbs () -> Enumerable[Messages::DumpGetReply]
328
+ # | () { (Messages::DumpGetReply) -> void } -> void
329
+ def dump_get(**args, &block)
330
+ exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
331
+ end
310
332
  # Delete metrics.
333
+ #
334
+ # Requires CAP_NET_ADMIN in the initial user namespace.
311
335
  #--
312
- # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: untyped, ?saddr_ipv4: ::Integer, ?saddr_ipv6: untyped) -> void
336
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> void
313
337
  def do_del(**args)
314
338
  exchange_message(:"do", Messages::DoDelRequest, nil, args)
315
339
  end
340
+ class AsyncOperations
341
+ # :nodoc:
342
+ def initialize(&exchange)
343
+ @exchange = exchange
344
+ end
345
+ # Retrieve metrics.
346
+ #--
347
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> ::Nl::Async::Future[Messages::DoGetReply]
348
+ def do_get(**args)
349
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
350
+ end
351
+ # Retrieve metrics.
352
+ #--
353
+ # @rbs () -> ::Nl::Async::Stream[Messages::DumpGetReply]
354
+ def dump_get(**args)
355
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
356
+ end
357
+ # Delete metrics.
358
+ #
359
+ # Requires CAP_NET_ADMIN in the initial user namespace.
360
+ #--
361
+ # @rbs (?addr_ipv4: ::Integer, ?addr_ipv6: ::String, ?saddr_ipv4: ::Integer, ?saddr_ipv6: ::String) -> ::Nl::Async::Future[void]
362
+ def do_del(**args)
363
+ @exchange.call(:"do", Messages::DoDelRequest, nil, args)
364
+ end
365
+ end
366
+ # Returns the asynchronous operation facade for this family.
367
+ #--
368
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
369
+ def async(stream_capacity: nil)
370
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
371
+ build_async_facade(AsyncOperations, stream_capacity:)
372
+ end
316
373
  end
317
374
  end; end