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,91 +3,193 @@
3
3
  # This file is based on Documentation/netlink/specs/fou.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
  # Foo-over-UDP.
11
- class Fou < ::Nl::Family
10
+ class Fou < ::Nl::Genl::Family
12
11
  NAME = "fou"
13
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("fou"))
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 [Fou]
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 [Fou] 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
+ module EncapType
33
+ Unspec = 0
34
+ Direct = 1
35
+ Gue = 2
36
+ end
37
+ end
15
38
  module Structs
16
39
  end
17
40
  module AttributeSets
18
- class Fou < ::Nl::Protocols::Genl::AttributeSet
41
+ class Fou < ::Nl::AttributeSet
19
42
  # Abstract class
20
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
43
+ class Attribute < ::Nl::AttributeSet::Attribute
21
44
  end
22
45
  class Port < Attribute
23
46
  TYPE = 1
24
47
  NAME = :"port"
25
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
48
+ # @private
49
+ ORDER = 0
50
+ # @private
51
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
26
52
  end
27
53
  class Af < Attribute
28
54
  TYPE = 2
29
55
  NAME = :"af"
30
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
56
+ # @private
57
+ ORDER = 1
58
+ # @private
59
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
31
60
  end
32
61
  class Ipproto < Attribute
33
62
  TYPE = 3
34
63
  NAME = :"ipproto"
35
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
64
+ # @private
65
+ ORDER = 2
66
+ # @private
67
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
36
68
  end
37
69
  class Type < Attribute
38
70
  TYPE = 4
39
71
  NAME = :"type"
40
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
72
+ # @private
73
+ ORDER = 3
74
+ # @private
75
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
41
76
  end
42
77
  class RemcsumNopartial < Attribute
43
78
  TYPE = 5
44
79
  NAME = :"remcsum_nopartial"
45
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
80
+ # @private
81
+ ORDER = 4
82
+ # @private
83
+ DATATYPE = ::Nl::DataTypes::Flag.new
46
84
  end
47
85
  class LocalV4 < Attribute
48
86
  TYPE = 6
49
87
  NAME = :"local_v4"
50
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
88
+ # @private
89
+ ORDER = 5
90
+ # @private
91
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
51
92
  end
52
93
  class LocalV6 < Attribute
53
94
  TYPE = 7
54
95
  NAME = :"local_v6"
55
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
96
+ # @private
97
+ ORDER = 6
98
+ # @private
99
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
56
100
  end
57
101
  class PeerV4 < Attribute
58
102
  TYPE = 8
59
103
  NAME = :"peer_v4"
60
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
104
+ # @private
105
+ ORDER = 7
106
+ # @private
107
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
61
108
  end
62
109
  class PeerV6 < Attribute
63
110
  TYPE = 9
64
111
  NAME = :"peer_v6"
65
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
112
+ # @private
113
+ ORDER = 8
114
+ # @private
115
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
66
116
  end
67
117
  class PeerPort < Attribute
68
118
  TYPE = 10
69
119
  NAME = :"peer_port"
70
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
120
+ # @private
121
+ ORDER = 9
122
+ # @private
123
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
71
124
  end
72
125
  class Ifindex < Attribute
73
126
  TYPE = 11
74
127
  NAME = :"ifindex"
75
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
128
+ # @private
129
+ ORDER = 10
130
+ # @private
131
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
76
132
  end
77
- # :nodoc:
133
+ # @private
78
134
  BY_NAME = Ractor.make_shareable({:"port" => Port, :"af" => Af, :"ipproto" => Ipproto, :"type" => Type, :"remcsum_nopartial" => RemcsumNopartial, :"local_v4" => LocalV4, :"local_v6" => LocalV6, :"peer_v4" => PeerV4, :"peer_v6" => PeerV6, :"peer_port" => PeerPort, :"ifindex" => Ifindex}) #: Hash[::Symbol, Attribute]
79
- # :nodoc:
135
+ # @private
80
136
  BY_TYPE = Ractor.make_shareable({1 => Port, 2 => Af, 3 => Ipproto, 4 => Type, 5 => RemcsumNopartial, 6 => LocalV4, 7 => LocalV6, 8 => PeerV4, 9 => PeerV6, 10 => PeerPort, 11 => Ifindex}) #: Hash[::Integer, Attribute]
