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/rt-rule.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 RtRule < ::Nl::Family
10
12
  NAME = "rt-rule"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("rt-rule", 0))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"rtnlgrp_ipv4_rule" => ::Nl::McastGroup.new("rtnlgrp-ipv4-rule", 8), :"rtnlgrp_ipv6_rule" => ::Nl::McastGroup.new("rtnlgrp-ipv6-rule", 19)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  Rtgenmsg = Struct.new(
14
17
  :"family", #: ::Integer
@@ -360,7 +363,7 @@ class RtRule < ::Nl::Family
360
363
  def l3mdev; attributes[:"l3mdev"]&.value; end
361
364
  # Gets the value of `uid-range` attribute in the message.
362
365
  #--
363
- # @rbs return: untyped
366
+ # @rbs return: ::String
364
367
  def uid_range; attributes[:"uid_range"]&.value; end
365
368
  # Gets the value of `protocol` attribute in the message.
366
369
  #--
@@ -372,11 +375,11 @@ class RtRule < ::Nl::Family
372
375
  def ip_proto; attributes[:"ip_proto"]&.value; end
373
376
  # Gets the value of `sport-range` attribute in the message.
374
377
  #--
375
- # @rbs return: untyped
378
+ # @rbs return: ::String
376
379
  def sport_range; attributes[:"sport_range"]&.value; end
377
380
  # Gets the value of `dport-range` attribute in the message.
378
381
  #--
379
- # @rbs return: untyped
382
+ # @rbs return: ::String
380
383
  def dport_range; attributes[:"dport_range"]&.value; end
381
384
  # Gets the value of `dscp` attribute in the message.
382
385
  #--
@@ -483,7 +486,7 @@ class RtRule < ::Nl::Family
483
486
  def l3mdev; attributes[:"l3mdev"]&.value; end
484
487
  # Gets the value of `uid-range` attribute in the message.
485
488
  #--
486
- # @rbs return: untyped
489
+ # @rbs return: ::String
487
490
  def uid_range; attributes[:"uid_range"]&.value; end
488
491
  # Gets the value of `protocol` attribute in the message.
489
492
  #--
@@ -495,11 +498,11 @@ class RtRule < ::Nl::Family
495
498
  def ip_proto; attributes[:"ip_proto"]&.value; end
496
499
  # Gets the value of `sport-range` attribute in the message.
497
500
  #--
498
- # @rbs return: untyped
501
+ # @rbs return: ::String
499
502
  def sport_range; attributes[:"sport_range"]&.value; end
500
503
  # Gets the value of `dport-range` attribute in the message.
501
504
  #--
502
- # @rbs return: untyped
505
+ # @rbs return: ::String
503
506
  def dport_range; attributes[:"dport_range"]&.value; end
504
507
  # Gets the value of `dscp` attribute in the message.
505
508
  #--
@@ -641,7 +644,255 @@ class RtRule < ::Nl::Family
641
644
  def l3mdev; attributes[:"l3mdev"]&.value; end
642
645
  # Gets the value of `uid-range` attribute in the message.
643
646
  #--
644
- # @rbs return: untyped
647
+ # @rbs return: ::String
648
+ def uid_range; attributes[:"uid_range"]&.value; end
649
+ # Gets the value of `protocol` attribute in the message.
650
+ #--
651
+ # @rbs return: ::Integer
652
+ def protocol; attributes[:"protocol"]&.value; end
653
+ # Gets the value of `ip-proto` attribute in the message.
654
+ #--
655
+ # @rbs return: ::Integer
656
+ def ip_proto; attributes[:"ip_proto"]&.value; end
657
+ # Gets the value of `sport-range` attribute in the message.
658
+ #--
659
+ # @rbs return: ::String
660
+ def sport_range; attributes[:"sport_range"]&.value; end
661
+ # Gets the value of `dport-range` attribute in the message.
662
+ #--
663
+ # @rbs return: ::String
664
+ def dport_range; attributes[:"dport_range"]&.value; end
665
+ # Gets the value of `dscp` attribute in the message.
666
+ #--
667
+ # @rbs return: ::Integer
668
+ def dscp; attributes[:"dscp"]&.value; end
669
+ # Gets the value of `flowlabel` attribute in the message.
670
+ #--
671
+ # @rbs return: ::Integer
672
+ def flowlabel; attributes[:"flowlabel"]&.value; end
673
+ # Gets the value of `flowlabel-mask` attribute in the message.
674
+ #--
675
+ # @rbs return: ::Integer
676
+ def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
677
+ # Gets the value of `sport-mask` attribute in the message.
678
+ #--
679
+ # @rbs return: ::Integer
680
+ def sport_mask; attributes[:"sport_mask"]&.value; end
681
+ # Gets the value of `dport-mask` attribute in the message.
682
+ #--
683
+ # @rbs return: ::Integer
684
+ def dport_mask; attributes[:"dport_mask"]&.value; end
685
+ # Gets the value of `dscp-mask` attribute in the message.
686
+ #--
687
+ # @rbs return: ::Integer
688
+ def dscp_mask; attributes[:"dscp_mask"]&.value; end
689
+ end
690
+ end
691
+ module Notifications
692
+ # Notify a rule creation
693
+ class NewruleNtf < ::Nl::Protocols::Raw::Message
694
+ TYPE = 32
695
+ FIXED_HEADER = Structs::FibRuleHdr
696
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
697
+ ATTRIBUTES = Ractor.make_shareable(%i[iifname goto priority fwmark flow tun_id suppress_ifgroup suppress_prefixlen table fwmask oifname l3mdev uid_range protocol ip_proto sport_range dport_range dscp flowlabel flowlabel_mask sport_mask dport_mask dscp_mask])
698
+ # Gets the value of `family` field in the message's fixed header.
699
+ #--
700
+ # @rbs return: ::Integer
701
+ def family; fixed_header.family; end
702
+ # Gets the value of `dst-len` field in the message's fixed header.
703
+ #--
704
+ # @rbs return: ::Integer
705
+ def dst_len; fixed_header.dst_len; end
706
+ # Gets the value of `src-len` field in the message's fixed header.
707
+ #--
708
+ # @rbs return: ::Integer
709
+ def src_len; fixed_header.src_len; end
710
+ # Gets the value of `tos` field in the message's fixed header.
711
+ #--
712
+ # @rbs return: ::Integer
713
+ def tos; fixed_header.tos; end
714
+ # Gets the value of `action` field in the message's fixed header.
715
+ #--
716
+ # @rbs return: ::Integer
717
+ def action; fixed_header.action; end
718
+ # Gets the value of `flags` field in the message's fixed header.
719
+ #--
720
+ # @rbs return: ::Integer
721
+ def flags; fixed_header.flags; end
722
+ # Gets the value of `iifname` attribute in the message.
723
+ #--
724
+ # @rbs return: ::String
725
+ def iifname; attributes[:"iifname"]&.value; end
726
+ # Gets the value of `goto` attribute in the message.
727
+ #--
728
+ # @rbs return: ::Integer
729
+ def goto; attributes[:"goto"]&.value; end
730
+ # Gets the value of `priority` attribute in the message.
731
+ #--
732
+ # @rbs return: ::Integer
733
+ def priority; attributes[:"priority"]&.value; end
734
+ # Gets the value of `fwmark` attribute in the message.
735
+ #--
736
+ # @rbs return: ::Integer
737
+ def fwmark; attributes[:"fwmark"]&.value; end
738
+ # Gets the value of `flow` attribute in the message.
739
+ #--
740
+ # @rbs return: ::Integer
741
+ def flow; attributes[:"flow"]&.value; end
742
+ # Gets the value of `tun-id` attribute in the message.
743
+ #--
744
+ # @rbs return: ::Integer
745
+ def tun_id; attributes[:"tun_id"]&.value; end
746
+ # Gets the value of `suppress-ifgroup` attribute in the message.
747
+ #--
748
+ # @rbs return: ::Integer
749
+ def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
750
+ # Gets the value of `suppress-prefixlen` attribute in the message.
751
+ #--
752
+ # @rbs return: ::Integer
753
+ def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
754
+ # Gets the value of `table` attribute or fixed header in the message.
755
+ #--
756
+ # @rbs return: ::Integer
757
+ def table; attributes[:"table"]&.value || fixed_header.table; end
758
+ # Gets the value of `fwmask` attribute in the message.
759
+ #--
760
+ # @rbs return: ::Integer
761
+ def fwmask; attributes[:"fwmask"]&.value; end
762
+ # Gets the value of `oifname` attribute in the message.
763
+ #--
764
+ # @rbs return: ::String
765
+ def oifname; attributes[:"oifname"]&.value; end
766
+ # Gets the value of `l3mdev` attribute in the message.
767
+ #--
768
+ # @rbs return: ::Integer
769
+ def l3mdev; attributes[:"l3mdev"]&.value; end
770
+ # Gets the value of `uid-range` attribute in the message.
771
+ #--
772
+ # @rbs return: ::String
773
+ def uid_range; attributes[:"uid_range"]&.value; end
774
+ # Gets the value of `protocol` attribute in the message.
775
+ #--
776
+ # @rbs return: ::Integer
777
+ def protocol; attributes[:"protocol"]&.value; end
778
+ # Gets the value of `ip-proto` attribute in the message.
779
+ #--
780
+ # @rbs return: ::Integer
781
+ def ip_proto; attributes[:"ip_proto"]&.value; end
782
+ # Gets the value of `sport-range` attribute in the message.
783
+ #--
784
+ # @rbs return: ::String
785
+ def sport_range; attributes[:"sport_range"]&.value; end
786
+ # Gets the value of `dport-range` attribute in the message.
787
+ #--
788
+ # @rbs return: ::String
789
+ def dport_range; attributes[:"dport_range"]&.value; end
790
+ # Gets the value of `dscp` attribute in the message.
791
+ #--
792
+ # @rbs return: ::Integer
793
+ def dscp; attributes[:"dscp"]&.value; end
794
+ # Gets the value of `flowlabel` attribute in the message.
795
+ #--
796
+ # @rbs return: ::Integer
797
+ def flowlabel; attributes[:"flowlabel"]&.value; end
798
+ # Gets the value of `flowlabel-mask` attribute in the message.
799
+ #--
800
+ # @rbs return: ::Integer
801
+ def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
802
+ # Gets the value of `sport-mask` attribute in the message.
803
+ #--
804
+ # @rbs return: ::Integer
805
+ def sport_mask; attributes[:"sport_mask"]&.value; end
806
+ # Gets the value of `dport-mask` attribute in the message.
807
+ #--
808
+ # @rbs return: ::Integer
809
+ def dport_mask; attributes[:"dport_mask"]&.value; end
810
+ # Gets the value of `dscp-mask` attribute in the message.
811
+ #--
812
+ # @rbs return: ::Integer
813
+ def dscp_mask; attributes[:"dscp_mask"]&.value; end
814
+ end
815
+ # Notify a rule deletion
816
+ class DelruleNtf < ::Nl::Protocols::Raw::Message
817
+ TYPE = 33
818
+ FIXED_HEADER = Structs::FibRuleHdr
819
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
820
+ ATTRIBUTES = Ractor.make_shareable(%i[iifname goto priority fwmark flow tun_id suppress_ifgroup suppress_prefixlen table fwmask oifname l3mdev uid_range protocol ip_proto sport_range dport_range dscp flowlabel flowlabel_mask sport_mask dport_mask dscp_mask])
821
+ # Gets the value of `family` field in the message's fixed header.
822
+ #--
823
+ # @rbs return: ::Integer
824
+ def family; fixed_header.family; end
825
+ # Gets the value of `dst-len` field in the message's fixed header.
826
+ #--
827
+ # @rbs return: ::Integer
828
+ def dst_len; fixed_header.dst_len; end
829
+ # Gets the value of `src-len` field in the message's fixed header.
830
+ #--
831
+ # @rbs return: ::Integer
832
+ def src_len; fixed_header.src_len; end
833
+ # Gets the value of `tos` field in the message's fixed header.
834
+ #--
835
+ # @rbs return: ::Integer
836
+ def tos; fixed_header.tos; end
837
+ # Gets the value of `action` field in the message's fixed header.
838
+ #--
839
+ # @rbs return: ::Integer
840
+ def action; fixed_header.action; end
841
+ # Gets the value of `flags` field in the message's fixed header.
842
+ #--
843
+ # @rbs return: ::Integer
844
+ def flags; fixed_header.flags; end
845
+ # Gets the value of `iifname` attribute in the message.
846
+ #--
847
+ # @rbs return: ::String
848
+ def iifname; attributes[:"iifname"]&.value; end
849
+ # Gets the value of `goto` attribute in the message.
850
+ #--
851
+ # @rbs return: ::Integer
852
+ def goto; attributes[:"goto"]&.value; end
853
+ # Gets the value of `priority` attribute in the message.
854
+ #--
855
+ # @rbs return: ::Integer
856
+ def priority; attributes[:"priority"]&.value; end
857
+ # Gets the value of `fwmark` attribute in the message.
858
+ #--
859
+ # @rbs return: ::Integer
860
+ def fwmark; attributes[:"fwmark"]&.value; end
861
+ # Gets the value of `flow` attribute in the message.
862
+ #--
863
+ # @rbs return: ::Integer
864
+ def flow; attributes[:"flow"]&.value; end
865
+ # Gets the value of `tun-id` attribute in the message.
866
+ #--
867
+ # @rbs return: ::Integer
868
+ def tun_id; attributes[:"tun_id"]&.value; end
869
+ # Gets the value of `suppress-ifgroup` attribute in the message.
870
+ #--
871
+ # @rbs return: ::Integer
872
+ def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
873
+ # Gets the value of `suppress-prefixlen` attribute in the message.
874
+ #--
875
+ # @rbs return: ::Integer
876
+ def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
877
+ # Gets the value of `table` attribute or fixed header in the message.
878
+ #--
879
+ # @rbs return: ::Integer
880
+ def table; attributes[:"table"]&.value || fixed_header.table; end
881
+ # Gets the value of `fwmask` attribute in the message.
882
+ #--
883
+ # @rbs return: ::Integer
884
+ def fwmask; attributes[:"fwmask"]&.value; end
885
+ # Gets the value of `oifname` attribute in the message.
886
+ #--
887
+ # @rbs return: ::String
888
+ def oifname; attributes[:"oifname"]&.value; end
889
+ # Gets the value of `l3mdev` attribute in the message.
890
+ #--
891
+ # @rbs return: ::Integer
892
+ def l3mdev; attributes[:"l3mdev"]&.value; end
893
+ # Gets the value of `uid-range` attribute in the message.
894
+ #--
895
+ # @rbs return: ::String
645
896
  def uid_range; attributes[:"uid_range"]&.value; end
646
897
  # Gets the value of `protocol` attribute in the message.
647
898
  #--
@@ -653,11 +904,11 @@ class RtRule < ::Nl::Family
653
904
  def ip_proto; attributes[:"ip_proto"]&.value; end
654
905
  # Gets the value of `sport-range` attribute in the message.
655
906
  #--
656
- # @rbs return: untyped
907
+ # @rbs return: ::String
657
908
  def sport_range; attributes[:"sport_range"]&.value; end
658
909
  # Gets the value of `dport-range` attribute in the message.
659
910
  #--
660
- # @rbs return: untyped
911
+ # @rbs return: ::String
661
912
  def dport_range; attributes[:"dport_range"]&.value; end
662
913
  # Gets the value of `dscp` attribute in the message.
663
914
  #--
@@ -685,15 +936,16 @@ class RtRule < ::Nl::Family
685
936
  def dscp_mask; attributes[:"dscp_mask"]&.value; end
686
937
  end
687
938
  end
939
+ NOTIFICATIONS = Ractor.make_shareable({32 => Notifications::NewruleNtf, 33 => Notifications::DelruleNtf}) #: Hash[::Integer, ::Class]
688
940
  # Add new FIB rule
689
941
  #--
690
- # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: untyped, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: untyped, ?dport_range: untyped, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
942
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: ::String, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: ::String, ?dport_range: ::String, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
691
943
  def do_newrule(**args)
692
944
  exchange_message(:"do", Messages::DoNewruleRequest, nil, args)
693
945
  end
694
946
  # Remove an existing FIB rule
695
947
  #--
696
- # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: untyped, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: untyped, ?dport_range: untyped, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
948
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: ::String, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: ::String, ?dport_range: ::String, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
697
949
  def do_delrule(**args)
698
950
  exchange_message(:"do", Messages::DoDelruleRequest, nil, args)
699
951
  end
@@ -704,5 +956,42 @@ class RtRule < ::Nl::Family
704
956
  def dump_getrule(**args, &block)
705
957
  exchange_message(:"dump", Messages::DumpGetruleRequest, Messages::DumpGetruleReply, args, &block)
706
958
  end
959
+ class AsyncOperations
960
+ # :nodoc:
961
+ def initialize(&exchange)
962
+ @exchange = exchange
963
+ end
964
+ # Add new FIB rule
965
+ #--
966
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: ::String, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: ::String, ?dport_range: ::String, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> ::Nl::Async::Future[void]
967
+ def do_newrule(**args)
968
+ @exchange.call(:"do", Messages::DoNewruleRequest, nil, args)
969
+ end
970
+ # Remove an existing FIB rule
971
+ #--
972
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: ::String, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: ::String, ?dport_range: ::String, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> ::Nl::Async::Future[void]
973
+ def do_delrule(**args)
974
+ @exchange.call(:"do", Messages::DoDelruleRequest, nil, args)
975
+ end
976
+ # Dump all FIB rules
977
+ #--
978
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetruleReply]
979
+ def dump_getrule(**args)
980
+ @exchange.call(:"dump", Messages::DumpGetruleRequest, Messages::DumpGetruleReply, args)
981
+ end
982
+ end
983
+ # Returns the asynchronous operation facade for this family.
984
+ #--
985
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
986
+ def async(stream_capacity: nil)
987
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
988
+ build_async_facade(AsyncOperations, stream_capacity:)
989
+ end
990
+ #--
991
+ # @rbs (*(:rtnlgrp_ipv4_rule | :rtnlgrp_ipv6_rule) groups) -> self
992
+ def subscribe(*groups) = super
993
+ #--
994
+ # @rbs (*(:rtnlgrp_ipv4_rule | :rtnlgrp_ipv6_rule) groups) -> self
995
+ def unsubscribe(*groups) = super
707
996
  end
