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,7 +3,6 @@
3
3
  # This file is based on Documentation/netlink/specs/ovs_packet.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
@@ -18,257 +17,433 @@ module Nl; module Linux
18
17
  # exist for the upcall path and are not used by the EXECUTE operation.
19
18
  # For EXECUTE, packet, key, and actions are mandatory (kernel returns
20
19
  # -EINVAL without them).
21
- class OvsPacket < ::Nl::Family
20
+ class OvsPacket < ::Nl::Genl::Family
22
21
  NAME = "ovs_packet"
23
- PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_packet"))
22
+ VERSION = 1
23
+ # @rbs (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) -> (::Nl::Family::Session & instance)
24
+ # @rbs | [R] (?resolver: ^(::Nl::Genl::Client, ::String) -> ::Nl::Genl::FamilyInfo, ?executor: executor?, ?notification_capacity: ::Integer?) { (instance) -> R } -> R
25
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
26
+ # @param [#call] resolver
27
+ # @param [Symbol, nil] executor
28
+ # @param [Integer, nil] notification_capacity
29
+ # @return [OvsPacket]
30
+ # @overload open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY, &block)
31
+ # @param [#call] resolver
32
+ # @param [Symbol, nil] executor
33
+ # @param [Integer, nil] notification_capacity
34
+ # @yieldparam [OvsPacket] family
35
+ # @return [Object] the result of the block
36
+ def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
37
+ super
38
+ end
39
+ # @private
24
40
  MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
25
41
  module Structs
26
42
  OvsHeader = Struct.new(
27
43
  :"dp_ifindex", #: ::Integer
28
44
  )
29
45
  class OvsHeader
30
- # :nodoc:
31
- MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
46
+ # @!attribute [rw] dp_ifindex
47
+ # @return [Integer]
48
+ # @private
49
+ MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
32
50
  # Decodes the struct.
33
- #--
34
51
  # @rbs decoder: ::Nl::Decoder
35
52
  # @rbs return: instance
53
+ # @param [Nl::Decoder] decoder
54
+ # @return [self]
36
55
  def self.decode(decoder)
37
56
  self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
38
57
  end
39
58
  # Encodes the struct.
40
- #--
41
59
  # @rbs encoder: ::Nl::Encoder
42
60
  # @rbs return: void
61
+ # @param [Nl::Encoder] encoder
62
+ # @return [void]
43
63
  def encode(encoder)
44
64
  MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
45
65
  end
46
66
  end
47
67
  end
48
68
  module AttributeSets
49
- class Packet < ::Nl::Protocols::Genl::AttributeSet
69
+ class Packet < ::Nl::AttributeSet
50
70
  # Abstract class
51
- class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
71
+ class Attribute < ::Nl::AttributeSet::Attribute
52
72
  end
73
+ # Packet data, from the start of the Ethernet header.
53
74
  class Packet < Attribute
54
75
  TYPE = 1
55
76
  NAME = :"packet"
56
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 14" unless it.bytesize >= 14 })
77
+ # @private
78
+ ORDER = 0
79
+ # @private
80
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 14" unless it.bytesize >= 14 })
57
81
  end
82
+ # Nested OVS_KEY_ATTR_* attributes, extracted flow key.
83
+ # Defined as binary because the key attribute-set belongs to the
84
+ # ovs_flow family spec; cross-spec references are not supported.
58
85
  class Key < Attribute
59
86
  TYPE = 2
60
87
  NAME = :"key"
61
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
88
+ # @private
89
+ ORDER = 1
90
+ # @private
91
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
62
92
  end
93
+ # Nested OVS_ACTION_ATTR_* attributes.
94
+ # Defined as binary for the same reason as key.
63
95
  class Actions < Attribute
64
96
  TYPE = 3
65
97
  NAME = :"actions"
66
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
98
+ # @private
99
+ ORDER = 2
100
+ # @private
101
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
67
102
  end
