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
@@ -1,32 +1,67 @@
1
1
  # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # This file is based on Documentation/netlink/specs/ovs_datapath.yaml from Linux v7.2.
2
4
  #--
3
5
  # frozen_string_literal: true
4
- # rbs_inline: enabled
5
6
  # This code is generated by Ynl::Generator. DO NOT EDIT.
6
7
  require 'nl'
7
8
  module Nl; module Linux
8
9
  # OVS datapath configuration over generic netlink.
9
- class OvsDatapath < ::Nl::Family
10
+ class OvsDatapath < ::Nl::Genl::Family
10
11
  NAME = "ovs_datapath"
11
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_datapath"))
12
+ VERSION = 2
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 [OvsDatapath]
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 [OvsDatapath] 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
30
+ MCAST_GROUPS = Ractor.make_shareable({:"ovs_datapath" => ::Nl::McastGroup.new("ovs_datapath", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
31
+ module Flags
32
+ module UserFeatures
33
+ # Allow last Netlink attribute to be unaligned
34
+ Unaligned = 1
35
+ # Allow datapath to associate multiple Netlink PIDs to each vport
36
+ VportPids = 2
37
+ # Allow tc offload recirc sharing
38
+ TcRecircSharing = 4
39
+ # Allow per-cpu dispatch of upcalls
40
+ DispatchUpcallPerCpu = 8
41
+ end
42
+ end
12
43
  module Structs
13
44
  OvsHeader = Struct.new(
14
45
  :"dp_ifindex", #: ::Integer
15
46
  )
16
47
  class OvsHeader
17
- # :nodoc:
18
- MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
48
+ # @!attribute [rw] dp_ifindex
49
+ # @return [Integer]
50
+ # @private
51
+ MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
19
52
  # Decodes the struct.
20
- #--
21
53
  # @rbs decoder: ::Nl::Decoder
22
54
  # @rbs return: instance
55
+ # @param [Nl::Decoder] decoder
56
+ # @return [self]
23
57
  def self.decode(decoder)
24
58
  self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
25
59
  end
26
60
  # Encodes the struct.
27
- #--
28
61
  # @rbs encoder: ::Nl::Encoder
29
62
  # @rbs return: void
63
+ # @param [Nl::Encoder] encoder
64
+ # @return [void]
30
65
  def encode(encoder)
31
66
  MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
32
67
  end
@@ -38,19 +73,29 @@ class OvsDatapath < ::Nl::Family
38
73
  :"n_flows", #: ::Integer
39
74
  )
40
75
  class OvsDpStats
41
- # :nodoc:
42
- MEMBERS = Ractor.make_shareable({n_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_missed: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_lost: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_flows: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
76
+ # @!attribute [rw] n_hit
77
+ # @return [Integer]
78
+ # @!attribute [rw] n_missed
79
+ # @return [Integer]
80
+ # @!attribute [rw] n_lost
81
+ # @return [Integer]
82
+ # @!attribute [rw] n_flows
83
+ # @return [Integer]
84
+ # @private
85
+ MEMBERS = Ractor.make_shareable({n_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_missed: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_lost: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_flows: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
43
86
  # Decodes the struct.
44
- #--
45
87
  # @rbs decoder: ::Nl::Decoder
46
88
  # @rbs return: instance
89
+ # @param [Nl::Decoder] decoder
90
+ # @return [self]
47
91
  def self.decode(decoder)
48
92
  self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
49
93
  end
50
94
  # Encodes the struct.
51
- #--
52
95
  # @rbs encoder: ::Nl::Encoder
53
96
  # @rbs return: void
97
+ # @param [Nl::Encoder] encoder
98
+ # @return [void]
54
99
  def encode(encoder)
55
100
  MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
56
101
  end
@@ -63,259 +108,428 @@ class OvsDatapath < ::Nl::Family
63
108
  :"pad1", #: ::Integer
64
109
  )
65
110
  class OvsDpMegaflowStats
66
- # :nodoc:
67
- MEMBERS = Ractor.make_shareable({n_mask_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_masks: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), padding: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), n_cache_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), pad1: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
111
+ # @!attribute [rw] n_mask_hit
112
+ # @return [Integer]
113
+ # @!attribute [rw] n_masks
114
+ # @return [Integer]
115
+ # @!attribute [rw] padding
116
+ # @return [Integer]
117
+ # @!attribute [rw] n_cache_hit
118
+ # @return [Integer]
119
+ # @!attribute [rw] pad1
120
+ # @return [Integer]
121
+ # @private
122
+ MEMBERS = Ractor.make_shareable({n_mask_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_masks: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), padding: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), n_cache_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), pad1: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
68
123
  # Decodes the struct.
69
- #--
70
124
  # @rbs decoder: ::Nl::Decoder
71
125
  # @rbs return: instance
126
+ # @param [Nl::Decoder] decoder
127
+ # @return [self]
72
128
  def self.decode(decoder)
73
129
  self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
74
130
  end
75
131
  # Encodes the struct.
76
- #--
77
132
  # @rbs encoder: ::Nl::Encoder
78
133
  # @rbs return: void
134
+ # @param [Nl::Encoder] encoder
135
+ # @return [void]
79
136
  def encode(encoder)
80
137
  MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
81
138
  end
82
139
  end
83
140
  end
84
141
  module AttributeSets
85
- class Datapath < ::Nl::Protocols::Genl::AttributeSet
142
+ class Datapath < ::Nl::AttributeSet
86
143
  # Abstract class
87
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
144
+ class Attribute < ::Nl::AttributeSet::Attribute
88
145
  end
89
146
  class Name < Attribute
90
147
  TYPE = 1
91
148
  NAME = :"name"
92
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
149
+ # @private
150
+ ORDER = 0
151
+ # @private
152
+ DATATYPE = ::Nl::DataTypes::String.new(check: nil)
93
153
  end
154
+ # upcall pid
94
155
  class UpcallPid < Attribute
95
156
  TYPE = 2
96
157
  NAME = :"upcall_pid"
97
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
158
+ # @private
159
+ ORDER = 1
160
+ # @private
161
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
98
162
  end
99
163
  class Stats < Attribute
100
164
  TYPE = 3
101
165
  NAME = :"stats"
102
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
166
+ # @private
167
+ ORDER = 2
168
+ # @private
169
+ DATATYPE = ::Nl::DataTypes::Struct.new(Structs::OvsDpStats, check: nil, consume_remaining: true)
103
170
  end
104
171
  class MegaflowStats < Attribute
105
172
  TYPE = 4
106
173
  NAME = :"megaflow_stats"
107
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
174
+ # @private
175
+ ORDER = 3
176
+ # @private
177
+ DATATYPE = ::Nl::DataTypes::Struct.new(Structs::OvsDpMegaflowStats, check: nil, consume_remaining: true)
108
178
  end
179
+ # Known flags are defined in {Flags::UserFeatures}.
109
180
  class UserFeatures < Attribute
110
181
  TYPE = 5
111
182
  NAME = :"user_features"
112
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
183
+ # @private
184
+ ORDER = 4
185
+ # @private
186
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
113
187
  end
114
188
  class MasksCacheSize < Attribute
115
189
  TYPE = 7
116
190
  NAME = :"masks_cache_size"
117
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
191
+ # @private
192
+ ORDER = 5
193
+ # @private
194
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
118
195
  end
119
196
  class PerCpuPids < Attribute
120
197
  TYPE = 8
121
198
  NAME = :"per_cpu_pids"
122
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
199
+ # @private
200
+ ORDER = 6
201
+ # @private
202
+ DATATYPE = ::Nl::DataTypes::PackedArray.new(::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), check: nil)
123
203
  end
124
204
  class Ifindex < Attribute
125
205
  TYPE = 9
126
206
  NAME = :"ifindex"
127
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
207
+ # @private
208
+ ORDER = 7
209
+ # @private
210
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
128
211
  end
129
- # :nodoc:
212
+ # @private
130
213
  BY_NAME = Ractor.make_shareable({:"name" => Name, :"upcall_pid" => UpcallPid, :"stats" => Stats, :"megaflow_stats" => MegaflowStats, :"user_features" => UserFeatures, :"masks_cache_size" => MasksCacheSize, :"per_cpu_pids" => PerCpuPids, :"ifindex" => Ifindex}) #: Hash[::Symbol, Attribute]
131
- # :nodoc:
214
+ # @private
132
215
  BY_TYPE = Ractor.make_shareable({1 => Name, 2 => UpcallPid, 3 => Stats, 4 => MegaflowStats, 5 => UserFeatures, 7 => MasksCacheSize, 8 => PerCpuPids, 9 => Ifindex}) #: Hash[::Integer, Attribute]
216
+ # @rbs return: ::String
217
+ # @return [String]
218
+ # @see Name
219
+ def name; self[:"name"]&.value; end
220
+ # upcall pid
221
+ # @rbs return: ::Integer
222
+ # @return [Integer]
223
+ # @see UpcallPid
224
+ def upcall_pid; self[:"upcall_pid"]&.value; end
225
+ # @rbs return: Structs::OvsDpStats
226
+ # @return [Structs::OvsDpStats]
227
+ # @see Stats
228
+ def stats; self[:"stats"]&.value; end
229
+ # @rbs return: Structs::OvsDpMegaflowStats
230
+ # @return [Structs::OvsDpMegaflowStats]
231
+ # @see MegaflowStats
232
+ def megaflow_stats; self[:"megaflow_stats"]&.value; end
233
+ # Known flags are defined in {Flags::UserFeatures}.
234
+ # @rbs return: ::Integer
235
+ # @return [Integer]
236
+ # @see UserFeatures
237
+ def user_features; self[:"user_features"]&.value; end
238
+ # @rbs return: ::Integer
239
+ # @return [Integer]
240
+ # @see MasksCacheSize
241
+ def masks_cache_size; self[:"masks_cache_size"]&.value; end
242
+ # @rbs return: ::Array[::Integer]
243
+ # @return [Array<Integer>]
244
+ # @see PerCpuPids
245
+ def per_cpu_pids; self[:"per_cpu_pids"]&.value; end
246
+ # @rbs return: ::Integer
247
+ # @return [Integer]
248
+ # @see Ifindex
249
+ def ifindex; self[:"ifindex"]&.value; end
133
250
  class << self
134
251
  # Looks up Attribute class by name.
135
- #--
136
252
  # @rbs name: Symbol
137
253
  # @rbs return: Attribute
254
+ # @param [Symbol] name
255
+ # @return [Attribute]
138
256
  def by_name(name); BY_NAME.fetch(name); end
139
257
  # Looks up Attribute class by type value.
140
- #--
141
258
  # @rbs type: Integer
142
259
  # @rbs return: Attribute
260
+ # @param [Integer] type
261
+ # @return [Attribute]
143
262
  def by_type(type); BY_TYPE.fetch(type); end
144
263
  end
145
264
  end
146
265
  end
147
266
  module Messages
148
267
  # Get / dump OVS data path configuration and state
149
- class DoGetRequest < ::Nl::Protocols::Genl::Message
268
+ class DoGetRequest < ::Nl::Genl::Message
150
269
  TYPE = 3
151
270
  FIXED_HEADER = Structs::OvsHeader
152
271
  ATTRIBUTE_SET = AttributeSets::Datapath
153
272
  ATTRIBUTES = Ractor.make_shareable(%i[name])
154
- # Gets the value of `dp-ifindex` field in the message's fixed header.
155
- #--
156
273
  # @rbs return: ::Integer
274
+ # @return [Integer]
157
275
  def dp_ifindex; fixed_header.dp_ifindex; end
158
- # Gets the value of `name` attribute in the message.
159
- #--
160
276
  # @rbs return: ::String
277
+ # @return [String]
278
+ # @see AttributeSets::Datapath::Name
161
279
  def name; attributes[:"name"]&.value; end
162
280
  end
163
281
  # Get / dump OVS data path configuration and state
164
- class DoGetReply < ::Nl::Protocols::Genl::Message
282
+ class DoGetReply < ::Nl::Genl::Message
165
283
  TYPE = 3
166
284
  FIXED_HEADER = Structs::OvsHeader
167
285
  ATTRIBUTE_SET = AttributeSets::Datapath
168
286
  ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
169
- # Gets the value of `dp-ifindex` field in the message's fixed header.
170
- #--
171
287
  # @rbs return: ::Integer
288
+ # @return [Integer]
172
289
  def dp_ifindex; fixed_header.dp_ifindex; end
173
- # Gets the value of `name` attribute in the message.
174
- #--
175
290
  # @rbs return: ::String
291
+ # @return [String]
292
+ # @see AttributeSets::Datapath::Name
176
293
  def name; attributes[:"name"]&.value; end
177
- # Gets the value of `upcall-pid` attribute in the message.
178
- #--
294
+ # upcall pid
179
295
  # @rbs return: ::Integer
296
+ # @return [Integer]
297
+ # @see AttributeSets::Datapath::UpcallPid
180
298
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
181
- # Gets the value of `stats` attribute in the message.
182
- #--
183
- # @rbs return: untyped
299
+ # @rbs return: Structs::OvsDpStats
300
+ # @return [Structs::OvsDpStats]
301
+ # @see AttributeSets::Datapath::Stats
184
302
  def stats; attributes[:"stats"]&.value; end
185
- # Gets the value of `megaflow-stats` attribute in the message.
186
- #--
187
- # @rbs return: untyped
303
+ # @rbs return: Structs::OvsDpMegaflowStats
304
+ # @return [Structs::OvsDpMegaflowStats]
305
+ # @see AttributeSets::Datapath::MegaflowStats
188
306
  def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
189
- # Gets the value of `user-features` attribute in the message.
190
- #--
307
+ # Known flags are defined in {Flags::UserFeatures}.
191
308
  # @rbs return: ::Integer
309
+ # @return [Integer]
310
+ # @see AttributeSets::Datapath::UserFeatures
192
311
  def user_features; attributes[:"user_features"]&.value; end
193
- # Gets the value of `masks-cache-size` attribute in the message.
194
- #--
195
312
  # @rbs return: ::Integer
313
+ # @return [Integer]
314
+ # @see AttributeSets::Datapath::MasksCacheSize
196
315
  def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
197
- # Gets the value of `per-cpu-pids` attribute in the message.
198
- #--
199
- # @rbs return: untyped
316
+ # @rbs return: ::Array[::Integer]
317
+ # @return [Array<Integer>]
318
+ # @see AttributeSets::Datapath::PerCpuPids
200
319
  def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
201
320
  end
202
321
  # Get / dump OVS data path configuration and state
203
- class DumpGetRequest < ::Nl::Protocols::Genl::Message
322
+ class DumpGetRequest < ::Nl::Genl::Message
204
323
  TYPE = 3
205
324
  FIXED_HEADER = Structs::OvsHeader
206
325
  ATTRIBUTE_SET = AttributeSets::Datapath
207
326
  ATTRIBUTES = Ractor.make_shareable(%i[name])
208
- # Gets the value of `dp-ifindex` field in the message's fixed header.
209
- #--
210
327
  # @rbs return: ::Integer
328
+ # @return [Integer]
211
329
  def dp_ifindex; fixed_header.dp_ifindex; end
212
- # Gets the value of `name` attribute in the message.
213
- #--
214
330
  # @rbs return: ::String
331
+ # @return [String]
332
+ # @see AttributeSets::Datapath::Name
215
333
  def name; attributes[:"name"]&.value; end
216
334
  end
217
335
  # Get / dump OVS data path configuration and state
218
- class DumpGetReply < ::Nl::Protocols::Genl::Message
336
+ class DumpGetReply < ::Nl::Genl::Message
219
337
  TYPE = 3
220
338
  FIXED_HEADER = Structs::OvsHeader
221
339
  ATTRIBUTE_SET = AttributeSets::Datapath
222
340
  ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
223
- # Gets the value of `dp-ifindex` field in the message's fixed header.
224
- #--
225
341
  # @rbs return: ::Integer
342
+ # @return [Integer]
226
343
  def dp_ifindex; fixed_header.dp_ifindex; end
227
- # Gets the value of `name` attribute in the message.
228
- #--
229
344
  # @rbs return: ::String
345
+ # @return [String]
346
+ # @see AttributeSets::Datapath::Name
230
347
  def name; attributes[:"name"]&.value; end
231
- # Gets the value of `upcall-pid` attribute in the message.
232
- #--
348
+ # upcall pid
233
349
  # @rbs return: ::Integer
350
+ # @return [Integer]
351
+ # @see AttributeSets::Datapath::UpcallPid
234
352
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
235
- # Gets the value of `stats` attribute in the message.
236
- #--
237
- # @rbs return: untyped
353
+ # @rbs return: Structs::OvsDpStats
354
+ # @return [Structs::OvsDpStats]
355
+ # @see AttributeSets::Datapath::Stats
238
356
  def stats; attributes[:"stats"]&.value; end
239
- # Gets the value of `megaflow-stats` attribute in the message.
240
- #--
241
- # @rbs return: untyped
357
+ # @rbs return: Structs::OvsDpMegaflowStats
358
+ # @return [Structs::OvsDpMegaflowStats]
359
+ # @see AttributeSets::Datapath::MegaflowStats
242
360
  def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
243
- # Gets the value of `user-features` attribute in the message.
244
- #--
361
+ # Known flags are defined in {Flags::UserFeatures}.
245
362
  # @rbs return: ::Integer
363
+ # @return [Integer]
364
+ # @see AttributeSets::Datapath::UserFeatures
246
365
  def user_features; attributes[:"user_features"]&.value; end
247
- # Gets the value of `masks-cache-size` attribute in the message.
248
- #--
249
366
  # @rbs return: ::Integer
367
+ # @return [Integer]
368
+ # @see AttributeSets::Datapath::MasksCacheSize
250
369
  def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
251
- # Gets the value of `per-cpu-pids` attribute in the message.
252
- #--
253
- # @rbs return: untyped
370
+ # @rbs return: ::Array[::Integer]
371
+ # @return [Array<Integer>]
372
+ # @see AttributeSets::Datapath::PerCpuPids
254
373
  def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
255
374
  end
256
375
  # Create new OVS data path
257
- class DoNewRequest < ::Nl::Protocols::Genl::Message
376
+ class DoNewRequest < ::Nl::Genl::Message
258
377
  TYPE = 1
259
378
  FIXED_HEADER = Structs::OvsHeader
260
379
  ATTRIBUTE_SET = AttributeSets::Datapath
261
380
  ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid user_features])