708
997
  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/sunrpc_cache.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 Sunrpc < ::Nl::Family
10
12
  NAME = "sunrpc"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("sunrpc"))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"none" => ::Nl::McastGroup.new("none", nil), :"exportd" => ::Nl::McastGroup.new("exportd", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  end
14
17
  module AttributeSets
@@ -216,6 +219,17 @@ class Sunrpc < ::Nl::Family
216
219
  end
217
220
  module Messages
218
221
  # Dump all pending ip_map requests
222
+ #
223
+ # Requires CAP_NET_ADMIN in the initial user namespace.
224
+ class DumpIpMapGetReqsRequest < ::Nl::Protocols::Genl::Message
225
+ TYPE = 2
226
+ FIXED_HEADER = nil
227
+ ATTRIBUTE_SET = AttributeSets::IpMapReqs
228
+ ATTRIBUTES = Ractor.make_shareable(%i[])
229
+ end
230
+ # Dump all pending ip_map requests
231
+ #
232
+ # Requires CAP_NET_ADMIN in the initial user namespace.
219
233
  class DumpIpMapGetReqsReply < ::Nl::Protocols::Genl::Message
220
234
  TYPE = 2
221
235
  FIXED_HEADER = nil
@@ -227,6 +241,8 @@ class Sunrpc < ::Nl::Family
227
241
  def requests; attributes[:"requests"]&.value; end
228
242
  end
229
243
  # Respond to one or more ip_map requests
244
+ #
245
+ # Requires CAP_NET_ADMIN in the initial user namespace.
230
246
  class DoIpMapSetReqsRequest < ::Nl::Protocols::Genl::Message
231
247
  TYPE = 3
232
248
  FIXED_HEADER = nil
@@ -238,6 +254,17 @@ class Sunrpc < ::Nl::Family
238
254
  def requests; attributes[:"requests"]&.value; end
239
255
  end
240
256
  # Dump all pending unix_gid requests
257
+ #
258
+ # Requires CAP_NET_ADMIN in the initial user namespace.
259
+ class DumpUnixGidGetReqsRequest < ::Nl::Protocols::Genl::Message
260
+ TYPE = 4
261
+ FIXED_HEADER = nil
262
+ ATTRIBUTE_SET = AttributeSets::UnixGidReqs
263
+ ATTRIBUTES = Ractor.make_shareable(%i[])
264
+ end
265
+ # Dump all pending unix_gid requests
266
+ #
267
+ # Requires CAP_NET_ADMIN in the initial user namespace.
241
268
  class DumpUnixGidGetReqsReply < ::Nl::Protocols::Genl::Message
242
269
  TYPE = 4
243
270
  FIXED_HEADER = nil
@@ -249,6 +276,8 @@ class Sunrpc < ::Nl::Family
249
276
  def requests; attributes[:"requests"]&.value; end
250
277
  end
251
278
  # Respond to one or more unix_gid requests
279
+ #
280
+ # Requires CAP_NET_ADMIN in the initial user namespace.
252
281
  class DoUnixGidSetReqsRequest < ::Nl::Protocols::Genl::Message
253
282
  TYPE = 5
254
283
  FIXED_HEADER = nil
@@ -260,6 +289,8 @@ class Sunrpc < ::Nl::Family
260
289
  def requests; attributes[:"requests"]&.value; end
261
290
  end
262
291
  # Flush sunrpc caches (ip_map and/or unix_gid)
292
+ #
293
+ # Requires CAP_NET_ADMIN in the initial user namespace.
263
294
  class DoCacheFlushRequest < ::Nl::Protocols::Genl::Message
264
295
  TYPE = 6
265
296
  FIXED_HEADER = nil
@@ -271,23 +302,122 @@ class Sunrpc < ::Nl::Family
271
302
  def mask; attributes[:"mask"]&.value; end
272
303
  end
273
304
  end
305
+ module Notifications
306
+ # Notification that there are cache requests that need servicing
307
+ #
308
+ # Multicast group: `exportd`.
309
+ class CacheNotify < ::Nl::Protocols::Genl::Message
310
+ TYPE = 1
311
+ FIXED_HEADER = nil
312
+ ATTRIBUTE_SET = AttributeSets::CacheNotify
313
+ ATTRIBUTES = Ractor.make_shareable(%i[cache_type])
314
+ # Gets the value of `cache-type` attribute in the message.
315
+ #--
316
+ # @rbs return: ::Integer
317
+ def cache_type; attributes[:"cache_type"]&.value; end
318
+ end
319
+ end
320
+ NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::CacheNotify}) #: Hash[::Integer, ::Class]
321
+ # Dump all pending ip_map requests
322
+ #
323
+ # Requires CAP_NET_ADMIN in the initial user namespace.
324
+ #--
325
+ # @rbs () -> Enumerable[Messages::DumpIpMapGetReqsReply]
326
+ # | () { (Messages::DumpIpMapGetReqsReply) -> void } -> void
327
+ def dump_ip_map_get_reqs(**args, &block)
328
+ exchange_message(:"dump", Messages::DumpIpMapGetReqsRequest, Messages::DumpIpMapGetReqsReply, args, &block)
329
+ end
274
330
  # Respond to one or more ip_map requests
