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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bea36721f23b526f593ceee10b7fbe2c420e511a3574e49134982af1d354ee2
4
- data.tar.gz: 07b51dcce909e7df313cd4bbef6eeaa8d1bbae82ed36258d75dc0f4bbd9f845d
3
+ metadata.gz: bed490a59c8ebdc1b573ff996f21f9ae4acaa976c62de168cd7de56f9f511988
4
+ data.tar.gz: 8b03bb15adf2e682ec3735fcd2d8a6f23a9c4bb45d4203bb2d66410db2cdd11d
5
5
  SHA512:
6
- metadata.gz: a3155f82614682291afe91ebe8d59858888fd25c7a12ce45d19b323a06463f78e301194303a4b378ca80b17d4c9f22fbc4a9388823b9066470afb8bc101c150a
7
- data.tar.gz: aef40e37d4591c13f65cdb02ab7bb9963dda593be5a726981bd267b48170e312257d1e2ab02a1806089cf77ec6b522840ee77caff660e44b2b10d3b77e5f2a53
6
+ metadata.gz: a60acb7de13c1b9bc3e56a0f3da1433e7747a9071e67df099dd7375d5a0d030bb8b5099ea250f2e7e9263039828a28fc42270ec867b1c3df0d18969e57ac81bd
7
+ data.tar.gz: bf8ed664a1561663de0321703e9a89251ef794f360415d17762f5cb9d1357b48e757f23be782038b0922389e16b8bd69453c795c2ef2c786ee6d10b7ca4b214e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v0.3.0 (2026-09-01)
6
+
5
7
  ## v0.2.4 (2026-08-22)
6
8
 
7
9
  - Update kernel YNL specification from Linux 7.2.
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
1
  require 'rspec/core/rake_task'
2
2
 
3
+ NLSPEC_PATH = 'Documentation/netlink/specs'
4
+ NLSPEC_VERSION = File.read('NLSPEC_VERSION').chomp
5
+
3
6
  RSpec::Core::RakeTask.new(:spec)
4
7
 
5
8
  task default: :spec
@@ -20,13 +23,20 @@ end
20
23
  specs.each do |spec, h|
21
24
  h => {source:, target:}
22
25
  task :generate => target
23
- task target => [source, 'generated/nl/linux'] do
26
+ task target => [source, 'generated/nl/linux', 'NLSPEC_VERSION', 'Rakefile'] do
24
27
  require 'ynl'
25
28
  File.open(source, 'r') do |src|