103
+ # Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
68
104
  class Userdata < Attribute
69
105
  TYPE = 4
70
106
  NAME = :"userdata"
71
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
107
+ # @private
108
+ ORDER = 3
109
+ # @private
110
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
72
111
  end
112
+ # Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
73
113
  class EgressTunKey < Attribute
74
114
  TYPE = 5
75
115
  NAME = :"egress_tun_key"
76
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
116
+ # @private
117
+ ORDER = 4
118
+ # @private
119
+ DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
77
120
  end
121
+ # Packet operation is a feature probe, error logging suppressed.
78
122
  class Probe < Attribute
79
123
  TYPE = 8
80
124
  NAME = :"probe"
81
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
125
+ # @private
126
+ ORDER = 5
127
+ # @private
128
+ DATATYPE = ::Nl::DataTypes::Flag.new
82
129
  end
130
+ # Maximum received IP fragment size.
83
131
  class Mru < Attribute
84
132
  TYPE = 9
85
133
  NAME = :"mru"
86
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
134
+ # @private
135
+ ORDER = 6
136
+ # @private
137
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
87
138
  end
139
+ # Packet size before truncation.
88
140
  class Len < Attribute
89
141
  TYPE = 10
90
142
  NAME = :"len"
91
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
143
+ # @private
144
+ ORDER = 7
145
+ # @private
146
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
92
147
  end
148
+ # Packet hash, low 32 bits are skb hash, upper bits are flags.
93
149
  class Hash < Attribute
94
150
  TYPE = 11
95
151
  NAME = :"hash"
96
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
152
+ # @private
153
+ ORDER = 8
154
+ # @private
155
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
97
156
  end
157
+ # Netlink PID to use for upcalls during EXECUTE processing.
98
158
  class UpcallPid < Attribute
99
159
  TYPE = 12
100
160
  NAME = :"upcall_pid"
101
- DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
161
+ # @private
162
+ ORDER = 9
163
+ # @private
164
+ DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
102
165
  end
103
- # :nodoc:
166
+ # @private
104
167
  BY_NAME = Ractor.make_shareable({:"packet" => Packet, :"key" => Key, :"actions" => Actions, :"userdata" => Userdata, :"egress_tun_key" => EgressTunKey, :"probe" => Probe, :"mru" => Mru, :"len" => Len, :"hash" => Hash, :"upcall_pid" => UpcallPid}) #: Hash[::Symbol, Attribute]
105
- # :nodoc:
168
+ # @private
106
169
  BY_TYPE = Ractor.make_shareable({1 => Packet, 2 => Key, 3 => Actions, 4 => Userdata, 5 => EgressTunKey, 8 => Probe, 9 => Mru, 10 => Len, 11 => Hash, 12 => UpcallPid}) #: Hash[::Integer, Attribute]
