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-addr.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 RtAddr < ::Nl::Family
10
12
  NAME = "rt-addr"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("rt-addr", 0))
14
+ MCAST_GROUPS = Ractor.make_shareable({:"rtnlgrp_ipv4_ifaddr" => ::Nl::McastGroup.new("rtnlgrp-ipv4-ifaddr", 5), :"rtnlgrp_ipv6_ifaddr" => ::Nl::McastGroup.new("rtnlgrp-ipv6-ifaddr", 9)}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  Ifaddrmsg = Struct.new(
14
17
  :"ifa_family", #: ::Integer
@@ -167,11 +170,11 @@ class RtAddr < ::Nl::Family
167
170
  def ifa_index; fixed_header.ifa_index; end
168
171
  # Gets the value of `address` attribute in the message.
169
172
  #--
170
- # @rbs return: untyped
173
+ # @rbs return: ::String
171
174
  def address; attributes[:"address"]&.value; end
172
175
  # Gets the value of `local` attribute in the message.
173
176
  #--
174
- # @rbs return: untyped
177
+ # @rbs return: ::String
175
178
  def local; attributes[:"local"]&.value; end
176
179
  # Gets the value of `label` attribute in the message.
177
180
  #--
@@ -179,7 +182,7 @@ class RtAddr < ::Nl::Family
179
182
  def label; attributes[:"label"]&.value; end
180
183
  # Gets the value of `cacheinfo` attribute in the message.
181
184
  #--
182
- # @rbs return: untyped
185
+ # @rbs return: ::String
183
186
  def cacheinfo; attributes[:"cacheinfo"]&.value; end
184
187
  end
185
188
  # Remove address
@@ -210,11 +213,11 @@ class RtAddr < ::Nl::Family
210
213
  def ifa_index; fixed_header.ifa_index; end
211
214
  # Gets the value of `address` attribute in the message.
212
215
  #--
213
- # @rbs return: untyped
216
+ # @rbs return: ::String
214
217
  def address; attributes[:"address"]&.value; end
215
218
  # Gets the value of `local` attribute in the message.
216
219
  #--
217
- # @rbs return: untyped
220
+ # @rbs return: ::String
218
221
  def local; attributes[:"local"]&.value; end
219
222
  end
220
223
  # Dump address information.
@@ -272,11 +275,11 @@ class RtAddr < ::Nl::Family
272
275
  def ifa_index; fixed_header.ifa_index; end
273
276
  # Gets the value of `address` attribute in the message.
274
277
  #--
275
- # @rbs return: untyped
278
+ # @rbs return: ::String
276
279
  def address; attributes[:"address"]&.value; end
277
280
  # Gets the value of `local` attribute in the message.
278
281
  #--
279
- # @rbs return: untyped
282
+ # @rbs return: ::String
280
283
  def local; attributes[:"local"]&.value; end
281
284
  # Gets the value of `label` attribute in the message.
282
285
  #--
@@ -284,7 +287,7 @@ class RtAddr < ::Nl::Family
284
287
  def label; attributes[:"label"]&.value; end
285
288
  # Gets the value of `cacheinfo` attribute in the message.
286
289
  #--
287
- # @rbs return: untyped
290
+ # @rbs return: ::String
288
291
  def cacheinfo; attributes[:"cacheinfo"]&.value; end
289
292
  end
290
293
  # Get / dump IPv4/IPv6 multicast addresses.
@@ -342,11 +345,11 @@ class RtAddr < ::Nl::Family
342
345
  def ifa_index; fixed_header.ifa_index; end
343
346
  # Gets the value of `cacheinfo` attribute in the message.
344
347
  #--
345
- # @rbs return: untyped
348
+ # @rbs return: ::String
346
349
  def cacheinfo; attributes[:"cacheinfo"]&.value; end
347
350
  # Gets the value of `multicast` attribute in the message.
348
351
  #--
349
- # @rbs return: untyped
352
+ # @rbs return: ::String
350
353
  def multicast; attributes[:"multicast"]&.value; end
351
354
  end
352
355
  # Get / dump IPv4/IPv6 multicast addresses.
@@ -404,23 +407,26 @@ class RtAddr < ::Nl::Family
404
407
  def ifa_index; fixed_header.ifa_index; end
405
408
  # Gets the value of `cacheinfo` attribute in the message.
406
409
  #--
407
- # @rbs return: untyped
410
+ # @rbs return: ::String
408
411
  def cacheinfo; attributes[:"cacheinfo"]&.value; end
409
412
  # Gets the value of `multicast` attribute in the message.
410
413
  #--
411
- # @rbs return: untyped
414
+ # @rbs return: ::String
412
415
  def multicast; attributes[:"multicast"]&.value; end
413
416
  end
414
417
  end
418
+ module Notifications
419
+ end
420
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
415
421
  # Add new address
416
422
  #--
417
- # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: untyped, ?local: untyped, ?label: ::String, ?cacheinfo: untyped) -> void
423
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: ::String, ?local: ::String, ?label: ::String, ?cacheinfo: ::String) -> void
418
424
  def do_newaddr(**args)
419
425
  exchange_message(:"do", Messages::DoNewaddrRequest, nil, args)
420
426
  end
421
427
  # Remove address
422
428
  #--
423
- # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: untyped, ?local: untyped) -> void
429
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: ::String, ?local: ::String) -> void
424
430
  def do_deladdr(**args)