137
+ # @rbs return: ::Integer
138
+ # @return [Integer]
139
+ # @see Port
140
+ def port; self[:"port"]&.value; end
141
+ # @rbs return: ::Integer
142
+ # @return [Integer]
143
+ # @see Af
144
+ def af; self[:"af"]&.value; end
145
+ # @rbs return: ::Integer
146
+ # @return [Integer]
147
+ # @see Ipproto
148
+ def ipproto; self[:"ipproto"]&.value; end
149
+ # @rbs return: ::Integer
150
+ # @return [Integer]
151
+ # @see Type
152
+ def type; self[:"type"]&.value; end
153
+ # @rbs return: ::Integer
154
+ # @return [Integer]
155
+ # @see RemcsumNopartial
156
+ def remcsum_nopartial; self[:"remcsum_nopartial"]&.value; end
157
+ # @rbs return: ::Integer
158
+ # @return [Integer]
159
+ # @see LocalV4
160
+ def local_v4; self[:"local_v4"]&.value; end
161
+ # @rbs return: ::String
162
+ # @return [String]
163
+ # @see LocalV6
164
+ def local_v6; self[:"local_v6"]&.value; end
165
+ # @rbs return: ::Integer
166
+ # @return [Integer]
167
+ # @see PeerV4
168
+ def peer_v4; self[:"peer_v4"]&.value; end
169
+ # @rbs return: ::String
170
+ # @return [String]
171
+ # @see PeerV6
172
+ def peer_v6; self[:"peer_v6"]&.value; end
173
+ # @rbs return: ::Integer
174
+ # @return [Integer]
175
+ # @see PeerPort
176
+ def peer_port; self[:"peer_port"]&.value; end
177
+ # @rbs return: ::Integer
178
+ # @return [Integer]
179
+ # @see Ifindex
180
+ def ifindex; self[:"ifindex"]&.value; end
81
181
  class << self
82
182
  # Looks up Attribute class by name.
83
- #--
84
183
  # @rbs name: Symbol
85
184
  # @rbs return: Attribute
185
+ # @param [Symbol] name
186
+ # @return [Attribute]
86
187
  def by_name(name); BY_NAME.fetch(name); end
87
188
  # Looks up Attribute class by type value.
88
- #--
89
189
  # @rbs type: Integer
90
190
  # @rbs return: Attribute
191
+ # @param [Integer] type
192
+ # @return [Attribute]
91
193
  def by_type(type); BY_TYPE.fetch(type); end
92
194
  end
93
195
  end
@@ -96,303 +198,380 @@ class Fou < ::Nl::Family
96
198
  # Add port.
97
199
  #
98
200
  # Requires CAP_NET_ADMIN in the initial user namespace.
99
- class DoAddRequest < ::Nl::Protocols::Genl::Message
201
+ class DoAddRequest < ::Nl::Genl::Message
100
202
  TYPE = 1
101
203
  FIXED_HEADER = nil
102
204
  ATTRIBUTE_SET = AttributeSets::Fou
103
205
  ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
104
- # Gets the value of `port` attribute in the message.
105
- #--
106
206
  # @rbs return: ::Integer
207
+ # @return [Integer]
208
+ # @see AttributeSets::Fou::Port
107
209
  def port; attributes[:"port"]&.value; end
108
- # Gets the value of `ipproto` attribute in the message.
109
- #--
110
210
  # @rbs return: ::Integer
211
+ # @return [Integer]
212
+ # @see AttributeSets::Fou::Ipproto
111
213
  def ipproto; attributes[:"ipproto"]&.value; end
112
- # Gets the value of `type` attribute in the message.
113
- #--
114
214
  # @rbs return: ::Integer
215
+ # @return [Integer]
216
+ # @see AttributeSets::Fou::Type
115
217
  def type; attributes[:"type"]&.value; end
116
- # Gets the value of `remcsum-nopartial` attribute in the message.
117
- #--
118
218
  # @rbs return: ::Integer
219
+ # @return [Integer]
220
+ # @see AttributeSets::Fou::RemcsumNopartial
119
221
  def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