331
+ #
332
+ # Requires CAP_NET_ADMIN in the initial user namespace.
275
333
  #--
276
334
  # @rbs (?requests: AttributeSets::IpMap) -> void
277
335
  def do_ip_map_set_reqs(**args)
278
336
  exchange_message(:"do", Messages::DoIpMapSetReqsRequest, nil, args)
279
337
  end
338
+ # Dump all pending unix_gid requests
339
+ #
340
+ # Requires CAP_NET_ADMIN in the initial user namespace.
341
+ #--
342
+ # @rbs () -> Enumerable[Messages::DumpUnixGidGetReqsReply]
343
+ # | () { (Messages::DumpUnixGidGetReqsReply) -> void } -> void
344
+ def dump_unix_gid_get_reqs(**args, &block)
345
+ exchange_message(:"dump", Messages::DumpUnixGidGetReqsRequest, Messages::DumpUnixGidGetReqsReply, args, &block)
346
+ end
280
347
  # Respond to one or more unix_gid requests
348
+ #
349
+ # Requires CAP_NET_ADMIN in the initial user namespace.
281
350
  #--
282
351
  # @rbs (?requests: AttributeSets::UnixGid) -> void
283
352
  def do_unix_gid_set_reqs(**args)
284
353
  exchange_message(:"do", Messages::DoUnixGidSetReqsRequest, nil, args)