170
+ # Packet data, from the start of the Ethernet header.
171
+ # @rbs return: ::String
172
+ # @return [String]
173
+ # @see Packet
174
+ def packet; self[:"packet"]&.value; end
175
+ # Nested OVS_KEY_ATTR_* attributes, extracted flow key.
176
+ # Defined as binary because the key attribute-set belongs to the
177
+ # ovs_flow family spec; cross-spec references are not supported.
178
+ # @rbs return: ::String
179
+ # @return [String]
180
+ # @see Key
181
+ def key; self[:"key"]&.value; end
182
+ # Nested OVS_ACTION_ATTR_* attributes.
183
+ # Defined as binary for the same reason as key.
184
+ # @rbs return: ::String
185
+ # @return [String]
186
+ # @see Actions
187
+ def actions; self[:"actions"]&.value; end
188
+ # Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
189
+ # @rbs return: ::String
190
+ # @return [String]
191
+ # @see Userdata
192
+ def userdata; self[:"userdata"]&.value; end
193
+ # Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
194
+ # @rbs return: ::String
195
+ # @return [String]
196
+ # @see EgressTunKey
197
+ def egress_tun_key; self[:"egress_tun_key"]&.value; end
198
+ # Packet operation is a feature probe, error logging suppressed.
199
+ # @rbs return: ::Integer
200
+ # @return [Integer]
201
+ # @see Probe
202
+ def probe; self[:"probe"]&.value; end
203
+ # Maximum received IP fragment size.
204
+ # @rbs return: ::Integer
205
+ # @return [Integer]
206
+ # @see Mru
207
+ def mru; self[:"mru"]&.value; end
208
+ # Packet size before truncation.
209
+ # @rbs return: ::Integer
210
+ # @return [Integer]
211
+ # @see Len
212
+ def len; self[:"len"]&.value; end
213
+ # Packet hash, low 32 bits are skb hash, upper bits are flags.
214
+ # @rbs return: ::Integer
215
+ # @return [Integer]
216
+ # @see Hash
217
+ def hash; self[:"hash"]&.value; end
218
+ # Netlink PID to use for upcalls during EXECUTE processing.
219
+ # @rbs return: ::Integer
220
+ # @return [Integer]
221
+ # @see UpcallPid
222
+ def upcall_pid; self[:"upcall_pid"]&.value; end
107
223
  class << self
108
224
  # Looks up Attribute class by name.
109
- #--
110
225
  # @rbs name: Symbol
111
226
  # @rbs return: Attribute
227
+ # @param [Symbol] name
228
+ # @return [Attribute]
112
229
  def by_name(name); BY_NAME.fetch(name); end
113
230
  # Looks up Attribute class by type value.
114
- #--
115
231
  # @rbs type: Integer
116
232
  # @rbs return: Attribute
233
+ # @param [Integer] type
234
+ # @return [Attribute]
117
235
  def by_type(type); BY_TYPE.fetch(type); end
118
236
  end
119
237
  end
120
238
  end
121
239
  module Messages
122
240
  # Apply actions to a packet.
123
- class DoExecuteRequest < ::Nl::Protocols::Genl::Message
241
+ class DoExecuteRequest < ::Nl::Genl::Message
124
242
  TYPE = 3
125
243
  FIXED_HEADER = Structs::OvsHeader
126
244
  ATTRIBUTE_SET = AttributeSets::Packet
127
245
  ATTRIBUTES = Ractor.make_shareable(%i[packet key actions probe mru hash upcall_pid])
128
- # Gets the value of `dp-ifindex` field in the message's fixed header.
129
- #--
130
246
  # @rbs return: ::Integer
247
+ # @return [Integer]
131
248
  def dp_ifindex; fixed_header.dp_ifindex; end
132
- # Gets the value of `packet` attribute in the message.
133
- #--
249
+ # Packet data, from the start of the Ethernet header.
134
250
  # @rbs return: ::String
251
+ # @return [String]
252
+ # @see AttributeSets::Packet::Packet
135
253
  def packet; attributes[:"packet"]&.value; end
136
- # Gets the value of `key` attribute in the message.
137
- #--
254
+ # Nested OVS_KEY_ATTR_* attributes, extracted flow key.
255
+ # Defined as binary because the key attribute-set belongs to the
256
+ # ovs_flow family spec; cross-spec references are not supported.
138
257
  # @rbs return: ::String
258
+ # @return [String]
259
+ # @see AttributeSets::Packet::Key
139
260
  def key; attributes[:"key"]&.value; end
140
- # Gets the value of `actions` attribute in the message.
141
- #--
261
+ # Nested OVS_ACTION_ATTR_* attributes.
262
+ # Defined as binary for the same reason as key.
142
263
  # @rbs return: ::String
264
+ # @return [String]
265
+ # @see AttributeSets::Packet::Actions
143
266
  def actions; attributes[:"actions"]&.value; end
144
- # Gets the value of `probe` attribute in the message.
145
- #--
267
+ # Packet operation is a feature probe, error logging suppressed.
146
268
  # @rbs return: ::Integer
