nl-linux 0.3.0 → 0.4.1

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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +5 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Rakefile +14 -2
  5. data/generated/nl/linux/binder.rb +172 -44
  6. data/generated/nl/linux/conntrack.rb +1293 -370
  7. data/generated/nl/linux/dev_energymodel.rb +278 -93
  8. data/generated/nl/linux/devlink.rb +5654 -1954
  9. data/generated/nl/linux/dpll.rb +1838 -669
  10. data/generated/nl/linux/drm_ras.rb +234 -72
  11. data/generated/nl/linux/ethtool.rb +6683 -2885
  12. data/generated/nl/linux/fou.rb +308 -129
  13. data/generated/nl/linux/handshake.rb +277 -99
  14. data/generated/nl/linux/lockd.rb +88 -33
  15. data/generated/nl/linux/mptcp_pm.rb +639 -186
  16. data/generated/nl/linux/net_shaper.rb +782 -224
  17. data/generated/nl/linux/netdev.rb +2105 -631
  18. data/generated/nl/linux/nfsd.rb +1030 -358
  19. data/generated/nl/linux/nftables.rb +5041 -1612
  20. data/generated/nl/linux/nl80211.rb +4531 -871
  21. data/generated/nl/linux/nlctrl.rb +411 -119
  22. data/generated/nl/linux/ovpn.rb +1211 -293
  23. data/generated/nl/linux/ovs_datapath.rb +271 -106
  24. data/generated/nl/linux/ovs_flow.rb +1819 -354
  25. data/generated/nl/linux/ovs_packet.rb +257 -82
  26. data/generated/nl/linux/ovs_vport.rb +334 -132
  27. data/generated/nl/linux/psp.rb +916 -281
  28. data/generated/nl/linux/rt_addr.rb +369 -166
  29. data/generated/nl/linux/rt_link.rb +6708 -1450
  30. data/generated/nl/linux/rt_neigh.rb +919 -364
  31. data/generated/nl/linux/rt_route.rb +1034 -448
  32. data/generated/nl/linux/rt_rule.rb +775 -395
  33. data/generated/nl/linux/sunrpc_cache.rb +297 -102
  34. data/generated/nl/linux/tc.rb +9989 -1780
  35. data/generated/nl/linux/tcp_metrics.rb +327 -105
  36. data/generated/nl/linux/team.rb +279 -93
  37. data/generated/nl/linux/wireguard.rb +432 -95
  38. data/generated/nl/linux.rb +1 -0
  39. data/lib/nl/linux/nlctrl_resolver.rb +31 -0
  40. data/lib/nl/linux/version.rb +1 -1
  41. data/sig/generated/nl/linux/binder.rbs +366 -0
  42. data/sig/generated/nl/linux/conntrack.rbs +2787 -0
  43. data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
  44. data/sig/generated/nl/linux/devlink.rbs +12496 -0
  45. data/sig/generated/nl/linux/dpll.rbs +3461 -0
  46. data/sig/generated/nl/linux/drm_ras.rbs +553 -0
  47. data/sig/generated/nl/linux/ethtool.rbs +15291 -0
  48. data/sig/generated/nl/linux/fou.rbs +702 -0
  49. data/sig/generated/nl/linux/handshake.rbs +622 -0
  50. data/sig/generated/nl/linux/lockd.rbs +234 -0
  51. data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
  52. data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
  53. data/sig/generated/nl/linux/netdev.rbs +4187 -0
  54. data/sig/generated/nl/linux/nfsd.rbs +2520 -0
  55. data/sig/generated/nl/linux/nftables.rbs +10304 -0
  56. data/sig/generated/nl/linux/nl80211.rbs +9786 -0
  57. data/sig/generated/nl/linux/nlctrl.rbs +944 -0
  58. data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
  59. data/sig/generated/nl/linux/ovpn.rbs +2564 -0
  60. data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
  61. data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
  62. data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
  63. data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
  64. data/sig/generated/nl/linux/psp.rbs +1846 -0
  65. data/sig/generated/nl/linux/rt_addr.rbs +866 -0
  66. data/sig/generated/nl/linux/rt_link.rbs +13438 -0
  67. data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
  68. data/sig/generated/nl/linux/rt_route.rbs +2218 -0
  69. data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
  70. data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
  71. data/sig/generated/nl/linux/tc.rbs +19931 -0
  72. data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
  73. data/sig/generated/nl/linux/team.rbs +733 -0
  74. data/sig/generated/nl/linux/version.rbs +7 -0
  75. data/sig/generated/nl/linux/wireguard.rbs +1006 -0
  76. data/sig/generated/nl/linux.rbs +6 -0
  77. data/sig/generated/nl-linux.rbs +2 -0
  78. metadata +46 -7
