nl-linux 0.2.4 → 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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/.yardopts +5 -0
  4. data/CHANGELOG.md +8 -0
  5. data/Rakefile +27 -5
  6. data/generated/nl/linux/binder.rb +227 -19
  7. data/generated/nl/linux/conntrack.rb +1325 -365
  8. data/generated/nl/linux/dev_energymodel.rb +357 -66
  9. data/generated/nl/linux/devlink.rb +6310 -1859
  10. data/generated/nl/linux/dpll.rb +2202 -376
  11. data/generated/nl/linux/drm_ras.rb +312 -63
  12. data/generated/nl/linux/ethtool.rb +7555 -2447
  13. data/generated/nl/linux/fou.rb +381 -133
  14. data/generated/nl/linux/handshake.rb +340 -70
  15. data/generated/nl/linux/lockd.rb +132 -27
  16. data/generated/nl/linux/mptcp_pm.rb +773 -161
  17. data/generated/nl/linux/net_shaper.rb +892 -211
  18. data/generated/nl/linux/netdev.rb +2366 -518
  19. data/generated/nl/linux/nfsd.rb +1299 -317
  20. data/generated/nl/linux/nftables.rb +5351 -1533
  21. data/generated/nl/linux/nl80211.rb +4601 -882
  22. data/generated/nl/linux/nlctrl.rb +460 -117
  23. data/generated/nl/linux/ovpn.rb +1360 -262
  24. data/generated/nl/linux/ovs_datapath.rb +312 -98
  25. data/generated/nl/linux/ovs_flow.rb +1866 -358
  26. data/generated/nl/linux/ovs_packet.rb +331 -45
  27. data/generated/nl/linux/ovs_vport.rb +374 -123
  28. data/generated/nl/linux/psp.rb +1093 -201
  29. data/generated/nl/linux/rt_addr.rb +423 -165
  30. data/generated/nl/linux/rt_link.rb +6928 -1336
  31. data/generated/nl/linux/rt_neigh.rb +1063 -297
  32. data/generated/nl/linux/rt_route.rb +1112 -483
  33. data/generated/nl/linux/rt_rule.rb +931 -262
  34. data/generated/nl/linux/sunrpc_cache.rb +407 -82
  35. data/generated/nl/linux/tc.rb +10081 -1763
  36. data/generated/nl/linux/tcp_metrics.rb +388 -109
  37. data/generated/nl/linux/team.rb +350 -84
  38. data/generated/nl/linux/wireguard.rb +525 -96
  39. data/generated/nl/linux.rb +1 -0
  40. data/lib/nl/linux/nlctrl_resolver.rb +31 -0
  41. data/lib/nl/linux/version.rb +1 -1
  42. data/sig/generated/nl/linux/binder.rbs +366 -0
  43. data/sig/generated/nl/linux/conntrack.rbs +2787 -0
  44. data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
  45. data/sig/generated/nl/linux/devlink.rbs +12496 -0
  46. data/sig/generated/nl/linux/dpll.rbs +3461 -0
  47. data/sig/generated/nl/linux/drm_ras.rbs +553 -0
  48. data/sig/generated/nl/linux/ethtool.rbs +15291 -0
  49. data/sig/generated/nl/linux/fou.rbs +702 -0
  50. data/sig/generated/nl/linux/handshake.rbs +622 -0
  51. data/sig/generated/nl/linux/lockd.rbs +234 -0
  52. data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
  53. data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
  54. data/sig/generated/nl/linux/netdev.rbs +4187 -0
  55. data/sig/generated/nl/linux/nfsd.rbs +2520 -0
  56. data/sig/generated/nl/linux/nftables.rbs +10304 -0
  57. data/sig/generated/nl/linux/nl80211.rbs +9786 -0
  58. data/sig/generated/nl/linux/nlctrl.rbs +944 -0
  59. data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
  60. data/sig/generated/nl/linux/ovpn.rbs +2564 -0
  61. data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
  62. data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
  63. data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
  64. data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
  65. data/sig/generated/nl/linux/psp.rbs +1846 -0
  66. data/sig/generated/nl/linux/rt_addr.rbs +866 -0
  67. data/sig/generated/nl/linux/rt_link.rbs +13438 -0
  68. data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
  69. data/sig/generated/nl/linux/rt_route.rbs +2218 -0
  70. data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
  71. data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
  72. data/sig/generated/nl/linux/tc.rbs +19931 -0
  73. data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
  74. data/sig/generated/nl/linux/team.rbs +733 -0
  75. data/sig/generated/nl/linux/version.rbs +7 -0
  76. data/sig/generated/nl/linux/wireguard.rbs +1006 -0
  77. data/sig/generated/nl/linux.rbs +6 -0
  78. data/sig/generated/nl-linux.rbs +2 -0
  79. metadata +51 -10