269
+ # @return [Integer]
270
+ # @see AttributeSets::Packet::Probe
147
271
  def probe; attributes[:"probe"]&.value; end
148
- # Gets the value of `mru` attribute in the message.
149
- #--
272
+ # Maximum received IP fragment size.
150
273
  # @rbs return: ::Integer
274
+ # @return [Integer]
275
+ # @see AttributeSets::Packet::Mru
151
276
  def mru; attributes[:"mru"]&.value; end
152
- # Gets the value of `hash` attribute in the message.
153
- #--
277
+ # Packet hash, low 32 bits are skb hash, upper bits are flags.
154
278
  # @rbs return: ::Integer
279
+ # @return [Integer]
280
+ # @see AttributeSets::Packet::Hash
155
281
  def hash; attributes[:"hash"]&.value; end
156
- # Gets the value of `upcall-pid` attribute in the message.
157
- #--
282
+ # Netlink PID to use for upcalls during EXECUTE processing.
158
283
  # @rbs return: ::Integer
284
+ # @return [Integer]
285
+ # @see AttributeSets::Packet::UpcallPid
159
286
  def upcall_pid; attributes[:"upcall_pid"]&.value; end
160
287
  end
161
288
  end
162
289
  module Notifications
163
290
  # Notify userspace of a flow table miss for a received packet.
164
- class Miss < ::Nl::Protocols::Genl::Message
291
+ class Miss < ::Nl::Genl::Message
165
292
  TYPE = 1
166
293
  FIXED_HEADER = Structs::OvsHeader
167
294
  ATTRIBUTE_SET = AttributeSets::Packet
168
295
  ATTRIBUTES = Ractor.make_shareable(%i[packet key actions userdata egress_tun_key mru len hash])
169
- # Gets the value of `dp-ifindex` field in the message's fixed header.
170
- #--
171
296
  # @rbs return: ::Integer
297
+ # @return [Integer]
172
298
  def dp_ifindex; fixed_header.dp_ifindex; end
173
- # Gets the value of `packet` attribute in the message.
174
- #--
299
+ # Packet data, from the start of the Ethernet header.
175
300
  # @rbs return: ::String
301
+ # @return [String]
302
+ # @see AttributeSets::Packet::Packet
176
303
  def packet; attributes[:"packet"]&.value; end
177
- # Gets the value of `key` attribute in the message.
178
- #--
304
+ # Nested OVS_KEY_ATTR_* attributes, extracted flow key.
305
+ # Defined as binary because the key attribute-set belongs to the
306
+ # ovs_flow family spec; cross-spec references are not supported.
179
307
  # @rbs return: ::String
308
+ # @return [String]
309
+ # @see AttributeSets::Packet::Key
180
310
  def key; attributes[:"key"]&.value; end
181
- # Gets the value of `actions` attribute in the message.
182
- #--
311
+ # Nested OVS_ACTION_ATTR_* attributes.
312
+ # Defined as binary for the same reason as key.
183
313
  # @rbs return: ::String
314
+ # @return [String]
315
+ # @see AttributeSets::Packet::Actions
184
316
  def actions; attributes[:"actions"]&.value; end
185
- # Gets the value of `userdata` attribute in the message.
186
- #--
317
+ # Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
187
318
  # @rbs return: ::String
319
+ # @return [String]
320
+ # @see AttributeSets::Packet::Userdata
188
321
  def userdata; attributes[:"userdata"]&.value; end
189
- # Gets the value of `egress-tun-key` attribute in the message.
190
- #--
322
+ # Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
191
323
  # @rbs return: ::String
324
+ # @return [String]
325
+ # @see AttributeSets::Packet::EgressTunKey
192
326
  def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
193
- # Gets the value of `mru` attribute in the message.
194
- #--
327
+ # Maximum received IP fragment size.
195
328
  # @rbs return: ::Integer
