nl-linux 0.2.3 → 0.2.4

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.
@@ -67,10 +67,15 @@ class Netdev < ::Nl::Family
67
67
  # Abstract class
68
68
  class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
69
69
  end
70
+ class RxBufLen < Attribute
71
+ TYPE = 1
72
+ NAME = :"rx_buf_len"
73
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::UINT, check: nil)
74
+ end
70
75
  # :nodoc:
71
- BY_NAME = Ractor.make_shareable({}) #: Hash[::Symbol, Attribute]
76
+ BY_NAME = Ractor.make_shareable({:"rx_buf_len" => RxBufLen}) #: Hash[::Symbol, Attribute]
72
77
  # :nodoc:
73
- BY_TYPE = Ractor.make_shareable({}) #: Hash[::Integer, Attribute]
78
+ BY_TYPE = Ractor.make_shareable({1 => RxBufLen}) #: Hash[::Integer, Attribute]
74
79
  class << self
75
80
  # Looks up Attribute class by name.
76
81
  #--
@@ -376,10 +381,14 @@ class Netdev < ::Nl::Family
376
381
  TYPE = 7
377
382
  NAME = :"xsk"
378
383
  end
384
+ class Lease < Attribute
385
+ TYPE = 8
386
+ NAME = :"lease"
387
+ end
379
388
  # :nodoc:
380
- BY_NAME = Ractor.make_shareable({:"id" => Id, :"ifindex" => Ifindex, :"type" => Type, :"napi_id" => NapiId, :"dmabuf" => Dmabuf, :"io_uring" => IoUring, :"xsk" => Xsk}) #: Hash[::Symbol, Attribute]
389
+ BY_NAME = Ractor.make_shareable({:"id" => Id, :"ifindex" => Ifindex, :"type" => Type, :"napi_id" => NapiId, :"dmabuf" => Dmabuf, :"io_uring" => IoUring, :"xsk" => Xsk, :"lease" => Lease}) #: Hash[::Symbol, Attribute]
381
390
  # :nodoc:
382
- BY_TYPE = Ractor.make_shareable({1 => Id, 2 => Ifindex, 3 => Type, 4 => NapiId, 5 => Dmabuf, 6 => IoUring, 7 => Xsk}) #: Hash[::Integer, Attribute]
391
+ BY_TYPE = Ractor.make_shareable({1 => Id, 2 => Ifindex, 3 => Type, 4 => NapiId, 5 => Dmabuf, 6 => IoUring, 7 => Xsk, 8 => Lease}) #: Hash[::Integer, Attribute]
383
392
  class << self
384
393
  # Looks up Attribute class by name.
385
394
  #--
@@ -611,6 +620,41 @@ class Netdev < ::Nl::Family
611
620
  def by_type(type); BY_TYPE.fetch(type); end
612
621
  end
613
622
  end
623
+ class Lease < ::Nl::Protocols::Genl::AttributeSet
624
+ # Abstract class
625
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
626
+ end
627
+ class Ifindex < Attribute
628
+ TYPE = 1
629
+ NAME = :"ifindex"
630
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
631
+ end
632
+ class Queue < Attribute
633
+ TYPE = 2
634
+ NAME = :"queue"
635
+ end
636
+ class NetnsId < Attribute
637
+ TYPE = 3
638
+ NAME = :"netns_id"
639
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 0" unless it >= 0 })
640
+ end
641
+ # :nodoc:
642
+ BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"queue" => Queue, :"netns_id" => NetnsId}) #: Hash[::Symbol, Attribute]
643
+ # :nodoc:
644
+ BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Queue, 3 => NetnsId}) #: Hash[::Integer, Attribute]
645
+ class << self
646
+ # Looks up Attribute class by name.
647
+ #--
648
+ # @rbs name: Symbol
649
+ # @rbs return: Attribute
650
+ def by_name(name); BY_NAME.fetch(name); end
651
+ # Looks up Attribute class by type value.
652
+ #--
653
+ # @rbs type: Integer
654
+ # @rbs return: Attribute
655
+ def by_type(type); BY_TYPE.fetch(type); end
656
+ end
657
+ end
614
658
  class Dmabuf < ::Nl::Protocols::Genl::AttributeSet
615
659
  # Abstract class
616
660
  class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
@@ -655,6 +699,8 @@ class Netdev < ::Nl::Family
655
699
  PagePoolStats::Info::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(PagePoolInfo)
656
700
  Queue::IoUring::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(IoUringProviderInfo)
657
701
  Queue::Xsk::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(XskInfo)
702
+ Queue::Lease::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Lease)
703
+ Lease::Queue::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(QueueId)
658
704
  Dmabuf::Queues::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(QueueId)
659
705
  end
660
706
  module Messages
@@ -783,6 +829,20 @@ class Netdev < ::Nl::Family
783
829
  # Only Page Pools associated by the driver with a net_device