120
- # Gets the value of `local-v4` attribute in the message.
121
- #--
122
222
  # @rbs return: ::Integer
223
+ # @return [Integer]
224
+ # @see AttributeSets::Fou::LocalV4
123
225
  def local_v4; attributes[:"local_v4"]&.value; end
124
- # Gets the value of `local-v6` attribute in the message.
125
- #--
126
226
  # @rbs return: ::String
227
+ # @return [String]
228
+ # @see AttributeSets::Fou::LocalV6
127
229
  def local_v6; attributes[:"local_v6"]&.value; end
128
- # Gets the value of `peer-v4` attribute in the message.
129
- #--
130
230
  # @rbs return: ::Integer
231
+ # @return [Integer]
232
+ # @see AttributeSets::Fou::PeerV4
131
233
  def peer_v4; attributes[:"peer_v4"]&.value; end
132
- # Gets the value of `peer-v6` attribute in the message.
133
- #--
134
234
  # @rbs return: ::String
235
+ # @return [String]
236
+ # @see AttributeSets::Fou::PeerV6
135
237
  def peer_v6; attributes[:"peer_v6"]&.value; end
136
- # Gets the value of `peer-port` attribute in the message.
137
- #--
138
238
  # @rbs return: ::Integer
239
+ # @return [Integer]
240
+ # @see AttributeSets::Fou::PeerPort
139
241
  def peer_port; attributes[:"peer_port"]&.value; end
140
- # Gets the value of `ifindex` attribute in the message.
141
- #--
142
242
  # @rbs return: ::Integer
243
+ # @return [Integer]
244
+ # @see AttributeSets::Fou::Ifindex
143
245
  def ifindex; attributes[:"ifindex"]&.value; end
144
246
  end
145
247
  # Delete port.
146
248
  #
147
249
  # Requires CAP_NET_ADMIN in the initial user namespace.
148
- class DoDelRequest < ::Nl::Protocols::Genl::Message
250
+ class DoDelRequest < ::Nl::Genl::Message
149
251
  TYPE = 2
150
252
  FIXED_HEADER = nil
151
253
  ATTRIBUTE_SET = AttributeSets::Fou
