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,5 +1,9 @@
1
1
  # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
2
  #
3
+ # This file is based on Documentation/netlink/specs/ovpn.yaml from Linux v7.2.
4
+ #
5
+ # Original YNL comment:
6
+ #
3
7
  # Author: Antonio Quartulli <antonio@openvpn.net>
4
8
  #
5
9
  # Copyright (c) 2024-2025, OpenVPN Inc.
@@ -14,6 +18,7 @@ module Nl; module Linux
14
18
  class Ovpn < ::Nl::Family
15
19
  NAME = "ovpn"
16
20
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovpn"))
21
+ MCAST_GROUPS = Ractor.make_shareable({:"peers" => ::Nl::McastGroup.new("peers", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
17
22
  module Structs
18
23
  end
19
24
  module AttributeSets
@@ -756,6 +761,8 @@ class Ovpn < ::Nl::Family
756
761
  end
757
762
  module Messages
758
763
  # Add a remote peer
764
+ #
765
+ # Requires CAP_NET_ADMIN in the initial user namespace.
759
766
  class DoPeerNewRequest < ::Nl::Protocols::Genl::Message
760
767
  TYPE = 1
761
768
  FIXED_HEADER = nil
@@ -771,6 +778,8 @@ class Ovpn < ::Nl::Family
771
778
  def peer; attributes[:"peer"]&.value; end
772
779
  end
773
780
  # modify a remote peer
781
+ #
782
+ # Requires CAP_NET_ADMIN in the initial user namespace.
774
783
  class DoPeerSetRequest < ::Nl::Protocols::Genl::Message
775
784
  TYPE = 2
776
785
  FIXED_HEADER = nil
@@ -786,6 +795,8 @@ class Ovpn < ::Nl::Family
786
795
  def peer; attributes[:"peer"]&.value; end
787
796
  end
788
797
  # Retrieve data about existing remote peers (or a specific one)
798
+ #
799
+ # Requires CAP_NET_ADMIN in the initial user namespace.
789
800
  class DoPeerGetRequest < ::Nl::Protocols::Genl::Message
790
801
  TYPE = 3
791
802
  FIXED_HEADER = nil
@@ -801,6 +812,8 @@ class Ovpn < ::Nl::Family
801
812
  def peer; attributes[:"peer"]&.value; end
802
813
  end
803
814
  # Retrieve data about existing remote peers (or a specific one)
815
+ #
816
+ # Requires CAP_NET_ADMIN in the initial user namespace.
804
817
  class DoPeerGetReply < ::Nl::Protocols::Genl::Message
805
818
  TYPE = 3
806
819
  FIXED_HEADER = nil
@@ -812,6 +825,8 @@ class Ovpn < ::Nl::Family
812
825
  def peer; attributes[:"peer"]&.value; end
813
826
  end
814
827
  # Retrieve data about existing remote peers (or a specific one)
828
+ #
829
+ # Requires CAP_NET_ADMIN in the initial user namespace.
815
830
  class DumpPeerGetRequest < ::Nl::Protocols::Genl::Message
816
831
  TYPE = 3
817
832
  FIXED_HEADER = nil
@@ -823,6 +838,8 @@ class Ovpn < ::Nl::Family
823
838
  def ifindex; attributes[:"ifindex"]&.value; end
824
839
  end
825
840
  # Retrieve data about existing remote peers (or a specific one)
841
+ #
842
+ # Requires CAP_NET_ADMIN in the initial user namespace.
826
843
  class DumpPeerGetReply < ::Nl::Protocols::Genl::Message
827
844
  TYPE = 3
828
845
  FIXED_HEADER = nil
@@ -834,6 +851,8 @@ class Ovpn < ::Nl::Family
834
851
  def peer; attributes[:"peer"]&.value; end
835
852
  end
836
853
  # Delete existing remote peer
854
+ #
855
+ # Requires CAP_NET_ADMIN in the initial user namespace.
837
856
  class DoPeerDelRequest < ::Nl::Protocols::Genl::Message
838
857
  TYPE = 4
839
858
  FIXED_HEADER = nil
@@ -849,6 +868,8 @@ class Ovpn < ::Nl::Family
849
868
  def peer; attributes[:"peer"]&.value; end
850
869
  end
851
870
  # Add a cipher key for a specific peer
871
+ #
872
+ # Requires CAP_NET_ADMIN in the initial user namespace.
852
873
  class DoKeyNewRequest < ::Nl::Protocols::Genl::Message
853
874
  TYPE = 6
854
875
  FIXED_HEADER = nil
@@ -864,6 +885,8 @@ class Ovpn < ::Nl::Family
864
885
  def keyconf; attributes[:"keyconf"]&.value; end
865
886
  end
866
887
  # Retrieve non-sensitive data about peer key and cipher
888
+ #
889
+ # Requires CAP_NET_ADMIN in the initial user namespace.
867
890
  class DoKeyGetRequest < ::Nl::Protocols::Genl::Message
868
891
  TYPE = 7
869
892
  FIXED_HEADER = nil
@@ -879,6 +902,8 @@ class Ovpn < ::Nl::Family
879
902
  def keyconf; attributes[:"keyconf"]&.value; end
880
903
  end
881
904
  # Retrieve non-sensitive data about peer key and cipher
905
+ #
906
+ # Requires CAP_NET_ADMIN in the initial user namespace.
882
907
  class DoKeyGetReply < ::Nl::Protocols::Genl::Message
883
908
  TYPE = 7
884
909
  FIXED_HEADER = nil
@@ -890,6 +915,8 @@ class Ovpn < ::Nl::Family
890
915
  def keyconf; attributes[:"keyconf"]&.value; end
891
916
  end
892
917
  # Swap primary and secondary session keys for a specific peer
918
+ #
919
+ # Requires CAP_NET_ADMIN in the initial user namespace.
893
920
  class DoKeySwapRequest < ::Nl::Protocols::Genl::Message
894
921
  TYPE = 8
895
922
  FIXED_HEADER = nil
@@ -905,6 +932,8 @@ class Ovpn < ::Nl::Family
905
932
  def keyconf; attributes[:"keyconf"]&.value; end
906
933
  end
907
934
  # Delete cipher key for a specific peer
935
+ #
936
+ # Requires CAP_NET_ADMIN in the initial user namespace.
908
937
  class DoKeyDelRequest < ::Nl::Protocols::Genl::Message
909
938
  TYPE = 10
910
939
  FIXED_HEADER = nil
@@ -920,25 +949,75 @@ class Ovpn < ::Nl::Family
920
949
  def keyconf; attributes[:"keyconf"]&.value; end
921
950
  end
922
951
  end
952
+ module Notifications
953
+ # Notification about a peer being deleted
954
+ #
955
+ # Multicast group: `peers`.
956
+ class PeerDelNtf < ::Nl::Protocols::Genl::Message
957
+ TYPE = 5
958
+ FIXED_HEADER = nil
959
+ ATTRIBUTE_SET = AttributeSets::Ovpn
960
+ ATTRIBUTES = Ractor.make_shareable(%i[peer])
961
+ # Gets the value of `peer` attribute in the message.
962
+ #--
963
+ # @rbs return: AttributeSets::Peer
964
+ def peer; attributes[:"peer"]&.value; end
965
+ end
966
+ # Notification about key having exhausted its IV space and requiring renegotiation
967
+ #
968
+ # Multicast group: `peers`.
969
+ class KeySwapNtf < ::Nl::Protocols::Genl::Message
970
+ TYPE = 9
971
+ FIXED_HEADER = nil
972
+ ATTRIBUTE_SET = AttributeSets::OvpnKeyconfGet
973
+ ATTRIBUTES = Ractor.make_shareable(%i[keyconf])
974
+ # Gets the value of `keyconf` attribute in the message.
975
+ #--
976
+ # @rbs return: AttributeSets::Keyconf
977
+ def keyconf; attributes[:"keyconf"]&.value; end
978
+ end
979
+ # Notification about a peer floating (changing its remote UDP endpoint)
980
+ #
981
+ # Multicast group: `peers`.
982
+ class PeerFloatNtf < ::Nl::Protocols::Genl::Message
983
+ TYPE = 11
984
+ FIXED_HEADER = nil
985
+ ATTRIBUTE_SET = AttributeSets::Ovpn
986
+ ATTRIBUTES = Ractor.make_shareable(%i[peer])
987
+ # Gets the value of `peer` attribute in the message.
988
+ #--
989
+ # @rbs return: AttributeSets::Peer
990
+ def peer; attributes[:"peer"]&.value; end
991
+ end
992
+ end
993
+ NOTIFICATIONS = Ractor.make_shareable({5 => Notifications::PeerDelNtf, 9 => Notifications::KeySwapNtf, 11 => Notifications::PeerFloatNtf}) #: Hash[::Integer, ::Class]
923
994
  # Add a remote peer
995
+ #
996
+ # Requires CAP_NET_ADMIN in the initial user namespace.
924
997
  #--
925
998
  # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
926
999
  def do_peer_new(**args)
927
1000
  exchange_message(:"do", Messages::DoPeerNewRequest, nil, args)
928
1001
  end
929
1002
  # modify a remote peer
1003
+ #
1004
+ # Requires CAP_NET_ADMIN in the initial user namespace.
930
1005
  #--
931
1006
  # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
932
1007
  def do_peer_set(**args)
933
1008
  exchange_message(:"do", Messages::DoPeerSetRequest, nil, args)
934
1009
  end
935
1010
  # Retrieve data about existing remote peers (or a specific one)
1011
+ #
1012
+ # Requires CAP_NET_ADMIN in the initial user namespace.
936
1013
  #--
937
1014
  # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> Messages::DoPeerGetReply
938
1015
  def do_peer_get(**args)
939
1016
  exchange_message(:"do", Messages::DoPeerGetRequest, Messages::DoPeerGetReply, args)
940
1017
  end
941
1018
  # Retrieve data about existing remote peers (or a specific one)
1019
+ #
1020
+ # Requires CAP_NET_ADMIN in the initial user namespace.
942
1021
  #--
943
1022
  # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpPeerGetReply]
944
1023
  # | (?ifindex: ::Integer) { (Messages::DumpPeerGetReply) -> void } -> void
@@ -946,34 +1025,135 @@ class Ovpn < ::Nl::Family
946
1025
  exchange_message(:"dump", Messages::DumpPeerGetRequest, Messages::DumpPeerGetReply, args, &block)
947
1026
  end
948
1027
  # Delete existing remote peer
1028
+ #
1029
+ # Requires CAP_NET_ADMIN in the initial user namespace.
949
1030
  #--
950
1031
  # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> void
951
1032
  def do_peer_del(**args)
952
1033
  exchange_message(:"do", Messages::DoPeerDelRequest, nil, args)
953
1034
  end
954
1035
  # Add a cipher key for a specific peer
1036
+ #
1037
+ # Requires CAP_NET_ADMIN in the initial user namespace.
955
1038
  #--
956
1039
  # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
957
1040
  def do_key_new(**args)
958
1041
  exchange_message(:"do", Messages::DoKeyNewRequest, nil, args)
959
1042
  end
960
1043
  # Retrieve non-sensitive data about peer key and cipher
1044
+ #
1045
+ # Requires CAP_NET_ADMIN in the initial user namespace.
961
1046
  #--
962
1047
  # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> Messages::DoKeyGetReply
963
1048
  def do_key_get(**args)
964
1049
  exchange_message(:"do", Messages::DoKeyGetRequest, Messages::DoKeyGetReply, args)
965
1050
  end
966
1051
  # Swap primary and secondary session keys for a specific peer
1052
+ #
1053
+ # Requires CAP_NET_ADMIN in the initial user namespace.
967
1054
  #--
968
1055
  # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
969
1056
  def do_key_swap(**args)
970
1057
  exchange_message(:"do", Messages::DoKeySwapRequest, nil, args)
971
1058
  end
972
1059
  # Delete cipher key for a specific peer
1060
+ #
1061
+ # Requires CAP_NET_ADMIN in the initial user namespace.
973
1062
  #--
974
1063
  # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> void
975
1064
  def do_key_del(**args)
976
1065
  exchange_message(:"do", Messages::DoKeyDelRequest, nil, args)
977
1066
  end
1067
+ class AsyncOperations
1068
+ # :nodoc:
1069
+ def initialize(&exchange)
1070
+ @exchange = exchange
1071
+ end
1072
+ # Add a remote peer
1073
+ #
1074
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1075
+ #--
1076
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> ::Nl::Async::Future[void]
1077
+ def do_peer_new(**args)
1078
+ @exchange.call(:"do", Messages::DoPeerNewRequest, nil, args)
1079
+ end
1080
+ # modify a remote peer
1081
+ #
1082
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1083
+ #--
1084
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> ::Nl::Async::Future[void]
1085
+ def do_peer_set(**args)
1086
+ @exchange.call(:"do", Messages::DoPeerSetRequest, nil, args)
1087
+ end
1088
+ # Retrieve data about existing remote peers (or a specific one)
1089
+ #
1090
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1091
+ #--
1092
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> ::Nl::Async::Future[Messages::DoPeerGetReply]
1093
+ def do_peer_get(**args)
1094
+ @exchange.call(:"do", Messages::DoPeerGetRequest, Messages::DoPeerGetReply, args)
1095
+ end
1096
+ # Retrieve data about existing remote peers (or a specific one)
1097
+ #
1098
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1099
+ #--
1100
+ # @rbs (?ifindex: ::Integer) -> ::Nl::Async::Stream[Messages::DumpPeerGetReply]
1101
+ def dump_peer_get(**args)
1102
+ @exchange.call(:"dump", Messages::DumpPeerGetRequest, Messages::DumpPeerGetReply, args)
1103
+ end
1104
+ # Delete existing remote peer
1105
+ #
1106
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1107
+ #--
1108
+ # @rbs (?ifindex: ::Integer, ?peer: AttributeSets::Peer) -> ::Nl::Async::Future[void]
1109
+ def do_peer_del(**args)
1110
+ @exchange.call(:"do", Messages::DoPeerDelRequest, nil, args)
1111
+ end
1112
+ # Add a cipher key for a specific peer
1113
+ #
1114
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1115
+ #--
1116
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> ::Nl::Async::Future[void]
1117
+ def do_key_new(**args)
1118
+ @exchange.call(:"do", Messages::DoKeyNewRequest, nil, args)
1119
+ end
1120
+ # Retrieve non-sensitive data about peer key and cipher
1121
+ #
1122
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1123
+ #--
1124
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> ::Nl::Async::Future[Messages::DoKeyGetReply]
1125
+ def do_key_get(**args)
1126
+ @exchange.call(:"do", Messages::DoKeyGetRequest, Messages::DoKeyGetReply, args)
1127
+ end
1128
+ # Swap primary and secondary session keys for a specific peer
1129
+ #
1130
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1131
+ #--
1132
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> ::Nl::Async::Future[void]
1133
+ def do_key_swap(**args)
1134
+ @exchange.call(:"do", Messages::DoKeySwapRequest, nil, args)
1135
+ end
1136
+ # Delete cipher key for a specific peer
1137
+ #
1138
+ # Requires CAP_NET_ADMIN in the initial user namespace.
1139
+ #--
1140
+ # @rbs (?ifindex: ::Integer, ?keyconf: AttributeSets::Keyconf) -> ::Nl::Async::Future[void]
1141
+ def do_key_del(**args)
1142
+ @exchange.call(:"do", Messages::DoKeyDelRequest, nil, args)
1143
+ end
1144
+ end
1145
+ # Returns the asynchronous operation facade for this family.
1146
+ #--
1147
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1148
+ def async(stream_capacity: nil)
1149
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
1150
+ build_async_facade(AsyncOperations, stream_capacity:)
1151
+ end
1152
+ #--
1153
+ # @rbs (*(:peers) groups) -> self
1154
+ def subscribe(*groups) = super
1155
+ #--
1156
+ # @rbs (*(:peers) groups) -> self
1157
+ def unsubscribe(*groups) = super
978
1158
  end
979
1159
  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/ovs_datapath.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 OvsDatapath < ::Nl::Family
10
12
  NAME = "ovs_datapath"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_datapath"))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"ovs_datapath" => ::Nl::McastGroup.new("ovs_datapath", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  OvsHeader = Struct.new(
14
17
  :"dp_ifindex", #: ::Integer
@@ -180,11 +183,11 @@ class OvsDatapath < ::Nl::Family
180
183
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
181
184
  # Gets the value of `stats` attribute in the message.
182
185
  #--
183
- # @rbs return: untyped
186
+ # @rbs return: ::String
184
187
  def stats; attributes[:"stats"]&.value; end
185
188
  # Gets the value of `megaflow-stats` attribute in the message.
186
189
  #--
187
- # @rbs return: untyped
190
+ # @rbs return: ::String
188
191
  def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
189
192
  # Gets the value of `user-features` attribute in the message.
190
193
  #--
@@ -196,7 +199,7 @@ class OvsDatapath < ::Nl::Family
196
199
  def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
197
200
  # Gets the value of `per-cpu-pids` attribute in the message.
198
201
  #--
199
- # @rbs return: untyped
202
+ # @rbs return: ::String
200
203
  def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
201
204
  end
202
205
  # Get / dump OVS data path configuration and state
@@ -234,11 +237,11 @@ class OvsDatapath < ::Nl::Family
234
237
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
235
238
  # Gets the value of `stats` attribute in the message.
236
239
  #--
237
- # @rbs return: untyped
240
+ # @rbs return: ::String
238
241
  def stats; attributes[:"stats"]&.value; end
239
242
  # Gets the value of `megaflow-stats` attribute in the message.
240
243
  #--
241
- # @rbs return: untyped
244
+ # @rbs return: ::String
242
245
  def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
243
246
  # Gets the value of `user-features` attribute in the message.
244
247
  #--
@@ -250,7 +253,7 @@ class OvsDatapath < ::Nl::Family
250
253
  def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
251
254
  # Gets the value of `per-cpu-pids` attribute in the message.
252
255
  #--
253
- # @rbs return: untyped
256
+ # @rbs return: ::String
254
257
  def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
255
258
  end
256
259
  # Create new OVS data path
@@ -292,6 +295,9 @@ class OvsDatapath < ::Nl::Family
292
295
  def name; attributes[:"name"]&.value; end
293
296
  end
294
297
  end
298
+ module Notifications
299
+ end
300
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
295
301
  # Get / dump OVS data path configuration and state
296
302
  #--
297
303
  # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Messages::DoGetReply
@@ -317,5 +323,48 @@ class OvsDatapath < ::Nl::Family
317
323
  def do_del(**args)
318
324
  exchange_message(:"do", Messages::DoDelRequest, nil, args)
319
325
  end
326
+ class AsyncOperations
327
+ # :nodoc:
328
+ def initialize(&exchange)
329
+ @exchange = exchange
330
+ end
331
+ # Get / dump OVS data path configuration and state
332
+ #--
333
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Future[Messages::DoGetReply]
334
+ def do_get(**args)
335
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
336
+ end
337
+ # Get / dump OVS data path configuration and state
338
+ #--
339
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Stream[Messages::DumpGetReply]
340
+ def dump_get(**args)
341
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
342
+ end
343
+ # Create new OVS data path
344
+ #--
345
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String, ?upcall_pid: ::Integer, ?user_features: ::Integer) -> ::Nl::Async::Future[void]
346
+ def do_new(**args)
347
+ @exchange.call(:"do", Messages::DoNewRequest, nil, args)
348
+ end
349
+ # Delete existing OVS data path
350
+ #--
351
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Future[void]
352
+ def do_del(**args)
353
+ @exchange.call(:"do", Messages::DoDelRequest, nil, args)
354
+ end
355
+ end
356
+ # Returns the asynchronous operation facade for this family.
357
+ #--
358
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
359
+ def async(stream_capacity: nil)
360
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
361
+ build_async_facade(AsyncOperations, stream_capacity:)
362
+ end
363
+ #--
364
+ # @rbs (*(:ovs_datapath) groups) -> self
365
+ def subscribe(*groups) = super
366
+ #--
367
+ # @rbs (*(:ovs_datapath) groups) -> self
368
+ def unsubscribe(*groups) = super
320
369
  end
321
370
  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/ovs_flow.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 OvsFlow < ::Nl::Family
10
12
  NAME = "ovs_flow"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_flow"))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"ovs_flow" => ::Nl::McastGroup.new("ovs_flow", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  # Header for OVS Generic Netlink messages.
14
17
  OvsHeader = Struct.new(
@@ -55,8 +58,8 @@ class OvsFlow < ::Nl::Family
55
58
  end
56
59
  end
57
60
  OvsKeyEthernet = Struct.new(
58
- :"eth_src", #: untyped
59
- :"eth_dst", #: untyped
61
+ :"eth_src", #: ::String
62
+ :"eth_dst", #: ::String
60
63
  )
61
64
  class OvsKeyEthernet
62
65
  # :nodoc:
@@ -124,8 +127,8 @@ class OvsFlow < ::Nl::Family
124
127
  end
125
128
  end
126
129
  OvsKeyIpv6 = Struct.new(
127
- :"ipv6_src", #: untyped
128
- :"ipv6_dst", #: untyped
130
+ :"ipv6_src", #: ::String
131
+ :"ipv6_dst", #: ::String
129
132
  :"ipv6_label", #: ::Integer
130
133
  :"ipv6_proto", #: ::Integer
131
134
  :"ipv6_tclass", #: ::Integer
@@ -263,8 +266,8 @@ class OvsFlow < ::Nl::Family
263
266
  :"arp_sip", #: ::Integer
264
267
  :"arp_tip", #: ::Integer
265
268
  :"arp_op", #: ::Integer
266
- :"arp_sha", #: untyped
267
- :"arp_tha", #: untyped
269
+ :"arp_sha", #: ::String
270
+ :"arp_tha", #: ::String
268
271
  )
269
272
  class OvsKeyArp
270
273
  # :nodoc:
@@ -285,9 +288,9 @@ class OvsFlow < ::Nl::Family
285
288
  end
286
289
  end
287
290
  OvsKeyNd = Struct.new(
288
- :"nd_target", #: untyped
289
- :"nd_sll", #: untyped
290
- :"nd_tll", #: untyped
291
+ :"nd_target", #: ::String
292
+ :"nd_sll", #: ::String
293
+ :"nd_tll", #: ::String
291
294
  )
292
295
  class OvsKeyNd
293
296
  # :nodoc:
@@ -1304,7 +1307,7 @@ class OvsFlow < ::Nl::Family
1304
1307
  def key; attributes[:"key"]&.value; end
1305
1308
  # Gets the value of `ufid` attribute in the message.
1306
1309
  #--
1307
- # @rbs return: untyped
1310
+ # @rbs return: ::String
1308
1311
  def ufid; attributes[:"ufid"]&.value; end
1309
1312
  # Gets the value of `ufid-flags` attribute in the message.
1310
1313
  #--
@@ -1331,7 +1334,7 @@ class OvsFlow < ::Nl::Family
1331
1334
  def actions; attributes[:"actions"]&.value; end
1332
1335
  # Gets the value of `stats` attribute in the message.
1333
1336
  #--
1334
- # @rbs return: untyped
1337
+ # @rbs return: ::String
1335
1338
  def stats; attributes[:"stats"]&.value; end
1336
1339
  # Gets the value of `mask` attribute in the message.
1337
1340
  #--
@@ -1339,7 +1342,7 @@ class OvsFlow < ::Nl::Family
1339
1342
  def mask; attributes[:"mask"]&.value; end
1340
1343
  # Gets the value of `ufid` attribute in the message.
1341
1344
  #--
1342
- # @rbs return: untyped
1345
+ # @rbs return: ::String
1343
1346
  def ufid; attributes[:"ufid"]&.value; end
1344
1347
  end
1345
1348
  # Get / dump OVS flow configuration and state
@@ -1358,7 +1361,7 @@ class OvsFlow < ::Nl::Family
1358
1361
  def key; attributes[:"key"]&.value; end
1359
1362
  # Gets the value of `ufid` attribute in the message.
1360
1363
  #--
1361
- # @rbs return: untyped
1364
+ # @rbs return: ::String
1362
1365
  def ufid; attributes[:"ufid"]&.value; end
1363
1366
  # Gets the value of `ufid-flags` attribute in the message.
1364
1367
  #--
@@ -1385,7 +1388,7 @@ class OvsFlow < ::Nl::Family
1385
1388
  def actions; attributes[:"actions"]&.value; end
1386
1389
  # Gets the value of `stats` attribute in the message.
1387
1390
  #--
1388
- # @rbs return: untyped
1391
+ # @rbs return: ::String
1389
1392
  def stats; attributes[:"stats"]&.value; end
1390
1393
  # Gets the value of `mask` attribute in the message.
1391
1394
  #--
@@ -1393,7 +1396,7 @@ class OvsFlow < ::Nl::Family
1393
1396
  def mask; attributes[:"mask"]&.value; end
1394
1397
  # Gets the value of `ufid` attribute in the message.
1395
1398
  #--
1396
- # @rbs return: untyped
1399
+ # @rbs return: ::String
1397
1400
  def ufid; attributes[:"ufid"]&.value; end
1398
1401
  end
1399
1402
  # Create OVS flow configuration in a data path
@@ -1420,28 +1423,68 @@ class OvsFlow < ::Nl::Family
1420
1423
  def mask; attributes[:"mask"]&.value; end
1421
1424
  # Gets the value of `ufid` attribute in the message.
1422
1425
  #--
1423
- # @rbs return: untyped
1426
+ # @rbs return: ::String
1424
1427
  def ufid; attributes[:"ufid"]&.value; end
1425
1428
  end
1426
1429
  end
1430
+ module Notifications
1431
+ end
1432
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
1427
1433
  # Get / dump OVS flow configuration and state
1428
1434
  #--
1429
- # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: untyped, ?ufid_flags: ::Integer) -> Messages::DoGetReply
1435
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: ::String, ?ufid_flags: ::Integer) -> Messages::DoGetReply
1430
1436
  def do_get(**args)
1431
1437
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
1432
1438
  end
1433
1439
  # Get / dump OVS flow configuration and state
1434
1440
  #--
1435
- # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: untyped, ?ufid_flags: ::Integer) -> Enumerable[Messages::DumpGetReply]
1436
- # | (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: untyped, ?ufid_flags: ::Integer) { (Messages::DumpGetReply) -> void } -> void
1441
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: ::String, ?ufid_flags: ::Integer) -> Enumerable[Messages::DumpGetReply]
1442
+ # | (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: ::String, ?ufid_flags: ::Integer) { (Messages::DumpGetReply) -> void } -> void
1437
1443
  def dump_get(**args, &block)
1438
1444
  exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
1439
1445
  end
1440
1446
  # Create OVS flow configuration in a data path
1441
1447
  #--
1442
- # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?actions: AttributeSets::ActionAttrs, ?mask: AttributeSets::KeyAttrs, ?ufid: untyped) -> void
1448
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?actions: AttributeSets::ActionAttrs, ?mask: AttributeSets::KeyAttrs, ?ufid: ::String) -> void
1443
1449
  def do_new(**args)