@@ -3,97 +3,199 @@
3
3
  # This file is based on Documentation/netlink/specs/drm_ras.yaml from Linux v7.2.
4
4
  #--
5
5
  # frozen_string_literal: true
6
- # rbs_inline: enabled
7
6
  # This code is generated by Ynl::Generator. DO NOT EDIT.
8
7
  require 'nl'
9
8
  module Nl; module Linux
10
9
  # 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
10
+ class DrmRas < ::Nl::Genl::Family
12
11
  NAME = "drm-ras"
13
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("drm-ras"))
12
+ VERSION = 1
13
+ # @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
14
+ # @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
15
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
16
+ # @param [#call] resolver
17
+ # @param [Symbol, nil] executor
18
+ # @param [Integer, nil] notification_capacity
19
+ # @return [DrmRas]
20
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
21
+ # @param [#call] resolver
22
+ # @param [Symbol, nil] executor
23
+ # @param [Integer, nil] notification_capacity
24
+ # @yieldparam [DrmRas] family
25
+ # @return [Object] the result of the block
26
+ def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
27
+ super
28
+ end
29
+ # @private
14
30
  MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
31
+ module Enums
32
+ # Type of the node. Currently, only error-counter nodes are supported, which expose reliability counters for a hardware/software component.
33
+ module NodeType
34
+ ErrorCounter = 1
35
+ end
36
+ end
15
37
  module Structs
16
38
  end
17
39
  module AttributeSets
18
- class NodeAttrs < ::Nl::Protocols::Genl::AttributeSet
40
+ class NodeAttrs < ::Nl::AttributeSet
19
41
  # Abstract class
20
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
42
+ class Attribute < ::Nl::AttributeSet::Attribute
21
43
  end
44
+ # Unique identifier for the node. Assigned dynamically by the DRM RAS core upon registration.
22
45
  class NodeId < Attribute
23
46
  TYPE = 1
24
47
  NAME = :"node_id"
25
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
48
+ # @private
49
+ ORDER = 0
50
+ # @private
51
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
26
52
  end
53
+ # Device name chosen by the driver at registration. Can be a PCI BDF, UUID, or module name if unique.
27
54
  class DeviceName < Attribute
28
55
  TYPE = 2
29
56
  NAME = :"device_name"
30
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
57
+ # @private
58
+ ORDER = 1
59
+ # @private
60
+ DATATYPE = ::Nl::DataTypes::String.new(check: nil)
31
61
  end
62
+ # Node name chosen by the driver at registration. Can be an IP block name, or any name that identifies the RAS node inside the device.
32
63
  class NodeName < Attribute
33
64
  TYPE = 3
34
65
  NAME = :"node_name"
35
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
66
+ # @private
67
+ ORDER = 2
68
+ # @private
69
+ DATATYPE = ::Nl::DataTypes::String.new(check: nil)
36
70
  end
71
+ # Type of this node, identifying its function.
72
+ #
73
+ # Known enum values are defined in {Enums::NodeType}.
37
74
  class NodeType < Attribute
38
75
  TYPE = 4
39
76
  NAME = :"node_type"
40
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
77
+ # @private
78
+ ORDER = 3
79
+ # @private
80
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
41
81
  end
42
- # :nodoc:
82
+ # @private
43
83
  BY_NAME = Ractor.make_shareable({:"node_id" => NodeId, :"device_name" => DeviceName, :"node_name" => NodeName, :"node_type" => NodeType}) #: Hash[::Symbol, Attribute]
44
- # :nodoc:
84
+ # @private
45
85
  BY_TYPE = Ractor.make_shareable({1 => NodeId, 2 => DeviceName, 3 => NodeName, 4 => NodeType}) #: Hash[::Integer, Attribute]
