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