nl-linux 0.2.3 → 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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/CHANGELOG.md +8 -0
  4. data/NLSPEC_VERSION +1 -1
  5. data/Rakefile +13 -3
  6. data/generated/nl/linux/binder.rb +80 -0
  7. data/generated/nl/linux/conntrack.rb +39 -2
  8. data/generated/nl/linux/dev_energymodel.rb +106 -0
  9. data/generated/nl/linux/devlink.rb +1478 -200
  10. data/generated/nl/linux/dpll.rb +790 -66
  11. data/generated/nl/linux/drm_ras.rb +309 -0
  12. data/generated/nl/linux/ethtool.rb +1597 -248
  13. data/generated/nl/linux/fou.rb +82 -13
  14. data/generated/nl/linux/handshake.rb +93 -1
  15. data/generated/nl/linux/lockd.rb +50 -0
  16. data/generated/nl/linux/mptcp_pm.rb +159 -0
  17. data/generated/nl/linux/net_shaper.rb +124 -1
  18. data/generated/nl/linux/netdev.rb +515 -6
  19. data/generated/nl/linux/nfsd.rb +878 -10
  20. data/generated/nl/linux/nftables.rb +2134 -179
  21. data/generated/nl/linux/nl80211.rb +81 -22
  22. data/generated/nl/linux/nlctrl.rb +59 -8
  23. data/generated/nl/linux/ovpn.rb +207 -12
  24. data/generated/nl/linux/ovs_datapath.rb +59 -10
  25. data/generated/nl/linux/ovs_flow.rb +63 -20
  26. data/generated/nl/linux/ovs_packet.rb +277 -0
  27. data/generated/nl/linux/ovs_vport.rb +59 -10
  28. data/generated/nl/linux/psp.rb +453 -6
  29. data/generated/nl/linux/rt_addr.rb +69 -14
  30. data/generated/nl/linux/rt_link.rb +452 -112
  31. data/generated/nl/linux/rt_neigh.rb +227 -16
  32. data/generated/nl/linux/rt_route.rb +92 -49
  33. data/generated/nl/linux/rt_rule.rb +300 -11
  34. data/generated/nl/linux/sunrpc_cache.rb +423 -0
  35. data/generated/nl/linux/tc.rb +168 -54
  36. data/generated/nl/linux/tcp_metrics.rb +69 -12
  37. data/generated/nl/linux/team.rb +80 -0
  38. data/generated/nl/linux/wireguard.rb +99 -7
  39. data/generated/nl/linux.rb +3 -0
  40. data/lib/nl/linux/version.rb +1 -1
  41. data/linux/devlink.yaml +92 -2
  42. data/linux/dpll.yaml +94 -5
  43. data/linux/drm_ras.yaml +126 -0
  44. data/linux/ethtool.yaml +21 -4
  45. data/linux/handshake.yaml +9 -0
  46. data/linux/mptcp_pm.yaml +1 -0
  47. data/linux/net_shaper.yaml +13 -6
  48. data/linux/netdev.yaml +61 -2
  49. data/linux/nfsd.yaml +303 -2
  50. data/linux/nftables.yaml +640 -49
  51. data/linux/ovpn.yaml +26 -1
  52. data/linux/ovs_packet.yaml +130 -0
  53. data/linux/psp.yaml +80 -3
  54. data/linux/rt-link.yaml +70 -24
  55. data/linux/sunrpc_cache.yaml +149 -0
  56. data/linux/tc.yaml +3 -0
  57. metadata +17 -9