86
+ # Unique identifier for the node. Assigned dynamically by the DRM RAS core upon registration.
87
+ # @rbs return: ::Integer
88
+ # @return [Integer]
89
+ # @see NodeId
90
+ def node_id; self[:"node_id"]&.value; end
91
+ # Device name chosen by the driver at registration. Can be a PCI BDF, UUID, or module name if unique.
92
+ # @rbs return: ::String
93
+ # @return [String]
94
+ # @see DeviceName
95
+ def device_name; self[:"device_name"]&.value; end
96
+ # Node name chosen by the driver at registration. Can be an IP block name, or any name that identifies the RAS node inside the device.
97
+ # @rbs return: ::String
98
+ # @return [String]
99
+ # @see NodeName
100
+ def node_name; self[:"node_name"]&.value; end
101
+ # Type of this node, identifying its function.
102
+ #
103
+ # Known enum values are defined in {Enums::NodeType}.
104
+ # @rbs return: ::Integer
105
+ # @return [Integer]
106
+ # @see NodeType
107
+ def node_type; self[:"node_type"]&.value; end
46
108
  class << self
47
109
  # Looks up Attribute class by name.
48
- #--
49
110
  # @rbs name: Symbol
50
111
  # @rbs return: Attribute
112
+ # @param [Symbol] name
113
+ # @return [Attribute]
51
114
  def by_name(name); BY_NAME.fetch(name); end
52
115
  # Looks up Attribute class by type value.
53
- #--
54
116
  # @rbs type: Integer
55
117
  # @rbs return: Attribute
118
+ # @param [Integer] type
119
+ # @return [Attribute]
56
120
  def by_type(type); BY_TYPE.fetch(type); end
57
121
  end
58
122
  end
59
- class ErrorCounterAttrs < ::Nl::Protocols::Genl::AttributeSet
123
+ class ErrorCounterAttrs < ::Nl::AttributeSet
60
124
  # Abstract class
61
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
125
+ class Attribute < ::Nl::AttributeSet::Attribute
62
126
  end
127
+ # Node ID targeted by this error counter operation.
63
128
  class NodeId < Attribute
64
129
  TYPE = 1
65
130
  NAME = :"node_id"
66
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
131
+ # @private
132
+ ORDER = 0
133
+ # @private
134
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
67
135
  end
136
+ # Unique identifier for a specific error counter within an node.
68
137
  class ErrorId < Attribute
69
138
  TYPE = 2
70
139
  NAME = :"error_id"
71
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
140
+ # @private
141
+ ORDER = 1
142
+ # @private
143
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
72
144
  end
145
+ # Name of the error.
73
146
  class ErrorName < Attribute
74
147
  TYPE = 3
75
148
  NAME = :"error_name"
76
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
149
+ # @private
150
+ ORDER = 2
151
+ # @private
152
+ DATATYPE = ::Nl::DataTypes::String.new(check: nil)
77
153
  end
154
+ # Current value of the requested error counter.
78
155
  class ErrorValue < Attribute
79
156
  TYPE = 4
80
157
  NAME = :"error_value"
81
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
158
+ # @private
159
+ ORDER = 3
160
+ # @private
161
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
82
162
  end
83
- # :nodoc:
163
+ # @private
84
164
  BY_NAME = Ractor.make_shareable({:"node_id" => NodeId, :"error_id" => ErrorId, :"error_name" => ErrorName, :"error_value" => ErrorValue}) #: Hash[::Symbol, Attribute]
85
- # :nodoc:
165
+ # @private
86
166
  BY_TYPE = Ractor.make_shareable({1 => NodeId, 2 => ErrorId, 3 => ErrorName, 4 => ErrorValue}) #: Hash[::Integer, Attribute]
167
+ # Node ID targeted by this error counter operation.
168
+ # @rbs return: ::Integer
169
+ # @return [Integer]
170
+ # @see NodeId
171
+ def node_id; self[:"node_id"]&.value; end
172
+ # Unique identifier for a specific error counter within an node.
173
+ # @rbs return: ::Integer
174
+ # @return [Integer]
175
+ # @see ErrorId
176
+ def error_id; self[:"error_id"]&.value; end
177
+ # Name of the error.
178
+ # @rbs return: ::String
179
+ # @return [String]
180
+ # @see ErrorName
181
+ def error_name; self[:"error_name"]&.value; end
182
+ # Current value of the requested error counter.
183
+ # @rbs return: ::Integer
184
+ # @return [Integer]
185
+ # @see ErrorValue
186
+ def error_value; self[:"error_value"]&.value; end
87
187
  class << self