285
354
  end
286
355
  # Flush sunrpc caches (ip_map and/or unix_gid)
356
+ #
357
+ # Requires CAP_NET_ADMIN in the initial user namespace.
287
358
  #--
288
359
  # @rbs (?mask: ::Integer) -> void
289
360
  def do_cache_flush(**args)
290
361
  exchange_message(:"do", Messages::DoCacheFlushRequest, nil, args)
291
362
  end
363
+ class AsyncOperations
364
+ # :nodoc:
365
+ def initialize(&exchange)
366
+ @exchange = exchange
367
+ end
368
+ # Dump all pending ip_map requests
369
+ #
370
+ # Requires CAP_NET_ADMIN in the initial user namespace.
371
+ #--
372
+ # @rbs () -> ::Nl::Async::Stream[Messages::DumpIpMapGetReqsReply]
373
+ def dump_ip_map_get_reqs(**args)
374
+ @exchange.call(:"dump", Messages::DumpIpMapGetReqsRequest, Messages::DumpIpMapGetReqsReply, args)
375
+ end
376
+ # Respond to one or more ip_map requests
377
+ #
378
+ # Requires CAP_NET_ADMIN in the initial user namespace.
379
+ #--
380
+ # @rbs (?requests: AttributeSets::IpMap) -> ::Nl::Async::Future[void]
381
+ def do_ip_map_set_reqs(**args)
382
+ @exchange.call(:"do", Messages::DoIpMapSetReqsRequest, nil, args)
383
+ end
384
+ # Dump all pending unix_gid requests
385
+ #
386
+ # Requires CAP_NET_ADMIN in the initial user namespace.
387
+ #--
388
+ # @rbs () -> ::Nl::Async::Stream[Messages::DumpUnixGidGetReqsReply]
389
+ def dump_unix_gid_get_reqs(**args)
390
+ @exchange.call(:"dump", Messages::DumpUnixGidGetReqsRequest, Messages::DumpUnixGidGetReqsReply, args)
391
+ end
392
+ # Respond to one or more unix_gid requests
393
+ #
394
+ # Requires CAP_NET_ADMIN in the initial user namespace.
395
+ #--
396
+ # @rbs (?requests: AttributeSets::UnixGid) -> ::Nl::Async::Future[void]
397
+ def do_unix_gid_set_reqs(**args)
398
+ @exchange.call(:"do", Messages::DoUnixGidSetReqsRequest, nil, args)
399
+ end
400
+ # Flush sunrpc caches (ip_map and/or unix_gid)
401
+ #
402
+ # Requires CAP_NET_ADMIN in the initial user namespace.
403
+ #--
404
+ # @rbs (?mask: ::Integer) -> ::Nl::Async::Future[void]
405
+ def do_cache_flush(**args)
406
+ @exchange.call(:"do", Messages::DoCacheFlushRequest, nil, args)
407
+ end
408
+ end
409
+ # Returns the asynchronous operation facade for this family.
410
+ #--
411
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
412
+ def async(stream_capacity: nil)
413
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
414
+ build_async_facade(AsyncOperations, stream_capacity:)
415
+ end
416
+ #--
417
+ # @rbs (*(:none | :exportd) groups) -> self
418
+ def subscribe(*groups) = super
419
+ #--
420
+ # @rbs (*(:none | :exportd) groups) -> self
421
+ def unsubscribe(*groups) = super
292
422
  end
293
423
  end; end