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.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +8 -0
- data/Rakefile +27 -5
- data/generated/nl/linux/binder.rb +227 -19
- data/generated/nl/linux/conntrack.rb +1325 -365
- data/generated/nl/linux/dev_energymodel.rb +357 -66
- data/generated/nl/linux/devlink.rb +6310 -1859
- data/generated/nl/linux/dpll.rb +2202 -376
- data/generated/nl/linux/drm_ras.rb +312 -63
- data/generated/nl/linux/ethtool.rb +7555 -2447
- data/generated/nl/linux/fou.rb +381 -133
- data/generated/nl/linux/handshake.rb +340 -70
- data/generated/nl/linux/lockd.rb +132 -27
- data/generated/nl/linux/mptcp_pm.rb +773 -161
- data/generated/nl/linux/net_shaper.rb +892 -211
- data/generated/nl/linux/netdev.rb +2366 -518
- data/generated/nl/linux/nfsd.rb +1299 -317
- data/generated/nl/linux/nftables.rb +5351 -1533
- data/generated/nl/linux/nl80211.rb +4601 -882
- data/generated/nl/linux/nlctrl.rb +460 -117
- data/generated/nl/linux/ovpn.rb +1360 -262
- data/generated/nl/linux/ovs_datapath.rb +312 -98
- data/generated/nl/linux/ovs_flow.rb +1866 -358
- data/generated/nl/linux/ovs_packet.rb +331 -45
- data/generated/nl/linux/ovs_vport.rb +374 -123
- data/generated/nl/linux/psp.rb +1093 -201
- data/generated/nl/linux/rt_addr.rb +423 -165
- data/generated/nl/linux/rt_link.rb +6928 -1336
- data/generated/nl/linux/rt_neigh.rb +1063 -297
- data/generated/nl/linux/rt_route.rb +1112 -483
- data/generated/nl/linux/rt_rule.rb +931 -262
- data/generated/nl/linux/sunrpc_cache.rb +407 -82
- data/generated/nl/linux/tc.rb +10081 -1763
- data/generated/nl/linux/tcp_metrics.rb +388 -109
- data/generated/nl/linux/team.rb +350 -84
- data/generated/nl/linux/wireguard.rb +525 -96
- data/generated/nl/linux.rb +1 -0
- data/lib/nl/linux/nlctrl_resolver.rb +31 -0
- data/lib/nl/linux/version.rb +1 -1
- data/sig/generated/nl/linux/binder.rbs +366 -0
- data/sig/generated/nl/linux/conntrack.rbs +2787 -0
- data/sig/generated/nl/linux/dev_energymodel.rbs +636 -0
- data/sig/generated/nl/linux/devlink.rbs +12496 -0
- data/sig/generated/nl/linux/dpll.rbs +3461 -0
- data/sig/generated/nl/linux/drm_ras.rbs +553 -0
- data/sig/generated/nl/linux/ethtool.rbs +15291 -0
- data/sig/generated/nl/linux/fou.rbs +702 -0
- data/sig/generated/nl/linux/handshake.rbs +622 -0
- data/sig/generated/nl/linux/lockd.rbs +234 -0
- data/sig/generated/nl/linux/mptcp_pm.rbs +1511 -0
- data/sig/generated/nl/linux/net_shaper.rbs +1645 -0
- data/sig/generated/nl/linux/netdev.rbs +4187 -0
- data/sig/generated/nl/linux/nfsd.rbs +2520 -0
- data/sig/generated/nl/linux/nftables.rbs +10304 -0
- data/sig/generated/nl/linux/nl80211.rbs +9786 -0
- data/sig/generated/nl/linux/nlctrl.rbs +944 -0
- data/sig/generated/nl/linux/nlctrl_resolver.rbs +20 -0
- data/sig/generated/nl/linux/ovpn.rbs +2564 -0
- data/sig/generated/nl/linux/ovs_datapath.rbs +640 -0
- data/sig/generated/nl/linux/ovs_flow.rbs +3659 -0
- data/sig/generated/nl/linux/ovs_packet.rbs +540 -0
- data/sig/generated/nl/linux/ovs_vport.rbs +777 -0
- data/sig/generated/nl/linux/psp.rbs +1846 -0
- data/sig/generated/nl/linux/rt_addr.rbs +866 -0
- data/sig/generated/nl/linux/rt_link.rbs +13438 -0
- data/sig/generated/nl/linux/rt_neigh.rbs +2124 -0
- data/sig/generated/nl/linux/rt_route.rbs +2218 -0
- data/sig/generated/nl/linux/rt_rule.rbs +1726 -0
- data/sig/generated/nl/linux/sunrpc_cache.rbs +739 -0
- data/sig/generated/nl/linux/tc.rbs +19931 -0
- data/sig/generated/nl/linux/tcp_metrics.rbs +740 -0
- data/sig/generated/nl/linux/team.rbs +733 -0
- data/sig/generated/nl/linux/version.rbs +7 -0
- data/sig/generated/nl/linux/wireguard.rbs +1006 -0
- data/sig/generated/nl/linux.rbs +6 -0
- data/sig/generated/nl-linux.rbs +2 -0
- metadata +51 -10
|
@@ -1,7 +1,8 @@
|
|
|
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_packet.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
|
|
@@ -16,151 +17,436 @@ module Nl; module Linux
|
|
|
16
17
|
# exist for the upcall path and are not used by the EXECUTE operation.
|
|
17
18
|
# For EXECUTE, packet, key, and actions are mandatory (kernel returns
|
|
18
19
|
# -EINVAL without them).
|
|
19
|
-
class OvsPacket < ::Nl::Family
|
|
20
|
+
class OvsPacket < ::Nl::Genl::Family
|
|
20
21
|
NAME = "ovs_packet"
|
|
21
|
-
|
|
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
|
|
40
|
+
MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
|
|
22
41
|
module Structs
|
|
23
42
|
OvsHeader = Struct.new(
|
|
24
43
|
:"dp_ifindex", #: ::Integer
|
|
25
44
|
)
|
|
26
45
|
class OvsHeader
|
|
27
|
-
#
|
|
28
|
-
|
|
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]
|
|
29
50
|
# Decodes the struct.
|
|
30
|
-
#--
|
|
31
51
|
# @rbs decoder: ::Nl::Decoder
|
|
32
52
|
# @rbs return: instance
|
|
53
|
+
# @param [Nl::Decoder] decoder
|
|
54
|
+
# @return [self]
|
|
33
55
|
def self.decode(decoder)
|
|
34
56
|
self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
|
|
35
57
|
end
|
|
36
58
|
# Encodes the struct.
|
|
37
|
-
#--
|
|
38
59
|
# @rbs encoder: ::Nl::Encoder
|
|
39
60
|
# @rbs return: void
|
|
61
|
+
# @param [Nl::Encoder] encoder
|
|
62
|
+
# @return [void]
|
|
40
63
|
def encode(encoder)
|
|
41
64
|
MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
|
|
42
65
|
end
|
|
43
66
|
end
|
|
44
67
|
end
|
|
45
68
|
module AttributeSets
|
|
46
|
-
class Packet < ::Nl::
|
|
69
|
+
class Packet < ::Nl::AttributeSet
|
|
47
70
|
# Abstract class
|
|
48
|
-
class Attribute < ::Nl::
|
|
71
|
+
class Attribute < ::Nl::AttributeSet::Attribute
|
|
49
72
|
end
|
|
73
|
+
# Packet data, from the start of the Ethernet header.
|
|
50
74
|
class Packet < Attribute
|
|
51
75
|
TYPE = 1
|
|
52
76
|
NAME = :"packet"
|
|
53
|
-
|
|
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 })
|
|
54
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.
|
|
55
85
|
class Key < Attribute
|
|
56
86
|
TYPE = 2
|
|
57
87
|
NAME = :"key"
|
|
58
|
-
|
|
88
|
+
# @private
|
|
89
|
+
ORDER = 1
|
|
90
|
+
# @private
|
|
91
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
59
92
|
end
|
|
93
|
+
# Nested OVS_ACTION_ATTR_* attributes.
|
|
94
|
+
# Defined as binary for the same reason as key.
|
|
60
95
|
class Actions < Attribute
|
|
61
96
|
TYPE = 3
|
|
62
97
|
NAME = :"actions"
|
|
63
|
-
|
|
98
|
+
# @private
|
|
99
|
+
ORDER = 2
|
|
100
|
+
# @private
|
|
101
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
64
102
|
end
|
|
103
|
+
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
65
104
|
class Userdata < Attribute
|
|
66
105
|
TYPE = 4
|
|
67
106
|
NAME = :"userdata"
|
|
68
|
-
|
|
107
|
+
# @private
|
|
108
|
+
ORDER = 3
|
|
109
|
+
# @private
|
|
110
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
69
111
|
end
|
|
112
|
+
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
70
113
|
class EgressTunKey < Attribute
|
|
71
114
|
TYPE = 5
|
|
72
115
|
NAME = :"egress_tun_key"
|
|
73
|
-
|
|
116
|
+
# @private
|
|
117
|
+
ORDER = 4
|
|
118
|
+
# @private
|
|
119
|
+
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
74
120
|
end
|
|
121
|
+
# Packet operation is a feature probe, error logging suppressed.
|
|
75
122
|
class Probe < Attribute
|
|
76
123
|
TYPE = 8
|
|
77
124
|
NAME = :"probe"
|
|
78
|
-
|
|
125
|
+
# @private
|
|
126
|
+
ORDER = 5
|
|
127
|
+
# @private
|
|
128
|
+
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
79
129
|
end
|
|
130
|
+
# Maximum received IP fragment size.
|
|
80
131
|
class Mru < Attribute
|
|
81
132
|
TYPE = 9
|
|
82
133
|
NAME = :"mru"
|
|
83
|
-
|
|
134
|
+
# @private
|
|
135
|
+
ORDER = 6
|
|
136
|
+
# @private
|
|
137
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
84
138
|
end
|
|
139
|
+
# Packet size before truncation.
|
|
85
140
|
class Len < Attribute
|
|
86
141
|
TYPE = 10
|
|
87
142
|
NAME = :"len"
|
|
88
|
-
|
|
143
|
+
# @private
|
|
144
|
+
ORDER = 7
|
|
145
|
+
# @private
|
|
146
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
89
147
|
end
|
|
148
|
+
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
90
149
|
class Hash < Attribute
|
|
91
150
|
TYPE = 11
|
|
92
151
|
NAME = :"hash"
|
|
93
|
-
|
|
152
|
+
# @private
|
|
153
|
+
ORDER = 8
|
|
154
|
+
# @private
|
|
155
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
94
156
|
end
|
|
157
|
+
# Netlink PID to use for upcalls during EXECUTE processing.
|
|
95
158
|
class UpcallPid < Attribute
|
|
96
159
|
TYPE = 12
|
|
97
160
|
NAME = :"upcall_pid"
|
|
98
|
-
|
|
161
|
+
# @private
|
|
162
|
+
ORDER = 9
|
|
163
|
+
# @private
|
|
164
|
+
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
99
165
|
end
|
|
100
|
-
#
|
|
166
|
+
# @private
|
|
101
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]
|
|
102
|
-
#
|
|
168
|
+
# @private
|
|
103
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
|
|
104
223
|
class << self
|
|
105
224
|
# Looks up Attribute class by name.
|
|
106
|
-
#--
|
|
107
225
|
# @rbs name: Symbol
|
|
108
226
|
# @rbs return: Attribute
|
|
227
|
+
# @param [Symbol] name
|
|
228
|
+
# @return [Attribute]
|
|
109
229
|
def by_name(name); BY_NAME.fetch(name); end
|
|
110
230
|
# Looks up Attribute class by type value.
|
|
111
|
-
#--
|
|
112
231
|
# @rbs type: Integer
|
|
113
232
|
# @rbs return: Attribute
|
|
233
|
+
# @param [Integer] type
|
|
234
|
+
# @return [Attribute]
|
|
114
235
|
def by_type(type); BY_TYPE.fetch(type); end
|
|
115
236
|
end
|
|
116
237
|
end
|
|
117
238
|
end
|
|
118
239
|
module Messages
|
|
119
240
|
# Apply actions to a packet.
|
|
120
|
-
class DoExecuteRequest < ::Nl::
|
|
241
|
+
class DoExecuteRequest < ::Nl::Genl::Message
|
|
121
242
|
TYPE = 3
|
|
122
243
|
FIXED_HEADER = Structs::OvsHeader
|
|
123
244
|
ATTRIBUTE_SET = AttributeSets::Packet
|
|
124
245
|
ATTRIBUTES = Ractor.make_shareable(%i[packet key actions probe mru hash upcall_pid])
|
|
125
|
-
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
126
|
-
#--
|
|
127
246
|
# @rbs return: ::Integer
|
|
247
|
+
# @return [Integer]
|
|
128
248
|
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
129
|
-
#
|
|
130
|
-
|
|
131
|
-
# @
|
|
249
|
+
# Packet data, from the start of the Ethernet header.
|
|
250
|
+
# @rbs return: ::String
|
|
251
|
+
# @return [String]
|
|
252
|
+
# @see AttributeSets::Packet::Packet
|
|
132
253
|
def packet; attributes[:"packet"]&.value; end
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
#
|
|
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.
|
|
257
|
+
# @rbs return: ::String
|
|
258
|
+
# @return [String]
|
|
259
|
+
# @see AttributeSets::Packet::Key
|
|
136
260
|
def key; attributes[:"key"]&.value; end
|
|
137
|
-
#
|
|
138
|
-
|
|
139
|
-
# @rbs return:
|
|
261
|
+
# Nested OVS_ACTION_ATTR_* attributes.
|
|
262
|
+
# Defined as binary for the same reason as key.
|
|
263
|
+
# @rbs return: ::String
|
|
264
|
+
# @return [String]
|
|
265
|
+
# @see AttributeSets::Packet::Actions
|
|
140
266
|
def actions; attributes[:"actions"]&.value; end
|
|
141
|
-
#
|
|
142
|
-
#--
|
|
267
|
+
# Packet operation is a feature probe, error logging suppressed.
|
|
143
268
|
# @rbs return: ::Integer
|
|
269
|
+
# @return [Integer]
|
|
270
|
+
# @see AttributeSets::Packet::Probe
|
|
144
271
|
def probe; attributes[:"probe"]&.value; end
|
|
145
|
-
#
|
|
146
|
-
#--
|
|
272
|
+
# Maximum received IP fragment size.
|
|
147
273
|
# @rbs return: ::Integer
|
|
274
|
+
# @return [Integer]
|
|
275
|
+
# @see AttributeSets::Packet::Mru
|
|
148
276
|
def mru; attributes[:"mru"]&.value; end
|
|
149
|
-
#
|
|
150
|
-
#--
|
|
277
|
+
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
151
278
|
# @rbs return: ::Integer
|
|
279
|
+
# @return [Integer]
|
|
280
|
+
# @see AttributeSets::Packet::Hash
|
|
152
281
|
def hash; attributes[:"hash"]&.value; end
|
|
153
|
-
#
|
|
154
|
-
#--
|
|
282
|
+
# Netlink PID to use for upcalls during EXECUTE processing.
|
|
155
283
|
# @rbs return: ::Integer
|
|
284
|
+
# @return [Integer]
|
|
285
|
+
# @see AttributeSets::Packet::UpcallPid
|
|
156
286
|
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
157
287
|
end
|
|
158
288
|
end
|
|
289
|
+
module Notifications
|
|
290
|
+
# Notify userspace of a flow table miss for a received packet.
|
|
291
|
+
class Miss < ::Nl::Genl::Message
|
|
292
|
+
TYPE = 1
|
|
293
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
294
|
+
ATTRIBUTE_SET = AttributeSets::Packet
|
|
295
|
+
ATTRIBUTES = Ractor.make_shareable(%i[packet key actions userdata egress_tun_key mru len hash])
|
|
296
|
+
# @rbs return: ::Integer
|
|
297
|
+
# @return [Integer]
|
|
298
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
299
|
+
# Packet data, from the start of the Ethernet header.
|
|
300
|
+
# @rbs return: ::String
|
|
301
|
+
# @return [String]
|
|
302
|
+
# @see AttributeSets::Packet::Packet
|
|
303
|
+
def packet; attributes[:"packet"]&.value; end
|
|
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.
|
|
307
|
+
# @rbs return: ::String
|
|
308
|
+
# @return [String]
|
|
309
|
+
# @see AttributeSets::Packet::Key
|
|
310
|
+
def key; attributes[:"key"]&.value; end
|
|
311
|
+
# Nested OVS_ACTION_ATTR_* attributes.
|
|
312
|
+
# Defined as binary for the same reason as key.
|
|
313
|
+
# @rbs return: ::String
|
|
314
|
+
# @return [String]
|
|
315
|
+
# @see AttributeSets::Packet::Actions
|
|
316
|
+
def actions; attributes[:"actions"]&.value; end
|
|
317
|
+
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
318
|
+
# @rbs return: ::String
|
|
319
|
+
# @return [String]
|
|
320
|
+
# @see AttributeSets::Packet::Userdata
|
|
321
|
+
def userdata; attributes[:"userdata"]&.value; end
|
|
322
|
+
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
323
|
+
# @rbs return: ::String
|
|
324
|
+
# @return [String]
|
|
325
|
+
# @see AttributeSets::Packet::EgressTunKey
|
|
326
|
+
def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
|
|
327
|
+
# Maximum received IP fragment size.
|
|
328
|
+
# @rbs return: ::Integer
|
|
329
|
+
# @return [Integer]
|
|
330
|
+
# @see AttributeSets::Packet::Mru
|
|
331
|
+
def mru; attributes[:"mru"]&.value; end
|
|
332
|
+
# Packet size before truncation.
|
|
333
|
+
# @rbs return: ::Integer
|
|
334
|
+
# @return [Integer]
|
|
335
|
+
# @see AttributeSets::Packet::Len
|
|
336
|
+
def len; attributes[:"len"]&.value; end
|
|
337
|
+
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
338
|
+
# @rbs return: ::Integer
|
|
339
|
+
# @return [Integer]
|
|
340
|
+
# @see AttributeSets::Packet::Hash
|
|
341
|
+
def hash; attributes[:"hash"]&.value; end
|
|
342
|
+
end
|
|
343
|
+
# Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action.
|
|
344
|
+
class Action < ::Nl::Genl::Message
|
|
345
|
+
TYPE = 2
|
|
346
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
347
|
+
ATTRIBUTE_SET = AttributeSets::Packet
|
|
348
|
+
ATTRIBUTES = Ractor.make_shareable(%i[packet key actions userdata egress_tun_key mru len hash])
|
|
349
|
+
# @rbs return: ::Integer
|
|
350
|
+
# @return [Integer]
|
|
351
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
352
|
+
# Packet data, from the start of the Ethernet header.
|
|
353
|
+
# @rbs return: ::String
|
|
354
|
+
# @return [String]
|
|
355
|
+
# @see AttributeSets::Packet::Packet
|
|
356
|
+
def packet; attributes[:"packet"]&.value; end
|
|
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.
|
|
360
|
+
# @rbs return: ::String
|
|
361
|
+
# @return [String]
|
|
362
|
+
# @see AttributeSets::Packet::Key
|
|
363
|
+
def key; attributes[:"key"]&.value; end
|
|
364
|
+
# Nested OVS_ACTION_ATTR_* attributes.
|
|
365
|
+
# Defined as binary for the same reason as key.
|
|
366
|
+
# @rbs return: ::String
|
|
367
|
+
# @return [String]
|
|
368
|
+
# @see AttributeSets::Packet::Actions
|
|
369
|
+
def actions; attributes[:"actions"]&.value; end
|
|
370
|
+
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
371
|
+
# @rbs return: ::String
|
|
372
|
+
# @return [String]
|
|
373
|
+
# @see AttributeSets::Packet::Userdata
|
|
374
|
+
def userdata; attributes[:"userdata"]&.value; end
|
|
375
|
+
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
376
|
+
# @rbs return: ::String
|
|
377
|
+
# @return [String]
|
|
378
|
+
# @see AttributeSets::Packet::EgressTunKey
|
|
379
|
+
def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
|
|
380
|
+
# Maximum received IP fragment size.
|
|
381
|
+
# @rbs return: ::Integer
|
|
382
|
+
# @return [Integer]
|
|
383
|
+
# @see AttributeSets::Packet::Mru
|
|
384
|
+
def mru; attributes[:"mru"]&.value; end
|
|
385
|
+
# Packet size before truncation.
|
|
386
|
+
# @rbs return: ::Integer
|
|
387
|
+
# @return [Integer]
|
|
388
|
+
# @see AttributeSets::Packet::Len
|
|
389
|
+
def len; attributes[:"len"]&.value; end
|
|
390
|
+
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
391
|
+
# @rbs return: ::Integer
|
|
392
|
+
# @return [Integer]
|
|
393
|
+
# @see AttributeSets::Packet::Hash
|
|
394
|
+
def hash; attributes[:"hash"]&.value; end
|
|
395
|
+
end
|
|
396
|
+
end
|
|
397
|
+
# @private
|
|
398
|
+
NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::Miss, 2 => Notifications::Action}) #: Hash[::Integer, ::Class]
|
|
159
399
|
# Apply actions to a packet.
|
|
160
|
-
|
|
161
|
-
# @
|
|
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
|
|
162
415
|
def do_execute(**args)
|
|
163
416
|
exchange_message(:"do", Messages::DoExecuteRequest, nil, args)
|
|
164
417
|
end
|
|
418
|
+
class AsyncOperations
|
|
419
|
+
# @private
|
|
420
|
+
def initialize(&exchange)
|
|
421
|
+
@exchange = exchange
|
|
422
|
+
end
|
|
423
|
+
# Apply actions to a packet.
|
|
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
|
|
439
|
+
def do_execute(**args)
|
|
440
|
+
@exchange.call(:"do", Messages::DoExecuteRequest, nil, args)
|
|
441
|
+
end
|
|
442
|
+
end
|
|
443
|
+
# Returns the asynchronous operation facade for this family.
|
|
444
|
+
# @rbs (?stream_capacity: ::Integer?) -> AsyncOperations
|
|
445
|
+
# @param [::Integer, nil] stream_capacity
|
|
446
|
+
# @return [AsyncOperations]
|
|
447
|
+
def async(stream_capacity: nil)
|
|
448
|
+
return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
|
|
449
|
+
build_async_facade(AsyncOperations, stream_capacity:)
|
|
450
|
+
end
|
|
165
451
|
end
|
|
166
452
|
end; end
|