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-neigh.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 RtNeigh < ::Nl::Family
10
12
  NAME = "rt-neigh"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("rt-neigh", 0))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"rtnlgrp_neigh" => ::Nl::McastGroup.new("rtnlgrp-neigh", 3)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  Ndmsg = Struct.new(
14
17
  :"ndm_family", #: ::Integer
@@ -467,11 +470,11 @@ class RtNeigh < ::Nl::Family
467
470
  def ndm_type; fixed_header.ndm_type; end
468
471
  # Gets the value of `dst` attribute in the message.
469
472
  #--
470
- # @rbs return: untyped
473
+ # @rbs return: ::String
471
474
  def dst; attributes[:"dst"]&.value; end
472
475
  # Gets the value of `lladdr` attribute in the message.
473
476
  #--
474
- # @rbs return: untyped
477
+ # @rbs return: ::String
475
478
  def lladdr; attributes[:"lladdr"]&.value; end
476
479
  # Gets the value of `probes` attribute in the message.
477
480
  #--
@@ -507,7 +510,7 @@ class RtNeigh < ::Nl::Family
507
510
  def nh_id; attributes[:"nh_id"]&.value; end
508
511
  # Gets the value of `fdb-ext-attrs` attribute in the message.
509
512
  #--
510
- # @rbs return: untyped
513
+ # @rbs return: ::String
511
514
  def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
512
515
  # Gets the value of `flags-ext` attribute in the message.
513
516
  #--
@@ -542,7 +545,7 @@ class RtNeigh < ::Nl::Family
542
545
  def ndm_type; fixed_header.ndm_type; end
543
546
  # Gets the value of `dst` attribute in the message.
544
547
  #--
545
- # @rbs return: untyped
548
+ # @rbs return: ::String
546
549
  def dst; attributes[:"dst"]&.value; end
547
550
  # Gets the value of `ifindex` attribute in the message.
548
551
  #--
@@ -577,7 +580,7 @@ class RtNeigh < ::Nl::Family
577
580
  def ndm_type; fixed_header.ndm_type; end
578
581
  # Gets the value of `dst` attribute in the message.
579
582
  #--
580
- # @rbs return: untyped
583
+ # @rbs return: ::String
581
584
  def dst; attributes[:"dst"]&.value; end
582
585
  end
583
586
  # Get or dump neighbour entries
@@ -608,11 +611,11 @@ class RtNeigh < ::Nl::Family
608
611
  def ndm_type; fixed_header.ndm_type; end
609
612
  # Gets the value of `dst` attribute in the message.
610
613
  #--
611
- # @rbs return: untyped
614
+ # @rbs return: ::String
612
615
  def dst; attributes[:"dst"]&.value; end
613
616
  # Gets the value of `lladdr` attribute in the message.
614
617
  #--
615
- # @rbs return: untyped
618
+ # @rbs return: ::String
616
619
  def lladdr; attributes[:"lladdr"]&.value; end
617
620
  # Gets the value of `probes` attribute in the message.
618
621
  #--
@@ -648,7 +651,7 @@ class RtNeigh < ::Nl::Family
648
651
  def nh_id; attributes[:"nh_id"]&.value; end
649
652
  # Gets the value of `fdb-ext-attrs` attribute in the message.
650
653
  #--
651
- # @rbs return: untyped
654
+ # @rbs return: ::String
652
655
  def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
653
656
  # Gets the value of `flags-ext` attribute in the message.
654
657
  #--
@@ -718,11 +721,11 @@ class RtNeigh < ::Nl::Family
718
721
  def ndm_type; fixed_header.ndm_type; end
719
722
  # Gets the value of `dst` attribute in the message.
720
723
  #--
721
- # @rbs return: untyped
724
+ # @rbs return: ::String
722
725
  def dst; attributes[:"dst"]&.value; end
723
726
  # Gets the value of `lladdr` attribute in the message.
724
727
  #--
725
- # @rbs return: untyped
728
+ # @rbs return: ::String
726
729
  def lladdr; attributes[:"lladdr"]&.value; end
727
730
  # Gets the value of `probes` attribute in the message.
728
731
  #--
@@ -758,7 +761,7 @@ class RtNeigh < ::Nl::Family
758
761
  def nh_id; attributes[:"nh_id"]&.value; end
759
762
  # Gets the value of `fdb-ext-attrs` attribute in the message.
760
763
  #--
761
- # @rbs return: untyped
764
+ # @rbs return: ::String
762
765
  def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
763
766
  # Gets the value of `flags-ext` attribute in the message.
764
767
  #--
@@ -804,7 +807,7 @@ class RtNeigh < ::Nl::Family
804
807
  def thresh3; attributes[:"thresh3"]&.value; end
805
808
  # Gets the value of `config` attribute in the message.
806
809
  #--
807
- # @rbs return: untyped
810
+ # @rbs return: ::String
808
811
  def config; attributes[:"config"]&.value; end
809
812
  # Gets the value of `parms` attribute in the message.
810
813
  #--
@@ -812,7 +815,7 @@ class RtNeigh < ::Nl::Family
812
815
  def parms; attributes[:"parms"]&.value; end
813
816
  # Gets the value of `stats` attribute in the message.
814
817
  #--
815
- # @rbs return: untyped
818
+ # @rbs return: ::String
816
819
  def stats; attributes[:"stats"]&.value; end
817
820
  # Gets the value of `gc-interval` attribute in the message.
818
821
  #--
@@ -855,21 +858,174 @@ class RtNeigh < ::Nl::Family
855
858
  def gc_interval; attributes[:"gc_interval"]&.value; end
856
859
  end
857
860
  end
861
+ module Notifications
862
+ # Notify a neighbour deletion
863
+ class DelneighNtf < ::Nl::Protocols::Raw::Message
864
+ TYPE = 29
865
+ FIXED_HEADER = Structs::Ndmsg
866
+ ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
867
+ ATTRIBUTES = Ractor.make_shareable(%i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext])
868
+ # Gets the value of `ndm-family` field in the message's fixed header.
869
+ #--
870
+ # @rbs return: ::Integer
871
+ def ndm_family; fixed_header.ndm_family; end
872
+ # Gets the value of `ndm-ifindex` field in the message's fixed header.
873
+ #--
874
+ # @rbs return: ::Integer
875
+ def ndm_ifindex; fixed_header.ndm_ifindex; end
876
+ # Gets the value of `ndm-state` field in the message's fixed header.
877
+ #--
878
+ # @rbs return: ::Integer
879
+ def ndm_state; fixed_header.ndm_state; end
880
+ # Gets the value of `ndm-flags` field in the message's fixed header.
881
+ #--
882
+ # @rbs return: ::Integer
883
+ def ndm_flags; fixed_header.ndm_flags; end
884
+ # Gets the value of `ndm-type` field in the message's fixed header.
885
+ #--
886
+ # @rbs return: ::Integer
887
+ def ndm_type; fixed_header.ndm_type; end
888
+ # Gets the value of `dst` attribute in the message.
889
+ #--
890
+ # @rbs return: ::String
891
+ def dst; attributes[:"dst"]&.value; end
892
+ # Gets the value of `lladdr` attribute in the message.
893
+ #--
894
+ # @rbs return: ::String
895
+ def lladdr; attributes[:"lladdr"]&.value; end
896
+ # Gets the value of `probes` attribute in the message.
897
+ #--
898
+ # @rbs return: ::Integer
899
+ def probes; attributes[:"probes"]&.value; end
900
+ # Gets the value of `vlan` attribute in the message.
901
+ #--
902
+ # @rbs return: ::Integer
903
+ def vlan; attributes[:"vlan"]&.value; end
904
+ # Gets the value of `port` attribute in the message.
905
+ #--
906
+ # @rbs return: ::Integer
907
+ def port; attributes[:"port"]&.value; end
908
+ # Gets the value of `vni` attribute in the message.
909
+ #--
910
+ # @rbs return: ::Integer
911
+ def vni; attributes[:"vni"]&.value; end
912
+ # Gets the value of `ifindex` attribute in the message.
913
+ #--
914
+ # @rbs return: ::Integer
915
+ def ifindex; attributes[:"ifindex"]&.value; end
916
+ # Gets the value of `master` attribute in the message.
917
+ #--
918
+ # @rbs return: ::Integer
919
+ def master; attributes[:"master"]&.value; end
920
+ # Gets the value of `protocol` attribute in the message.
921
+ #--
922
+ # @rbs return: ::Integer
923
+ def protocol; attributes[:"protocol"]&.value; end
924
+ # Gets the value of `nh-id` attribute in the message.
925
+ #--
926
+ # @rbs return: ::Integer
927
+ def nh_id; attributes[:"nh_id"]&.value; end
928
+ # Gets the value of `fdb-ext-attrs` attribute in the message.
929
+ #--
930
+ # @rbs return: ::String
931
+ def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
932
+ # Gets the value of `flags-ext` attribute in the message.
933
+ #--
934
+ # @rbs return: ::Integer
935
+ def flags_ext; attributes[:"flags_ext"]&.value; end
936
+ end
937
+ # Notify a neighbour creation
938
+ class NewneighNtf < ::Nl::Protocols::Raw::Message
939
+ TYPE = 28
940
+ FIXED_HEADER = Structs::Ndmsg
941
+ ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
942
+ ATTRIBUTES = Ractor.make_shareable(%i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext])
943
+ # Gets the value of `ndm-family` field in the message's fixed header.
944
+ #--
945
+ # @rbs return: ::Integer
946
+ def ndm_family; fixed_header.ndm_family; end
947
+ # Gets the value of `ndm-ifindex` field in the message's fixed header.
948
+ #--
949
+ # @rbs return: ::Integer
950
+ def ndm_ifindex; fixed_header.ndm_ifindex; end
951
+ # Gets the value of `ndm-state` field in the message's fixed header.
952
+ #--
953
+ # @rbs return: ::Integer
954
+ def ndm_state; fixed_header.ndm_state; end
955
+ # Gets the value of `ndm-flags` field in the message's fixed header.
956
+ #--
957
+ # @rbs return: ::Integer
958
+ def ndm_flags; fixed_header.ndm_flags; end
959
+ # Gets the value of `ndm-type` field in the message's fixed header.
960
+ #--
961
+ # @rbs return: ::Integer
962
+ def ndm_type; fixed_header.ndm_type; end
963
+ # Gets the value of `dst` attribute in the message.
964
+ #--
965
+ # @rbs return: ::String
966
+ def dst; attributes[:"dst"]&.value; end
967
+ # Gets the value of `lladdr` attribute in the message.
968
+ #--
969
+ # @rbs return: ::String
970
+ def lladdr; attributes[:"lladdr"]&.value; end
971
+ # Gets the value of `probes` attribute in the message.
972
+ #--
973
+ # @rbs return: ::Integer
974
+ def probes; attributes[:"probes"]&.value; end
975
+ # Gets the value of `vlan` attribute in the message.
976
+ #--
977
+ # @rbs return: ::Integer
978
+ def vlan; attributes[:"vlan"]&.value; end
979
+ # Gets the value of `port` attribute in the message.
980
+ #--
981
+ # @rbs return: ::Integer
982
+ def port; attributes[:"port"]&.value; end
983
+ # Gets the value of `vni` attribute in the message.
984
+ #--
985
+ # @rbs return: ::Integer
986
+ def vni; attributes[:"vni"]&.value; end
987
+ # Gets the value of `ifindex` attribute in the message.
988
+ #--
989
+ # @rbs return: ::Integer
990
+ def ifindex; attributes[:"ifindex"]&.value; end
991
+ # Gets the value of `master` attribute in the message.
992
+ #--
993
+ # @rbs return: ::Integer
994
+ def master; attributes[:"master"]&.value; end
995
+ # Gets the value of `protocol` attribute in the message.
996
+ #--
997
+ # @rbs return: ::Integer
998
+ def protocol; attributes[:"protocol"]&.value; end
999
+ # Gets the value of `nh-id` attribute in the message.
1000
+ #--
1001
+ # @rbs return: ::Integer
1002
+ def nh_id; attributes[:"nh_id"]&.value; end
1003
+ # Gets the value of `fdb-ext-attrs` attribute in the message.
1004
+ #--
1005
+ # @rbs return: ::String
1006
+ def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
1007
+ # Gets the value of `flags-ext` attribute in the message.
1008
+ #--
1009
+ # @rbs return: ::Integer
1010
+ def flags_ext; attributes[:"flags_ext"]&.value; end
1011
+ end
1012
+ end
1013
+ NOTIFICATIONS = Ractor.make_shareable({29 => Notifications::DelneighNtf, 28 => Notifications::NewneighNtf}) #: Hash[::Integer, ::Class]
858
1014
  # Add new neighbour entry