262
- # Gets the value of `dp-ifindex` field in the message's fixed header.
263
- #--
264
381
  # @rbs return: ::Integer
382
+ # @return [Integer]
265
383
  def dp_ifindex; fixed_header.dp_ifindex; end
266
- # Gets the value of `name` attribute in the message.
267
- #--
268
384
  # @rbs return: ::String
385
+ # @return [String]
386
+ # @see AttributeSets::Datapath::Name
269
387
  def name; attributes[:"name"]&.value; end
270
- # Gets the value of `upcall-pid` attribute in the message.
271
- #--
388
+ # upcall pid
272
389
  # @rbs return: ::Integer
390
+ # @return [Integer]
391
+ # @see AttributeSets::Datapath::UpcallPid
273
392
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
274
- # Gets the value of `user-features` attribute in the message.
275
- #--
393
+ # Known flags are defined in {Flags::UserFeatures}.
276
394
  # @rbs return: ::Integer
395
+ # @return [Integer]
396
+ # @see AttributeSets::Datapath::UserFeatures
277
397
  def user_features; attributes[:"user_features"]&.value; end
278
398
  end
279
399
  # Delete existing OVS data path
280
- class DoDelRequest < ::Nl::Protocols::Genl::Message
400
+ class DoDelRequest < ::Nl::Genl::Message
281
401
  TYPE = 2