425
431
  exchange_message(:"do", Messages::DoDeladdrRequest, nil, args)
426
432
  end
@@ -444,5 +450,54 @@ class RtAddr < ::Nl::Family
444
450
  def dump_getmulticast(**args, &block)
445
451
  exchange_message(:"dump", Messages::DumpGetmulticastRequest, Messages::DumpGetmulticastReply, args, &block)
446
452
  end
453
+ class AsyncOperations
454
+ # :nodoc:
455
+ def initialize(&exchange)
456
+ @exchange = exchange
457
+ end
458
+ # Add new address
459
+ #--
460
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: ::String, ?local: ::String, ?label: ::String, ?cacheinfo: ::String) -> ::Nl::Async::Future[void]
461
+ def do_newaddr(**args)
462
+ @exchange.call(:"do", Messages::DoNewaddrRequest, nil, args)
463
+ end
464
+ # Remove address
465
+ #--
466
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer, ?address: ::String, ?local: ::String) -> ::Nl::Async::Future[void]
467
+ def do_deladdr(**args)
468
+ @exchange.call(:"do", Messages::DoDeladdrRequest, nil, args)
469
+ end
470
+ # Dump address information.
471
+ #--
472
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetaddrReply]
473
+ def dump_getaddr(**args)
474
+ @exchange.call(:"dump", Messages::DumpGetaddrRequest, Messages::DumpGetaddrReply, args)
475
+ end
476
+ # Get / dump IPv4/IPv6 multicast addresses.
477
+ #--
478
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer) -> ::Nl::Async::Future[Messages::DoGetmulticastReply]
479
+ def do_getmulticast(**args)
480
+ @exchange.call(:"do", Messages::DoGetmulticastRequest, Messages::DoGetmulticastReply, args)
481
+ end
482
+ # Get / dump IPv4/IPv6 multicast addresses.
483
+ #--
484
+ # @rbs (?ifa_family: ::Integer, ?ifa_prefixlen: ::Integer, ?ifa_flags: ::Integer, ?ifa_scope: ::Integer, ?ifa_index: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetmulticastReply]
485
+ def dump_getmulticast(**args)
486
+ @exchange.call(:"dump", Messages::DumpGetmulticastRequest, Messages::DumpGetmulticastReply, args)
487
+ end
488
+ end
489
+ # Returns the asynchronous operation facade for this family.
490
+ #--
491
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
492
+ def async(stream_capacity: nil)
493
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
494
+ build_async_facade(AsyncOperations, stream_capacity:)
495
+ end
496
+ #--
497
+ # @rbs (*(:rtnlgrp_ipv4_ifaddr | :rtnlgrp_ipv6_ifaddr) groups) -> self
498
+ def subscribe(*groups) = super
499
+ #--
500
+ # @rbs (*(:rtnlgrp_ipv4_ifaddr | :rtnlgrp_ipv6_ifaddr) groups) -> self
501
+ def unsubscribe(*groups) = super
447
502
  end
448
503
  end; end