26
- front = src.readlines.take_while {|l| !l.start_with?('---') }.grep(/\A\#/).join
29
+ comments = src.readlines.take_while {|l| !l.start_with?('---') }.grep(/\A\#/)
27
30
 
28
31
  File.open(target, 'w') do |out|
29
- out << front
32
+ out << comments.shift
33
+ out << "#\n"
34
+ out << "# This file is based on #{NLSPEC_PATH}/#{spec} from Linux v#{NLSPEC_VERSION}.\n"
35
+ unless comments.empty?
36
+ out << "#\n"
37
+ out << "# Original YNL comment:\n"
38
+ out << comments.join
39
+ end
30
40
  out << "#--\n"
31
41
  out << Ynl::Generator::PRELUDE
32
42
  out << "module Nl; module Linux\n"
@@ -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/binder.yaml from Linux v7.2.
4
+ #
5
+ # Original YNL comment:
6
+ #
3
7
  # Copyright 2025 Google LLC
4
8
  #
5
9
  #--
@@ -12,6 +16,7 @@ module Nl; module Linux
12
16
  class Binder < ::Nl::Family
13
17
  NAME = "binder"
14
18
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("binder"))
19
+ MCAST_GROUPS = Ractor.make_shareable({:"report" => ::Nl::McastGroup.new("report", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
15
20
  module Structs
16
21
  end
17
22
  module AttributeSets
@@ -92,5 +97,80 @@ class Binder < ::Nl::Family
92
97
  end
93
98
  module Messages
94
99
  end
100
+ module Notifications
101
+ # A multicast event sent to userspace subscribers to notify them about
102
+ # binder transaction failures. The generated report provides the full
103
+ # details of the specific transaction that failed. The intention is for
104
+ # programs to monitor these events and react to the failures as needed.
105
+ #
106
+ #
107
+ # Multicast group: `report`.
108
+ class Report < ::Nl::Protocols::Genl::Message
109
+ TYPE = 1
110
+ FIXED_HEADER = nil
111
+ ATTRIBUTE_SET = AttributeSets::Report
112
+ ATTRIBUTES = Ractor.make_shareable(%i[error context from_pid from_tid to_pid to_tid is_reply flags code data_size])
113
+ # Gets the value of `error` attribute in the message.
114
+ #--
115
+ # @rbs return: ::Integer
116
+ def error; attributes[:"error"]&.value; end
117
+ # Gets the value of `context` attribute in the message.
118
+ #--
119
+ # @rbs return: ::String
120
+ def context; attributes[:"context"]&.value; end
121
+ # Gets the value of `from-pid` attribute in the message.
122
+ #--
123
+ # @rbs return: ::Integer
124
+ def from_pid; attributes[:"from_pid"]&.value; end
125
+ # Gets the value of `from-tid` attribute in the message.
126
+ #--
127
+ # @rbs return: ::Integer
128
+ def from_tid; attributes[:"from_tid"]&.value; end
129
+ # Gets the value of `to-pid` attribute in the message.
130
+ #--
131
+ # @rbs return: ::Integer
132
+ def to_pid; attributes[:"to_pid"]&.value; end
133
+ # Gets the value of `to-tid` attribute in the message.
134
+ #--
135
+ # @rbs return: ::Integer
136
+ def to_tid; attributes[:"to_tid"]&.value; end
137
+ # Gets the value of `is-reply` attribute in the message.
138
+ #--
139
+ # @rbs return: ::Integer
140
+ def is_reply; attributes[:"is_reply"]&.value; end
141
+ # Gets the value of `flags` attribute in the message.
142
+ #--
143
+ # @rbs return: ::Integer
144
+ def flags; attributes[:"flags"]&.value; end
145
+ # Gets the value of `code` attribute in the message.
146
+ #--
147
+ # @rbs return: ::Integer
148
+ def code; attributes[:"code"]&.value; end
149
+ # Gets the value of `data-size` attribute in the message.
150
+ #--
151
+ # @rbs return: ::Integer
152
+ def data_size; attributes[:"data_size"]&.value; end
153
+ end
154
+ end
155
+ NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::Report}) #: Hash[::Integer, ::Class]
156
+ class AsyncOperations
157
+ # :nodoc:
158
+ def initialize(&exchange)
159
+ @exchange = exchange
160
+ end
161
+ end
162
+ # Returns the asynchronous operation facade for this family.
163
+ #--
164
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
165
+ def async(stream_capacity: nil)
166
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
167
+ build_async_facade(AsyncOperations, stream_capacity:)
168
+ end
169
+ #--
170
+ # @rbs (*(:report) groups) -> self
171
+ def subscribe(*groups) = super
172
+ #--
173
+ # @rbs (*(:report) groups) -> self
174
+ def unsubscribe(*groups) = super
95
175
  end
96
176
  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/conntrack.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 Conntrack < ::Nl::Family
10
12
  NAME = "conntrack"
11
13
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("conntrack", 12))
14
+ MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
12
15
  module Structs
13
16
  Nfgenmsg = Struct.new(
14
17
  :"nfgen_family", #: ::Integer
@@ -983,7 +986,7 @@ class Conntrack < ::Nl::Family
983
986
  def secctx; attributes[:"secctx"]&.value; end
984
987
  # Gets the value of `labels` attribute in the message.
985
988
  #--
986
- # @rbs return: untyped
989
+ # @rbs return: ::String
987
990
  def labels; attributes[:"labels"]&.value; end
988
991
  # Gets the value of `synproxy` attribute in the message.
989
992
  #--
@@ -1117,7 +1120,7 @@ class Conntrack < ::Nl::Family
1117
1120
  def secctx; attributes[:"secctx"]&.value; end
1118
1121
  # Gets the value of `labels` attribute in the message.
1119
1122
  #--
1120
- # @rbs return: untyped
1123
+ # @rbs return: ::String
1121
1124
  def labels; attributes[:"labels"]&.value; end
1122
1125
  # Gets the value of `synproxy` attribute in the message.
1123
1126
  #--
@@ -1203,6 +1206,9 @@ class Conntrack < ::Nl::Family
1203
1206
  def chain_toolong; attributes[:"chain_toolong"]&.value; end
1204
1207
  end
1205
1208
  end
1209
+ module Notifications
1210
+ end
1211
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
1206
1212
  # get / dump entries
1207
1213
  #--
1208
1214
  # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: AttributeSets::TupleAttrs, ?tuple_reply: AttributeSets::TupleAttrs, ?zone: ::Integer) -> Messages::DoGetReply
@@ -1223,5 +1229,36 @@ class Conntrack < ::Nl::Family
1223
1229
  def dump_get_stats(**args, &block)
1224
1230
  exchange_message(:"dump", Messages::DumpGetStatsRequest, Messages::DumpGetStatsReply, args, &block)
1225
1231
  end
1232
+ class AsyncOperations
1233
+ # :nodoc:
1234
+ def initialize(&exchange)
1235
+ @exchange = exchange
1236
+ end
1237
+ # get / dump entries
1238
+ #--
1239
+ # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: AttributeSets::TupleAttrs, ?tuple_reply: AttributeSets::TupleAttrs, ?zone: ::Integer) -> ::Nl::Async::Future[Messages::DoGetReply]
1240
+ def do_get(**args)
1241
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
1242
+ end
1243
+ # get / dump entries
1244
+ #--
1245
+ # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?filter: AttributeSets::TupleAttrs) -> ::Nl::Async::Stream[Messages::DumpGetReply]
1246
+ def dump_get(**args)
1247
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
1248
+ end
1249
+ # dump pcpu conntrack stats
1250
+ #--
1251
+ # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetStatsReply]
1252
+ def dump_get_stats(**args)
1253
+ @exchange.call(:"dump", Messages::DumpGetStatsRequest, Messages::DumpGetStatsReply, args)
1254
+ end
1255
+ end
1256
+ # Returns the asynchronous operation facade for this family.
1257
+ #--
1258
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1259
+ def async(stream_capacity: nil)
1260
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
1261
+ build_async_facade(AsyncOperations, stream_capacity:)
1262
+ end
1226
1263
  end
1227
1264
  end; end
@@ -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/dev-energymodel.yaml from Linux v7.2.
4
+ #
5
+ # Original YNL comment:
6
+ #
3
7
  # Copyright (c) 2025 Valve Corporation.
4
8
  #
5
9
  #--
@@ -12,6 +16,7 @@ module Nl; module Linux
12
16
  class DevEnergymodel < ::Nl::Family
13
17
  NAME = "dev-energymodel"
14
18
  PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("dev-energymodel"))
19
+ MCAST_GROUPS = Ractor.make_shareable({:"event" => ::Nl::McastGroup.new("event", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
15
20
  module Structs
16
21
  end
17
22
  module AttributeSets
@@ -174,6 +179,13 @@ class DevEnergymodel < ::Nl::Family
174
179
  def cpus; attributes[:"cpus"]&.value; end
175
180
  end
176
181
  # Get the list of information for all performance domains.
182
+ class DumpGetPerfDomainsRequest < ::Nl::Protocols::Genl::Message
183
+ TYPE = 1
184
+ FIXED_HEADER = nil
185
+ ATTRIBUTE_SET = AttributeSets::PerfDomain
186
+ ATTRIBUTES = Ractor.make_shareable(%i[])
187
+ end
188
+ # Get the list of information for all performance domains.
177
189
  class DumpGetPerfDomainsReply < ::Nl::Protocols::Genl::Message
178
190
  TYPE = 1
179
191
  FIXED_HEADER = nil
@@ -219,17 +231,111 @@ class DevEnergymodel < ::Nl::Family
219
231
  def perf_state; attributes[:"perf_state"]&.value; end
220
232
  end
221
233
  end
234
+ module Notifications
235
+ # A performance domain is created.
236
+ #
237
+ # Multicast group: `event`.
238
+ class PerfDomainCreated < ::Nl::Protocols::Genl::Message
239
+ TYPE = 3
240
+ FIXED_HEADER = nil
241
+ ATTRIBUTE_SET = AttributeSets::PerfTable
242
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id perf_state])
243
+ # Gets the value of `perf-domain-id` attribute in the message.
244
+ #--
245
+ # @rbs return: ::Integer
246
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
247
+ # Gets the value of `perf-state` attribute in the message.
248
+ #--
249
+ # @rbs return: AttributeSets::PerfState
250
+ def perf_state; attributes[:"perf_state"]&.value; end
251
+ end
252
+ # A performance domain is updated.
253
+ #
254
+ # Multicast group: `event`.
255
+ class PerfDomainUpdated < ::Nl::Protocols::Genl::Message
256
+ TYPE = 4
257
+ FIXED_HEADER = nil
258
+ ATTRIBUTE_SET = AttributeSets::PerfTable
259
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id perf_state])
260
+ # Gets the value of `perf-domain-id` attribute in the message.
261
+ #--
262
+ # @rbs return: ::Integer
263
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
264
+ # Gets the value of `perf-state` attribute in the message.
265
+ #--
266
+ # @rbs return: AttributeSets::PerfState
267
+ def perf_state; attributes[:"perf_state"]&.value; end
268
+ end
269
+ # A performance domain is deleted.
270
+ #
271
+ # Multicast group: `event`.
272
+ class PerfDomainDeleted < ::Nl::Protocols::Genl::Message
273
+ TYPE = 5
274
+ FIXED_HEADER = nil
275
+ ATTRIBUTE_SET = AttributeSets::PerfTable
276
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id])
277
+ # Gets the value of `perf-domain-id` attribute in the message.
278
+ #--
279
+ # @rbs return: ::Integer
280
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
281
+ end
282
+ end
283
+ NOTIFICATIONS = Ractor.make_shareable({3 => Notifications::PerfDomainCreated, 4 => Notifications::PerfDomainUpdated, 5 => Notifications::PerfDomainDeleted}) #: Hash[::Integer, ::Class]
222
284
  # Get the list of information for all performance domains.