282
402
  FIXED_HEADER = Structs::OvsHeader
283
403
  ATTRIBUTE_SET = AttributeSets::Datapath
284
404
  ATTRIBUTES = Ractor.make_shareable(%i[name])
285
- # Gets the value of `dp-ifindex` field in the message's fixed header.
286
- #--
287
405
  # @rbs return: ::Integer
406
+ # @return [Integer]
288
407
  def dp_ifindex; fixed_header.dp_ifindex; end
289
- # Gets the value of `name` attribute in the message.
290
- #--
291
408
  # @rbs return: ::String
409
+ # @return [String]
410
+ # @see AttributeSets::Datapath::Name
292
411
  def name; attributes[:"name"]&.value; end
293
412
  end
294
413
  end
414
+ module Notifications
415
+ end
416
+ # @private
417
+ NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
295
418
  # Get / dump OVS data path configuration and state
296
- #--
297
419
  # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Messages::DoGetReply
420
+ # @param [Hash] args
421
+ # @option args [Integer] dp_ifindex
422
+ # @option args [String] name
423
+ # @return [Messages::DoGetReply]
424
+ # @see Messages::DoGetRequest
298
425
  def do_get(**args)
299
426
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
300
427
  end
301
428
  # Get / dump OVS data path configuration and state
302
- #--
303
- # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Enumerable[Messages::DumpGetReply]
429
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Array[Messages::DumpGetReply]
304
430
  # | (?dp_ifindex: ::Integer, ?name: ::String) { (Messages::DumpGetReply) -> void } -> void