88
188
  # Looks up Attribute class by name.
89
- #--
90
189
  # @rbs name: Symbol
91
190
  # @rbs return: Attribute
191
+ # @param [Symbol] name
192
+ # @return [Attribute]
92
193
  def by_name(name); BY_NAME.fetch(name); end
93
194
  # Looks up Attribute class by type value.
94
- #--
95
195
  # @rbs type: Integer
96
196
  # @rbs return: Attribute
197
+ # @param [Integer] type
198
+ # @return [Attribute]
97
199
  def by_type(type); BY_TYPE.fetch(type); end
98
200
  end
99
201
  end
@@ -102,7 +204,7 @@ class DrmRas < ::Nl::Family
102
204
  # 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
205
  #
104
206
  # Requires CAP_NET_ADMIN in the initial user namespace.
105
- class DumpListNodesRequest < ::Nl::Protocols::Genl::Message
207
+ class DumpListNodesRequest < ::Nl::Genl::Message
106
208
  TYPE = 1
107
209
  FIXED_HEADER = nil
108
210
  ATTRIBUTE_SET = AttributeSets::NodeAttrs
@@ -111,196 +213,256 @@ class DrmRas < ::Nl::Family
111
213
  # 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
214
  #
113
215
  # Requires CAP_NET_ADMIN in the initial user namespace.
114
- class DumpListNodesReply < ::Nl::Protocols::Genl::Message
216
+ class DumpListNodesReply < ::Nl::Genl::Message
115
217
  TYPE = 1
116
218
  FIXED_HEADER = nil
117
219
  ATTRIBUTE_SET = AttributeSets::NodeAttrs
118
220
  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
- #--
221
+ # Unique identifier for the node. Assigned dynamically by the DRM RAS core upon registration.
121
222
  # @rbs return: ::Integer
223
+ # @return [Integer]
224
+ # @see AttributeSets::NodeAttrs::NodeId
122
225
  def node_id; attributes[:"node_id"]&.value; end
123
- # Gets the value of `device-name` attribute in the message.
124
- #--
226
+ # Device name chosen by the driver at registration. Can be a PCI BDF, UUID, or module name if unique.
125
227
  # @rbs return: ::String
228
+ # @return [String]
229
+ # @see AttributeSets::NodeAttrs::DeviceName
126
230
  def device_name; attributes[:"device_name"]&.value; end
127
- # Gets the value of `node-name` attribute in the message.
128
- #--
231
+ # Node name chosen by the driver at registration. Can be an IP block name, or any name that identifies the RAS node inside the device.
129
232
  # @rbs return: ::String
233
+ # @return [String]
234
+ # @see AttributeSets::NodeAttrs::NodeName
130
235
  def node_name; attributes[:"node_name"]&.value; end
131
- # Gets the value of `node-type` attribute in the message.
132
- #--
236
+ # Type of this node, identifying its function.
237
+ #
238
+ # Known enum values are defined in {Enums::NodeType}.
133
239
  # @rbs return: ::Integer
240
+ # @return [Integer]
241
+ # @see AttributeSets::NodeAttrs::NodeType
134
242
  def node_type; attributes[:"node_type"]&.value; end
135
243
  end
136
244
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
137
245
  #
138
246
  # Requires CAP_NET_ADMIN in the initial user namespace.
139
- class DoGetErrorCounterRequest < ::Nl::Protocols::Genl::Message
247
+ class DoGetErrorCounterRequest < ::Nl::Genl::Message
140
248
  TYPE = 2
141
249
  FIXED_HEADER = nil
142
250
  ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
143
251
  ATTRIBUTES = Ractor.make_shareable(%i[node_id error_id])
144
- # Gets the value of `node-id` attribute in the message.
145
- #--
252
+ # Node ID targeted by this error counter operation.
146
253
  # @rbs return: ::Integer