223
285
  #--
224
286
  # @rbs (?perf_domain_id: ::Integer) -> Messages::DoGetPerfDomainsReply
225
287
  def do_get_perf_domains(**args)
226
288
  exchange_message(:"do", Messages::DoGetPerfDomainsRequest, Messages::DoGetPerfDomainsReply, args)
227
289
  end
290
+ # Get the list of information for all performance domains.
291
+ #--
292
+ # @rbs () -> Enumerable[Messages::DumpGetPerfDomainsReply]
293
+ # | () { (Messages::DumpGetPerfDomainsReply) -> void } -> void
294
+ def dump_get_perf_domains(**args, &block)
295
+ exchange_message(:"dump", Messages::DumpGetPerfDomainsRequest, Messages::DumpGetPerfDomainsReply, args, &block)
296
+ end
228
297
  # Get the energy model table of a performance domain.
229
298
  #--
230
299
  # @rbs (?perf_domain_id: ::Integer) -> Messages::DoGetPerfTableReply
231
300
  def do_get_perf_table(**args)
232
301
  exchange_message(:"do", Messages::DoGetPerfTableRequest, Messages::DoGetPerfTableReply, args)
233
302
  end
303
+ class AsyncOperations
304
+ # :nodoc:
305
+ def initialize(&exchange)
306
+ @exchange = exchange
307
+ end
308
+ # Get the list of information for all performance domains.
309
+ #--
310
+ # @rbs (?perf_domain_id: ::Integer) -> ::Nl::Async::Future[Messages::DoGetPerfDomainsReply]
311
+ def do_get_perf_domains(**args)
312
+ @exchange.call(:"do", Messages::DoGetPerfDomainsRequest, Messages::DoGetPerfDomainsReply, args)
313
+ end
314
+ # Get the list of information for all performance domains.
315
+ #--
316
+ # @rbs () -> ::Nl::Async::Stream[Messages::DumpGetPerfDomainsReply]
317
+ def dump_get_perf_domains(**args)
318
+ @exchange.call(:"dump", Messages::DumpGetPerfDomainsRequest, Messages::DumpGetPerfDomainsReply, args)
319
+ end
320
+ # Get the energy model table of a performance domain.
321
+ #--
322
+ # @rbs (?perf_domain_id: ::Integer) -> ::Nl::Async::Future[Messages::DoGetPerfTableReply]
323
+ def do_get_perf_table(**args)
324
+ @exchange.call(:"do", Messages::DoGetPerfTableRequest, Messages::DoGetPerfTableReply, args)
325
+ end
326
+ end
327
+ # Returns the asynchronous operation facade for this family.
328
+ #--
329
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
330
+ def async(stream_capacity: nil)
331
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
332
+ build_async_facade(AsyncOperations, stream_capacity:)
333
+ end
334
+ #--
335
+ # @rbs (*(:event) groups) -> self
336
+ def subscribe(*groups) = super
337
+ #--
338
+ # @rbs (*(:event) groups) -> self
339
+ def unsubscribe(*groups) = super
234
340
  end
235
341
  end; end