431
+ # @overload dump_get(**args)
432
+ # Returns an array when no block is given.
433
+ # @param [Hash] args
434
+ # @option args [Integer] dp_ifindex
435
+ # @option args [String] name
436
+ # @return [Array<Messages::DumpGetReply>]
437
+ # @overload dump_get(**args, &block)
438
+ # Yields each reply when a block is given.
439
+ # @param [Hash] args
440
+ # @option args [Integer] dp_ifindex
441
+ # @option args [String] name
442
+ # @yieldparam [Messages::DumpGetReply] reply
443
+ # @return [void]
444
+ # @see Messages::DumpGetRequest
305
445
  def dump_get(**args, &block)
306
446
  exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
307
447
  end
308
448
  # Create new OVS data path
309
- #--
310
449
  # @rbs (?dp_ifindex: ::Integer, ?name: ::String, ?upcall_pid: ::Integer, ?user_features: ::Integer) -> void
450
+ # @param [Hash] args
451
+ # @option args [Integer] dp_ifindex
452
+ # @option args [String] name
453
+ # @option args [Integer] upcall_pid upcall pid
454
+ # @option args [Integer] user_features Known flags are defined in {Flags::UserFeatures}.
455
+ # @return [void]
456
+ # @see Messages::DoNewRequest
311
457
  def do_new(**args)