859
1015
  #--
860
- # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: untyped, ?lladdr: untyped, ?probes: ::Integer, ?vlan: ::Integer, ?port: ::Integer, ?vni: ::Integer, ?ifindex: ::Integer, ?master: ::Integer, ?protocol: ::Integer, ?nh_id: ::Integer, ?fdb_ext_attrs: untyped, ?flags_ext: ::Integer) -> void
1016
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String, ?lladdr: ::String, ?probes: ::Integer, ?vlan: ::Integer, ?port: ::Integer, ?vni: ::Integer, ?ifindex: ::Integer, ?master: ::Integer, ?protocol: ::Integer, ?nh_id: ::Integer, ?fdb_ext_attrs: ::String, ?flags_ext: ::Integer) -> void
861
1017
  def do_newneigh(**args)
862
1018
  exchange_message(:"do", Messages::DoNewneighRequest, nil, args)
863
1019
  end
864
1020
  # Remove an existing neighbour entry
865
1021
  #--
866
- # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: untyped, ?ifindex: ::Integer) -> void
1022
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String, ?ifindex: ::Integer) -> void
867
1023
  def do_delneigh(**args)
868
1024
  exchange_message(:"do", Messages::DoDelneighRequest, nil, args)
869
1025
  end
870
1026
  # Get or dump neighbour entries