254
+ # @return [Integer]
255
+ # @see AttributeSets::ErrorCounterAttrs::NodeId
147
256
  def node_id; attributes[:"node_id"]&.value; end
148
- # Gets the value of `error-id` attribute in the message.
149
- #--
257
+ # Unique identifier for a specific error counter within an node.
150
258
  # @rbs return: ::Integer
259
+ # @return [Integer]
260
+ # @see AttributeSets::ErrorCounterAttrs::ErrorId
151
261
  def error_id; attributes[:"error_id"]&.value; end
152
262
  end
153
263
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
154
264
  #
155
265
  # Requires CAP_NET_ADMIN in the initial user namespace.
156
- class DoGetErrorCounterReply < ::Nl::Protocols::Genl::Message
266
+ class DoGetErrorCounterReply < ::Nl::Genl::Message
157
267
  TYPE = 2
158
268
  FIXED_HEADER = nil
159
269
  ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
160
270
  ATTRIBUTES = Ractor.make_shareable(%i[error_id error_name error_value])
161
- # Gets the value of `error-id` attribute in the message.
162
- #--
271
+ # Unique identifier for a specific error counter within an node.
163
272
  # @rbs return: ::Integer
273
+ # @return [Integer]
274
+ # @see AttributeSets::ErrorCounterAttrs::ErrorId
164
275
  def error_id; attributes[:"error_id"]&.value; end
165
- # Gets the value of `error-name` attribute in the message.
166
- #--
276
+ # Name of the error.
167
277
  # @rbs return: ::String
278
+ # @return [String]
279
+ # @see AttributeSets::ErrorCounterAttrs::ErrorName
168
280
  def error_name; attributes[:"error_name"]&.value; end
169
- # Gets the value of `error-value` attribute in the message.
170
- #--
281
+ # Current value of the requested error counter.
171
282
  # @rbs return: ::Integer
283
+ # @return [Integer]
284
+ # @see AttributeSets::ErrorCounterAttrs::ErrorValue
172
285
  def error_value; attributes[:"error_value"]&.value; end
173
286
  end
174
287
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
175
288
  #
176
289
  # Requires CAP_NET_ADMIN in the initial user namespace.
177
- class DumpGetErrorCounterRequest < ::Nl::Protocols::Genl::Message
290
+ class DumpGetErrorCounterRequest < ::Nl::Genl::Message
178
291
  TYPE = 2
179
292
  FIXED_HEADER = nil
180
293
  ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
181
294
  ATTRIBUTES = Ractor.make_shareable(%i[node_id])
182
- # Gets the value of `node-id` attribute in the message.
183
- #--
295
+ # Node ID targeted by this error counter operation.
184
296
  # @rbs return: ::Integer
297
+ # @return [Integer]
298
+ # @see AttributeSets::ErrorCounterAttrs::NodeId
185
299
  def node_id; attributes[:"node_id"]&.value; end
186
300
  end
187
301
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
188
302
  #
189
303
  # Requires CAP_NET_ADMIN in the initial user namespace.
190
- class DumpGetErrorCounterReply < ::Nl::Protocols::Genl::Message
304
+ class DumpGetErrorCounterReply < ::Nl::Genl::Message
191
305
  TYPE = 2
192
306
  FIXED_HEADER = nil
193
307
  ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
194
308
  ATTRIBUTES = Ractor.make_shareable(%i[error_id error_name error_value])
195
- # Gets the value of `error-id` attribute in the message.
196
- #--
309
+ # Unique identifier for a specific error counter within an node.
197
310
  # @rbs return: ::Integer
311
+ # @return [Integer]
312
+ # @see AttributeSets::ErrorCounterAttrs::ErrorId
198
313
  def error_id; attributes[:"error_id"]&.value; end
199
- # Gets the value of `error-name` attribute in the message.
200
- #--
314
+ # Name of the error.
201
315
  # @rbs return: ::String
316
+ # @return [String]
317
+ # @see AttributeSets::ErrorCounterAttrs::ErrorName
202
318
  def error_name; attributes[:"error_name"]&.value; end
203
- # Gets the value of `error-value` attribute in the message.
204
- #--
319
+ # Current value of the requested error counter.
205
320
  # @rbs return: ::Integer