329
+ # @return [Integer]
330
+ # @see AttributeSets::Packet::Mru
196
331
  def mru; attributes[:"mru"]&.value; end
197
- # Gets the value of `len` attribute in the message.
198
- #--
332
+ # Packet size before truncation.
199
333
  # @rbs return: ::Integer
334
+ # @return [Integer]
335
+ # @see AttributeSets::Packet::Len
200
336
  def len; attributes[:"len"]&.value; end
201
- # Gets the value of `hash` attribute in the message.
202
- #--
337
+ # Packet hash, low 32 bits are skb hash, upper bits are flags.
203
338
  # @rbs return: ::Integer
339
+ # @return [Integer]
340
+ # @see AttributeSets::Packet::Hash
204
341
  def hash; attributes[:"hash"]&.value; end
205
342
  end
206
343
  # Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action.
207
- class Action < ::Nl::Protocols::Genl::Message
344
+ class Action < ::Nl::Genl::Message
208
345
  TYPE = 2
209
346
  FIXED_HEADER = Structs::OvsHeader
210
347
  ATTRIBUTE_SET = AttributeSets::Packet
211
348
  ATTRIBUTES = Ractor.make_shareable(%i[packet key actions userdata egress_tun_key mru len hash])
212
- # Gets the value of `dp-ifindex` field in the message's fixed header.
213
- #--
214
349
  # @rbs return: ::Integer
350
+ # @return [Integer]
215
351
  def dp_ifindex; fixed_header.dp_ifindex; end
216
- # Gets the value of `packet` attribute in the message.
217
- #--
352
+ # Packet data, from the start of the Ethernet header.
218
353
  # @rbs return: ::String
354
+ # @return [String]
355
+ # @see AttributeSets::Packet::Packet
219
356
  def packet; attributes[:"packet"]&.value; end
220
- # Gets the value of `key` attribute in the message.
221
- #--
357
+ # Nested OVS_KEY_ATTR_* attributes, extracted flow key.
358
+ # Defined as binary because the key attribute-set belongs to the
359
+ # ovs_flow family spec; cross-spec references are not supported.
222
360
  # @rbs return: ::String
361
+ # @return [String]
362
+ # @see AttributeSets::Packet::Key
223
363
  def key; attributes[:"key"]&.value; end
224
- # Gets the value of `actions` attribute in the message.
225
- #--
364
+ # Nested OVS_ACTION_ATTR_* attributes.
365
+ # Defined as binary for the same reason as key.
226
366
  # @rbs return: ::String
367
+ # @return [String]
368
+ # @see AttributeSets::Packet::Actions
227
369
  def actions; attributes[:"actions"]&.value; end
228
- # Gets the value of `userdata` attribute in the message.
229
- #--
370
+ # Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
230
371
  # @rbs return: ::String
372
+ # @return [String]
373
+ # @see AttributeSets::Packet::Userdata
231
374
  def userdata; attributes[:"userdata"]&.value; end
232
- # Gets the value of `egress-tun-key` attribute in the message.
233
- #--
375
+ # Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
234
376
  # @rbs return: ::String
377
+ # @return [String]
378
+ # @see AttributeSets::Packet::EgressTunKey
235
379
  def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
236
- # Gets the value of `mru` attribute in the message.
237
- #--
380
+ # Maximum received IP fragment size.
238
381
  # @rbs return: ::Integer
382
+ # @return [Integer]
383
+ # @see AttributeSets::Packet::Mru
239
384
  def mru; attributes[:"mru"]&.value; end
240
- # Gets the value of `len` attribute in the message.
241
- #--
385
+ # Packet size before truncation.
242
386
  # @rbs return: ::Integer
387
+ # @return [Integer]
388
+ # @see AttributeSets::Packet::Len
243
389
  def len; attributes[:"len"]&.value; end
244
- # Gets the value of `hash` attribute in the message.
245
- #--
390
+ # Packet hash, low 32 bits are skb hash, upper bits are flags.
246
391
  # @rbs return: ::Integer