@@ -0,0 +1,309 @@
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/drm_ras.yaml from Linux v7.2.
4
+ #--
5
+ # frozen_string_literal: true
6
+ # rbs_inline: enabled
7
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
8
+ require 'nl'
9
+ module Nl; module Linux
10
+ # DRM RAS (Reliability, Availability, Serviceability) over Generic Netlink. Provides a standardized mechanism for DRM drivers to register "nodes" representing hardware/software components capable of reporting error counters. Userspace tools can query the list of nodes or individual error counters via the Generic Netlink interface.
11
+ class DrmRas < ::Nl::Family
12
+ NAME = "drm-ras"
13
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("drm-ras"))
14
+ MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
15
+ module Structs
16
+ end
17
+ module AttributeSets
18
+ class NodeAttrs < ::Nl::Protocols::Genl::AttributeSet
19
+ # Abstract class
20
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
21
+ end
22
+ class NodeId < Attribute
23
+ TYPE = 1
24
+ NAME = :"node_id"
25
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
26
+ end
27
+ class DeviceName < Attribute
28
+ TYPE = 2
29
+ NAME = :"device_name"
30
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
31
+ end
32
+ class NodeName < Attribute
33
+ TYPE = 3
34
+ NAME = :"node_name"
35
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
36
+ end
37
+ class NodeType < Attribute
38
+ TYPE = 4
39
+ NAME = :"node_type"
40
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
41
+ end
42
+ # :nodoc:
43
+ BY_NAME = Ractor.make_shareable({:"node_id" => NodeId, :"device_name" => DeviceName, :"node_name" => NodeName, :"node_type" => NodeType}) #: Hash[::Symbol, Attribute]
44
+ # :nodoc:
45
+ BY_TYPE = Ractor.make_shareable({1 => NodeId, 2 => DeviceName, 3 => NodeName, 4 => NodeType}) #: Hash[::Integer, Attribute]
46
+ class << self
47
+ # Looks up Attribute class by name.
48
+ #--
49
+ # @rbs name: Symbol
50
+ # @rbs return: Attribute
51
+ def by_name(name); BY_NAME.fetch(name); end
52
+ # Looks up Attribute class by type value.
53
+ #--
54
+ # @rbs type: Integer
55
+ # @rbs return: Attribute
56
+ def by_type(type); BY_TYPE.fetch(type); end
57
+ end
58
+ end
59
+ class ErrorCounterAttrs < ::Nl::Protocols::Genl::AttributeSet
60
+ # Abstract class
61
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
62
+ end
63
+ class NodeId < Attribute
64
+ TYPE = 1
65
+ NAME = :"node_id"
66
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
67
+ end
68
+ class ErrorId < Attribute
69
+ TYPE = 2
70
+ NAME = :"error_id"
71
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
72
+ end
73
+ class ErrorName < Attribute
74
+ TYPE = 3
75
+ NAME = :"error_name"
76
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
77
+ end
78
+ class ErrorValue < Attribute
79
+ TYPE = 4
80
+ NAME = :"error_value"
81
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
82
+ end
83
+ # :nodoc:
84
+ BY_NAME = Ractor.make_shareable({:"node_id" => NodeId, :"error_id" => ErrorId, :"error_name" => ErrorName, :"error_value" => ErrorValue}) #: Hash[::Symbol, Attribute]
85
+ # :nodoc:
86
+ BY_TYPE = Ractor.make_shareable({1 => NodeId, 2 => ErrorId, 3 => ErrorName, 4 => ErrorValue}) #: Hash[::Integer, Attribute]
87
+ class << self
88
+ # Looks up Attribute class by name.
89
+ #--
90
+ # @rbs name: Symbol
91
+ # @rbs return: Attribute
92
+ def by_name(name); BY_NAME.fetch(name); end
93
+ # Looks up Attribute class by type value.
94
+ #--
95
+ # @rbs type: Integer
96
+ # @rbs return: Attribute
97
+ def by_type(type); BY_TYPE.fetch(type); end
98
+ end
99
+ end
100
+ end
101
+ module Messages
102
+ # Retrieve the full list of currently registered DRM RAS nodes. Each node includes its dynamically assigned ID, name, and type. **Important:** User space must call this operation first to obtain the node IDs. These IDs are required for all subsequent operations on nodes, such as querying error counters.
103
+ #
104
+ # Requires CAP_NET_ADMIN in the initial user namespace.
105
+ class DumpListNodesRequest < ::Nl::Protocols::Genl::Message
106
+ TYPE = 1
107
+ FIXED_HEADER = nil
108
+ ATTRIBUTE_SET = AttributeSets::NodeAttrs
109
+ ATTRIBUTES = Ractor.make_shareable(%i[])
110
+ end
111
+ # Retrieve the full list of currently registered DRM RAS nodes. Each node includes its dynamically assigned ID, name, and type. **Important:** User space must call this operation first to obtain the node IDs. These IDs are required for all subsequent operations on nodes, such as querying error counters.
112
+ #
113
+ # Requires CAP_NET_ADMIN in the initial user namespace.
114
+ class DumpListNodesReply < ::Nl::Protocols::Genl::Message
115
+ TYPE = 1
116
+ FIXED_HEADER = nil
117
+ ATTRIBUTE_SET = AttributeSets::NodeAttrs
118
+ ATTRIBUTES = Ractor.make_shareable(%i[node_id device_name node_name node_type])
119
+ # Gets the value of `node-id` attribute in the message.
120
+ #--
121
+ # @rbs return: ::Integer
122
+ def node_id; attributes[:"node_id"]&.value; end
123
+ # Gets the value of `device-name` attribute in the message.
124
+ #--
125
+ # @rbs return: ::String
126
+ def device_name; attributes[:"device_name"]&.value; end
127
+ # Gets the value of `node-name` attribute in the message.
128
+ #--
129
+ # @rbs return: ::String
130
+ def node_name; attributes[:"node_name"]&.value; end
131
+ # Gets the value of `node-type` attribute in the message.
132
+ #--
133
+ # @rbs return: ::Integer
134
+ def node_type; attributes[:"node_type"]&.value; end
135
+ end
136
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
137
+ #
138
+ # Requires CAP_NET_ADMIN in the initial user namespace.
139
+ class DoGetErrorCounterRequest < ::Nl::Protocols::Genl::Message
140
+ TYPE = 2
141
+ FIXED_HEADER = nil
142
+ ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
143
+ ATTRIBUTES = Ractor.make_shareable(%i[node_id error_id])
144
+ # Gets the value of `node-id` attribute in the message.
145
+ #--
146
+ # @rbs return: ::Integer
147
+ def node_id; attributes[:"node_id"]&.value; end
148
+ # Gets the value of `error-id` attribute in the message.
149
+ #--
150
+ # @rbs return: ::Integer
151
+ def error_id; attributes[:"error_id"]&.value; end
152
+ end
153
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
154
+ #
155
+ # Requires CAP_NET_ADMIN in the initial user namespace.
156
+ class DoGetErrorCounterReply < ::Nl::Protocols::Genl::Message
157
+ TYPE = 2
158
+ FIXED_HEADER = nil
159
+ ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
160
+ ATTRIBUTES = Ractor.make_shareable(%i[error_id error_name error_value])
161
+ # Gets the value of `error-id` attribute in the message.
162
+ #--
163
+ # @rbs return: ::Integer
164
+ def error_id; attributes[:"error_id"]&.value; end
165
+ # Gets the value of `error-name` attribute in the message.
166
+ #--
167
+ # @rbs return: ::String
168
+ def error_name; attributes[:"error_name"]&.value; end
169
+ # Gets the value of `error-value` attribute in the message.
170
+ #--
171
+ # @rbs return: ::Integer
172
+ def error_value; attributes[:"error_value"]&.value; end
173
+ end
174
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
175
+ #
176
+ # Requires CAP_NET_ADMIN in the initial user namespace.
177
+ class DumpGetErrorCounterRequest < ::Nl::Protocols::Genl::Message
178
+ TYPE = 2
179
+ FIXED_HEADER = nil
180
+ ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
181
+ ATTRIBUTES = Ractor.make_shareable(%i[node_id])
182
+ # Gets the value of `node-id` attribute in the message.
183
+ #--
184
+ # @rbs return: ::Integer
185
+ def node_id; attributes[:"node_id"]&.value; end
186
+ end
187
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
188
+ #
189
+ # Requires CAP_NET_ADMIN in the initial user namespace.
190
+ class DumpGetErrorCounterReply < ::Nl::Protocols::Genl::Message
191
+ TYPE = 2
192
+ FIXED_HEADER = nil
193
+ ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
194
+ ATTRIBUTES = Ractor.make_shareable(%i[error_id error_name error_value])
195
+ # Gets the value of `error-id` attribute in the message.
196
+ #--
197
+ # @rbs return: ::Integer
198
+ def error_id; attributes[:"error_id"]&.value; end
199
+ # Gets the value of `error-name` attribute in the message.
200
+ #--
201
+ # @rbs return: ::String
202
+ def error_name; attributes[:"error_name"]&.value; end
203
+ # Gets the value of `error-value` attribute in the message.
204
+ #--
205
+ # @rbs return: ::Integer
206
+ def error_value; attributes[:"error_value"]&.value; end
207
+ end
208
+ # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
209
+ #
210
+ # Requires CAP_NET_ADMIN in the initial user namespace.
211
+ class DoClearErrorCounterRequest < ::Nl::Protocols::Genl::Message
212
+ TYPE = 3
213
+ FIXED_HEADER = nil
214
+ ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
215
+ ATTRIBUTES = Ractor.make_shareable(%i[node_id error_id])
216
+ # Gets the value of `node-id` attribute in the message.
217
+ #--
218
+ # @rbs return: ::Integer
219
+ def node_id; attributes[:"node_id"]&.value; end
220
+ # Gets the value of `error-id` attribute in the message.
221
+ #--
222
+ # @rbs return: ::Integer
223
+ def error_id; attributes[:"error_id"]&.value; end
224
+ end
225
+ end
226
+ module Notifications
227
+ end
228
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
229
+ # Retrieve the full list of currently registered DRM RAS nodes. Each node includes its dynamically assigned ID, name, and type. **Important:** User space must call this operation first to obtain the node IDs. These IDs are required for all subsequent operations on nodes, such as querying error counters.
230
+ #
231
+ # Requires CAP_NET_ADMIN in the initial user namespace.
232
+ #--
233
+ # @rbs () -> Enumerable[Messages::DumpListNodesReply]
234
+ # | () { (Messages::DumpListNodesReply) -> void } -> void
235
+ def dump_list_nodes(**args, &block)
236
+ exchange_message(:"dump", Messages::DumpListNodesRequest, Messages::DumpListNodesReply, args, &block)
237
+ end
238
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
239
+ #
240
+ # Requires CAP_NET_ADMIN in the initial user namespace.
241
+ #--
242
+ # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> Messages::DoGetErrorCounterReply
243
+ def do_get_error_counter(**args)
244
+ exchange_message(:"do", Messages::DoGetErrorCounterRequest, Messages::DoGetErrorCounterReply, args)
245
+ end
246
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
247
+ #
248
+ # Requires CAP_NET_ADMIN in the initial user namespace.
249
+ #--
250
+ # @rbs (?node_id: ::Integer) -> Enumerable[Messages::DumpGetErrorCounterReply]
251
+ # | (?node_id: ::Integer) { (Messages::DumpGetErrorCounterReply) -> void } -> void
252
+ def dump_get_error_counter(**args, &block)
253
+ exchange_message(:"dump", Messages::DumpGetErrorCounterRequest, Messages::DumpGetErrorCounterReply, args, &block)
254
+ end
255
+ # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
256
+ #
257
+ # Requires CAP_NET_ADMIN in the initial user namespace.
258
+ #--
259
+ # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> void
260
+ def do_clear_error_counter(**args)
261
+ exchange_message(:"do", Messages::DoClearErrorCounterRequest, nil, args)
262
+ end
263
+ class AsyncOperations
264
+ # :nodoc:
265
+ def initialize(&exchange)
266
+ @exchange = exchange
267
+ end
268
+ # Retrieve the full list of currently registered DRM RAS nodes. Each node includes its dynamically assigned ID, name, and type. **Important:** User space must call this operation first to obtain the node IDs. These IDs are required for all subsequent operations on nodes, such as querying error counters.
269
+ #
270
+ # Requires CAP_NET_ADMIN in the initial user namespace.
271
+ #--
272
+ # @rbs () -> ::Nl::Async::Stream[Messages::DumpListNodesReply]
273
+ def dump_list_nodes(**args)
274
+ @exchange.call(:"dump", Messages::DumpListNodesRequest, Messages::DumpListNodesReply, args)
275
+ end
276
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
277
+ #
278
+ # Requires CAP_NET_ADMIN in the initial user namespace.
279
+ #--
280
+ # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> ::Nl::Async::Future[Messages::DoGetErrorCounterReply]
281
+ def do_get_error_counter(**args)
282
+ @exchange.call(:"do", Messages::DoGetErrorCounterRequest, Messages::DoGetErrorCounterReply, args)
283
+ end
284
+ # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
285
+ #
286
+ # Requires CAP_NET_ADMIN in the initial user namespace.
287
+ #--
288
+ # @rbs (?node_id: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetErrorCounterReply]
289
+ def dump_get_error_counter(**args)
290
+ @exchange.call(:"dump", Messages::DumpGetErrorCounterRequest, Messages::DumpGetErrorCounterReply, args)
291
+ end
292
+ # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
293
+ #
294
+ # Requires CAP_NET_ADMIN in the initial user namespace.
295
+ #--
296
+ # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> ::Nl::Async::Future[void]
297
+ def do_clear_error_counter(**args)
298
+ @exchange.call(:"do", Messages::DoClearErrorCounterRequest, nil, args)
299
+ end
300
+ end
301
+ # Returns the asynchronous operation facade for this family.
302
+ #--
303
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
304
+ def async(stream_capacity: nil)
305
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
306
+ build_async_facade(AsyncOperations, stream_capacity:)
307
+ end
308
+ end
309
+ end; end