312
458
  exchange_message(:"do", Messages::DoNewRequest, nil, args)
313
459
  end
314
460
  # Delete existing OVS data path
315
- #--
316
461
  # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> void
462
+ # @param [Hash] args
463
+ # @option args [Integer] dp_ifindex
464
+ # @option args [String] name
465
+ # @return [void]
466
+ # @see Messages::DoDelRequest
317
467
  def do_del(**args)
318
468
  exchange_message(:"do", Messages::DoDelRequest, nil, args)
319
469
  end
470
+ class AsyncOperations
471
+ # @private
472
+ def initialize(&exchange)
473
+ @exchange = exchange
474
+ end
475
+ # Get / dump OVS data path configuration and state
476
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Future[Messages::DoGetReply]
477
+ # @param [Hash] args
478
+ # @option args [Integer] dp_ifindex
479
+ # @option args [String] name
480
+ # @return [Nl::Async::Future<Messages::DoGetReply>]
481
+ # @see Messages::DoGetRequest
482
+ def do_get(**args)
483
+ @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
484
+ end
485
+ # Get / dump OVS data path configuration and state
486
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Stream[Messages::DumpGetReply]
487
+ # @param [Hash] args
488
+ # @option args [Integer] dp_ifindex
489
+ # @option args [String] name
490
+ # @return [Nl::Async::Stream<Messages::DumpGetReply>]
491
+ # @see Messages::DumpGetRequest
492
+ def dump_get(**args)
493
+ @exchange.call(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args)
494
+ end
495
+ # Create new OVS data path
496
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String, ?upcall_pid: ::Integer, ?user_features: ::Integer) -> ::Nl::Async::Future[void]
497
+ # @param [Hash] args
498
+ # @option args [Integer] dp_ifindex
499
+ # @option args [String] name
500
+ # @option args [Integer] upcall_pid upcall pid
501
+ # @option args [Integer] user_features Known flags are defined in {Flags::UserFeatures}.
502
+ # @return [Nl::Async::Future<void>]
503
+ # @see Messages::DoNewRequest
504
+ def do_new(**args)
505
+ @exchange.call(:"do", Messages::DoNewRequest, nil, args)
506
+ end
507
+ # Delete existing OVS data path
508
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> ::Nl::Async::Future[void]
509
+ # @param [Hash] args
510
+ # @option args [Integer] dp_ifindex
511
+ # @option args [String] name
512
+ # @return [Nl::Async::Future<void>]
513
+ # @see Messages::DoDelRequest
514
+ def do_del(**args)
515
+ @exchange.call(:"do", Messages::DoDelRequest, nil, args)
516
+ end
517
+ end
518
+ # Returns the asynchronous operation facade for this family.
519
+ # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
520
+ # @param [::Integer, nil] stream_capacity
521
+ # @return [AsyncOperations]
522
+ def async(stream_capacity: nil)
523
+ return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
524
+ build_async_facade(AsyncOperations, stream_capacity:)
525
+ end
526
+ # @rbs (*(:ovs_datapath) groups) -> self
527
+ # @param [Array<:ovs_datapath>] groups
528
+ # @return [self]
529
+ def subscribe(*groups) = super
530
+ # @rbs (*(:ovs_datapath) groups) -> self
531
+ # @param [Array<:ovs_datapath>] groups
532
+ # @return [self]
533
+ def unsubscribe(*groups) = super
320
534
  end
321
535
  end; end