784
830
  # can be listed. ifindex will not be reported if the net_device
785
831
  # no longer exists.
832
+ class DumpPagePoolGetRequest < ::Nl::Protocols::Genl::Message
833
+ TYPE = 5
834
+ FIXED_HEADER = nil
835
+ ATTRIBUTE_SET = AttributeSets::PagePool
836
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex])
837
+ # Gets the value of `ifindex` attribute in the message.
838
+ #--
839
+ # @rbs return: ::Integer
840
+ def ifindex; attributes[:"ifindex"]&.value; end
841
+ end
842
+ # Get / dump information about Page Pools.
843
+ # Only Page Pools associated by the driver with a net_device
844
+ # can be listed. ifindex will not be reported if the net_device
845
+ # no longer exists.
786
846
  class DumpPagePoolGetReply < ::Nl::Protocols::Genl::Message
787
847
  TYPE = 5
788
848
  FIXED_HEADER = nil
@@ -888,6 +948,17 @@ class Netdev < ::Nl::Family
888
948
  def recycle_released_refcnt; attributes[:"recycle_released_refcnt"]&.value; end
889
949
  end
890
950
  # Get page pool statistics.
951
+ class DumpPagePoolStatsGetRequest < ::Nl::Protocols::Genl::Message
952
+ TYPE = 9
953
+ FIXED_HEADER = nil
954
+ ATTRIBUTE_SET = AttributeSets::PagePoolStats
955
+ ATTRIBUTES = Ractor.make_shareable(%i[info])
956
+ # Gets the value of `info` attribute in the message.
957
+ #--
958
+ # @rbs return: AttributeSets::PagePoolInfo
959
+ def info; attributes[:"info"]&.value; end
960
+ end
961
+ # Get page pool statistics.
891
962
  class DumpPagePoolStatsGetReply < ::Nl::Protocols::Genl::Message
892
963
  TYPE = 9
893
964
  FIXED_HEADER = nil
@@ -966,7 +1037,7 @@ class Netdev < ::Nl::Family
966
1037
  TYPE = 10
967
1038
  FIXED_HEADER = nil
968
1039
  ATTRIBUTE_SET = AttributeSets::Queue
969
- ATTRIBUTES = Ractor.make_shareable(%i[id ifindex type napi_id dmabuf io_uring xsk])
1040
+ ATTRIBUTES = Ractor.make_shareable(%i[id ifindex type napi_id dmabuf io_uring xsk lease])
970
1041
  # Gets the value of `id` attribute in the message.
971
1042
  #--
972
1043
  # @rbs return: ::Integer
@@ -995,6 +1066,10 @@ class Netdev < ::Nl::Family
995
1066
  #--
996
1067
  # @rbs return: AttributeSets::XskInfo
997
1068
  def xsk; attributes[:"xsk"]&.value; end
1069
+ # Gets the value of `lease` attribute in the message.
1070
+ #--
1071
+ # @rbs return: AttributeSets::Lease
1072
+ def lease; attributes[:"lease"]&.value; end
998
1073
  end
999
1074
  # Get queue information from the kernel. Only configured queues will be reported (as opposed to all available hardware queues).
1000
1075
  class DumpQueueGetRequest < ::Nl::Protocols::Genl::Message
@@ -1012,7 +1087,7 @@ class Netdev < ::Nl::Family
1012
1087
  TYPE = 10
1013
1088
  FIXED_HEADER = nil
1014
1089
  ATTRIBUTE_SET = AttributeSets::Queue
1015
- ATTRIBUTES = Ractor.make_shareable(%i[id ifindex type napi_id dmabuf io_uring xsk])
1090
+ ATTRIBUTES = Ractor.make_shareable(%i[id ifindex type napi_id dmabuf io_uring xsk lease])
1016
1091
  # Gets the value of `id` attribute in the message.
1017
1092
  #--
1018
1093
  # @rbs return: ::Integer
@@ -1041,6 +1116,10 @@ class Netdev < ::Nl::Family
1041
1116
  #--
1042
1117
  # @rbs return: AttributeSets::XskInfo
1043
1118
  def xsk; attributes[:"xsk"]&.value; end
1119
+ # Gets the value of `lease` attribute in the message.
1120
+ #--
1121
+ # @rbs return: AttributeSets::Lease
1122
+ def lease; attributes[:"lease"]&.value; end
1044
1123
  end
1045
1124
  # Get information about NAPI instances configured on the system.
1046
1125
  class DoNapiGetRequest < ::Nl::Protocols::Genl::Message
@@ -1371,6 +1450,38 @@ class Netdev < ::Nl::Family
1371
1450
  # @rbs return: ::Integer
1372
1451
  def id; attributes[:"id"]&.value; end
1373
1452
  end
