nl-linux 0.2.0 → 0.2.2

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Rakefile +31 -5
  4. data/generated/nl/linux/binder.rb +96 -0
  5. data/generated/nl/linux/conntrack.rb +1227 -0
  6. data/generated/nl/linux/dev_energymodel.rb +235 -0
  7. data/generated/nl/linux/devlink.rb +5177 -0
  8. data/generated/nl/linux/dpll.rb +944 -0
  9. data/generated/nl/linux/ethtool.rb +7121 -0
  10. data/generated/nl/linux/fou.rb +332 -0
  11. data/generated/nl/linux/handshake.rb +238 -0
  12. data/generated/nl/linux/lockd.rb +99 -0
  13. data/generated/nl/linux/mptcp_pm.rb +607 -0
  14. data/generated/nl/linux/net_shaper.rb +731 -0
  15. data/generated/nl/linux/netdev.rb +1450 -0
  16. data/generated/nl/linux/nfsd.rb +500 -0
  17. data/generated/nl/linux/nftables.rb +2924 -0
  18. data/generated/nl/linux/nl80211.rb +3393 -0
  19. data/generated/nl/linux/nlctrl.rb +397 -0
  20. data/generated/nl/linux/ovpn.rb +964 -0
  21. data/generated/nl/linux/ovs_datapath.rb +321 -0
  22. data/generated/nl/linux/ovs_flow.rb +1447 -0
  23. data/generated/nl/linux/ovs_vport.rb +391 -0
  24. data/generated/nl/linux/psp.rb +463 -0
  25. data/generated/nl/linux/rt_addr.rb +448 -0
  26. data/generated/nl/linux/rt_link.rb +4613 -0
  27. data/generated/nl/linux/rt_neigh.rb +897 -0
  28. data/generated/nl/linux/rt_route.rb +1126 -0
  29. data/generated/nl/linux/rt_rule.rb +708 -0
  30. data/generated/nl/linux/tc.rb +7066 -0
  31. data/generated/nl/linux/tcp_metrics.rb +317 -0
  32. data/generated/nl/linux/team.rb +339 -0
  33. data/generated/nl/linux/wireguard.rb +430 -0
  34. data/generated/nl/linux.rb +35 -0
  35. data/lib/nl/linux/version.rb +1 -1
  36. data/lib/nl-linux.rb +1 -1
  37. metadata +37 -7
  38. data/lib/nl/linux.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df579603e97b80f797b8ea8d1b38199873c07debdd82422c9352a9c176e7e5ca
4
- data.tar.gz: 5417475edcb03943768e6533dd938439ef0e85bc2d120878cec35a3b89901fb2
3
+ metadata.gz: 284ea375be70db2139625cb4082e1fd210a73d8cc6881fc6e9034a6209b1b976
4
+ data.tar.gz: e9ce0e063afdfff003858e9fc2666a0b1fd0dff7b0e60911f9cb2b049dcbb858
5
5
  SHA512:
6
- metadata.gz: 963857b6b18959f58537fa27645555e71b74d597df7d5d7684fc4fee1588232ee25d4ad58b93d28aeeb86c2a82defa4afdc828023b4f98254ec3d260b033771d
7
- data.tar.gz: bfa923cfe0a5e767366a297d57e5129f97ef94a04729e1d665e76878e2a540b7aed7259e27983125aad69c7f2c0347d23eccf0183c3101ab5e2514f9da2cea8b
6
+ metadata.gz: 360ff89e86f3abeb0a8809466203cf4223ca13458adcb5aafc6a52ef47ddf04a43f74ec3417546a5e0f35cb055a9e0ff13faaf7ddea42c26834b134811a46427
7
+ data.tar.gz: 8412f62adba758c60aca182f4efb0e29712786dc84ba7d677efd3a2fee8cbf08d513f5e06f5352ae3042563d34fa1e5e0ca44825c641c3de8609722f5ff2e2f7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v0.2.2 (2026-03-02)
6
+
7
+ ## v0.2.1 (2026-03-02)
8
+
5
9
  ## v0.2.0 (2026-03-02)
6
10
 
7
11
  - Initial release
data/Rakefile CHANGED
@@ -8,11 +8,17 @@ directory 'generated'
8
8
  directory 'generated/nl' => 'generated'
9
9
  directory 'generated/nl/linux' => 'generated/nl'
10
10
 
11
- # For each of linux/%.yaml spec, generate generated/nl/linux/%.rb
12
- Dir['*.yaml', base: 'linux'].each do |spec|
13
- target = 'generated/nl/linux/' + spec.gsub(?-, ?_).sub(%r[\.yaml\z], '.rb')
14
- source = 'linux/' + spec
11
+ specs = Dir['*.yaml', base: 'linux'].to_h do |spec|
12
+ [
13
+ spec,
14
+ source: 'linux/' + spec,
15
+ target: 'generated/nl/linux/' + spec.gsub(?-, ?_).sub(%r[\.yaml\z], '.rb'),
16
+ ]
17
+ end
15
18
 