871
1027
  #--
872
- # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: untyped) -> Messages::DoGetneighReply
1028
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String) -> Messages::DoGetneighReply
873
1029
  def do_getneigh(**args)
874
1030
  exchange_message(:"do", Messages::DoGetneighRequest, Messages::DoGetneighReply, args)
875
1031
  end
@@ -893,5 +1049,60 @@ class RtNeigh < ::Nl::Family
893
1049
  def do_setneightbl(**args)
894
1050
  exchange_message(:"do", Messages::DoSetneightblRequest, nil, args)
895
1051
  end
1052
+ class AsyncOperations
1053
+ # :nodoc:
1054
+ def initialize(&exchange)
1055
+ @exchange = exchange
1056
+ end
1057
+ # Add new neighbour entry
1058
+ #--
1059
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String, ?lladdr: ::String, ?probes: ::Integer, ?vlan: ::Integer, ?port: ::Integer, ?vni: ::Integer, ?ifindex: ::Integer, ?master: ::Integer, ?protocol: ::Integer, ?nh_id: ::Integer, ?fdb_ext_attrs: ::String, ?flags_ext: ::Integer) -> ::Nl::Async::Future[void]
1060
+ def do_newneigh(**args)
1061
+ @exchange.call(:"do", Messages::DoNewneighRequest, nil, args)
1062
+ end
1063
+ # Remove an existing neighbour entry
1064
+ #--
1065
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String, ?ifindex: ::Integer) -> ::Nl::Async::Future[void]
1066
+ def do_delneigh(**args)
1067
+ @exchange.call(:"do", Messages::DoDelneighRequest, nil, args)
1068
+ end
1069
+ # Get or dump neighbour entries
1070
+ #--
1071
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String) -> ::Nl::Async::Future[Messages::DoGetneighReply]
1072
+ def do_getneigh(**args)
1073
+ @exchange.call(:"do", Messages::DoGetneighRequest, Messages::DoGetneighReply, args)
1074
+ end
1075
+ # Get or dump neighbour entries
1076
+ #--
1077
+ # @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?ifindex: ::Integer, ?master: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetneighReply]
1078
+ def dump_getneigh(**args)
1079
+ @exchange.call(:"dump", Messages::DumpGetneighRequest, Messages::DumpGetneighReply, args)
1080
+ end
1081
+ # Get or dump neighbour tables
1082
+ #--
1083
+ # @rbs (?family: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetneightblReply]
1084
+ def dump_getneightbl(**args)
1085
+ @exchange.call(:"dump", Messages::DumpGetneightblRequest, Messages::DumpGetneightblReply, args)
1086
+ end
1087
+ # Set neighbour tables
1088
+ #--
1089
+ # @rbs (?family: ::Integer, ?name: ::String, ?thresh1: ::Integer, ?thresh2: ::Integer, ?thresh3: ::Integer, ?parms: AttributeSets::NdtpaAttrs, ?gc_interval: ::Integer) -> ::Nl::Async::Future[void]
1090
+ def do_setneightbl(**args)
1091
+ @exchange.call(:"do", Messages::DoSetneightblRequest, nil, args)
1092
+ end
1093
+ end
1094
+ # Returns the asynchronous operation facade for this family.
1095
+ #--
1096
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1097
+ def async(stream_capacity: nil)
1098
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
1099
+ build_async_facade(AsyncOperations, stream_capacity:)
1100
+ end
1101
+ #--
1102
+ # @rbs (*(:rtnlgrp_neigh) groups) -> self
1103
+ def subscribe(*groups) = super
1104
+ #--
1105
+ # @rbs (*(:rtnlgrp_neigh) groups) -> self
1106
+ def unsubscribe(*groups) = super
896
1107
  end
897
1108
  end; end