1453
+ # Create a new queue for the given netdevice. Whether this operation
1454
+ # is supported depends on the device and the driver.
1455
+ class DoQueueCreateRequest < ::Nl::Protocols::Genl::Message
1456
+ TYPE = 16
1457
+ FIXED_HEADER = nil
1458
+ ATTRIBUTE_SET = AttributeSets::Queue
1459
+ ATTRIBUTES = Ractor.make_shareable(%i[ifindex type lease])
1460
+ # Gets the value of `ifindex` attribute in the message.
1461
+ #--
1462
+ # @rbs return: ::Integer
1463
+ def ifindex; attributes[:"ifindex"]&.value; end
1464
+ # Gets the value of `type` attribute in the message.
1465
+ #--
1466
+ # @rbs return: ::Integer
1467
+ def type; attributes[:"type"]&.value; end
1468
+ # Gets the value of `lease` attribute in the message.
1469
+ #--
1470
+ # @rbs return: AttributeSets::Lease
1471
+ def lease; attributes[:"lease"]&.value; end
1472
+ end
1473
+ # Create a new queue for the given netdevice. Whether this operation
1474
+ # is supported depends on the device and the driver.
1475
+ class DoQueueCreateReply < ::Nl::Protocols::Genl::Message
1476
+ TYPE = 16
1477
+ FIXED_HEADER = nil
1478
+ ATTRIBUTE_SET = AttributeSets::Queue
1479
+ ATTRIBUTES = Ractor.make_shareable(%i[id])
1480
+ # Gets the value of `id` attribute in the message.
1481
+ #--
1482
+ # @rbs return: ::Integer
1483
+ def id; attributes[:"id"]&.value; end
1484
+ end
1374
1485
  end
1375
1486
  # Get / dump information about a netdev.
1376
1487
  #--
@@ -1387,12 +1498,29 @@ class Netdev < ::Nl::Family
1387
1498
  def do_page_pool_get(**args)
1388
1499
  exchange_message(:"do", Messages::DoPagePoolGetRequest, Messages::DoPagePoolGetReply, args)
1389
1500
  end
1501
+ # Get / dump information about Page Pools.
1502
+ # Only Page Pools associated by the driver with a net_device
1503
+ # can be listed. ifindex will not be reported if the net_device
1504
+ # no longer exists.
1505
+ #--
1506
+ # @rbs (?ifindex: ::Integer) -> Enumerable[Messages::DumpPagePoolGetReply]
1507
+ # | (?ifindex: ::Integer) { (Messages::DumpPagePoolGetReply) -> void } -> void
1508
+ def dump_page_pool_get(**args, &block)
1509
+ exchange_message(:"dump", Messages::DumpPagePoolGetRequest, Messages::DumpPagePoolGetReply, args, &block)
1510
+ end
1390
1511
  # Get page pool statistics.
1391
1512
  #--
1392
1513
  # @rbs (?info: AttributeSets::PagePoolInfo) -> Messages::DoPagePoolStatsGetReply
1393
1514
  def do_page_pool_stats_get(**args)
1394
1515
  exchange_message(:"do", Messages::DoPagePoolStatsGetRequest, Messages::DoPagePoolStatsGetReply, args)
1395
1516
  end
1517
+ # Get page pool statistics.
1518
+ #--
1519
+ # @rbs (?info: AttributeSets::PagePoolInfo) -> Enumerable[Messages::DumpPagePoolStatsGetReply]
1520
+ # | (?info: AttributeSets::PagePoolInfo) { (Messages::DumpPagePoolStatsGetReply) -> void } -> void
1521
+ def dump_page_pool_stats_get(**args, &block)
1522
+ exchange_message(:"dump", Messages::DumpPagePoolStatsGetRequest, Messages::DumpPagePoolStatsGetReply, args, &block)
1523
+ end
1396
1524
  # Get queue information from the kernel. Only configured queues will be reported (as opposed to all available hardware queues).
1397
1525
  #--
1398
1526
  # @rbs (?id: ::Integer, ?ifindex: ::Integer, ?type: ::Integer) -> Messages::DoQueueGetReply
@@ -1446,5 +1574,12 @@ class Netdev < ::Nl::Family
1446
1574
  def do_bind_tx(**args)
1447
1575
  exchange_message(:"do", Messages::DoBindTxRequest, Messages::DoBindTxReply, args)
1448
1576
  end
1577
+ # Create a new queue for the given netdevice. Whether this operation
1578
+ # is supported depends on the device and the driver.
1579
+ #--
1580
+ # @rbs (?ifindex: ::Integer, ?type: ::Integer, ?lease: AttributeSets::Lease) -> Messages::DoQueueCreateReply
1581
+ def do_queue_create(**args)
1582
+ exchange_message(:"do", Messages::DoQueueCreateRequest, Messages::DoQueueCreateReply, args)
1583
+ end
1449
1584
  end
1450
1585
  end; end