19
+ # For each of linux/%.yaml spec, generate generated/nl/linux/%.rb
20
+ specs.each do |spec, h|
21
+ h => {source:, target:}
16
22
  task :generate => target
17
23
  task target => [source, 'generated/nl/linux'] do
18
24
  require 'ynl'
@@ -22,10 +28,30 @@ Dir['*.yaml', base: 'linux'].each do |spec|
22
28
  File.open(target, 'w') do |out|
23
29
  out << front
24
30
  out << "#--\n"
25
- Ynl::Family.generate(src.tap(&:rewind), out, namespace: 'Nl::Linux')
31
+ out << Ynl::Generator::PRELUDE
32
+ out << "module Nl; module Linux\n"
33
+ Ynl::Family.generate(src.tap(&:rewind), out)
34
+ out << "end; end\n"
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ task 'generated/nl/linux.rb' => specs.values.map { it[:target] } do |t|
41
+ File.open(t.name, 'w') do |out|
42
+ out << "require 'nl/linux/version'\n"
43
+ out << "module Nl\n"
44
+ out << " module Linux\n"
45
+ specs.values.map { it[:target] }.each do |f|
46
+ cls = File.read(f)[/^class\s\K[^\s]+/]
47
+ if cls
48
+ out << " autoload :#{cls}, #{f.sub('generated/', '').dump}\n"
26
49
  end
27
50
  end
51
+ out << " end\n"
52
+ out << "end\n"
28
53
  end
29
54
  end
55
+ task :generate => 'generated/nl/linux.rb'
30
56
 
31
57
  task :default => :generate
@@ -0,0 +1,96 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ #--
6
+ # frozen_string_literal: true
7
+ # rbs_inline: enabled
8
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
9
+ require 'nl'
10
+ module Nl; module Linux
11
+ # Binder interface over generic netlink
12
+ class Binder < ::Nl::Family
13
+ NAME = "binder"
14
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("binder"))
15
+ module Structs
16
+ end
17
+ module AttributeSets
18
+ # Attributes included within a transaction failure report. The elements
19
+ # correspond directly with the specific transaction that failed, along
20
+ # with the error returned to the sender e.g. BR_DEAD_REPLY.
21
+ class Report < ::Nl::Protocols::Genl::AttributeSet
22
+ # Abstract class
23
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
24
+ end
25
+ class Error < Attribute
26
+ TYPE = 1
27
+ NAME = :"error"
28
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
29
+ end
30
+ class Context < Attribute
31
+ TYPE = 2
32
+ NAME = :"context"
33
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
34
+ end
35
+ class FromPid < Attribute
36
+ TYPE = 3
37
+ NAME = :"from_pid"
38
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
39
+ end
40
+ class FromTid < Attribute
41
+ TYPE = 4
42
+ NAME = :"from_tid"
43
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
44
+ end
45
+ class ToPid < Attribute
46
+ TYPE = 5
47
+ NAME = :"to_pid"
48
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
49
+ end
50
+ class ToTid < Attribute
51
+ TYPE = 6
52
+ NAME = :"to_tid"
53
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
54
+ end
55
+ class IsReply < Attribute
56
+ TYPE = 7
57
+ NAME = :"is_reply"
58
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
59
+ end
60
+ class Flags < Attribute
61
+ TYPE = 8
62
+ NAME = :"flags"
63
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
64
+ end
65
+ class Code < Attribute
66
+ TYPE = 9
67
+ NAME = :"code"
68
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
69
+ end
70
+ class DataSize < Attribute
71
+ TYPE = 10
72
+ NAME = :"data_size"
73
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
74
+ end
75
+ # :nodoc:
76
+ BY_NAME = Ractor.make_shareable({:"error" => Error, :"context" => Context, :"from_pid" => FromPid, :"from_tid" => FromTid, :"to_pid" => ToPid, :"to_tid" => ToTid, :"is_reply" => IsReply, :"flags" => Flags, :"code" => Code, :"data_size" => DataSize}) #: Hash[::Symbol, Attribute]
77
+ # :nodoc:
78
+ BY_TYPE = Ractor.make_shareable({1 => Error, 2 => Context, 3 => FromPid, 4 => FromTid, 5 => ToPid, 6 => ToTid, 7 => IsReply, 8 => Flags, 9 => Code, 10 => DataSize}) #: Hash[::Integer, Attribute]
79
+ class << self
80
+ # Looks up Attribute class by name.
81
+ #--
82
+ # @rbs name: Symbol
83
+ # @rbs return: Attribute
84
+ def by_name(name); BY_NAME.fetch(name); end
85
+ # Looks up Attribute class by type value.
86
+ #--
87
+ # @rbs type: Integer
88
+ # @rbs return: Attribute
89
+ def by_type(type); BY_TYPE.fetch(type); end
90
+ end
91
+ end
92
+ end
93
+ module Messages
94
+ end
95
+ end
96
+ end; end