nl-linux 0.4.1 → 0.5.0
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/CHANGELOG.md +7 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
2
|
#
|
|
3
|
-
# This file is based on Documentation/netlink/specs/ovs_packet.yaml from Linux v7.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/ovs_packet.yaml from Linux v7.3.
|
|
4
4
|
#--
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
@@ -37,7 +37,7 @@ class OvsPacket < ::Nl::Genl::Family
|
|
|
37
37
|
super
|
|
38
38
|
end
|
|
39
39
|
# @private
|
|
40
|
-
MCAST_GROUPS =
|
|
40
|
+
MCAST_GROUPS = {}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
41
41
|
module Structs
|
|
42
42
|
OvsHeader = Struct.new(
|
|
43
43
|
:"dp_ifindex", #: ::Integer
|
|
@@ -46,14 +46,25 @@ class OvsPacket < ::Nl::Genl::Family
|
|
|
46
46
|
# @!attribute [rw] dp_ifindex
|
|
47
47
|
# @return [Integer]
|
|
48
48
|
# @private
|
|
49
|
-
MEMBERS =
|
|
49
|
+
MEMBERS = {dp_ifindex: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
50
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
51
|
+
# @private
|
|
52
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
53
|
+
def self.from_params(params, context: nil)
|
|
54
|
+
unknown = params.keys - members
|
|
55
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
56
|
+
self.new(
|
|
57
|
+
MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0), context:),
|
|
58
|
+
)
|
|
59
|
+
end
|
|
50
60
|
# Decodes the struct.
|
|
51
61
|
# @rbs decoder: ::Nl::Decoder
|
|
52
62
|
# @rbs return: instance
|
|
53
63
|
# @param [Nl::Decoder] decoder
|
|
54
64
|
# @return [self]
|
|
55
65
|
def self.decode(decoder)
|
|
56
|
-
|
|
66
|
+
value_0 = decoder.get_host_u32
|
|
67
|
+
self.new(value_0)
|
|
57
68
|
end
|
|
58
69
|
# Encodes the struct.
|
|
59
70
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -61,341 +72,293 @@ class OvsPacket < ::Nl::Genl::Family
|
|
|
61
72
|
# @param [Nl::Encoder] encoder
|
|
62
73
|
# @return [void]
|
|
63
74
|
def encode(encoder)
|
|
64
|
-
MEMBERS.
|
|
75
|
+
MEMBERS[:"dp_ifindex"].encode(encoder, public_send(:"dp_ifindex"))
|
|
65
76
|
end
|
|
66
77
|
end
|
|
67
78
|
end
|
|
68
79
|
module AttributeSets
|
|
69
80
|
class Packet < ::Nl::AttributeSet
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
module Definitions
|
|
82
|
+
# Packet data, from the start of the Ethernet header.
|
|
83
|
+
# @rbs return: ::String
|
|
84
|
+
# @return [String]
|
|
85
|
+
def packet; self[:"packet"]; end
|
|
86
|
+
# Nested OVS_KEY_ATTR_* attributes, extracted flow key.
|
|
87
|
+
# Defined as binary because the key attribute-set belongs to the
|
|
88
|
+
# ovs_flow family spec; cross-spec references are not supported.
|
|
89
|
+
# @rbs return: ::String
|
|
90
|
+
# @return [String]
|
|
91
|
+
def key; self[:"key"]; end
|
|
92
|
+
# Nested OVS_ACTION_ATTR_* attributes.
|
|
93
|
+
# Defined as binary for the same reason as key.
|
|
94
|
+
# @rbs return: ::String
|
|
95
|
+
# @return [String]
|
|
96
|
+
def actions; self[:"actions"]; end
|
|
97
|
+
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
98
|
+
# @rbs return: ::String
|
|
99
|
+
# @return [String]
|
|
100
|
+
def userdata; self[:"userdata"]; end
|
|
101
|
+
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
102
|
+
# @rbs return: ::String
|
|
103
|
+
# @return [String]
|
|
104
|
+
def egress_tun_key; self[:"egress_tun_key"]; end
|
|
105
|
+
# Packet operation is a feature probe, error logging suppressed.
|
|
106
|
+
# @rbs return: ::Integer
|
|
107
|
+
# @return [Integer]
|
|
108
|
+
def probe; self[:"probe"]; end
|
|
109
|
+
# Maximum received IP fragment size.
|
|
110
|
+
# @rbs return: ::Integer
|
|
111
|
+
# @return [Integer]
|
|
112
|
+
def mru; self[:"mru"]; end
|
|
113
|
+
# Packet size before truncation.
|
|
114
|
+
# @rbs return: ::Integer
|
|
115
|
+
# @return [Integer]
|
|
116
|
+
def len; self[:"len"]; end
|
|
117
|
+
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
118
|
+
# @rbs return: ::Integer
|
|
119
|
+
# @return [Integer]
|
|
120
|
+
def hash; self[:"hash"]; end
|
|
121
|
+
# Netlink PID to use for upcalls during EXECUTE processing.
|
|
122
|
+
# @rbs return: ::Integer
|
|
123
|
+
# @return [Integer]
|
|
124
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
72
125
|
end
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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 })
|
|
126
|
+
include Definitions
|
|
127
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
128
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
129
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
130
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
81
131
|
end
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
NAME = :"key"
|
|
88
|
-
# @private
|
|
89
|
-
ORDER = 1
|
|
90
|
-
# @private
|
|
91
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
92
|
-
end
|
|
93
|
-
# Nested OVS_ACTION_ATTR_* attributes.
|
|
94
|
-
# Defined as binary for the same reason as key.
|
|
95
|
-
class Actions < Attribute
|
|
96
|
-
TYPE = 3
|
|
97
|
-
NAME = :"actions"
|
|
98
|
-
# @private
|
|
99
|
-
ORDER = 2
|
|
100
|
-
# @private
|
|
101
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
102
|
-
end
|
|
103
|
-
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
104
|
-
class Userdata < Attribute
|
|
105
|
-
TYPE = 4
|
|
106
|
-
NAME = :"userdata"
|
|
107
|
-
# @private
|
|
108
|
-
ORDER = 3
|
|
109
|
-
# @private
|
|
110
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
111
|
-
end
|
|
112
|
-
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
113
|
-
class EgressTunKey < Attribute
|
|
114
|
-
TYPE = 5
|
|
115
|
-
NAME = :"egress_tun_key"
|
|
116
|
-
# @private
|
|
117
|
-
ORDER = 4
|
|
118
|
-
# @private
|
|
119
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
120
|
-
end
|
|
121
|
-
# Packet operation is a feature probe, error logging suppressed.
|
|
122
|
-
class Probe < Attribute
|
|
123
|
-
TYPE = 8
|
|
124
|
-
NAME = :"probe"
|
|
125
|
-
# @private
|
|
126
|
-
ORDER = 5
|
|
127
|
-
# @private
|
|
128
|
-
DATATYPE = ::Nl::DataTypes::Flag.new
|
|
129
|
-
end
|
|
130
|
-
# Maximum received IP fragment size.
|
|
131
|
-
class Mru < Attribute
|
|
132
|
-
TYPE = 9
|
|
133
|
-
NAME = :"mru"
|
|
134
|
-
# @private
|
|
135
|
-
ORDER = 6
|
|
136
|
-
# @private
|
|
137
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
138
|
-
end
|
|
139
|
-
# Packet size before truncation.
|
|
140
|
-
class Len < Attribute
|
|
141
|
-
TYPE = 10
|
|
142
|
-
NAME = :"len"
|
|
143
|
-
# @private
|
|
144
|
-
ORDER = 7
|
|
145
|
-
# @private
|
|
146
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
147
|
-
end
|
|
148
|
-
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
149
|
-
class Hash < Attribute
|
|
150
|
-
TYPE = 11
|
|
151
|
-
NAME = :"hash"
|
|
152
|
-
# @private
|
|
153
|
-
ORDER = 8
|
|
154
|
-
# @private
|
|
155
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
156
|
-
end
|
|
157
|
-
# Netlink PID to use for upcalls during EXECUTE processing.
|
|
158
|
-
class UpcallPid < Attribute
|
|
159
|
-
TYPE = 12
|
|
160
|
-
NAME = :"upcall_pid"
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
module AttributeSets
|
|
135
|
+
class Packet
|
|
136
|
+
module Definitions
|
|
161
137
|
# @private
|
|
162
|
-
|
|
138
|
+
BY_TYPE = ::Array.new(13).tap do |definitions|
|
|
139
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"packet", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 14" unless it.bytesize >= 14 } }), multi: false, order: 0, selector_slot: nil)
|
|
140
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"key", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 1, selector_slot: nil)
|
|
141
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"actions", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 2, selector_slot: nil)
|
|
142
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"userdata", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 3, selector_slot: nil)
|
|
143
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"egress_tun_key", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 4, selector_slot: nil)
|
|
144
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"probe", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 5, selector_slot: nil)
|
|
145
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"mru", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 6, selector_slot: nil)
|
|
146
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"len", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
|
|
147
|
+
definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"hash", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 8, selector_slot: nil)
|
|
148
|
+
definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"upcall_pid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 9, selector_slot: nil)
|
|
149
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
150
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
163
151
|
# @private
|
|
164
|
-
|
|
165
|
-
end
|
|
166
|
-
# @private
|
|
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]
|
|
168
|
-
# @private
|
|
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
|
|
223
|
-
class << self
|
|
224
|
-
# Looks up Attribute class by name.
|
|
225
|
-
# @rbs name: Symbol
|
|
226
|
-
# @rbs return: Attribute
|
|
227
|
-
# @param [Symbol] name
|
|
228
|
-
# @return [Attribute]
|
|
229
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
230
|
-
# Looks up Attribute class by type value.
|
|
231
|
-
# @rbs type: Integer
|
|
232
|
-
# @rbs return: Attribute
|
|
233
|
-
# @param [Integer] type
|
|
234
|
-
# @return [Attribute]
|
|
235
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
152
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
236
153
|
end
|
|
237
154
|
end
|
|
238
155
|
end
|
|
239
156
|
module Messages
|
|
240
157
|
# Apply actions to a packet.
|
|
241
|
-
class DoExecuteRequest < ::Nl::
|
|
158
|
+
class DoExecuteRequest < ::Nl::Message
|
|
242
159
|
TYPE = 3
|
|
243
160
|
FIXED_HEADER = Structs::OvsHeader
|
|
244
161
|
ATTRIBUTE_SET = AttributeSets::Packet
|
|
245
|
-
ATTRIBUTES =
|
|
162
|
+
ATTRIBUTES = %i[packet key actions probe mru hash upcall_pid].freeze
|
|
163
|
+
include ATTRIBUTE_SET::Definitions
|
|
164
|
+
def initialize(dp_ifindex, attributes = [])
|
|
165
|
+
@dp_ifindex = dp_ifindex
|
|
166
|
+
@attributes = attributes
|
|
167
|
+
end
|
|
168
|
+
# @private
|
|
169
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
170
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
171
|
+
new(
|
|
172
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
173
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
177
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
178
|
+
def self.decode(decoder)
|
|
179
|
+
value_0 = decoder.get_host_u32
|
|
180
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
181
|
+
end
|
|
182
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
183
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
184
|
+
encode_attributes(encoder, external_selectors:)
|
|
185
|
+
end
|
|
246
186
|
# @rbs return: ::Integer
|
|
247
187
|
# @return [Integer]
|
|
248
|
-
def dp_ifindex;
|
|
188
|
+
def dp_ifindex; @dp_ifindex; end
|
|
249
189
|
# Packet data, from the start of the Ethernet header.
|
|
250
190
|
# @rbs return: ::String
|
|
251
191
|
# @return [String]
|
|
252
|
-
|
|
253
|
-
def packet; attributes[:"packet"]&.value; end
|
|
192
|
+
def packet; self[:"packet"]; end
|
|
254
193
|
# Nested OVS_KEY_ATTR_* attributes, extracted flow key.
|
|
255
194
|
# Defined as binary because the key attribute-set belongs to the
|
|
256
195
|
# ovs_flow family spec; cross-spec references are not supported.
|
|
257
196
|
# @rbs return: ::String
|
|
258
197
|
# @return [String]
|
|
259
|
-
|
|
260
|
-
def key; attributes[:"key"]&.value; end
|
|
198
|
+
def key; self[:"key"]; end
|
|
261
199
|
# Nested OVS_ACTION_ATTR_* attributes.
|
|
262
200
|
# Defined as binary for the same reason as key.
|
|
263
201
|
# @rbs return: ::String
|
|
264
202
|
# @return [String]
|
|
265
|
-
|
|
266
|
-
def actions; attributes[:"actions"]&.value; end
|
|
203
|
+
def actions; self[:"actions"]; end
|
|
267
204
|
# Packet operation is a feature probe, error logging suppressed.
|
|
268
205
|
# @rbs return: ::Integer
|
|
269
206
|
# @return [Integer]
|
|
270
|
-
|
|
271
|
-
def probe; attributes[:"probe"]&.value; end
|
|
207
|
+
def probe; self[:"probe"]; end
|
|
272
208
|
# Maximum received IP fragment size.
|
|
273
209
|
# @rbs return: ::Integer
|
|
274
210
|
# @return [Integer]
|
|
275
|
-
|
|
276
|
-
def mru; attributes[:"mru"]&.value; end
|
|
211
|
+
def mru; self[:"mru"]; end
|
|
277
212
|
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
278
213
|
# @rbs return: ::Integer
|
|
279
214
|
# @return [Integer]
|
|
280
|
-
|
|
281
|
-
def hash; attributes[:"hash"]&.value; end
|
|
215
|
+
def hash; self[:"hash"]; end
|
|
282
216
|
# Netlink PID to use for upcalls during EXECUTE processing.
|
|
283
217
|
# @rbs return: ::Integer
|
|
284
218
|
# @return [Integer]
|
|
285
|
-
|
|
286
|
-
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
219
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
287
220
|
end
|
|
288
221
|
end
|
|
289
222
|
module Notifications
|
|
290
223
|
# Notify userspace of a flow table miss for a received packet.
|
|
291
|
-
class Miss < ::Nl::
|
|
224
|
+
class Miss < ::Nl::Message
|
|
292
225
|
TYPE = 1
|
|
293
226
|
FIXED_HEADER = Structs::OvsHeader
|
|
294
227
|
ATTRIBUTE_SET = AttributeSets::Packet
|
|
295
|
-
ATTRIBUTES =
|
|
228
|
+
ATTRIBUTES = %i[packet key actions userdata egress_tun_key mru len hash].freeze
|
|
229
|
+
include ATTRIBUTE_SET::Definitions
|
|
230
|
+
def initialize(dp_ifindex, attributes = [])
|
|
231
|
+
@dp_ifindex = dp_ifindex
|
|
232
|
+
@attributes = attributes
|
|
233
|
+
end
|
|
234
|
+
# @private
|
|
235
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
236
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
237
|
+
new(
|
|
238
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
239
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
240
|
+
)
|
|
241
|
+
end
|
|
242
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
243
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
244
|
+
def self.decode(decoder)
|
|
245
|
+
value_0 = decoder.get_host_u32
|
|
246
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
247
|
+
end
|
|
248
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
249
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
250
|
+
encode_attributes(encoder, external_selectors:)
|
|
251
|
+
end
|
|
296
252
|
# @rbs return: ::Integer
|
|
297
253
|
# @return [Integer]
|
|
298
|
-
def dp_ifindex;
|
|
254
|
+
def dp_ifindex; @dp_ifindex; end
|
|
299
255
|
# Packet data, from the start of the Ethernet header.
|
|
300
256
|
# @rbs return: ::String
|
|
301
257
|
# @return [String]
|
|
302
|
-
|
|
303
|
-
def packet; attributes[:"packet"]&.value; end
|
|
258
|
+
def packet; self[:"packet"]; end
|
|
304
259
|
# Nested OVS_KEY_ATTR_* attributes, extracted flow key.
|
|
305
260
|
# Defined as binary because the key attribute-set belongs to the
|
|
306
261
|
# ovs_flow family spec; cross-spec references are not supported.
|
|
307
262
|
# @rbs return: ::String
|
|
308
263
|
# @return [String]
|
|
309
|
-
|
|
310
|
-
def key; attributes[:"key"]&.value; end
|
|
264
|
+
def key; self[:"key"]; end
|
|
311
265
|
# Nested OVS_ACTION_ATTR_* attributes.
|
|
312
266
|
# Defined as binary for the same reason as key.
|
|
313
267
|
# @rbs return: ::String
|
|
314
268
|
# @return [String]
|
|
315
|
-
|
|
316
|
-
def actions; attributes[:"actions"]&.value; end
|
|
269
|
+
def actions; self[:"actions"]; end
|
|
317
270
|
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
318
271
|
# @rbs return: ::String
|
|
319
272
|
# @return [String]
|
|
320
|
-
|
|
321
|
-
def userdata; attributes[:"userdata"]&.value; end
|
|
273
|
+
def userdata; self[:"userdata"]; end
|
|
322
274
|
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
323
275
|
# @rbs return: ::String
|
|
324
276
|
# @return [String]
|
|
325
|
-
|
|
326
|
-
def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
|
|
277
|
+
def egress_tun_key; self[:"egress_tun_key"]; end
|
|
327
278
|
# Maximum received IP fragment size.
|
|
328
279
|
# @rbs return: ::Integer
|
|
329
280
|
# @return [Integer]
|
|
330
|
-
|
|
331
|
-
def mru; attributes[:"mru"]&.value; end
|
|
281
|
+
def mru; self[:"mru"]; end
|
|
332
282
|
# Packet size before truncation.
|
|
333
283
|
# @rbs return: ::Integer
|
|
334
284
|
# @return [Integer]
|
|
335
|
-
|
|
336
|
-
def len; attributes[:"len"]&.value; end
|
|
285
|
+
def len; self[:"len"]; end
|
|
337
286
|
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
338
287
|
# @rbs return: ::Integer
|
|
339
288
|
# @return [Integer]
|
|
340
|
-
|
|
341
|
-
def hash; attributes[:"hash"]&.value; end
|
|
289
|
+
def hash; self[:"hash"]; end
|
|
342
290
|
end
|
|
343
291
|
# Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action.
|
|
344
|
-
class Action < ::Nl::
|
|
292
|
+
class Action < ::Nl::Message
|
|
345
293
|
TYPE = 2
|
|
346
294
|
FIXED_HEADER = Structs::OvsHeader
|
|
347
295
|
ATTRIBUTE_SET = AttributeSets::Packet
|
|
348
|
-
ATTRIBUTES =
|
|
296
|
+
ATTRIBUTES = %i[packet key actions userdata egress_tun_key mru len hash].freeze
|
|
297
|
+
include ATTRIBUTE_SET::Definitions
|
|
298
|
+
def initialize(dp_ifindex, attributes = [])
|
|
299
|
+
@dp_ifindex = dp_ifindex
|
|
300
|
+
@attributes = attributes
|
|
301
|
+
end
|
|
302
|
+
# @private
|
|
303
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
304
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
305
|
+
new(
|
|
306
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
307
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
311
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
312
|
+
def self.decode(decoder)
|
|
313
|
+
value_0 = decoder.get_host_u32
|
|
314
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
315
|
+
end
|
|
316
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
317
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
318
|
+
encode_attributes(encoder, external_selectors:)
|
|
319
|
+
end
|
|
349
320
|
# @rbs return: ::Integer
|
|
350
321
|
# @return [Integer]
|
|
351
|
-
def dp_ifindex;
|
|
322
|
+
def dp_ifindex; @dp_ifindex; end
|
|
352
323
|
# Packet data, from the start of the Ethernet header.
|
|
353
324
|
# @rbs return: ::String
|
|
354
325
|
# @return [String]
|
|
355
|
-
|
|
356
|
-
def packet; attributes[:"packet"]&.value; end
|
|
326
|
+
def packet; self[:"packet"]; end
|
|
357
327
|
# Nested OVS_KEY_ATTR_* attributes, extracted flow key.
|
|
358
328
|
# Defined as binary because the key attribute-set belongs to the
|
|
359
329
|
# ovs_flow family spec; cross-spec references are not supported.
|
|
360
330
|
# @rbs return: ::String
|
|
361
331
|
# @return [String]
|
|
362
|
-
|
|
363
|
-
def key; attributes[:"key"]&.value; end
|
|
332
|
+
def key; self[:"key"]; end
|
|
364
333
|
# Nested OVS_ACTION_ATTR_* attributes.
|
|
365
334
|
# Defined as binary for the same reason as key.
|
|
366
335
|
# @rbs return: ::String
|
|
367
336
|
# @return [String]
|
|
368
|
-
|
|
369
|
-
def actions; attributes[:"actions"]&.value; end
|
|
337
|
+
def actions; self[:"actions"]; end
|
|
370
338
|
# Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
|
|
371
339
|
# @rbs return: ::String
|
|
372
340
|
# @return [String]
|
|
373
|
-
|
|
374
|
-
def userdata; attributes[:"userdata"]&.value; end
|
|
341
|
+
def userdata; self[:"userdata"]; end
|
|
375
342
|
# Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
|
|
376
343
|
# @rbs return: ::String
|
|
377
344
|
# @return [String]
|
|
378
|
-
|
|
379
|
-
def egress_tun_key; attributes[:"egress_tun_key"]&.value; end
|
|
345
|
+
def egress_tun_key; self[:"egress_tun_key"]; end
|
|
380
346
|
# Maximum received IP fragment size.
|
|
381
347
|
# @rbs return: ::Integer
|
|
382
348
|
# @return [Integer]
|
|
383
|
-
|
|
384
|
-
def mru; attributes[:"mru"]&.value; end
|
|
349
|
+
def mru; self[:"mru"]; end
|
|
385
350
|
# Packet size before truncation.
|
|
386
351
|
# @rbs return: ::Integer
|
|
387
352
|
# @return [Integer]
|
|
388
|
-
|
|
389
|
-
def len; attributes[:"len"]&.value; end
|
|
353
|
+
def len; self[:"len"]; end
|
|
390
354
|
# Packet hash, low 32 bits are skb hash, upper bits are flags.
|
|
391
355
|
# @rbs return: ::Integer
|
|
392
356
|
# @return [Integer]
|
|
393
|
-
|
|
394
|
-
def hash; attributes[:"hash"]&.value; end
|
|
357
|
+
def hash; self[:"hash"]; end
|
|
395
358
|
end
|
|
396
359
|
end
|
|
397
360
|
# @private
|
|
398
|
-
NOTIFICATIONS =
|
|
361
|
+
NOTIFICATIONS = {1 => Notifications::Miss, 2 => Notifications::Action}.freeze #: Hash[::Integer, ::Class]
|
|
399
362
|
# Apply actions to a packet.
|
|
400
363
|
# @rbs (?dp_ifindex: ::Integer, ?packet: ::String, ?key: ::String, ?actions: ::String, ?probe: ::Integer, ?mru: ::Integer, ?hash: ::Integer, ?upcall_pid: ::Integer) -> void
|
|
401
364
|
# @param [Hash] args
|