1444
1450
  exchange_message(:"do", Messages::DoNewRequest, nil, args)
1445
1451
  end
1452
+ class AsyncOperations
1453
+ # :nodoc:
1454
+ def initialize(&exchange)
1455
+ @exchange = exchange
1456
+ end
1457
+ # Get / dump OVS flow configuration and state
1458
+ #--
1459
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: ::String, ?ufid_flags: ::Integer) -> ::Nl::Async::Future[Messages::DoGetReply]
1460
+ def do_get(**args)
1461
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
1462
+ end
1463
+ # Get / dump OVS flow configuration and state
1464
+ #--
1465
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?ufid: ::String, ?ufid_flags: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetReply]
1466
+ def dump_get(**args)
1467
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
1468
+ end
1469
+ # Create OVS flow configuration in a data path
1470
+ #--
1471
+ # @rbs (?dp_ifindex: ::Integer, ?key: AttributeSets::KeyAttrs, ?actions: AttributeSets::ActionAttrs, ?mask: AttributeSets::KeyAttrs, ?ufid: ::String) -> ::Nl::Async::Future[void]
1472
+ def do_new(**args)
1473
+ @exchange.call(:"do", Messages::DoNewRequest, nil, args)
1474
+ end
1475
+ end
1476
+ # Returns the asynchronous operation facade for this family.
1477
+ #--
1478
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1479
+ def async(stream_capacity: nil)
1480
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
1481
+ build_async_facade(AsyncOperations, stream_capacity:)
1482
+ end
1483
+ #--
1484
+ # @rbs (*(:ovs_flow) groups) -> self
1485
+ def subscribe(*groups) = super
1486
+ #--
1487
+ # @rbs (*(:ovs_flow) groups) -> self
1488
+ def unsubscribe(*groups) = super
1446
1489
  end
1447
1490
  end; end