@@ -0,0 +1,1006 @@
1
+ # Generated from generated/nl/linux/wireguard.rb with RBS::Inline
2
+
3
+ module Nl
4
+ module Linux
5
+ # **Netlink protocol to control WireGuard network devices.**
6
+ #
7
+ # The below enums and macros are for interfacing with WireGuard, using generic
8
+ # netlink, with family ``WG_GENL_NAME`` and version ``WG_GENL_VERSION``. It
9
+ # defines two commands: get and set. Note that while they share many common
10
+ # attributes, these two commands actually accept a slightly different set of
11
+ # inputs and outputs. These differences are noted under the individual
12
+ # attributes.
13
+ class Wireguard < ::Nl::Genl::Family
14
+ NAME: ::String
15
+
16
+ VERSION: ::Integer
17
+
18
+ # @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
19
+ # @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
20
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
21
+ # @param [#call] resolver
22
+ # @param [Symbol, nil] executor
23
+ # @param [Integer, nil] notification_capacity
24
+ # @return [Wireguard]
25
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
26
+ # @param [#call] resolver
27
+ # @param [Symbol, nil] executor
28
+ # @param [Integer, nil] notification_capacity
29
+ # @yieldparam [Wireguard] family
30
+ # @return [Object] the result of the block
31
+ def self.open: (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
32
+
33
+ # @private
34
+ MCAST_GROUPS: Hash[::Symbol, ::Nl::McastGroup]
35
+
36
+ module Constants
37
+ WG_KEY_LEN: ::Integer
38
+ end
39
+
40
+ module Flags
41
+ module WgdeviceFlags
42
+ ReplacePeers: ::Integer
43
+ end
44
+
45
+ module WgpeerFlags
46
+ RemoveMe: ::Integer
47
+
48
+ ReplaceAllowedips: ::Integer
49
+
50
+ UpdateOnly: ::Integer
51
+ end
52
+
53
+ module WgallowedipFlags
54
+ RemoveMe: ::Integer
55
+ end
56
+ end
57
+
58
+ module Structs
59
+ class KernelTimespec < Struct[::Integer]
60
+ attr_accessor sec(): ::Integer
61
+
62
+ attr_accessor nsec(): ::Integer
63
+
64
+ def self.new: (?::Integer sec, ?::Integer nsec) -> instance
65
+ | (?sec: ::Integer, ?nsec: ::Integer) -> instance
66
+ end
67
+
68
+ class KernelTimespec
69
+ # @!attribute [rw] sec
70
+ # Number of seconds, since UNIX epoch.
71
+ # @return [Integer]
72
+ # @!attribute [rw] nsec
73
+ # Number of nanoseconds, after the second began.
74
+ # @return [Integer]
75
+ # @private
76
+ MEMBERS: Hash[::Symbol, ::Nl::_DataType]
77
+
78
+ # Decodes the struct.
79
+ # @rbs decoder: ::Nl::Decoder
80
+ # @rbs return: instance
81
+ # @param [Nl::Decoder] decoder
82
+ # @return [self]
83
+ def self.decode: (::Nl::Decoder decoder) -> instance
84
+
85
+ # Encodes the struct.
86
+ # @rbs encoder: ::Nl::Encoder
87
+ # @rbs return: void
88
+ # @param [Nl::Encoder] encoder
89
+ # @return [void]
90
+ def encode: (::Nl::Encoder encoder) -> void
91
+ end
92
+ end
93
+
94
+ module AttributeSets
95
+ class Wgdevice < ::Nl::AttributeSet
96
+ # Abstract class
97
+ class Attribute < ::Nl::AttributeSet::Attribute
98
+ end
99
+
100
+ class Ifindex < Attribute
101
+ TYPE: ::Integer
102
+
103
+ NAME: ::Symbol
104
+
105
+ # @private
106
+ ORDER: ::Integer
107
+
108
+ # @private
109
+ DATATYPE: untyped
110
+ end
111
+
112
+ class Ifname < Attribute
113
+ TYPE: ::Integer
114
+
115
+ NAME: ::Symbol
116
+
117
+ # @private
118
+ ORDER: ::Integer
119
+
120
+ # @private
121
+ DATATYPE: untyped
122
+ end
123
+
124
+ # Set to all zeros to remove.
125
+ class PrivateKey < Attribute
126
+ TYPE: ::Integer
127
+
128
+ NAME: ::Symbol
129
+
130
+ # @private
131
+ ORDER: ::Integer
132
+
133
+ # @private
134
+ DATATYPE: untyped
135
+ end
136
+
137
+ class PublicKey < Attribute
138
+ TYPE: ::Integer
139
+
140
+ NAME: ::Symbol
141
+
142
+ # @private
143
+ ORDER: ::Integer
144
+
145
+ # @private
146
+ DATATYPE: untyped
147
+ end
148
+
149
+ # ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
150
+ # removed prior to adding the list below.
151
+ #
152
+ #
153
+ # Known flags are defined in {Flags::WgdeviceFlags}.
154
+ class Flags < Attribute
155
+ TYPE: ::Integer
156
+
157
+ NAME: ::Symbol
158
+
159
+ # @private
160
+ ORDER: ::Integer
161
+
162
+ # @private
163
+ DATATYPE: untyped
164
+ end
165
+
166
+ # Set as ``0`` to choose randomly.
167
+ class ListenPort < Attribute
168
+ TYPE: ::Integer
169
+
170
+ NAME: ::Symbol
171
+
172
+ # @private
173
+ ORDER: ::Integer
174
+
175
+ # @private
176
+ DATATYPE: untyped
177
+ end
178
+
179
+ # Set as ``0`` to disable.
180
+ class Fwmark < Attribute
181
+ TYPE: ::Integer
182
+
183
+ NAME: ::Symbol
184
+
185
+ # @private
186
+ ORDER: ::Integer
187
+
188
+ # @private
189
+ DATATYPE: untyped
190
+ end
191
+
192
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
193
+ # zero on ``GET_DEVICE`` operations.
194
+ class Peers < Attribute
195
+ TYPE: ::Integer
196
+
197
+ NAME: ::Symbol
198
+
199
+ # @private
200
+ ORDER: ::Integer
201
+ end
202
+
203
+ # @private
204
+ BY_NAME: Hash[::Symbol, Attribute]
205
+
206
+ # @private
207
+ BY_TYPE: Hash[::Integer, Attribute]
208
+
209
+ # @rbs return: ::Integer
210
+ # @return [Integer]
211
+ # @see Ifindex
212
+ def ifindex: () -> ::Integer
213
+
214
+ # @rbs return: ::String
215
+ # @return [String]
216
+ # @see Ifname
217
+ def ifname: () -> ::String
218
+
219
+ # Set to all zeros to remove.
220
+ # @rbs return: ::String
221
+ # @return [String]
222
+ # @see PrivateKey
223
+ def private_key: () -> ::String
224
+
225
+ # @rbs return: ::String
226
+ # @return [String]
227
+ # @see PublicKey
228
+ def public_key: () -> ::String
229
+
230
+ # ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
231
+ # removed prior to adding the list below.
232
+ #
233
+ #
234
+ # Known flags are defined in {Flags::WgdeviceFlags}.
235
+ # @rbs return: ::Integer
236
+ # @return [Integer]
237
+ # @see Flags
238
+ def flags: () -> ::Integer
239
+
240
+ # Set as ``0`` to choose randomly.
241
+ # @rbs return: ::Integer
242
+ # @return [Integer]
243
+ # @see ListenPort
244
+ def listen_port: () -> ::Integer
245
+
246
+ # Set as ``0`` to disable.
247
+ # @rbs return: ::Integer
248
+ # @return [Integer]
249
+ # @see Fwmark
250
+ def fwmark: () -> ::Integer
251
+
252
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
253
+ # zero on ``GET_DEVICE`` operations.
254
+ # @rbs return: ::Array[AttributeSets::Wgpeer]
255
+ # @return [Array<AttributeSets::Wgpeer>]
256
+ # @see Peers
257
+ def peers: () -> ::Array[AttributeSets::Wgpeer]
258
+
259
+ # Looks up Attribute class by name.
260
+ # @rbs name: Symbol
261
+ # @rbs return: Attribute
262
+ # @param [Symbol] name
263
+ # @return [Attribute]
264
+ def self.by_name: (Symbol name) -> Attribute
265
+
266
+ # Looks up Attribute class by type value.
267
+ # @rbs type: Integer
268
+ # @rbs return: Attribute
269
+ # @param [Integer] type
270
+ # @return [Attribute]
271
+ def self.by_type: (Integer type) -> Attribute
272
+ end
273
+
274
+ class Wgpeer < ::Nl::AttributeSet
275
+ # Abstract class
276
+ class Attribute < ::Nl::AttributeSet::Attribute
277
+ end
278
+
279
+ class PublicKey < Attribute
280
+ TYPE: ::Integer
281
+
282
+ NAME: ::Symbol
283
+
284
+ # @private
285
+ ORDER: ::Integer
286
+
287
+ # @private
288
+ DATATYPE: untyped
289
+ end
290
+
291
+ # Set as all zeros to remove.
292
+ class PresharedKey < Attribute
293
+ TYPE: ::Integer
294
+
295
+ NAME: ::Symbol
296
+
297
+ # @private
298
+ ORDER: ::Integer
299
+
300
+ # @private
301
+ DATATYPE: untyped
302
+ end
303
+
304
+ # ``0`` and/or ``WGPEER_F_REMOVE_ME`` if the specified peer should not
305
+ # exist at the end of the operation, rather than added/updated and/or
306
+ # ``WGPEER_F_REPLACE_ALLOWEDIPS`` if all current allowed IPs of this
307
+ # peer should be removed prior to adding the list below and/or
308
+ # ``WGPEER_F_UPDATE_ONLY`` if the peer should only be set if it already
309
+ # exists.
310
+ #
311
+ #
312
+ # Known flags are defined in {Flags::WgpeerFlags}.
313
+ class Flags < Attribute
314
+ TYPE: ::Integer
315
+
316
+ NAME: ::Symbol
317
+
318
+ # @private
319
+ ORDER: ::Integer
320
+
321
+ # @private
322
+ DATATYPE: untyped
323
+ end
324
+
325
+ # struct sockaddr_in or struct sockaddr_in6
326
+ class Endpoint < Attribute
327
+ TYPE: ::Integer
328
+
329
+ NAME: ::Symbol
330
+
331
+ # @private
332
+ ORDER: ::Integer
333
+
334
+ # @private
335
+ DATATYPE: untyped
336
+ end
337
+
338
+ # Set as ``0`` to disable.
339
+ class PersistentKeepaliveInterval < Attribute
340
+ TYPE: ::Integer
341
+
342
+ NAME: ::Symbol
343
+
344
+ # @private
345
+ ORDER: ::Integer
346
+
347
+ # @private
348
+ DATATYPE: untyped
349
+ end
350
+
351
+ class LastHandshakeTime < Attribute
352
+ TYPE: ::Integer
353
+
354
+ NAME: ::Symbol
355
+
356
+ # @private
357
+ ORDER: ::Integer
358
+
359
+ # @private
360
+ DATATYPE: untyped
361
+ end
362
+
363
+ class RxBytes < Attribute
364
+ TYPE: ::Integer
365
+
366
+ NAME: ::Symbol
367
+
368
+ # @private
369
+ ORDER: ::Integer
370
+
371
+ # @private
372
+ DATATYPE: untyped
373
+ end
374
+
375
+ class TxBytes < Attribute
376
+ TYPE: ::Integer
377
+
378
+ NAME: ::Symbol
379
+
380
+ # @private
381
+ ORDER: ::Integer
382
+
383
+ # @private
384
+ DATATYPE: untyped
385
+ end
386
+
387
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
388
+ # zero on ``GET_DEVICE`` operations.
389
+ class Allowedips < Attribute
390
+ TYPE: ::Integer
391
+
392
+ NAME: ::Symbol
393
+
394
+ # @private
395
+ ORDER: ::Integer
396
+ end
397
+
398
+ # Should not be set or used at all by most users of this API, as the
399
+ # most recent protocol will be used when this is unset. Otherwise,
400
+ # must be set to ``1``.
401
+ class ProtocolVersion < Attribute
402
+ TYPE: ::Integer
403
+
404
+ NAME: ::Symbol
405
+
406
+ # @private
407
+ ORDER: ::Integer
408
+
409
+ # @private
410
+ DATATYPE: untyped
411
+ end
412
+
413
+ # @private
414
+ BY_NAME: Hash[::Symbol, Attribute]
415
+
416
+ # @private
417
+ BY_TYPE: Hash[::Integer, Attribute]
418
+
419
+ # @rbs return: ::String
420
+ # @return [String]
421
+ # @see PublicKey
422
+ def public_key: () -> ::String
423
+
424
+ # Set as all zeros to remove.
425
+ # @rbs return: ::String
426
+ # @return [String]
427
+ # @see PresharedKey
428
+ def preshared_key: () -> ::String
429
+
430
+ # ``0`` and/or ``WGPEER_F_REMOVE_ME`` if the specified peer should not
431
+ # exist at the end of the operation, rather than added/updated and/or
432
+ # ``WGPEER_F_REPLACE_ALLOWEDIPS`` if all current allowed IPs of this
433
+ # peer should be removed prior to adding the list below and/or
434
+ # ``WGPEER_F_UPDATE_ONLY`` if the peer should only be set if it already
435
+ # exists.
436
+ #
437
+ #
438
+ # Known flags are defined in {Flags::WgpeerFlags}.
439
+ # @rbs return: ::Integer
440
+ # @return [Integer]
441
+ # @see Flags
442
+ def flags: () -> ::Integer
443
+
444
+ # struct sockaddr_in or struct sockaddr_in6
445
+ # @rbs return: ::String
446
+ # @return [String]
447
+ # @see Endpoint
448
+ def endpoint: () -> ::String
449
+
450
+ # Set as ``0`` to disable.
451
+ # @rbs return: ::Integer
452
+ # @return [Integer]
453
+ # @see PersistentKeepaliveInterval
454
+ def persistent_keepalive_interval: () -> ::Integer
455
+
456
+ # @rbs return: Structs::KernelTimespec
457
+ # @return [Structs::KernelTimespec]
458
+ # @see LastHandshakeTime
459
+ def last_handshake_time: () -> Structs::KernelTimespec
460
+
461
+ # @rbs return: ::Integer
462
+ # @return [Integer]
463
+ # @see RxBytes
464
+ def rx_bytes: () -> ::Integer
465
+
466
+ # @rbs return: ::Integer
467
+ # @return [Integer]
468
+ # @see TxBytes
469
+ def tx_bytes: () -> ::Integer
470
+
471
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
472
+ # zero on ``GET_DEVICE`` operations.
473
+ # @rbs return: ::Array[AttributeSets::Wgallowedip]
474
+ # @return [Array<AttributeSets::Wgallowedip>]
475
+ # @see Allowedips
476
+ def allowedips: () -> ::Array[AttributeSets::Wgallowedip]
477
+
478
+ # Should not be set or used at all by most users of this API, as the
479
+ # most recent protocol will be used when this is unset. Otherwise,
480
+ # must be set to ``1``.
481
+ # @rbs return: ::Integer
482
+ # @return [Integer]
483
+ # @see ProtocolVersion
484
+ def protocol_version: () -> ::Integer
485
+
486
+ # Looks up Attribute class by name.
487
+ # @rbs name: Symbol
488
+ # @rbs return: Attribute
489
+ # @param [Symbol] name
490
+ # @return [Attribute]
491
+ def self.by_name: (Symbol name) -> Attribute
492
+
493
+ # Looks up Attribute class by type value.
494
+ # @rbs type: Integer
495
+ # @rbs return: Attribute
496
+ # @param [Integer] type
497
+ # @return [Attribute]
498
+ def self.by_type: (Integer type) -> Attribute
499
+ end
500
+
501
+ class Wgallowedip < ::Nl::AttributeSet
502
+ # Abstract class
503
+ class Attribute < ::Nl::AttributeSet::Attribute
504
+ end
505
+
506
+ # IP family, either ``AF_INET`` or ``AF_INET6``.
507
+ class Family < Attribute
508
+ TYPE: ::Integer
509
+
510
+ NAME: ::Symbol
511
+
512
+ # @private
513
+ ORDER: ::Integer
514
+
515
+ # @private
516
+ DATATYPE: untyped
517
+ end
518
+
519
+ # Either ``struct in_addr`` or ``struct in6_addr``.
520
+ class Ipaddr < Attribute
521
+ TYPE: ::Integer
522
+
523
+ NAME: ::Symbol
524
+
525
+ # @private
526
+ ORDER: ::Integer
527
+
528
+ # @private
529
+ DATATYPE: untyped
530
+ end
531
+
532
+ class CidrMask < Attribute
533
+ TYPE: ::Integer
534
+
535
+ NAME: ::Symbol
536
+
537
+ # @private
538
+ ORDER: ::Integer
539
+
540
+ # @private
541
+ DATATYPE: untyped
542
+ end
543
+
544
+ # ``WGALLOWEDIP_F_REMOVE_ME`` if the specified IP should be removed;
545
+ # otherwise, this IP will be added if it is not already present.
546
+ #
547
+ #
548
+ # Known flags are defined in {Flags::WgallowedipFlags}.
549
+ class Flags < Attribute
550
+ TYPE: ::Integer
551
+
552
+ NAME: ::Symbol
553
+
554
+ # @private
555
+ ORDER: ::Integer
556
+
557
+ # @private
558
+ DATATYPE: untyped
559
+ end
560
+
561
+ # @private
562
+ BY_NAME: Hash[::Symbol, Attribute]
563
+
564
+ # @private
565
+ BY_TYPE: Hash[::Integer, Attribute]
566
+
567
+ # IP family, either ``AF_INET`` or ``AF_INET6``.
568
+ # @rbs return: ::Integer
569
+ # @return [Integer]
570
+ # @see Family
571
+ def family: () -> ::Integer
572
+
573
+ # Either ``struct in_addr`` or ``struct in6_addr``.
574
+ # @rbs return: ::String
575
+ # @return [String]
576
+ # @see Ipaddr
577
+ def ipaddr: () -> ::String
578
+
579
+ # @rbs return: ::Integer
580
+ # @return [Integer]
581
+ # @see CidrMask
582
+ def cidr_mask: () -> ::Integer
583
+
584
+ # ``WGALLOWEDIP_F_REMOVE_ME`` if the specified IP should be removed;
585
+ # otherwise, this IP will be added if it is not already present.
586
+ #
587
+ #
588
+ # Known flags are defined in {Flags::WgallowedipFlags}.
589
+ # @rbs return: ::Integer
590
+ # @return [Integer]
591
+ # @see Flags
592
+ def flags: () -> ::Integer
593
+
594
+ # Looks up Attribute class by name.
595
+ # @rbs name: Symbol
596
+ # @rbs return: Attribute
597
+ # @param [Symbol] name
598
+ # @return [Attribute]
599
+ def self.by_name: (Symbol name) -> Attribute
600
+
601
+ # Looks up Attribute class by type value.
602
+ # @rbs type: Integer
603
+ # @rbs return: Attribute
604
+ # @param [Integer] type
605
+ # @return [Attribute]
606
+ def self.by_type: (Integer type) -> Attribute
607
+ end
608
+ end
609
+
610
+ module Messages
611
+ # Retrieve WireGuard device
612
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~
613
+ #
614
+ # The command should be called with one but not both of:
615
+ #
616
+ # - ``WGDEVICE_A_IFINDEX``
617
+ # - ``WGDEVICE_A_IFNAME``
618
+ #
619
+ # The kernel will then return several messages (``NLM_F_MULTI``). It is
620
+ # possible that all of the allowed IPs of a single peer will not fit
621
+ # within a single netlink message. In that case, the same peer will be
622
+ # written in the following message, except it will only contain
623
+ # ``WGPEER_A_PUBLIC_KEY`` and ``WGPEER_A_ALLOWEDIPS``. This may occur
624
+ # several times in a row for the same peer. It is then up to the receiver
625
+ # to coalesce adjacent peers. Likewise, it is possible that all peers will
626
+ # not fit within a single message. So, subsequent peers will be sent in
627
+ # following messages, except those will only contain ``WGDEVICE_A_IFNAME``
628
+ # and ``WGDEVICE_A_PEERS``. It is then up to the receiver to coalesce
629
+ # these messages to form the complete list of peers.
630
+ #
631
+ # Since this is an ``NLA_F_DUMP`` command, the final message will always
632
+ # be ``NLMSG_DONE``, even if an error occurs. However, this ``NLMSG_DONE``
633
+ # message contains an integer error code. It is either zero or a negative
634
+ # error code corresponding to the errno.
635
+ #
636
+ #
637
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
638
+ class DumpGetDeviceRequest < ::Nl::Genl::Message
639
+ TYPE: ::Integer
640
+
641
+ FIXED_HEADER: untyped
642
+
643
+ ATTRIBUTE_SET: untyped
644
+
645
+ ATTRIBUTES: untyped
646
+
647
+ # @rbs return: ::Integer
648
+ # @return [Integer]
649
+ # @see AttributeSets::Wgdevice::Ifindex
650
+ def ifindex: () -> ::Integer
651
+
652
+ # @rbs return: ::String
653
+ # @return [String]
654
+ # @see AttributeSets::Wgdevice::Ifname
655
+ def ifname: () -> ::String
656
+ end
657
+
658
+ # Retrieve WireGuard device
659
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~
660
+ #
661
+ # The command should be called with one but not both of:
662
+ #
663
+ # - ``WGDEVICE_A_IFINDEX``
664
+ # - ``WGDEVICE_A_IFNAME``
665
+ #
666
+ # The kernel will then return several messages (``NLM_F_MULTI``). It is
667
+ # possible that all of the allowed IPs of a single peer will not fit
668
+ # within a single netlink message. In that case, the same peer will be
669
+ # written in the following message, except it will only contain
670
+ # ``WGPEER_A_PUBLIC_KEY`` and ``WGPEER_A_ALLOWEDIPS``. This may occur
671
+ # several times in a row for the same peer. It is then up to the receiver
672
+ # to coalesce adjacent peers. Likewise, it is possible that all peers will
673
+ # not fit within a single message. So, subsequent peers will be sent in
674
+ # following messages, except those will only contain ``WGDEVICE_A_IFNAME``
675
+ # and ``WGDEVICE_A_PEERS``. It is then up to the receiver to coalesce
676
+ # these messages to form the complete list of peers.
677
+ #
678
+ # Since this is an ``NLA_F_DUMP`` command, the final message will always
679
+ # be ``NLMSG_DONE``, even if an error occurs. However, this ``NLMSG_DONE``
680
+ # message contains an integer error code. It is either zero or a negative
681
+ # error code corresponding to the errno.
682
+ #
683
+ #
684
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
685
+ class DumpGetDeviceReply < ::Nl::Genl::Message
686
+ TYPE: ::Integer
687
+
688
+ FIXED_HEADER: untyped
689
+
690
+ ATTRIBUTE_SET: untyped
691
+
692
+ ATTRIBUTES: untyped
693
+
694
+ # @rbs return: ::Integer
695
+ # @return [Integer]
696
+ # @see AttributeSets::Wgdevice::Ifindex
697
+ def ifindex: () -> ::Integer
698
+
699
+ # @rbs return: ::String
700
+ # @return [String]
701
+ # @see AttributeSets::Wgdevice::Ifname
702
+ def ifname: () -> ::String
703
+
704
+ # Set to all zeros to remove.
705
+ # @rbs return: ::String
706
+ # @return [String]
707
+ # @see AttributeSets::Wgdevice::PrivateKey
708
+ def private_key: () -> ::String
709
+
710
+ # @rbs return: ::String
711
+ # @return [String]
712
+ # @see AttributeSets::Wgdevice::PublicKey
713
+ def public_key: () -> ::String
714
+
715
+ # ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
716
+ # removed prior to adding the list below.
717
+ #
718
+ #
719
+ # Known flags are defined in {Flags::WgdeviceFlags}.
720
+ # @rbs return: ::Integer
721
+ # @return [Integer]
722
+ # @see AttributeSets::Wgdevice::Flags
723
+ def flags: () -> ::Integer
724
+
725
+ # Set as ``0`` to choose randomly.
726
+ # @rbs return: ::Integer
727
+ # @return [Integer]
728
+ # @see AttributeSets::Wgdevice::ListenPort
729
+ def listen_port: () -> ::Integer
730
+
731
+ # Set as ``0`` to disable.
732
+ # @rbs return: ::Integer
733
+ # @return [Integer]
734
+ # @see AttributeSets::Wgdevice::Fwmark
735
+ def fwmark: () -> ::Integer
736
+
737
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
738
+ # zero on ``GET_DEVICE`` operations.
739
+ # @rbs return: ::Array[AttributeSets::Wgpeer]
740
+ # @return [Array<AttributeSets::Wgpeer>]
741
+ # @see AttributeSets::Wgdevice::Peers
742
+ def peers: () -> ::Array[AttributeSets::Wgpeer]
743
+ end
744
+
745
+ # Set WireGuard device
746
+ # ~~~~~~~~~~~~~~~~~~~~
747
+ #
748
+ # This command should be called with a wgdevice set, containing one but
749
+ # not both of ``WGDEVICE_A_IFINDEX`` and ``WGDEVICE_A_IFNAME``.
750
+ #
751
+ # It is possible that the amount of configuration data exceeds that of the
752
+ # maximum message length accepted by the kernel. In that case, several
753
+ # messages should be sent one after another, with each successive one
754
+ # filling in information not contained in the prior. Note that if
755
+ # ``WGDEVICE_F_REPLACE_PEERS`` is specified in the first message, it
756
+ # probably should not be specified in fragments that come after, so that
757
+ # the list of peers is only cleared the first time but appended after.
758
+ # Likewise for peers, if ``WGPEER_F_REPLACE_ALLOWEDIPS`` is specified in
759
+ # the first message of a peer, it likely should not be specified in
760
+ # subsequent fragments.
761
+ #
762
+ # If an error occurs, ``NLMSG_ERROR`` will reply containing an errno.
763
+ #
764
+ #
765
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
766
+ class DoSetDeviceRequest < ::Nl::Genl::Message
767
+ TYPE: ::Integer
768
+
769
+ FIXED_HEADER: untyped
770
+
771
+ ATTRIBUTE_SET: untyped
772
+
773
+ ATTRIBUTES: untyped
774
+
775
+ # @rbs return: ::Integer
776
+ # @return [Integer]
777
+ # @see AttributeSets::Wgdevice::Ifindex
778
+ def ifindex: () -> ::Integer
779
+
780
+ # @rbs return: ::String
781
+ # @return [String]
782
+ # @see AttributeSets::Wgdevice::Ifname
783
+ def ifname: () -> ::String
784
+
785
+ # Set to all zeros to remove.
786
+ # @rbs return: ::String
787
+ # @return [String]
788
+ # @see AttributeSets::Wgdevice::PrivateKey
789
+ def private_key: () -> ::String
790
+
791
+ # @rbs return: ::String
792
+ # @return [String]
793
+ # @see AttributeSets::Wgdevice::PublicKey
794
+ def public_key: () -> ::String
795
+
796
+ # ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
797
+ # removed prior to adding the list below.
798
+ #
799
+ #
800
+ # Known flags are defined in {Flags::WgdeviceFlags}.
801
+ # @rbs return: ::Integer
802
+ # @return [Integer]
803
+ # @see AttributeSets::Wgdevice::Flags
804
+ def flags: () -> ::Integer
805
+
806
+ # Set as ``0`` to choose randomly.
807
+ # @rbs return: ::Integer
808
+ # @return [Integer]
809
+ # @see AttributeSets::Wgdevice::ListenPort
810
+ def listen_port: () -> ::Integer
811
+
812
+ # Set as ``0`` to disable.
813
+ # @rbs return: ::Integer
814
+ # @return [Integer]
815
+ # @see AttributeSets::Wgdevice::Fwmark
816
+ def fwmark: () -> ::Integer
817
+
818
+ # The index/type parameter is unused on ``SET_DEVICE`` operations and is
819
+ # zero on ``GET_DEVICE`` operations.
820
+ # @rbs return: ::Array[AttributeSets::Wgpeer]
821
+ # @return [Array<AttributeSets::Wgpeer>]
822
+ # @see AttributeSets::Wgdevice::Peers
823
+ def peers: () -> ::Array[AttributeSets::Wgpeer]
824
+ end
825
+ end
826
+
827
+ module Notifications
828
+ end
829
+
830
+ # @private
831
+ NOTIFICATIONS: Hash[::Integer, ::Class]
832
+
833
+ # Retrieve WireGuard device
834
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~
835
+ #
836
+ # The command should be called with one but not both of:
837
+ #
838
+ # - ``WGDEVICE_A_IFINDEX``
839
+ # - ``WGDEVICE_A_IFNAME``
840
+ #
841
+ # The kernel will then return several messages (``NLM_F_MULTI``). It is
842
+ # possible that all of the allowed IPs of a single peer will not fit
843
+ # within a single netlink message. In that case, the same peer will be
844
+ # written in the following message, except it will only contain
845
+ # ``WGPEER_A_PUBLIC_KEY`` and ``WGPEER_A_ALLOWEDIPS``. This may occur
846
+ # several times in a row for the same peer. It is then up to the receiver
847
+ # to coalesce adjacent peers. Likewise, it is possible that all peers will
848
+ # not fit within a single message. So, subsequent peers will be sent in
849
+ # following messages, except those will only contain ``WGDEVICE_A_IFNAME``
850
+ # and ``WGDEVICE_A_PEERS``. It is then up to the receiver to coalesce
851
+ # these messages to form the complete list of peers.
852
+ #
853
+ # Since this is an ``NLA_F_DUMP`` command, the final message will always
854
+ # be ``NLMSG_DONE``, even if an error occurs. However, this ``NLMSG_DONE``
855
+ # message contains an integer error code. It is either zero or a negative
856
+ # error code corresponding to the errno.
857
+ #
858
+ #
859
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
860
+ # @rbs (?ifindex: ::Integer, ?ifname: ::String) -> Array[Messages::DumpGetDeviceReply]
861
+ # | (?ifindex: ::Integer, ?ifname: ::String) { (Messages::DumpGetDeviceReply) -> void } -> void
862
+ # @overload dump_get_device(**args)
863
+ # Returns an array when no block is given.
864
+ # @param [Hash] args
865
+ # @option args [Integer] ifindex
866
+ # @option args [String] ifname
867
+ # @return [Array<Messages::DumpGetDeviceReply>]
868
+ # @overload dump_get_device(**args, &block)
869
+ # Yields each reply when a block is given.
870
+ # @param [Hash] args
871
+ # @option args [Integer] ifindex
872
+ # @option args [String] ifname
873
+ # @yieldparam [Messages::DumpGetDeviceReply] reply
874
+ # @return [void]
875
+ # @see Messages::DumpGetDeviceRequest
876
+ def dump_get_device: (?ifindex: ::Integer, ?ifname: ::String) -> Array[Messages::DumpGetDeviceReply]
877
+ | (?ifindex: ::Integer, ?ifname: ::String) { (Messages::DumpGetDeviceReply) -> void } -> void
878
+
879
+ # Set WireGuard device
880
+ # ~~~~~~~~~~~~~~~~~~~~
881
+ #
882
+ # This command should be called with a wgdevice set, containing one but
883
+ # not both of ``WGDEVICE_A_IFINDEX`` and ``WGDEVICE_A_IFNAME``.
884
+ #
885
+ # It is possible that the amount of configuration data exceeds that of the
886
+ # maximum message length accepted by the kernel. In that case, several
887
+ # messages should be sent one after another, with each successive one
888
+ # filling in information not contained in the prior. Note that if
889
+ # ``WGDEVICE_F_REPLACE_PEERS`` is specified in the first message, it
890
+ # probably should not be specified in fragments that come after, so that
891
+ # the list of peers is only cleared the first time but appended after.
892
+ # Likewise for peers, if ``WGPEER_F_REPLACE_ALLOWEDIPS`` is specified in
893
+ # the first message of a peer, it likely should not be specified in
894
+ # subsequent fragments.
895
+ #
896
+ # If an error occurs, ``NLMSG_ERROR`` will reply containing an errno.
897
+ #
898
+ #
899
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
900
+ # @rbs (?ifindex: ::Integer, ?ifname: ::String, ?private_key: ::String, ?public_key: ::String, ?flags: ::Integer, ?listen_port: ::Integer, ?fwmark: ::Integer, ?peers: ::Array[(AttributeSets::Wgpeer | ::Hash[::Symbol, untyped])]) -> void
901
+ # @param [Hash] args
902
+ # @option args [Integer] ifindex
903
+ # @option args [String] ifname
904
+ # @option args [String] private_key Set to all zeros to remove.
905
+ # @option args [String] public_key
906
+ # @option args [Integer] flags ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
907
+ # removed prior to adding the list below.
908
+ #
909
+ #
910
+ # Known flags are defined in {Flags::WgdeviceFlags}.
911
+ # @option args [Integer] listen_port Set as ``0`` to choose randomly.
912
+ # @option args [Integer] fwmark Set as ``0`` to disable.
913
+ # @option args [Array<AttributeSets::Wgpeer, Hash<Symbol, Object>>] peers The index/type parameter is unused on ``SET_DEVICE`` operations and is
914
+ # zero on ``GET_DEVICE`` operations.
915
+ # @return [void]
916
+ # @see Messages::DoSetDeviceRequest
917
+ def do_set_device: (?ifindex: ::Integer, ?ifname: ::String, ?private_key: ::String, ?public_key: ::String, ?flags: ::Integer, ?listen_port: ::Integer, ?fwmark: ::Integer, ?peers: ::Array[AttributeSets::Wgpeer | ::Hash[::Symbol, untyped]]) -> void
918
+
919
+ class AsyncOperations
920
+ # @private
921
+ def initialize: () ?{ (?) -> untyped } -> untyped
922
+
923
+ # Retrieve WireGuard device
924
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~
925
+ #
926
+ # The command should be called with one but not both of:
927
+ #
928
+ # - ``WGDEVICE_A_IFINDEX``
929
+ # - ``WGDEVICE_A_IFNAME``
930
+ #
931
+ # The kernel will then return several messages (``NLM_F_MULTI``). It is
932
+ # possible that all of the allowed IPs of a single peer will not fit
933
+ # within a single netlink message. In that case, the same peer will be
934
+ # written in the following message, except it will only contain
935
+ # ``WGPEER_A_PUBLIC_KEY`` and ``WGPEER_A_ALLOWEDIPS``. This may occur
936
+ # several times in a row for the same peer. It is then up to the receiver
937
+ # to coalesce adjacent peers. Likewise, it is possible that all peers will
938
+ # not fit within a single message. So, subsequent peers will be sent in
939
+ # following messages, except those will only contain ``WGDEVICE_A_IFNAME``
940
+ # and ``WGDEVICE_A_PEERS``. It is then up to the receiver to coalesce
941
+ # these messages to form the complete list of peers.
942
+ #
943
+ # Since this is an ``NLA_F_DUMP`` command, the final message will always
944
+ # be ``NLMSG_DONE``, even if an error occurs. However, this ``NLMSG_DONE``
945
+ # message contains an integer error code. It is either zero or a negative
946
+ # error code corresponding to the errno.
947
+ #
948
+ #
949
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
950
+ # @rbs (?ifindex: ::Integer, ?ifname: ::String) -> ::Nl::Async::Stream[Messages::DumpGetDeviceReply]
951
+ # @param [Hash] args
952
+ # @option args [Integer] ifindex
953
+ # @option args [String] ifname
954
+ # @return [Nl::Async::Stream<Messages::DumpGetDeviceReply>]
955
+ # @see Messages::DumpGetDeviceRequest
956
+ def dump_get_device: (?ifindex: ::Integer, ?ifname: ::String) -> ::Nl::Async::Stream[Messages::DumpGetDeviceReply]
957
+
958
+ # Set WireGuard device
959
+ # ~~~~~~~~~~~~~~~~~~~~
960
+ #
961
+ # This command should be called with a wgdevice set, containing one but
962
+ # not both of ``WGDEVICE_A_IFINDEX`` and ``WGDEVICE_A_IFNAME``.
963
+ #
964
+ # It is possible that the amount of configuration data exceeds that of the
965
+ # maximum message length accepted by the kernel. In that case, several
966
+ # messages should be sent one after another, with each successive one
967
+ # filling in information not contained in the prior. Note that if
968
+ # ``WGDEVICE_F_REPLACE_PEERS`` is specified in the first message, it
969
+ # probably should not be specified in fragments that come after, so that
970
+ # the list of peers is only cleared the first time but appended after.
971
+ # Likewise for peers, if ``WGPEER_F_REPLACE_ALLOWEDIPS`` is specified in
972
+ # the first message of a peer, it likely should not be specified in
973
+ # subsequent fragments.
974
+ #
975
+ # If an error occurs, ``NLMSG_ERROR`` will reply containing an errno.
976
+ #
977
+ #
978
+ # Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
979
+ # @rbs (?ifindex: ::Integer, ?ifname: ::String, ?private_key: ::String, ?public_key: ::String, ?flags: ::Integer, ?listen_port: ::Integer, ?fwmark: ::Integer, ?peers: ::Array[(AttributeSets::Wgpeer | ::Hash[::Symbol, untyped])]) -> ::Nl::Async::Future[void]
980
+ # @param [Hash] args
981
+ # @option args [Integer] ifindex
982
+ # @option args [String] ifname
983
+ # @option args [String] private_key Set to all zeros to remove.
984
+ # @option args [String] public_key
985
+ # @option args [Integer] flags ``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
986
+ # removed prior to adding the list below.
987
+ #
988
+ #
989
+ # Known flags are defined in {Flags::WgdeviceFlags}.
990
+ # @option args [Integer] listen_port Set as ``0`` to choose randomly.
991
+ # @option args [Integer] fwmark Set as ``0`` to disable.
992
+ # @option args [Array<AttributeSets::Wgpeer, Hash<Symbol, Object>>] peers The index/type parameter is unused on ``SET_DEVICE`` operations and is
993
+ # zero on ``GET_DEVICE`` operations.
994
+ # @return [Nl::Async::Future<void>]
995
+ # @see Messages::DoSetDeviceRequest
996
+ def do_set_device: (?ifindex: ::Integer, ?ifname: ::String, ?private_key: ::String, ?public_key: ::String, ?flags: ::Integer, ?listen_port: ::Integer, ?fwmark: ::Integer, ?peers: ::Array[AttributeSets::Wgpeer | ::Hash[::Symbol, untyped]]) -> ::Nl::Async::Future[void]
997
+ end
998
+
999
+ # Returns the asynchronous operation facade for this family.
1000
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
1001
+ # @param [::Integer, nil] stream_capacity
1002
+ # @return [AsyncOperations]
1003
+ def async: (?stream_capacity: ::Integer?) -> AsyncOperations
1004
+ end
1005
+ end
1006
+ end