321
+ # @return [Integer]
322
+ # @see AttributeSets::ErrorCounterAttrs::ErrorValue
206
323
  def error_value; attributes[:"error_value"]&.value; end
207
324
  end
208
325
  # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
209
326
  #
210
327
  # Requires CAP_NET_ADMIN in the initial user namespace.
211
- class DoClearErrorCounterRequest < ::Nl::Protocols::Genl::Message
328
+ class DoClearErrorCounterRequest < ::Nl::Genl::Message
212
329
  TYPE = 3
213
330
  FIXED_HEADER = nil
214
331
  ATTRIBUTE_SET = AttributeSets::ErrorCounterAttrs
215
332
  ATTRIBUTES = Ractor.make_shareable(%i[node_id error_id])
216
- # Gets the value of `node-id` attribute in the message.
217
- #--
333
+ # Node ID targeted by this error counter operation.
218
334
  # @rbs return: ::Integer
335
+ # @return [Integer]
336
+ # @see AttributeSets::ErrorCounterAttrs::NodeId
219
337
  def node_id; attributes[:"node_id"]&.value; end
220
- # Gets the value of `error-id` attribute in the message.
221
- #--
338
+ # Unique identifier for a specific error counter within an node.
222
339
  # @rbs return: ::Integer
340
+ # @return [Integer]
341
+ # @see AttributeSets::ErrorCounterAttrs::ErrorId
223
342
  def error_id; attributes[:"error_id"]&.value; end
224
343
  end
225
344
  end
226
345
  module Notifications
227
346
  end
347
+ # @private
228
348
  NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
229
349
  # 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
350
  #
231
351
  # Requires CAP_NET_ADMIN in the initial user namespace.
232
- #--
233
- # @rbs () -> Enumerable[Messages::DumpListNodesReply]
352
+ # @rbs () -> Array[Messages::DumpListNodesReply]
234
353
  # | () { (Messages::DumpListNodesReply) -> void } -> void
354
+ # @overload dump_list_nodes(**args)
355
+ # Returns an array when no block is given.
356
+ # @param [Hash] args
357
+ # @return [Array<Messages::DumpListNodesReply>]
358
+ # @overload dump_list_nodes(**args, &block)
359
+ # Yields each reply when a block is given.
360
+ # @param [Hash] args
361
+ # @yieldparam [Messages::DumpListNodesReply] reply
362
+ # @return [void]
363
+ # @see Messages::DumpListNodesRequest
235
364
  def dump_list_nodes(**args, &block)
236
365
  exchange_message(:"dump", Messages::DumpListNodesRequest, Messages::DumpListNodesReply, args, &block)
237
366
  end
238
367
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
239
368
  #
240
369
  # Requires CAP_NET_ADMIN in the initial user namespace.
241
- #--
242
370
  # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> Messages::DoGetErrorCounterReply
371
+ # @param [Hash] args
372
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
373
+ # @option args [Integer] error_id Unique identifier for a specific error counter within an node.
374
+ # @return [Messages::DoGetErrorCounterReply]
375
+ # @see Messages::DoGetErrorCounterRequest
243
376
  def do_get_error_counter(**args)
244
377
  exchange_message(:"do", Messages::DoGetErrorCounterRequest, Messages::DoGetErrorCounterReply, args)
245
378
  end
246
379
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
247
380
  #
248
381
  # Requires CAP_NET_ADMIN in the initial user namespace.
249
- #--
250
- # @rbs (?node_id: ::Integer) -> Enumerable[Messages::DumpGetErrorCounterReply]
382
+ # @rbs (?node_id: ::Integer) -> Array[Messages::DumpGetErrorCounterReply]
251
383
  # | (?node_id: ::Integer) { (Messages::DumpGetErrorCounterReply) -> void } -> void
384
+ # @overload dump_get_error_counter(**args)
385
+ # Returns an array when no block is given.
386
+ # @param [Hash] args
387
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
388
+ # @return [Array<Messages::DumpGetErrorCounterReply>]
389
+ # @overload dump_get_error_counter(**args, &block)
390
+ # Yields each reply when a block is given.
391
+ # @param [Hash] args
392
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
393
+ # @yieldparam [Messages::DumpGetErrorCounterReply] reply
394
+ # @return [void]
395
+ # @see Messages::DumpGetErrorCounterRequest
252
396
  def dump_get_error_counter(**args, &block)