152
254
  ATTRIBUTES = Ractor.make_shareable(%i[port af local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
153
- # Gets the value of `port` attribute in the message.
154
- #--
155
255
  # @rbs return: ::Integer
256
+ # @return [Integer]
257
+ # @see AttributeSets::Fou::Port
156
258
  def port; attributes[:"port"]&.value; end
157
- # Gets the value of `af` attribute in the message.
158
- #--
159
259
  # @rbs return: ::Integer
260
+ # @return [Integer]
261
+ # @see AttributeSets::Fou::Af
160
262
  def af; attributes[:"af"]&.value; end
161
- # Gets the value of `local-v4` attribute in the message.
162
- #--
163
263
  # @rbs return: ::Integer
264
+ # @return [Integer]
265
+ # @see AttributeSets::Fou::LocalV4
164
266
  def local_v4; attributes[:"local_v4"]&.value; end
165
- # Gets the value of `local-v6` attribute in the message.
166
- #--
167
267
  # @rbs return: ::String
268
+ # @return [String]
269
+ # @see AttributeSets::Fou::LocalV6
168
270
  def local_v6; attributes[:"local_v6"]&.value; end
169
- # Gets the value of `peer-v4` attribute in the message.
170
- #--
171
271
  # @rbs return: ::Integer
272
+ # @return [Integer]
273
+ # @see AttributeSets::Fou::PeerV4
172
274
  def peer_v4; attributes[:"peer_v4"]&.value; end
173
- # Gets the value of `peer-v6` attribute in the message.
174
- #--
175
275
  # @rbs return: ::String
276
+ # @return [String]
277
+ # @see AttributeSets::Fou::PeerV6
176
278
  def peer_v6; attributes[:"peer_v6"]&.value; end
177
- # Gets the value of `peer-port` attribute in the message.
178
- #--
179
279
  # @rbs return: ::Integer
280
+ # @return [Integer]
281
+ # @see AttributeSets::Fou::PeerPort
180
282
  def peer_port; attributes[:"peer_port"]&.value; end
181
- # Gets the value of `ifindex` attribute in the message.
182
- #--
183
283
  # @rbs return: ::Integer
284
+ # @return [Integer]
285
+ # @see AttributeSets::Fou::Ifindex
184
286
  def ifindex; attributes[:"ifindex"]&.value; end
185
287
  end
186
288
  # Get tunnel info.
187
- class DoGetRequest < ::Nl::Protocols::Genl::Message
289
+ class DoGetRequest < ::Nl::Genl::Message
188
290
  TYPE = 3
189
291
  FIXED_HEADER = nil
190
292
  ATTRIBUTE_SET = AttributeSets::Fou
191
293
  ATTRIBUTES = Ractor.make_shareable(%i[port af local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
192
- # Gets the value of `port` attribute in the message.
193
- #--
194
294
  # @rbs return: ::Integer
295
+ # @return [Integer]
296
+ # @see AttributeSets::Fou::Port
195
297
  def port; attributes[:"port"]&.value; end
196
- # Gets the value of `af` attribute in the message.
197
- #--
198
298
  # @rbs return: ::Integer
299
+ # @return [Integer]
300
+ # @see AttributeSets::Fou::Af
199
301
  def af; attributes[:"af"]&.value; end
200
- # Gets the value of `local-v4` attribute in the message.
201
- #--
202
302
  # @rbs return: ::Integer
303
+ # @return [Integer]
304
+ # @see AttributeSets::Fou::LocalV4
203
305
  def local_v4; attributes[:"local_v4"]&.value; end
204
- # Gets the value of `local-v6` attribute in the message.
205
- #--
206
306
  # @rbs return: ::String
307
+ # @return [String]
308
+ # @see AttributeSets::Fou::LocalV6
207
309
  def local_v6; attributes[:"local_v6"]&.value; end
208
- # Gets the value of `peer-v4` attribute in the message.
209
- #--
210
310
  # @rbs return: ::Integer
311
+ # @return [Integer]
312
+ # @see AttributeSets::Fou::PeerV4
211
313
  def peer_v4; attributes[:"peer_v4"]&.value; end
212
- # Gets the value of `peer-v6` attribute in the message.
213
- #--
214
314
  # @rbs return: ::String
315
+ # @return [String]
316
+ # @see AttributeSets::Fou::PeerV6
215
317
  def peer_v6; attributes[:"peer_v6"]&.value; end
216
- # Gets the value of `peer-port` attribute in the message.
217
- #--
218
318
  # @rbs return: ::Integer
319
+ # @return [Integer]
320
+ # @see AttributeSets::Fou::PeerPort
219
321
  def peer_port; attributes[:"peer_port"]&.value; end
220
- # Gets the value of `ifindex` attribute in the message.
221
- #--
222
322
  # @rbs return: ::Integer
323
+ # @return [Integer]
324
+ # @see AttributeSets::Fou::Ifindex
223
325
  def ifindex; attributes[:"ifindex"]&.value; end
224
326
  end
225
327
  # Get tunnel info.
226
- class DoGetReply < ::Nl::Protocols::Genl::Message
328
+ class DoGetReply < ::Nl::Genl::Message
227
329
  TYPE = 3
228
330
  FIXED_HEADER = nil
229
331
  ATTRIBUTE_SET = AttributeSets::Fou
230
332
  ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
231
- # Gets the value of `port` attribute in the message.
232
- #--
233
333
  # @rbs return: ::Integer
334
+ # @return [Integer]
335
+ # @see AttributeSets::Fou::Port
234
336
  def port; attributes[:"port"]&.value; end
235
- # Gets the value of `ipproto` attribute in the message.
236
- #--
237
337
  # @rbs return: ::Integer
338
+ # @return [Integer]
339
+ # @see AttributeSets::Fou::Ipproto
238
340
  def ipproto; attributes[:"ipproto"]&.value; end
239
- # Gets the value of `type` attribute in the message.
240
- #--
241
341
  # @rbs return: ::Integer
342
+ # @return [Integer]
343
+ # @see AttributeSets::Fou::Type
242
344
  def type; attributes[:"type"]&.value; end
243
- # Gets the value of `remcsum-nopartial` attribute in the message.
244
- #--
245
345
  # @rbs return: ::Integer
346
+ # @return [Integer]
347
+ # @see AttributeSets::Fou::RemcsumNopartial
246
348
  def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
247
- # Gets the value of `local-v4` attribute in the message.
248
- #--
249
349
  # @rbs return: ::Integer
350
+ # @return [Integer]
351
+ # @see AttributeSets::Fou::LocalV4
250
352
  def local_v4; attributes[:"local_v4"]&.value; end
251
- # Gets the value of `local-v6` attribute in the message.
252
- #--
253
353
  # @rbs return: ::String
354
+ # @return [String]
355
+ # @see AttributeSets::Fou::LocalV6
254
356
  def local_v6; attributes[:"local_v6"]&.value; end
255
- # Gets the value of `peer-v4` attribute in the message.
256
- #--
257
357
  # @rbs return: ::Integer
358
+ # @return [Integer]
359
+ # @see AttributeSets::Fou::PeerV4
258
360
  def peer_v4; attributes[:"peer_v4"]&.value; end
259
- # Gets the value of `peer-v6` attribute in the message.
260
- #--
261
361
  # @rbs return: ::String
362
+ # @return [String]
363
+ # @see AttributeSets::Fou::PeerV6
262
364
  def peer_v6; attributes[:"peer_v6"]&.value; end
263
- # Gets the value of `peer-port` attribute in the message.
264
- #--
265
365
  # @rbs return: ::Integer
366
+ # @return [Integer]
367
+ # @see AttributeSets::Fou::PeerPort
266
368
  def peer_port; attributes[:"peer_port"]&.value; end
267
- # Gets the value of `ifindex` attribute in the message.
268
- #--
269
369
  # @rbs return: ::Integer
370
+ # @return [Integer]
371
+ # @see AttributeSets::Fou::Ifindex
270
372
  def ifindex; attributes[:"ifindex"]&.value; end
271
373
  end
272
374
  # Get tunnel info.
273
- class DumpGetRequest < ::Nl::Protocols::Genl::Message
375
+ class DumpGetRequest < ::Nl::Genl::Message
274
376
  TYPE = 3
275
377
  FIXED_HEADER = nil
276
378
  ATTRIBUTE_SET = AttributeSets::Fou
277
379
  ATTRIBUTES = Ractor.make_shareable(%i[])
278
380
  end
279
381
  # Get tunnel info.
280
- class DumpGetReply < ::Nl::Protocols::Genl::Message
382
+ class DumpGetReply < ::Nl::Genl::Message
281
383
  TYPE = 3
282
384
  FIXED_HEADER = nil
283
385
  ATTRIBUTE_SET = AttributeSets::Fou
284
386
  ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
285
- # Gets the value of `port` attribute in the message.
286
- #--
287
387
  # @rbs return: ::Integer
388
+ # @return [Integer]
389
+ # @see AttributeSets::Fou::Port
288
390
  def port; attributes[:"port"]&.value; end
289
- # Gets the value of `ipproto` attribute in the message.
290
- #--
291
391
  # @rbs return: ::Integer
392
+ # @return [Integer]
393
+ # @see AttributeSets::Fou::Ipproto
292
394
  def ipproto; attributes[:"ipproto"]&.value; end
293
- # Gets the value of `type` attribute in the message.
294
- #--
295
395
  # @rbs return: ::Integer
396
+ # @return [Integer]
397
+ # @see AttributeSets::Fou::Type
296
398
  def type; attributes[:"type"]&.value; end
297
- # Gets the value of `remcsum-nopartial` attribute in the message.
298
- #--
299
399
  # @rbs return: ::Integer
400
+ # @return [Integer]
401
+ # @see AttributeSets::Fou::RemcsumNopartial
300
402
  def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
301
- # Gets the value of `local-v4` attribute in the message.
302
- #--
303
403
  # @rbs return: ::Integer
404
+ # @return [Integer]
405
+ # @see AttributeSets::Fou::LocalV4
304
406
  def local_v4; attributes[:"local_v4"]&.value; end
305
- # Gets the value of `local-v6` attribute in the message.
306
- #--
307
407
  # @rbs return: ::String
408
+ # @return [String]
409
+ # @see AttributeSets::Fou::LocalV6
308
410
  def local_v6; attributes[:"local_v6"]&.value; end
309
- # Gets the value of `peer-v4` attribute in the message.
310
- #--
311
411
  # @rbs return: ::Integer
412
+ # @return [Integer]
413
+ # @see AttributeSets::Fou::PeerV4
312
414
  def peer_v4; attributes[:"peer_v4"]&.value; end
313
- # Gets the value of `peer-v6` attribute in the message.
314
- #--
315
415
  # @rbs return: ::String
416
+ # @return [String]
417
+ # @see AttributeSets::Fou::PeerV6
316
418
  def peer_v6; attributes[:"peer_v6"]&.value; end
317
- # Gets the value of `peer-port` attribute in the message.
318
- #--
319
419
  # @rbs return: ::Integer
420
+ # @return [Integer]
421
+ # @see AttributeSets::Fou::PeerPort
320
422
  def peer_port; attributes[:"peer_port"]&.value; end
321
- # Gets the value of `ifindex` attribute in the message.
322
- #--
323
423
  # @rbs return: ::Integer
424
+ # @return [Integer]
425
+ # @see AttributeSets::Fou::Ifindex
324
426
  def ifindex; attributes[:"ifindex"]&.value; end
325
427
  end
326
428
  end
327
429
  module Notifications
328
430
  end
431
+ # @private
329
432
  NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
330
433
  # Add port.
331
434
  #
332
435
  # Requires CAP_NET_ADMIN in the initial user namespace.
333
- #--
334
436
  # @rbs (?port: ::Integer, ?ipproto: ::Integer, ?type: ::Integer, ?remcsum_nopartial: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> void
437
+ # @param [Hash] args
438
+ # @option args [Integer] port
439
+ # @option args [Integer] ipproto
440
+ # @option args [Integer] type
441
+ # @option args [Integer] remcsum_nopartial
442
+ # @option args [Integer] local_v4
443
+ # @option args [String] local_v6
444
+ # @option args [Integer] peer_v4
445
+ # @option args [String] peer_v6
446
+ # @option args [Integer] peer_port
447
+ # @option args [Integer] ifindex
448
+ # @return [void]
449
+ # @see Messages::DoAddRequest
335
450
  def do_add(**args)
336
451
  exchange_message(:"do", Messages::DoAddRequest, nil, args)
337
452
  end
338
453
  # Delete port.
339
454
  #
340
455
  # Requires CAP_NET_ADMIN in the initial user namespace.
341
- #--
342
456
  # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> void
457
+ # @param [Hash] args
458
+ # @option args [Integer] port
459
+ # @option args [Integer] af
460
+ # @option args [Integer] local_v4
461
+ # @option args [String] local_v6
462
+ # @option args [Integer] peer_v4
463
+ # @option args [String] peer_v6
464
+ # @option args [Integer] peer_port
465
+ # @option args [Integer] ifindex
466
+ # @return [void]
467
+ # @see Messages::DoDelRequest
343
468
  def do_del(**args)
344
469
  exchange_message(:"do", Messages::DoDelRequest, nil, args)
345
470
  end
346
471
  # Get tunnel info.
347
- #--
348
472
  # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> Messages::DoGetReply
473
+ # @param [Hash] args
474
+ # @option args [Integer] port
475
+ # @option args [Integer] af
476
+ # @option args [Integer] local_v4
477
+ # @option args [String] local_v6
478
+ # @option args [Integer] peer_v4
479
+ # @option args [String] peer_v6
480
+ # @option args [Integer] peer_port
481
+ # @option args [Integer] ifindex
482
+ # @return [Messages::DoGetReply]
483
+ # @see Messages::DoGetRequest
349
484
  def do_get(**args)
350
485
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
351
486
  end
352
487
  # Get tunnel info.
353
- #--
354
- # @rbs () -> Enumerable[Messages::DumpGetReply]
488
+ # @rbs () -> Array[Messages::DumpGetReply]
355
489
  # | () { (Messages::DumpGetReply) -> void } -> void
490
+ # @overload dump_get(**args)
491
+ # Returns an array when no block is given.
492
+ # @param [Hash] args
493
+ # @return [Array<Messages::DumpGetReply>]
494
+ # @overload dump_get(**args, &block)
495
+ # Yields each reply when a block is given.
496
+ # @param [Hash] args
497
+ # @yieldparam [Messages::DumpGetReply] reply
498
+ # @return [void]
499
+ # @see Messages::DumpGetRequest
356
500
  def dump_get(**args, &block)
357
501
  exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
358
502
  end
359
503
  class AsyncOperations
360
- # :nodoc:
504
+ # @private
361
505
  def initialize(&exchange)
362
506
  @exchange = exchange
363
507
  end
364
508
  # Add port.
365
509
  #
366
510
  # Requires CAP_NET_ADMIN in the initial user namespace.
367
- #--
368
511
  # @rbs (?port: ::Integer, ?ipproto: ::Integer, ?type: ::Integer, ?remcsum_nopartial: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> ::Nl::Async::Future[void]
512
+ # @param [Hash] args
513
+ # @option args [Integer] port
514
+ # @option args [Integer] ipproto
515
+ # @option args [Integer] type
516
+ # @option args [Integer] remcsum_nopartial
517
+ # @option args [Integer] local_v4
518
+ # @option args [String] local_v6
519
+ # @option args [Integer] peer_v4
520
+ # @option args [String] peer_v6
521
+ # @option args [Integer] peer_port
522
+ # @option args [Integer] ifindex
523
+ # @return [Nl::Async::Future<void>]
524
+ # @see Messages::DoAddRequest
369
525
  def do_add(**args)
370
526
  @exchange.call(:"do", Messages::DoAddRequest, nil, args)
371
527
  end
372
528
  # Delete port.
373
529
  #
374
530
  # Requires CAP_NET_ADMIN in the initial user namespace.
375
- #--
376
531
  # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> ::Nl::Async::Future[void]
532
+ # @param [Hash] args
533
+ # @option args [Integer] port
534
+ # @option args [Integer] af
535
+ # @option args [Integer] local_v4
536
+ # @option args [String] local_v6
537
+ # @option args [Integer] peer_v4
538
+ # @option args [String] peer_v6
539
+ # @option args [Integer] peer_port
540
+ # @option args [Integer] ifindex
541
+ # @return [Nl::Async::Future<void>]
542
+ # @see Messages::DoDelRequest
377
543
  def do_del(**args)
378
544
  @exchange.call(:"do", Messages::DoDelRequest, nil, args)
379
545
  end
380
546
  # Get tunnel info.
381
- #--
382
547
  # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: ::String, ?peer_v4: ::Integer, ?peer_v6: ::String, ?peer_port: ::Integer, ?ifindex: ::Integer) -> ::Nl::Async::Future[Messages::DoGetReply]
548
+ # @param [Hash] args
549
+ # @option args [Integer] port
550
+ # @option args [Integer] af
551
+ # @option args [Integer] local_v4
552
+ # @option args [String] local_v6
553
+ # @option args [Integer] peer_v4
554
+ # @option args [String] peer_v6
555
+ # @option args [Integer] peer_port
556
+ # @option args [Integer] ifindex
557
+ # @return [Nl::Async::Future<Messages::DoGetReply>]
558
+ # @see Messages::DoGetRequest
383
559
  def do_get(**args)
384
560
  @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
385
561
  end
386
562
  # Get tunnel info.
387
- #--
388
563
  # @rbs () -> ::Nl::Async::Stream[Messages::DumpGetReply]
564
+ # @param [Hash] args
565
+ # @return [Nl::Async::Stream<Messages::DumpGetReply>]
566
+ # @see Messages::DumpGetRequest
389
567
  def dump_get(**args)
390
568
  @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
391
569
  end
392
570
  end
393
571
  # Returns the asynchronous operation facade for this family.
394
- #--
395
572
  # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
573
+ # @param [::Integer, nil] stream_capacity
574
+ # @return [AsyncOperations]
396
575
  def async(stream_capacity: nil)
397
576
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
398
577
  build_async_facade(AsyncOperations, stream_capacity:)