nl-linux 0.2.0 → 0.2.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.
@@ -0,0 +1,498 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ # NFSD configuration over generic netlink.
8
+ class Nl::Linux::Nfsd < ::Nl::Family
9
+ NAME = "nfsd"
10
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("nfsd"))
11
+ module Structs
12
+ end
13
+ module AttributeSets
14
+ class RpcStatus < ::Nl::Protocols::Genl::AttributeSet
15
+ # Abstract class
16
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
17
+ end
18
+ class Xid < Attribute
19
+ TYPE = 1
20
+ NAME = :"xid"
21
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
22
+ end
23
+ class Flags < Attribute
24
+ TYPE = 2
25
+ NAME = :"flags"
26
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
27
+ end
28
+ class Prog < Attribute
29
+ TYPE = 3
30
+ NAME = :"prog"
31
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
32
+ end
33
+ class Version < Attribute
34
+ TYPE = 4
35
+ NAME = :"version"
36
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
37
+ end
38
+ class Proc < Attribute
39
+ TYPE = 5
40
+ NAME = :"proc"
41
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
42
+ end
43
+ class ServiceTime < Attribute
44
+ TYPE = 6
45
+ NAME = :"service_time"
46
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S64, check: nil)
47
+ end
48
+ class Pad < Attribute
49
+ TYPE = 7
50
+ NAME = :"pad"
51
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Pad.new()
52
+ end
53
+ class Saddr4 < Attribute
54
+ TYPE = 8
55
+ NAME = :"saddr4"
56
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
57
+ end
58
+ class Daddr4 < Attribute
59
+ TYPE = 9
60
+ NAME = :"daddr4"
61
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
62
+ end
63
+ class Saddr6 < Attribute
64
+ TYPE = 10
65
+ NAME = :"saddr6"
66
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
67
+ end
68
+ class Daddr6 < Attribute
69
+ TYPE = 11
70
+ NAME = :"daddr6"
71
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
72
+ end
73
+ class Sport < Attribute
74
+ TYPE = 12
75
+ NAME = :"sport"
76
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
77
+ end
78
+ class Dport < Attribute
79
+ TYPE = 13
80
+ NAME = :"dport"
81
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
82
+ end
83
+ class CompoundOps < Attribute
84
+ TYPE = 14
85
+ NAME = :"compound_ops"
86
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
87
+ end
88
+ # :nodoc:
89
+ BY_NAME = Ractor.make_shareable({:"xid" => Xid, :"flags" => Flags, :"prog" => Prog, :"version" => Version, :"proc" => Proc, :"service_time" => ServiceTime, :"pad" => Pad, :"saddr4" => Saddr4, :"daddr4" => Daddr4, :"saddr6" => Saddr6, :"daddr6" => Daddr6, :"sport" => Sport, :"dport" => Dport, :"compound_ops" => CompoundOps}) #: Hash[::Symbol, Attribute]
90
+ # :nodoc:
91
+ BY_TYPE = Ractor.make_shareable({1 => Xid, 2 => Flags, 3 => Prog, 4 => Version, 5 => Proc, 6 => ServiceTime, 7 => Pad, 8 => Saddr4, 9 => Daddr4, 10 => Saddr6, 11 => Daddr6, 12 => Sport, 13 => Dport, 14 => CompoundOps}) #: Hash[::Integer, Attribute]
92
+ class << self
93
+ # Looks up Attribute class by name.
94
+ #--
95
+ # @rbs name: Symbol
96
+ # @rbs return: Attribute
97
+ def by_name(name); BY_NAME.fetch(name); end
98
+ # Looks up Attribute class by type value.
99
+ #--
100
+ # @rbs type: Integer
101
+ # @rbs return: Attribute
102
+ def by_type(type); BY_TYPE.fetch(type); end
103
+ end
104
+ end
105
+ class Server < ::Nl::Protocols::Genl::AttributeSet
106
+ # Abstract class
107
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
108
+ end
109
+ class Threads < Attribute
110
+ TYPE = 1
111
+ NAME = :"threads"
112
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
113
+ end
114
+ class Gracetime < Attribute
115
+ TYPE = 2
116
+ NAME = :"gracetime"
117
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
118
+ end
119
+ class Leasetime < Attribute
120
+ TYPE = 3
121
+ NAME = :"leasetime"
122
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
123
+ end
124
+ class Scope < Attribute
125
+ TYPE = 4
126
+ NAME = :"scope"
127
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
128
+ end
129
+ # :nodoc:
130
+ BY_NAME = Ractor.make_shareable({:"threads" => Threads, :"gracetime" => Gracetime, :"leasetime" => Leasetime, :"scope" => Scope}) #: Hash[::Symbol, Attribute]
131
+ # :nodoc:
132
+ BY_TYPE = Ractor.make_shareable({1 => Threads, 2 => Gracetime, 3 => Leasetime, 4 => Scope}) #: Hash[::Integer, Attribute]
133
+ class << self
134
+ # Looks up Attribute class by name.
135
+ #--
136
+ # @rbs name: Symbol
137
+ # @rbs return: Attribute
138
+ def by_name(name); BY_NAME.fetch(name); end
139
+ # Looks up Attribute class by type value.
140
+ #--
141
+ # @rbs type: Integer
142
+ # @rbs return: Attribute
143
+ def by_type(type); BY_TYPE.fetch(type); end
144
+ end
145
+ end
146
+ class Version < ::Nl::Protocols::Genl::AttributeSet
147
+ # Abstract class
148
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
149
+ end
150
+ class Major < Attribute
151
+ TYPE = 1
152
+ NAME = :"major"
153
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
154
+ end
155
+ class Minor < Attribute
156
+ TYPE = 2
157
+ NAME = :"minor"
158
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
159
+ end
160
+ class Enabled < Attribute
161
+ TYPE = 3
162
+ NAME = :"enabled"
163
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
164
+ end
165
+ # :nodoc:
166
+ BY_NAME = Ractor.make_shareable({:"major" => Major, :"minor" => Minor, :"enabled" => Enabled}) #: Hash[::Symbol, Attribute]
167
+ # :nodoc:
168
+ BY_TYPE = Ractor.make_shareable({1 => Major, 2 => Minor, 3 => Enabled}) #: Hash[::Integer, Attribute]
169
+ class << self
170
+ # Looks up Attribute class by name.
171
+ #--
172
+ # @rbs name: Symbol
173
+ # @rbs return: Attribute
174
+ def by_name(name); BY_NAME.fetch(name); end
175
+ # Looks up Attribute class by type value.
176
+ #--
177
+ # @rbs type: Integer
178
+ # @rbs return: Attribute
179
+ def by_type(type); BY_TYPE.fetch(type); end
180
+ end
181
+ end
182
+ class ServerProto < ::Nl::Protocols::Genl::AttributeSet
183
+ # Abstract class
184
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
185
+ end
186
+ class Version < Attribute
187
+ TYPE = 1
188
+ NAME = :"version"
189
+ end
190
+ # :nodoc:
191
+ BY_NAME = Ractor.make_shareable({:"version" => Version}) #: Hash[::Symbol, Attribute]
192
+ # :nodoc:
193
+ BY_TYPE = Ractor.make_shareable({1 => Version}) #: Hash[::Integer, Attribute]
194
+ class << self
195
+ # Looks up Attribute class by name.
196
+ #--
197
+ # @rbs name: Symbol
198
+ # @rbs return: Attribute
199
+ def by_name(name); BY_NAME.fetch(name); end
200
+ # Looks up Attribute class by type value.
201
+ #--
202
+ # @rbs type: Integer
203
+ # @rbs return: Attribute
204
+ def by_type(type); BY_TYPE.fetch(type); end
205
+ end
206
+ end
207
+ class Sock < ::Nl::Protocols::Genl::AttributeSet
208
+ # Abstract class
209
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
210
+ end
211
+ class Addr < Attribute
212
+ TYPE = 1
213
+ NAME = :"addr"
214
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
215
+ end
216
+ class TransportName < Attribute
217
+ TYPE = 2
218
+ NAME = :"transport_name"
219
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
220
+ end
221
+ # :nodoc:
222
+ BY_NAME = Ractor.make_shareable({:"addr" => Addr, :"transport_name" => TransportName}) #: Hash[::Symbol, Attribute]
223
+ # :nodoc:
224
+ BY_TYPE = Ractor.make_shareable({1 => Addr, 2 => TransportName}) #: Hash[::Integer, Attribute]
225
+ class << self
226
+ # Looks up Attribute class by name.
227
+ #--
228
+ # @rbs name: Symbol
229
+ # @rbs return: Attribute
230
+ def by_name(name); BY_NAME.fetch(name); end
231
+ # Looks up Attribute class by type value.
232
+ #--
233
+ # @rbs type: Integer
234
+ # @rbs return: Attribute
235
+ def by_type(type); BY_TYPE.fetch(type); end
236
+ end
237
+ end
238
+ class ServerSock < ::Nl::Protocols::Genl::AttributeSet
239
+ # Abstract class
240
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
241
+ end
242
+ class Addr < Attribute
243
+ TYPE = 1
244
+ NAME = :"addr"
245
+ end
246
+ # :nodoc:
247
+ BY_NAME = Ractor.make_shareable({:"addr" => Addr}) #: Hash[::Symbol, Attribute]
248
+ # :nodoc:
249
+ BY_TYPE = Ractor.make_shareable({1 => Addr}) #: Hash[::Integer, Attribute]
250
+ class << self
251
+ # Looks up Attribute class by name.
252
+ #--
253
+ # @rbs name: Symbol
254
+ # @rbs return: Attribute
255
+ def by_name(name); BY_NAME.fetch(name); end
256
+ # Looks up Attribute class by type value.
257
+ #--
258
+ # @rbs type: Integer
259
+ # @rbs return: Attribute
260
+ def by_type(type); BY_TYPE.fetch(type); end
261
+ end
262
+ end
263
+ class PoolMode < ::Nl::Protocols::Genl::AttributeSet
264
+ # Abstract class
265
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
266
+ end
267
+ class Mode < Attribute
268
+ TYPE = 1
269
+ NAME = :"mode"
270
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
271
+ end
272
+ class Npools < Attribute
273
+ TYPE = 2
274
+ NAME = :"npools"
275
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
276
+ end
277
+ # :nodoc:
278
+ BY_NAME = Ractor.make_shareable({:"mode" => Mode, :"npools" => Npools}) #: Hash[::Symbol, Attribute]
279
+ # :nodoc:
280
+ BY_TYPE = Ractor.make_shareable({1 => Mode, 2 => Npools}) #: Hash[::Integer, Attribute]
281
+ class << self
282
+ # Looks up Attribute class by name.
283
+ #--
284
+ # @rbs name: Symbol
285
+ # @rbs return: Attribute
286
+ def by_name(name); BY_NAME.fetch(name); end
287
+ # Looks up Attribute class by type value.
288
+ #--
289
+ # @rbs type: Integer
290
+ # @rbs return: Attribute
291
+ def by_type(type); BY_TYPE.fetch(type); end
292
+ end
293
+ end
294
+ ServerProto::Version::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Version)
295
+ ServerSock::Addr::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(Sock)
296
+ end
297
+ module Messages
298
+ # dump pending nfsd rpc
299
+ class DumpRpcStatusGetReply < ::Nl::Protocols::Genl::Message
300
+ TYPE = 1
301
+ FIXED_HEADER = nil
302
+ ATTRIBUTE_SET = AttributeSets::RpcStatus
303
+ ATTRIBUTES = Ractor.make_shareable(%i[xid flags prog version proc service_time saddr4 daddr4 saddr6 daddr6 sport dport compound_ops])
304
+ # Gets the value of `xid` attribute in the message.
305
+ #--
306
+ # @rbs return: ::Integer
307
+ def xid; attributes[:"xid"]&.value; end
308
+ # Gets the value of `flags` attribute in the message.
309
+ #--
310
+ # @rbs return: ::Integer
311
+ def flags; attributes[:"flags"]&.value; end
312
+ # Gets the value of `prog` attribute in the message.
313
+ #--
314
+ # @rbs return: ::Integer
315
+ def prog; attributes[:"prog"]&.value; end
316
+ # Gets the value of `version` attribute in the message.
317
+ #--
318
+ # @rbs return: ::Integer
319
+ def version; attributes[:"version"]&.value; end
320
+ # Gets the value of `proc` attribute in the message.
321
+ #--
322
+ # @rbs return: ::Integer
323
+ def proc; attributes[:"proc"]&.value; end
324
+ # Gets the value of `service-time` attribute in the message.
325
+ #--
326
+ # @rbs return: ::Integer
327
+ def service_time; attributes[:"service_time"]&.value; end
328
+ # Gets the value of `saddr4` attribute in the message.
329
+ #--
330
+ # @rbs return: ::Integer
331
+ def saddr4; attributes[:"saddr4"]&.value; end
332
+ # Gets the value of `daddr4` attribute in the message.
333
+ #--
334
+ # @rbs return: ::Integer
335
+ def daddr4; attributes[:"daddr4"]&.value; end
336
+ # Gets the value of `saddr6` attribute in the message.
337
+ #--
338
+ # @rbs return: untyped
339
+ def saddr6; attributes[:"saddr6"]&.value; end
340
+ # Gets the value of `daddr6` attribute in the message.
341
+ #--
342
+ # @rbs return: untyped
343
+ def daddr6; attributes[:"daddr6"]&.value; end
344
+ # Gets the value of `sport` attribute in the message.
345
+ #--
346
+ # @rbs return: ::Integer
347
+ def sport; attributes[:"sport"]&.value; end
348
+ # Gets the value of `dport` attribute in the message.
349
+ #--
350
+ # @rbs return: ::Integer
351
+ def dport; attributes[:"dport"]&.value; end
352
+ # Gets the value of `compound-ops` attribute in the message.
353
+ #--
354
+ # @rbs return: ::Integer
355
+ def compound_ops; attributes[:"compound_ops"]&.value; end
356
+ end
357
+ # set the number of running threads
358
+ class DoThreadsSetRequest < ::Nl::Protocols::Genl::Message
359
+ TYPE = 2
360
+ FIXED_HEADER = nil
361
+ ATTRIBUTE_SET = AttributeSets::Server
362
+ ATTRIBUTES = Ractor.make_shareable(%i[threads gracetime leasetime scope])
363
+ # Gets the value of `threads` attribute in the message.
364
+ #--
365
+ # @rbs return: ::Integer
366
+ def threads; attributes[:"threads"]&.value; end
367
+ # Gets the value of `gracetime` attribute in the message.
368
+ #--
369
+ # @rbs return: ::Integer
370
+ def gracetime; attributes[:"gracetime"]&.value; end
371
+ # Gets the value of `leasetime` attribute in the message.
372
+ #--
373
+ # @rbs return: ::Integer
374
+ def leasetime; attributes[:"leasetime"]&.value; end
375
+ # Gets the value of `scope` attribute in the message.
376
+ #--
377
+ # @rbs return: ::String
378
+ def scope; attributes[:"scope"]&.value; end
379
+ end
380
+ # get the number of running threads
381
+ class DoThreadsGetReply < ::Nl::Protocols::Genl::Message
382
+ TYPE = 3
383
+ FIXED_HEADER = nil
384
+ ATTRIBUTE_SET = AttributeSets::Server
385
+ ATTRIBUTES = Ractor.make_shareable(%i[threads gracetime leasetime scope])
386
+ # Gets the value of `threads` attribute in the message.
387
+ #--
388
+ # @rbs return: ::Integer
389
+ def threads; attributes[:"threads"]&.value; end
390
+ # Gets the value of `gracetime` attribute in the message.
391
+ #--
392
+ # @rbs return: ::Integer
393
+ def gracetime; attributes[:"gracetime"]&.value; end
394
+ # Gets the value of `leasetime` attribute in the message.
395
+ #--
396
+ # @rbs return: ::Integer
397
+ def leasetime; attributes[:"leasetime"]&.value; end
398
+ # Gets the value of `scope` attribute in the message.
399
+ #--
400
+ # @rbs return: ::String
401
+ def scope; attributes[:"scope"]&.value; end
402
+ end
403
+ # set nfs enabled versions
404
+ class DoVersionSetRequest < ::Nl::Protocols::Genl::Message
405
+ TYPE = 4
406
+ FIXED_HEADER = nil
407
+ ATTRIBUTE_SET = AttributeSets::ServerProto
408
+ ATTRIBUTES = Ractor.make_shareable(%i[version])
409
+ # Gets the value of `version` attribute in the message.
410
+ #--
411
+ # @rbs return: AttributeSets::Version
412
+ def version; attributes[:"version"]&.value; end
413
+ end
414
+ # get nfs enabled versions
415
+ class DoVersionGetReply < ::Nl::Protocols::Genl::Message
416
+ TYPE = 5
417
+ FIXED_HEADER = nil
418
+ ATTRIBUTE_SET = AttributeSets::ServerProto
419
+ ATTRIBUTES = Ractor.make_shareable(%i[version])
420
+ # Gets the value of `version` attribute in the message.
421
+ #--
422
+ # @rbs return: AttributeSets::Version
423
+ def version; attributes[:"version"]&.value; end
424
+ end
425
+ # set nfs running sockets
426
+ class DoListenerSetRequest < ::Nl::Protocols::Genl::Message
427
+ TYPE = 6
428
+ FIXED_HEADER = nil
429
+ ATTRIBUTE_SET = AttributeSets::ServerSock
430
+ ATTRIBUTES = Ractor.make_shareable(%i[addr])
431
+ # Gets the value of `addr` attribute in the message.
432
+ #--
433
+ # @rbs return: AttributeSets::Sock
434
+ def addr; attributes[:"addr"]&.value; end
435
+ end
436
+ # get nfs running listeners
437
+ class DoListenerGetReply < ::Nl::Protocols::Genl::Message
438
+ TYPE = 7
439
+ FIXED_HEADER = nil
440
+ ATTRIBUTE_SET = AttributeSets::ServerSock
441
+ ATTRIBUTES = Ractor.make_shareable(%i[addr])
442
+ # Gets the value of `addr` attribute in the message.
443
+ #--
444
+ # @rbs return: AttributeSets::Sock
445
+ def addr; attributes[:"addr"]&.value; end
446
+ end
447
+ # set the current server pool-mode
448
+ class DoPoolModeSetRequest < ::Nl::Protocols::Genl::Message
449
+ TYPE = 8
450
+ FIXED_HEADER = nil
451
+ ATTRIBUTE_SET = AttributeSets::PoolMode
452
+ ATTRIBUTES = Ractor.make_shareable(%i[mode])
453
+ # Gets the value of `mode` attribute in the message.
454
+ #--
455
+ # @rbs return: ::String
456
+ def mode; attributes[:"mode"]&.value; end
457
+ end
458
+ # get info about server pool-mode
459
+ class DoPoolModeGetReply < ::Nl::Protocols::Genl::Message
460
+ TYPE = 9
461
+ FIXED_HEADER = nil
462
+ ATTRIBUTE_SET = AttributeSets::PoolMode
463
+ ATTRIBUTES = Ractor.make_shareable(%i[mode npools])
464
+ # Gets the value of `mode` attribute in the message.
465
+ #--
466
+ # @rbs return: ::String
467
+ def mode; attributes[:"mode"]&.value; end
468
+ # Gets the value of `npools` attribute in the message.
469
+ #--
470
+ # @rbs return: ::Integer
471
+ def npools; attributes[:"npools"]&.value; end
472
+ end
473
+ end
474
+ # set the number of running threads
475
+ #--
476
+ # @rbs (?threads: ::Integer, ?gracetime: ::Integer, ?leasetime: ::Integer, ?scope: ::String) -> void
477
+ def do_threads_set(**args)
478
+ exchange_message(:"do", Messages::DoThreadsSetRequest, nil, args)
479
+ end
480
+ # set nfs enabled versions
481
+ #--
482
+ # @rbs (?version: AttributeSets::Version) -> void
483
+ def do_version_set(**args)
484
+ exchange_message(:"do", Messages::DoVersionSetRequest, nil, args)
485
+ end
486
+ # set nfs running sockets
487
+ #--
488
+ # @rbs (?addr: AttributeSets::Sock) -> void
489
+ def do_listener_set(**args)
490
+ exchange_message(:"do", Messages::DoListenerSetRequest, nil, args)
491
+ end
492
+ # set the current server pool-mode
493
+ #--
494
+ # @rbs (?mode: ::String) -> void
495
+ def do_pool_mode_set(**args)
496
+ exchange_message(:"do", Messages::DoPoolModeSetRequest, nil, args)
497
+ end
498
+ end