392
+ # @return [Integer]
393
+ # @see AttributeSets::Packet::Hash
247
394
  def hash; attributes[:"hash"]&.value; end
248
395
  end
249
396
  end
397
+ # @private
250
398
  NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::Miss, 2 => Notifications::Action}) #: Hash[::Integer, ::Class]
251
399
  # Apply actions to a packet.
252
- #--
253
400
  # @rbs (?dp_ifindex: ::Integer, ?packet: ::String, ?key: ::String, ?actions: ::String, ?probe: ::Integer, ?mru: ::Integer, ?hash: ::Integer, ?upcall_pid: ::Integer) -> void
401
+ # @param [Hash] args
402
+ # @option args [Integer] dp_ifindex
403
+ # @option args [String] packet Packet data, from the start of the Ethernet header.
404
+ # @option args [String] key Nested OVS_KEY_ATTR_* attributes, extracted flow key.
405
+ # Defined as binary because the key attribute-set belongs to the
406
+ # ovs_flow family spec; cross-spec references are not supported.
407
+ # @option args [String] actions Nested OVS_ACTION_ATTR_* attributes.
408
+ # Defined as binary for the same reason as key.
409
+ # @option args [Integer] probe Packet operation is a feature probe, error logging suppressed.
410
+ # @option args [Integer] mru Maximum received IP fragment size.
411
+ # @option args [Integer] hash Packet hash, low 32 bits are skb hash, upper bits are flags.
412
+ # @option args [Integer] upcall_pid Netlink PID to use for upcalls during EXECUTE processing.
413
+ # @return [void]
414
+ # @see Messages::DoExecuteRequest
254
415
  def do_execute(**args)
255
416
  exchange_message(:"do", Messages::DoExecuteRequest, nil, args)
256
417
  end
257
418
  class AsyncOperations
258
- # :nodoc:
419
+ # @private
259
420
  def initialize(&exchange)
260
421
  @exchange = exchange
261
422
  end
262
423
  # Apply actions to a packet.
263
- #--
264
424
  # @rbs (?dp_ifindex: ::Integer, ?packet: ::String, ?key: ::String, ?actions: ::String, ?probe: ::Integer, ?mru: ::Integer, ?hash: ::Integer, ?upcall_pid: ::Integer) -> ::Nl::Async::Future[void]
425
+ # @param [Hash] args
426
+ # @option args [Integer] dp_ifindex
427
+ # @option args [String] packet Packet data, from the start of the Ethernet header.
428
+ # @option args [String] key Nested OVS_KEY_ATTR_* attributes, extracted flow key.
429
+ # Defined as binary because the key attribute-set belongs to the
430
+ # ovs_flow family spec; cross-spec references are not supported.
431
+ # @option args [String] actions Nested OVS_ACTION_ATTR_* attributes.
432
+ # Defined as binary for the same reason as key.
433
+ # @option args [Integer] probe Packet operation is a feature probe, error logging suppressed.
434
+ # @option args [Integer] mru Maximum received IP fragment size.
435
+ # @option args [Integer] hash Packet hash, low 32 bits are skb hash, upper bits are flags.
436
+ # @option args [Integer] upcall_pid Netlink PID to use for upcalls during EXECUTE processing.
437
+ # @return [Nl::Async::Future<void>]
438
+ # @see Messages::DoExecuteRequest
265
439
  def do_execute(**args)
266
440
  @exchange.call(:"do", Messages::DoExecuteRequest, nil, args)
267
441
  end
268
442
  end
269
443
  # Returns the asynchronous operation facade for this family.
270
- #--
271
444
  # @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
445
+ # @param [::Integer, nil] stream_capacity
446
+ # @return [AsyncOperations]
272
447
  def async(stream_capacity: nil)
273
448
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
274
449
  build_async_facade(AsyncOperations, stream_capacity:)