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
@@ -36,3 +36,4 @@ module Nl
36
36
  autoload :Wireguard, "nl/linux/wireguard.rb"
37
37
  end
38
38
  end
39
+ require 'nl/linux/nlctrl_resolver'
@@ -0,0 +1,31 @@
1
+ require 'nl/linux/nlctrl'
2
+
3
+ module Nl
4
+ module Linux
5
+ # Resolves Generic Netlink family metadata through nlctrl.
6
+ class NlctrlResolver
7
+ FAMILY_INFO_CTRL = Nl::Genl::FamilyInfo.new(
8
+ id: Genl::GENL_ID_CTRL,
9
+ multicast_groups: {}.freeze,
10
+ ).freeze
11
+
12
+ # Resolves a Generic Netlink family metadata through nlctrl.
13
+ #
14
+ # @param [Genl::Client] client
15
+ # @param [String] family_name
16
+ # @return [Genl::FamilyInfo]
17
+ # @rbs (Genl::Client client, String family_name) -> Genl::FamilyInfo
18
+ def call(client, family_name)
19
+ return FAMILY_INFO_CTRL if family_name == Nlctrl::NAME
20
+
21
+ reply = client.family(Nlctrl).do_getfamily(family_name:)
22
+ groups = (reply.mcast_groups || []).to_h do |attributes|
23
+ [attributes[:name].value, attributes[:id].value]
24
+ end
25
+ Genl::FamilyInfo.new(id: reply.family_id, multicast_groups: groups.freeze)
26
+ end
27
+ end
28
+
29
+ DEFAULT_RESOLVER = NlctrlResolver.new.freeze
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  module Nl
2
2
  module Linux
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
@@ -0,0 +1,366 @@
1
+ # Generated from generated/nl/linux/binder.rb with RBS::Inline
2
+
3
+ module Nl
4
+ module Linux
5
+ # Binder interface over generic netlink
6
+ class Binder < ::Nl::Genl::Family
7
+ NAME: ::String
8
+
9
+ VERSION: ::Integer
10
+
11
+ # @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
12
+ # @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
13
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
14
+ # @param [#call] resolver
15
+ # @param [Symbol, nil] executor
16
+ # @param [Integer, nil] notification_capacity
17
+ # @return [Binder]
18
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
19
+ # @param [#call] resolver
20
+ # @param [Symbol, nil] executor
21
+ # @param [Integer, nil] notification_capacity
22
+ # @yieldparam [Binder] family
23
+ # @return [Object] the result of the block
24
+ def self.open: (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
25
+
26
+ # @private
27
+ MCAST_GROUPS: Hash[::Symbol, ::Nl::McastGroup]
28
+
29
+ module Structs
30
+ end
31
+
32
+ module AttributeSets
33
+ # Attributes included within a transaction failure report. The elements
34
+ # correspond directly with the specific transaction that failed, along
35
+ # with the error returned to the sender e.g. BR_DEAD_REPLY.
36
+ class Report < ::Nl::AttributeSet
37
+ # Abstract class
38
+ class Attribute < ::Nl::AttributeSet::Attribute
39
+ end
40
+
41
+ # The enum binder_driver_return_protocol returned to the sender.
42
+ class Error < Attribute
43
+ TYPE: ::Integer
44
+
45
+ NAME: ::Symbol
46
+
47
+ # @private
48
+ ORDER: ::Integer
49
+
50
+ # @private
51
+ DATATYPE: untyped
52
+ end
53
+
54
+ # The binder context where the transaction occurred.
55
+ class Context < Attribute
56
+ TYPE: ::Integer
57
+
58
+ NAME: ::Symbol
59
+
60
+ # @private
61
+ ORDER: ::Integer
62
+
63
+ # @private
64
+ DATATYPE: untyped
65
+ end
66
+
67
+ # The PID of the sender process.
68
+ class FromPid < Attribute
69
+ TYPE: ::Integer
70
+
71
+ NAME: ::Symbol
72
+
73
+ # @private
74
+ ORDER: ::Integer
75
+
76
+ # @private
77
+ DATATYPE: untyped
78
+ end
79
+
80
+ # The TID of the sender thread.
81
+ class FromTid < Attribute
82
+ TYPE: ::Integer
83
+
84
+ NAME: ::Symbol
85
+
86
+ # @private
87
+ ORDER: ::Integer
88
+
89
+ # @private
90
+ DATATYPE: untyped
91
+ end
92
+
93
+ # The PID of the recipient process. This attribute may not be present
94
+ # if the target could not be determined.
95
+ class ToPid < Attribute
96
+ TYPE: ::Integer
97
+
98
+ NAME: ::Symbol
99
+
100
+ # @private
101
+ ORDER: ::Integer
102
+
103
+ # @private
104
+ DATATYPE: untyped
105
+ end
106
+
107
+ # The TID of the recipient thread. This attribute may not be present
108
+ # if the target could not be determined.
109
+ class ToTid < Attribute
110
+ TYPE: ::Integer
111
+
112
+ NAME: ::Symbol
113
+
114
+ # @private
115
+ ORDER: ::Integer
116
+
117
+ # @private
118
+ DATATYPE: untyped
119
+ end
120
+
121
+ # When present, indicates the failed transaction is a reply.
122
+ class IsReply < Attribute
123
+ TYPE: ::Integer
124
+
125
+ NAME: ::Symbol
126
+
127
+ # @private
128
+ ORDER: ::Integer
129
+
130
+ # @private
131
+ DATATYPE: untyped
132
+ end
133
+
134
+ # The bitmask of enum transaction_flags from the transaction.
135
+ class Flags < Attribute
136
+ TYPE: ::Integer
137
+
138
+ NAME: ::Symbol
139
+
140
+ # @private
141
+ ORDER: ::Integer
142
+
143
+ # @private
144
+ DATATYPE: untyped
145
+ end
146
+
147
+ # The application-defined code from the transaction.
148
+ class Code < Attribute
149
+ TYPE: ::Integer
150
+
151
+ NAME: ::Symbol
152
+
153
+ # @private
154
+ ORDER: ::Integer
155
+
156
+ # @private
157
+ DATATYPE: untyped
158
+ end
159
+
160
+ # The transaction payload size in bytes.
161
+ class DataSize < Attribute
162
+ TYPE: ::Integer
163
+
164
+ NAME: ::Symbol
165
+
166
+ # @private
167
+ ORDER: ::Integer
168
+
169
+ # @private
170
+ DATATYPE: untyped
171
+ end
172
+
173
+ # @private
174
+ BY_NAME: Hash[::Symbol, Attribute]
175
+
176
+ # @private
177
+ BY_TYPE: Hash[::Integer, Attribute]
178
+
179
+ # The enum binder_driver_return_protocol returned to the sender.
180
+ # @rbs return: ::Integer
181
+ # @return [Integer]
182
+ # @see Error
183
+ def error: () -> ::Integer
184
+
185
+ # The binder context where the transaction occurred.
186
+ # @rbs return: ::String
187
+ # @return [String]
188
+ # @see Context
189
+ def context: () -> ::String
190
+
191
+ # The PID of the sender process.
192
+ # @rbs return: ::Integer
193
+ # @return [Integer]
194
+ # @see FromPid
195
+ def from_pid: () -> ::Integer
196
+
197
+ # The TID of the sender thread.
198
+ # @rbs return: ::Integer
199
+ # @return [Integer]
200
+ # @see FromTid
201
+ def from_tid: () -> ::Integer
202
+
203
+ # The PID of the recipient process. This attribute may not be present
204
+ # if the target could not be determined.
205
+ # @rbs return: ::Integer
206
+ # @return [Integer]
207
+ # @see ToPid
208
+ def to_pid: () -> ::Integer
209
+
210
+ # The TID of the recipient thread. This attribute may not be present
211
+ # if the target could not be determined.
212
+ # @rbs return: ::Integer
213
+ # @return [Integer]
214
+ # @see ToTid
215
+ def to_tid: () -> ::Integer
216
+
217
+ # When present, indicates the failed transaction is a reply.
218
+ # @rbs return: ::Integer
219
+ # @return [Integer]
220
+ # @see IsReply
221
+ def is_reply: () -> ::Integer
222
+
223
+ # The bitmask of enum transaction_flags from the transaction.
224
+ # @rbs return: ::Integer
225
+ # @return [Integer]
226
+ # @see Flags
227
+ def flags: () -> ::Integer
228
+
229
+ # The application-defined code from the transaction.
230
+ # @rbs return: ::Integer
231
+ # @return [Integer]
232
+ # @see Code
233
+ def code: () -> ::Integer
234
+
235
+ # The transaction payload size in bytes.
236
+ # @rbs return: ::Integer
237
+ # @return [Integer]
238
+ # @see DataSize
239
+ def data_size: () -> ::Integer
240
+
241
+ # Looks up Attribute class by name.
242
+ # @rbs name: Symbol
243
+ # @rbs return: Attribute
244
+ # @param [Symbol] name
245
+ # @return [Attribute]
246
+ def self.by_name: (Symbol name) -> Attribute
247
+
248
+ # Looks up Attribute class by type value.
249
+ # @rbs type: Integer
250
+ # @rbs return: Attribute
251
+ # @param [Integer] type
252
+ # @return [Attribute]
253
+ def self.by_type: (Integer type) -> Attribute
254
+ end
255
+ end
256
+
257
+ module Messages
258
+ end
259
+
260
+ module Notifications
261
+ # A multicast event sent to userspace subscribers to notify them about
262
+ # binder transaction failures. The generated report provides the full
263
+ # details of the specific transaction that failed. The intention is for
264
+ # programs to monitor these events and react to the failures as needed.
265
+ #
266
+ #
267
+ # Multicast group: `report`.
268
+ class Report < ::Nl::Genl::Message
269
+ TYPE: ::Integer
270
+
271
+ FIXED_HEADER: untyped
272
+
273
+ ATTRIBUTE_SET: untyped
274
+
275
+ ATTRIBUTES: untyped
276
+
277
+ # The enum binder_driver_return_protocol returned to the sender.
278
+ # @rbs return: ::Integer
279
+ # @return [Integer]
280
+ # @see AttributeSets::Report::Error
281
+ def error: () -> ::Integer
282
+
283
+ # The binder context where the transaction occurred.
284
+ # @rbs return: ::String
285
+ # @return [String]
286
+ # @see AttributeSets::Report::Context
287
+ def context: () -> ::String
288
+
289
+ # The PID of the sender process.
290
+ # @rbs return: ::Integer
291
+ # @return [Integer]
292
+ # @see AttributeSets::Report::FromPid
293
+ def from_pid: () -> ::Integer
294
+
295
+ # The TID of the sender thread.
296
+ # @rbs return: ::Integer
297
+ # @return [Integer]
298
+ # @see AttributeSets::Report::FromTid
299
+ def from_tid: () -> ::Integer
300
+
301
+ # The PID of the recipient process. This attribute may not be present
302
+ # if the target could not be determined.
303
+ # @rbs return: ::Integer
304
+ # @return [Integer]
305
+ # @see AttributeSets::Report::ToPid
306
+ def to_pid: () -> ::Integer
307
+
308
+ # The TID of the recipient thread. This attribute may not be present
309
+ # if the target could not be determined.
310
+ # @rbs return: ::Integer
311
+ # @return [Integer]
312
+ # @see AttributeSets::Report::ToTid
313
+ def to_tid: () -> ::Integer
314
+
315
+ # When present, indicates the failed transaction is a reply.
316
+ # @rbs return: ::Integer
317
+ # @return [Integer]
318
+ # @see AttributeSets::Report::IsReply
319
+ def is_reply: () -> ::Integer
320
+
321
+ # The bitmask of enum transaction_flags from the transaction.
322
+ # @rbs return: ::Integer
323
+ # @return [Integer]
324
+ # @see AttributeSets::Report::Flags
325
+ def flags: () -> ::Integer
326
+
327
+ # The application-defined code from the transaction.
328
+ # @rbs return: ::Integer
329
+ # @return [Integer]
330
+ # @see AttributeSets::Report::Code
331
+ def code: () -> ::Integer
332
+
333
+ # The transaction payload size in bytes.
334
+ # @rbs return: ::Integer
335
+ # @return [Integer]
336
+ # @see AttributeSets::Report::DataSize
337
+ def data_size: () -> ::Integer
338
+ end
339
+ end
340
+
341
+ # @private
342
+ NOTIFICATIONS: Hash[::Integer, ::Class]
343
+
344
+ class AsyncOperations
345
+ # @private
346
+ def initialize: () ?{ (?) -> untyped } -> untyped
347
+ end
348
+
349
+ # Returns the asynchronous operation facade for this family.
350
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
351
+ # @param [::Integer, nil] stream_capacity
352
+ # @return [AsyncOperations]
353
+ def async: (?stream_capacity: ::Integer?) -> AsyncOperations
354
+
355
+ # @rbs (*(:report) groups) -> self
356
+ # @param [Array<:report>] groups
357
+ # @return [self]
358
+ def subscribe: (*:report groups) -> self
359
+
360
+ # @rbs (*(:report) groups) -> self
361
+ # @param [Array<:report>] groups
362
+ # @return [self]
363
+ def unsubscribe: (*:report groups) -> self
364
+ end
365
+ end
366
+ end