253
397
  exchange_message(:"dump", Messages::DumpGetErrorCounterRequest, Messages::DumpGetErrorCounterReply, args, &block)
254
398
  end
255
399
  # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
256
400
  #
257
401
  # Requires CAP_NET_ADMIN in the initial user namespace.
258
- #--
259
402
  # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> void
403
+ # @param [Hash] args
404
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
405
+ # @option args [Integer] error_id Unique identifier for a specific error counter within an node.
406
+ # @return [void]
407
+ # @see Messages::DoClearErrorCounterRequest
260
408
  def do_clear_error_counter(**args)
261
409
  exchange_message(:"do", Messages::DoClearErrorCounterRequest, nil, args)
262
410
  end
263
411
  class AsyncOperations
264
- # :nodoc:
412
+ # @private
265
413
  def initialize(&exchange)
266
414
  @exchange = exchange
267
415
  end
268
416
  # 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
417
  #
270
418
  # Requires CAP_NET_ADMIN in the initial user namespace.
271
- #--
272
419
  # @rbs () -> ::Nl::Async::Stream[Messages::DumpListNodesReply]
420
+ # @param [Hash] args
421
+ # @return [Nl::Async::Stream<Messages::DumpListNodesReply>]
422
+ # @see Messages::DumpListNodesRequest
273
423
  def dump_list_nodes(**args)
274
424
  @exchange.call(:"dump", Messages::DumpListNodesRequest, Messages::DumpListNodesReply, args)
275
425
  end
276
426
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
277
427
  #
278
428
  # Requires CAP_NET_ADMIN in the initial user namespace.
279
- #--
280
429
  # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> ::Nl::Async::Future[Messages::DoGetErrorCounterReply]
430
+ # @param [Hash] args
431
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
432
+ # @option args [Integer] error_id Unique identifier for a specific error counter within an node.
433
+ # @return [Nl::Async::Future<Messages::DoGetErrorCounterReply>]
434
+ # @see Messages::DoGetErrorCounterRequest
281
435
  def do_get_error_counter(**args)
282
436
  @exchange.call(:"do", Messages::DoGetErrorCounterRequest, Messages::DoGetErrorCounterReply, args)
283
437
  end
284
438
  # Retrieve error counter for a given node. The response includes the id, the name, and even the current value of each counter.
285
439
  #
286
440
  # Requires CAP_NET_ADMIN in the initial user namespace.
287
- #--
288
441
  # @rbs (?node_id: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetErrorCounterReply]
442
+ # @param [Hash] args
443
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
444
+ # @return [Nl::Async::Stream<Messages::DumpGetErrorCounterReply>]
445
+ # @see Messages::DumpGetErrorCounterRequest
289
446
  def dump_get_error_counter(**args)
290
447
  @exchange.call(:"dump", Messages::DumpGetErrorCounterRequest, Messages::DumpGetErrorCounterReply, args)
291
448
  end
292
449
  # Clear error counter for a given node. The request includes the error-id and node-id of the counter to be cleared.
293
450
  #
294
451
  # Requires CAP_NET_ADMIN in the initial user namespace.
295
- #--
296
452
  # @rbs (?node_id: ::Integer, ?error_id: ::Integer) -> ::Nl::Async::Future[void]
453
+ # @param [Hash] args
454
+ # @option args [Integer] node_id Node ID targeted by this error counter operation.
455
+ # @option args [Integer] error_id Unique identifier for a specific error counter within an node.
456
+ # @return [Nl::Async::Future<void>]
457
+ # @see Messages::DoClearErrorCounterRequest
297
458
  def do_clear_error_counter(**args)
298
459
  @exchange.call(:"do", Messages::DoClearErrorCounterRequest, nil, args)
299
460
  end
300
461
  end
301
462
  # Returns the asynchronous operation facade for this family.
302
- #--
303
463
  # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
464
+ # @param [::Integer, nil] stream_capacity
465
+ # @return [AsyncOperations]
304
466
  def async(stream_capacity: nil)
305
467
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
306
468
  build_async_facade(AsyncOperations, stream_capacity:)