nl-linux 0.4.2 → 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 +5 -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_vport.yaml from Linux v7.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/ovs_vport.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.
|
|
@@ -27,7 +27,7 @@ class OvsVport < ::Nl::Genl::Family
|
|
|
27
27
|
super
|
|
28
28
|
end
|
|
29
29
|
# @private
|
|
30
|
-
MCAST_GROUPS =
|
|
30
|
+
MCAST_GROUPS = {:"ovs_vport" => ::Nl::McastGroup.new("ovs_vport", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
31
31
|
module Enums
|
|
32
32
|
module VportType
|
|
33
33
|
Unspec = 0
|
|
@@ -46,14 +46,25 @@ class OvsVport < ::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,7 +72,7 @@ class OvsVport < ::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
|
OvsVportStats = Struct.new(
|
|
@@ -92,14 +103,39 @@ class OvsVport < ::Nl::Genl::Family
|
|
|
92
103
|
# @!attribute [rw] tx_dropped
|
|
93
104
|
# @return [Integer]
|
|
94
105
|
# @private
|
|
95
|
-
MEMBERS =
|
|
106
|
+
MEMBERS = {rx_packets: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, tx_packets: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, rx_bytes: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, tx_bytes: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, rx_errors: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, tx_errors: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, rx_dropped: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, tx_dropped: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
107
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
108
|
+
# @private
|
|
109
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
110
|
+
def self.from_params(params, context: nil)
|
|
111
|
+
unknown = params.keys - members
|
|
112
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
113
|
+
self.new(
|
|
114
|
+
MEMBERS[:"rx_packets"].coerce(params.fetch(:"rx_packets", 0), context:),
|
|
115
|
+
MEMBERS[:"tx_packets"].coerce(params.fetch(:"tx_packets", 0), context:),
|
|
116
|
+
MEMBERS[:"rx_bytes"].coerce(params.fetch(:"rx_bytes", 0), context:),
|
|
117
|
+
MEMBERS[:"tx_bytes"].coerce(params.fetch(:"tx_bytes", 0), context:),
|
|
118
|
+
MEMBERS[:"rx_errors"].coerce(params.fetch(:"rx_errors", 0), context:),
|
|
119
|
+
MEMBERS[:"tx_errors"].coerce(params.fetch(:"tx_errors", 0), context:),
|
|
120
|
+
MEMBERS[:"rx_dropped"].coerce(params.fetch(:"rx_dropped", 0), context:),
|
|
121
|
+
MEMBERS[:"tx_dropped"].coerce(params.fetch(:"tx_dropped", 0), context:),
|
|
122
|
+
)
|
|
123
|
+
end
|
|
96
124
|
# Decodes the struct.
|
|
97
125
|
# @rbs decoder: ::Nl::Decoder
|
|
98
126
|
# @rbs return: instance
|
|
99
127
|
# @param [Nl::Decoder] decoder
|
|
100
128
|
# @return [self]
|
|
101
129
|
def self.decode(decoder)
|
|
102
|
-
|
|
130
|
+
value_0 = decoder.get_host_u64
|
|
131
|
+
value_1 = decoder.get_host_u64
|
|
132
|
+
value_2 = decoder.get_host_u64
|
|
133
|
+
value_3 = decoder.get_host_u64
|
|
134
|
+
value_4 = decoder.get_host_u64
|
|
135
|
+
value_5 = decoder.get_host_u64
|
|
136
|
+
value_6 = decoder.get_host_u64
|
|
137
|
+
value_7 = decoder.get_host_u64
|
|
138
|
+
self.new(value_0, value_1, value_2, value_3, value_4, value_5, value_6, value_7)
|
|
103
139
|
end
|
|
104
140
|
# Encodes the struct.
|
|
105
141
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -107,413 +143,420 @@ class OvsVport < ::Nl::Genl::Family
|
|
|
107
143
|
# @param [Nl::Encoder] encoder
|
|
108
144
|
# @return [void]
|
|
109
145
|
def encode(encoder)
|
|
110
|
-
MEMBERS.
|
|
146
|
+
MEMBERS[:"rx_packets"].encode(encoder, public_send(:"rx_packets"))
|
|
147
|
+
MEMBERS[:"tx_packets"].encode(encoder, public_send(:"tx_packets"))
|
|
148
|
+
MEMBERS[:"rx_bytes"].encode(encoder, public_send(:"rx_bytes"))
|
|
149
|
+
MEMBERS[:"tx_bytes"].encode(encoder, public_send(:"tx_bytes"))
|
|
150
|
+
MEMBERS[:"rx_errors"].encode(encoder, public_send(:"rx_errors"))
|
|
151
|
+
MEMBERS[:"tx_errors"].encode(encoder, public_send(:"tx_errors"))
|
|
152
|
+
MEMBERS[:"rx_dropped"].encode(encoder, public_send(:"rx_dropped"))
|
|
153
|
+
MEMBERS[:"tx_dropped"].encode(encoder, public_send(:"tx_dropped"))
|
|
111
154
|
end
|
|
112
155
|
end
|
|
113
156
|
end
|
|
114
157
|
module AttributeSets
|
|
115
158
|
class VportOptions < ::Nl::AttributeSet
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
ORDER = 0
|
|
124
|
-
# @private
|
|
125
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
159
|
+
module Definitions
|
|
160
|
+
# @rbs return: ::Integer
|
|
161
|
+
# @return [Integer]
|
|
162
|
+
def dst_port; self[:"dst_port"]; end
|
|
163
|
+
# @rbs return: ::Integer
|
|
164
|
+
# @return [Integer]
|
|
165
|
+
def extension; self[:"extension"]; end
|
|
126
166
|
end
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
# @private
|
|
133
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
134
|
-
end
|
|
135
|
-
# @private
|
|
136
|
-
BY_NAME = Ractor.make_shareable({:"dst_port" => DstPort, :"extension" => Extension}) #: Hash[::Symbol, Attribute]
|
|
137
|
-
# @private
|
|
138
|
-
BY_TYPE = Ractor.make_shareable({1 => DstPort, 2 => Extension}) #: Hash[::Integer, Attribute]
|
|
139
|
-
# @rbs return: ::Integer
|
|
140
|
-
# @return [Integer]
|
|
141
|
-
# @see DstPort
|
|
142
|
-
def dst_port; self[:"dst_port"]&.value; end
|
|
143
|
-
# @rbs return: ::Integer
|
|
144
|
-
# @return [Integer]
|
|
145
|
-
# @see Extension
|
|
146
|
-
def extension; self[:"extension"]&.value; end
|
|
147
|
-
class << self
|
|
148
|
-
# Looks up Attribute class by name.
|
|
149
|
-
# @rbs name: Symbol
|
|
150
|
-
# @rbs return: Attribute
|
|
151
|
-
# @param [Symbol] name
|
|
152
|
-
# @return [Attribute]
|
|
153
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
154
|
-
# Looks up Attribute class by type value.
|
|
155
|
-
# @rbs type: Integer
|
|
156
|
-
# @rbs return: Attribute
|
|
157
|
-
# @param [Integer] type
|
|
158
|
-
# @return [Attribute]
|
|
159
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
167
|
+
include Definitions
|
|
168
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
169
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
170
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
171
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
160
172
|
end
|
|
161
173
|
end
|
|
162
174
|
class UpcallStats < ::Nl::AttributeSet
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
ORDER = 0
|
|
171
|
-
# @private
|
|
172
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
173
|
-
end
|
|
174
|
-
class Fail < Attribute
|
|
175
|
-
TYPE = 1
|
|
176
|
-
NAME = :"fail"
|
|
177
|
-
# @private
|
|
178
|
-
ORDER = 1
|
|
179
|
-
# @private
|
|
180
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
175
|
+
module Definitions
|
|
176
|
+
# @rbs return: ::Integer
|
|
177
|
+
# @return [Integer]
|
|
178
|
+
def success; self[:"success"]; end
|
|
179
|
+
# @rbs return: ::Integer
|
|
180
|
+
# @return [Integer]
|
|
181
|
+
def fail; self[:"fail"]; end
|
|
181
182
|
end
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
# @
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
# @return [Integer]
|
|
188
|
-
# @see Success
|
|
189
|
-
def success; self[:"success"]&.value; end
|
|
190
|
-
# @rbs return: ::Integer
|
|
191
|
-
# @return [Integer]
|
|
192
|
-
# @see Fail
|
|
193
|
-
def fail; self[:"fail"]&.value; end
|
|
194
|
-
class << self
|
|
195
|
-
# Looks up Attribute class by name.
|
|
196
|
-
# @rbs name: Symbol
|
|
197
|
-
# @rbs return: Attribute
|
|
198
|
-
# @param [Symbol] name
|
|
199
|
-
# @return [Attribute]
|
|
200
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
201
|
-
# Looks up Attribute class by type value.
|
|
202
|
-
# @rbs type: Integer
|
|
203
|
-
# @rbs return: Attribute
|
|
204
|
-
# @param [Integer] type
|
|
205
|
-
# @return [Attribute]
|
|
206
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
183
|
+
include Definitions
|
|
184
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
185
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
186
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
187
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
207
188
|
end
|
|
208
189
|
end
|
|
209
190
|
class Vport < ::Nl::AttributeSet
|
|
210
|
-
|
|
211
|
-
|
|
191
|
+
module Definitions
|
|
192
|
+
# @rbs return: ::Integer
|
|
193
|
+
# @return [Integer]
|
|
194
|
+
def port_no; self[:"port_no"]; end
|
|
195
|
+
# Known enum values are defined in {Enums::VportType}.
|
|
196
|
+
# @rbs return: ::Integer
|
|
197
|
+
# @return [Integer]
|
|
198
|
+
def type; self[:"type"]; end
|
|
199
|
+
# @rbs return: ::String
|
|
200
|
+
# @return [String]
|
|
201
|
+
def name; self[:"name"]; end
|
|
202
|
+
# @rbs return: AttributeSets::VportOptions
|
|
203
|
+
# @return [AttributeSets::VportOptions]
|
|
204
|
+
def options; self[:"options"]; end
|
|
205
|
+
# @rbs return: ::Array[::Integer]
|
|
206
|
+
# @return [Array<Integer>]
|
|
207
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
208
|
+
# @rbs return: Structs::OvsVportStats
|
|
209
|
+
# @return [Structs::OvsVportStats]
|
|
210
|
+
def stats; self[:"stats"]; end
|
|
211
|
+
# @rbs return: ::Integer
|
|
212
|
+
# @return [Integer]
|
|
213
|
+
def ifindex; self[:"ifindex"]; end
|
|
214
|
+
# @rbs return: ::Integer
|
|
215
|
+
# @return [Integer]
|
|
216
|
+
def netnsid; self[:"netnsid"]; end
|
|
217
|
+
# @rbs return: AttributeSets::UpcallStats
|
|
218
|
+
# @return [AttributeSets::UpcallStats]
|
|
219
|
+
def upcall_stats; self[:"upcall_stats"]; end
|
|
212
220
|
end
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
# @private
|
|
219
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
220
|
-
end
|
|
221
|
-
# Known enum values are defined in {Enums::VportType}.
|
|
222
|
-
class Type < Attribute
|
|
223
|
-
TYPE = 2
|
|
224
|
-
NAME = :"type"
|
|
225
|
-
# @private
|
|
226
|
-
ORDER = 1
|
|
227
|
-
# @private
|
|
228
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
229
|
-
end
|
|
230
|
-
class Name < Attribute
|
|
231
|
-
TYPE = 3
|
|
232
|
-
NAME = :"name"
|
|
233
|
-
# @private
|
|
234
|
-
ORDER = 2
|
|
235
|
-
# @private
|
|
236
|
-
DATATYPE = ::Nl::DataTypes::String.new(check: nil)
|
|
237
|
-
end
|
|
238
|
-
class Options < Attribute
|
|
239
|
-
TYPE = 4
|
|
240
|
-
NAME = :"options"
|
|
241
|
-
# @private
|
|
242
|
-
ORDER = 3
|
|
243
|
-
end
|
|
244
|
-
class UpcallPid < Attribute
|
|
245
|
-
TYPE = 5
|
|
246
|
-
NAME = :"upcall_pid"
|
|
247
|
-
# @private
|
|
248
|
-
ORDER = 4
|
|
249
|
-
# @private
|
|
250
|
-
DATATYPE = ::Nl::DataTypes::PackedArray.new(::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), check: nil)
|
|
221
|
+
include Definitions
|
|
222
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
223
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
224
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
225
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
251
226
|
end
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
module AttributeSets
|
|
230
|
+
class VportOptions
|
|
231
|
+
module Definitions
|
|
255
232
|
# @private
|
|
256
|
-
|
|
233
|
+
BY_TYPE = ::Array.new(3).tap do |definitions|
|
|
234
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dst_port", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
|
|
235
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"extension", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
236
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
237
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
257
238
|
# @private
|
|
258
|
-
|
|
239
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
259
240
|
end
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
241
|
+
end
|
|
242
|
+
class UpcallStats
|
|
243
|
+
module Definitions
|
|
263
244
|
# @private
|
|
264
|
-
|
|
245
|
+
BY_TYPE = ::Array.new(2).tap do |definitions|
|
|
246
|
+
definitions[0] = ::Nl::AttributeSet::Definition.new(id: 0, name: :"success", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 0, selector_slot: nil)
|
|
247
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"fail", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 1, selector_slot: nil)
|
|
248
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
249
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
265
250
|
# @private
|
|
266
|
-
|
|
251
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
267
252
|
end
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
# @private
|
|
272
|
-
ORDER = 7
|
|
253
|
+
end
|
|
254
|
+
class Vport
|
|
255
|
+
module Definitions
|
|
273
256
|
# @private
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
257
|
+
BY_TYPE = ::Array.new(11).tap do |definitions|
|
|
258
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"port_no", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
|
|
259
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
260
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"name", datatype: ::Nl::DataTypes::String.new, multi: false, order: 2, selector_slot: nil)
|
|
261
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"options", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::VportOptions, selector_bindings: []), multi: false, order: 3, selector_slot: nil)
|
|
262
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"upcall_pid", datatype: ::Nl::DataTypes::PackedArray.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new), multi: false, order: 4, selector_slot: nil)
|
|
263
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"stats", datatype: ::Nl::DataTypes::Struct.new(Structs::OvsVportStats, consume_remaining: true), multi: false, order: 5, selector_slot: nil)
|
|
264
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 6, selector_slot: nil)
|
|
265
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"netnsid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
|
|
266
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"upcall_stats", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::UpcallStats, selector_bindings: []), multi: false, order: 8, selector_slot: nil)
|
|
267
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
268
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
279
269
|
# @private
|
|
280
|
-
|
|
281
|
-
end
|
|
282
|
-
# @private
|
|
283
|
-
BY_NAME = Ractor.make_shareable({:"port_no" => PortNo, :"type" => Type, :"name" => Name, :"options" => Options, :"upcall_pid" => UpcallPid, :"stats" => Stats, :"ifindex" => Ifindex, :"netnsid" => Netnsid, :"upcall_stats" => UpcallStats}) #: Hash[::Symbol, Attribute]
|
|
284
|
-
# @private
|
|
285
|
-
BY_TYPE = Ractor.make_shareable({1 => PortNo, 2 => Type, 3 => Name, 4 => Options, 5 => UpcallPid, 6 => Stats, 8 => Ifindex, 9 => Netnsid, 10 => UpcallStats}) #: Hash[::Integer, Attribute]
|
|
286
|
-
# @rbs return: ::Integer
|
|
287
|
-
# @return [Integer]
|
|
288
|
-
# @see PortNo
|
|
289
|
-
def port_no; self[:"port_no"]&.value; end
|
|
290
|
-
# Known enum values are defined in {Enums::VportType}.
|
|
291
|
-
# @rbs return: ::Integer
|
|
292
|
-
# @return [Integer]
|
|
293
|
-
# @see Type
|
|
294
|
-
def type; self[:"type"]&.value; end
|
|
295
|
-
# @rbs return: ::String
|
|
296
|
-
# @return [String]
|
|
297
|
-
# @see Name
|
|
298
|
-
def name; self[:"name"]&.value; end
|
|
299
|
-
# @rbs return: AttributeSets::VportOptions
|
|
300
|
-
# @return [AttributeSets::VportOptions]
|
|
301
|
-
# @see Options
|
|
302
|
-
def options; self[:"options"]&.value; end
|
|
303
|
-
# @rbs return: ::Array[::Integer]
|
|
304
|
-
# @return [Array<Integer>]
|
|
305
|
-
# @see UpcallPid
|
|
306
|
-
def upcall_pid; self[:"upcall_pid"]&.value; end
|
|
307
|
-
# @rbs return: Structs::OvsVportStats
|
|
308
|
-
# @return [Structs::OvsVportStats]
|
|
309
|
-
# @see Stats
|
|
310
|
-
def stats; self[:"stats"]&.value; end
|
|
311
|
-
# @rbs return: ::Integer
|
|
312
|
-
# @return [Integer]
|
|
313
|
-
# @see Ifindex
|
|
314
|
-
def ifindex; self[:"ifindex"]&.value; end
|
|
315
|
-
# @rbs return: ::Integer
|
|
316
|
-
# @return [Integer]
|
|
317
|
-
# @see Netnsid
|
|
318
|
-
def netnsid; self[:"netnsid"]&.value; end
|
|
319
|
-
# @rbs return: AttributeSets::UpcallStats
|
|
320
|
-
# @return [AttributeSets::UpcallStats]
|
|
321
|
-
# @see UpcallStats
|
|
322
|
-
def upcall_stats; self[:"upcall_stats"]&.value; end
|
|
323
|
-
class << self
|
|
324
|
-
# Looks up Attribute class by name.
|
|
325
|
-
# @rbs name: Symbol
|
|
326
|
-
# @rbs return: Attribute
|
|
327
|
-
# @param [Symbol] name
|
|
328
|
-
# @return [Attribute]
|
|
329
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
330
|
-
# Looks up Attribute class by type value.
|
|
331
|
-
# @rbs type: Integer
|
|
332
|
-
# @rbs return: Attribute
|
|
333
|
-
# @param [Integer] type
|
|
334
|
-
# @return [Attribute]
|
|
335
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
270
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
336
271
|
end
|
|
337
272
|
end
|
|
338
|
-
# @private
|
|
339
|
-
Vport::Options::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::VportOptions, selector_bindings: Ractor.make_shareable([]))
|
|
340
|
-
# @private
|
|
341
|
-
Vport::UpcallStats::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::UpcallStats, selector_bindings: Ractor.make_shareable([]))
|
|
342
273
|
end
|
|
343
274
|
module Messages
|
|
344
275
|
# Create a new OVS vport
|
|
345
|
-
class DoNewRequest < ::Nl::
|
|
276
|
+
class DoNewRequest < ::Nl::Message
|
|
346
277
|
TYPE = 1
|
|
347
278
|
FIXED_HEADER = Structs::OvsHeader
|
|
348
279
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
349
|
-
ATTRIBUTES =
|
|
280
|
+
ATTRIBUTES = %i[type name options upcall_pid ifindex].freeze
|
|
281
|
+
include ATTRIBUTE_SET::Definitions
|
|
282
|
+
def initialize(dp_ifindex, attributes = [])
|
|
283
|
+
@dp_ifindex = dp_ifindex
|
|
284
|
+
@attributes = attributes
|
|
285
|
+
end
|
|
286
|
+
# @private
|
|
287
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
288
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
289
|
+
new(
|
|
290
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
291
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
292
|
+
)
|
|
293
|
+
end
|
|
294
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
295
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
296
|
+
def self.decode(decoder)
|
|
297
|
+
value_0 = decoder.get_host_u32
|
|
298
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
299
|
+
end
|
|
300
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
301
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
302
|
+
encode_attributes(encoder, external_selectors:)
|
|
303
|
+
end
|
|
350
304
|
# @rbs return: ::Integer
|
|
351
305
|
# @return [Integer]
|
|
352
|
-
def dp_ifindex;
|
|
306
|
+
def dp_ifindex; @dp_ifindex; end
|
|
353
307
|
# Known enum values are defined in {Enums::VportType}.
|
|
354
308
|
# @rbs return: ::Integer
|
|
355
309
|
# @return [Integer]
|
|
356
|
-
|
|
357
|
-
def type; attributes[:"type"]&.value; end
|
|
310
|
+
def type; self[:"type"]; end
|
|
358
311
|
# @rbs return: ::String
|
|
359
312
|
# @return [String]
|
|
360
|
-
|
|
361
|
-
def name; attributes[:"name"]&.value; end
|
|
313
|
+
def name; self[:"name"]; end
|
|
362
314
|
# @rbs return: AttributeSets::VportOptions
|
|
363
315
|
# @return [AttributeSets::VportOptions]
|
|
364
|
-
|
|
365
|
-
def options; attributes[:"options"]&.value; end
|
|
316
|
+
def options; self[:"options"]; end
|
|
366
317
|
# @rbs return: ::Array[::Integer]
|
|
367
318
|
# @return [Array<Integer>]
|
|
368
|
-
|
|
369
|
-
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
319
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
370
320
|
# @rbs return: ::Integer
|
|
371
321
|
# @return [Integer]
|
|
372
|
-
|
|
373
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
322
|
+
def ifindex; self[:"ifindex"]; end
|
|
374
323
|
end
|
|
375
324
|
# Delete existing OVS vport from a data path
|
|
376
|
-
class DoDelRequest < ::Nl::
|
|
325
|
+
class DoDelRequest < ::Nl::Message
|
|
377
326
|
TYPE = 2
|
|
378
327
|
FIXED_HEADER = Structs::OvsHeader
|
|
379
328
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
380
|
-
ATTRIBUTES =
|
|
329
|
+
ATTRIBUTES = %i[port_no type name].freeze
|
|
330
|
+
include ATTRIBUTE_SET::Definitions
|
|
331
|
+
def initialize(dp_ifindex, attributes = [])
|
|
332
|
+
@dp_ifindex = dp_ifindex
|
|
333
|
+
@attributes = attributes
|
|
334
|
+
end
|
|
335
|
+
# @private
|
|
336
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
337
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
338
|
+
new(
|
|
339
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
340
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
341
|
+
)
|
|
342
|
+
end
|
|
343
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
344
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
345
|
+
def self.decode(decoder)
|
|
346
|
+
value_0 = decoder.get_host_u32
|
|
347
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
348
|
+
end
|
|
349
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
350
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
351
|
+
encode_attributes(encoder, external_selectors:)
|
|
352
|
+
end
|
|
381
353
|
# @rbs return: ::Integer
|
|
382
354
|
# @return [Integer]
|
|
383
|
-
def dp_ifindex;
|
|
355
|
+
def dp_ifindex; @dp_ifindex; end
|
|
384
356
|
# @rbs return: ::Integer
|
|
385
357
|
# @return [Integer]
|
|
386
|
-
|
|
387
|
-
def port_no; attributes[:"port_no"]&.value; end
|
|
358
|
+
def port_no; self[:"port_no"]; end
|
|
388
359
|
# Known enum values are defined in {Enums::VportType}.
|
|
389
360
|
# @rbs return: ::Integer
|
|
390
361
|
# @return [Integer]
|
|
391
|
-
|
|
392
|
-
def type; attributes[:"type"]&.value; end
|
|
362
|
+
def type; self[:"type"]; end
|
|
393
363
|
# @rbs return: ::String
|
|
394
364
|
# @return [String]
|
|
395
|
-
|
|
396
|
-
def name; attributes[:"name"]&.value; end
|
|
365
|
+
def name; self[:"name"]; end
|
|
397
366
|
end
|
|
398
367
|
# Get / dump OVS vport configuration and state
|
|
399
|
-
class DoGetRequest < ::Nl::
|
|
368
|
+
class DoGetRequest < ::Nl::Message
|
|
400
369
|
TYPE = 3
|
|
401
370
|
FIXED_HEADER = Structs::OvsHeader
|
|
402
371
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
403
|
-
ATTRIBUTES =
|
|
372
|
+
ATTRIBUTES = %i[name].freeze
|
|
373
|
+
include ATTRIBUTE_SET::Definitions
|
|
374
|
+
def initialize(dp_ifindex, attributes = [])
|
|
375
|
+
@dp_ifindex = dp_ifindex
|
|
376
|
+
@attributes = attributes
|
|
377
|
+
end
|
|
378
|
+
# @private
|
|
379
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
380
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
381
|
+
new(
|
|
382
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
383
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
384
|
+
)
|
|
385
|
+
end
|
|
386
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
387
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
388
|
+
def self.decode(decoder)
|
|
389
|
+
value_0 = decoder.get_host_u32
|
|
390
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
391
|
+
end
|
|
392
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
393
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
394
|
+
encode_attributes(encoder, external_selectors:)
|
|
395
|
+
end
|
|
404
396
|
# @rbs return: ::Integer
|
|
405
397
|
# @return [Integer]
|
|
406
|
-
def dp_ifindex;
|
|
398
|
+
def dp_ifindex; @dp_ifindex; end
|
|
407
399
|
# @rbs return: ::String
|
|
408
400
|
# @return [String]
|
|
409
|
-
|
|
410
|
-
def name; attributes[:"name"]&.value; end
|
|
401
|
+
def name; self[:"name"]; end
|
|
411
402
|
end
|
|
412
403
|
# Get / dump OVS vport configuration and state
|
|
413
|
-
class DoGetReply < ::Nl::
|
|
404
|
+
class DoGetReply < ::Nl::Message
|
|
414
405
|
TYPE = 3
|
|
415
406
|
FIXED_HEADER = Structs::OvsHeader
|
|
416
407
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
417
|
-
ATTRIBUTES =
|
|
408
|
+
ATTRIBUTES = %i[port_no type name upcall_pid stats ifindex netnsid upcall_stats].freeze
|
|
409
|
+
include ATTRIBUTE_SET::Definitions
|
|
410
|
+
def initialize(dp_ifindex, attributes = [])
|
|
411
|
+
@dp_ifindex = dp_ifindex
|
|
412
|
+
@attributes = attributes
|
|
413
|
+
end
|
|
414
|
+
# @private
|
|
415
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
416
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
417
|
+
new(
|
|
418
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
419
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
420
|
+
)
|
|
421
|
+
end
|
|
422
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
423
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
424
|
+
def self.decode(decoder)
|
|
425
|
+
value_0 = decoder.get_host_u32
|
|
426
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
427
|
+
end
|
|
428
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
429
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
430
|
+
encode_attributes(encoder, external_selectors:)
|
|
431
|
+
end
|
|
418
432
|
# @rbs return: ::Integer
|
|
419
433
|
# @return [Integer]
|
|
420
|
-
def dp_ifindex;
|
|
434
|
+
def dp_ifindex; @dp_ifindex; end
|
|
421
435
|
# @rbs return: ::Integer
|
|
422
436
|
# @return [Integer]
|
|
423
|
-
|
|
424
|
-
def port_no; attributes[:"port_no"]&.value; end
|
|
437
|
+
def port_no; self[:"port_no"]; end
|
|
425
438
|
# Known enum values are defined in {Enums::VportType}.
|
|
426
439
|
# @rbs return: ::Integer
|
|
427
440
|
# @return [Integer]
|
|
428
|
-
|
|
429
|
-
def type; attributes[:"type"]&.value; end
|
|
441
|
+
def type; self[:"type"]; end
|
|
430
442
|
# @rbs return: ::String
|
|
431
443
|
# @return [String]
|
|
432
|
-
|
|
433
|
-
def name; attributes[:"name"]&.value; end
|
|
444
|
+
def name; self[:"name"]; end
|
|
434
445
|
# @rbs return: ::Array[::Integer]
|
|
435
446
|
# @return [Array<Integer>]
|
|
436
|
-
|
|
437
|
-
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
447
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
438
448
|
# @rbs return: Structs::OvsVportStats
|
|
439
449
|
# @return [Structs::OvsVportStats]
|
|
440
|
-
|
|
441
|
-
def stats; attributes[:"stats"]&.value; end
|
|
450
|
+
def stats; self[:"stats"]; end
|
|
442
451
|
# @rbs return: ::Integer
|
|
443
452
|
# @return [Integer]
|
|
444
|
-
|
|
445
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
453
|
+
def ifindex; self[:"ifindex"]; end
|
|
446
454
|
# @rbs return: ::Integer
|
|
447
455
|
# @return [Integer]
|
|
448
|
-
|
|
449
|
-
def netnsid; attributes[:"netnsid"]&.value; end
|
|
456
|
+
def netnsid; self[:"netnsid"]; end
|
|
450
457
|
# @rbs return: AttributeSets::UpcallStats
|
|
451
458
|
# @return [AttributeSets::UpcallStats]
|
|
452
|
-
|
|
453
|
-
def upcall_stats; attributes[:"upcall_stats"]&.value; end
|
|
459
|
+
def upcall_stats; self[:"upcall_stats"]; end
|
|
454
460
|
end
|
|
455
461
|
# Get / dump OVS vport configuration and state
|
|
456
|
-
class DumpGetRequest < ::Nl::
|
|
462
|
+
class DumpGetRequest < ::Nl::Message
|
|
457
463
|
TYPE = 3
|
|
458
464
|
FIXED_HEADER = Structs::OvsHeader
|
|
459
465
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
460
|
-
ATTRIBUTES =
|
|
466
|
+
ATTRIBUTES = %i[name].freeze
|
|
467
|
+
include ATTRIBUTE_SET::Definitions
|
|
468
|
+
def initialize(dp_ifindex, attributes = [])
|
|
469
|
+
@dp_ifindex = dp_ifindex
|
|
470
|
+
@attributes = attributes
|
|
471
|
+
end
|
|
472
|
+
# @private
|
|
473
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
474
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
475
|
+
new(
|
|
476
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
477
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
478
|
+
)
|
|
479
|
+
end
|
|
480
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
481
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
482
|
+
def self.decode(decoder)
|
|
483
|
+
value_0 = decoder.get_host_u32
|
|
484
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
485
|
+
end
|
|
486
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
487
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
488
|
+
encode_attributes(encoder, external_selectors:)
|
|
489
|
+
end
|
|
461
490
|
# @rbs return: ::Integer
|
|
462
491
|
# @return [Integer]
|
|
463
|
-
def dp_ifindex;
|
|
492
|
+
def dp_ifindex; @dp_ifindex; end
|
|
464
493
|
# @rbs return: ::String
|
|
465
494
|
# @return [String]
|
|
466
|
-
|
|
467
|
-
def name; attributes[:"name"]&.value; end
|
|
495
|
+
def name; self[:"name"]; end
|
|
468
496
|
end
|
|
469
497
|
# Get / dump OVS vport configuration and state
|
|
470
|
-
class DumpGetReply < ::Nl::
|
|
498
|
+
class DumpGetReply < ::Nl::Message
|
|
471
499
|
TYPE = 3
|
|
472
500
|
FIXED_HEADER = Structs::OvsHeader
|
|
473
501
|
ATTRIBUTE_SET = AttributeSets::Vport
|
|
474
|
-
ATTRIBUTES =
|
|
502
|
+
ATTRIBUTES = %i[port_no type name upcall_pid stats ifindex netnsid upcall_stats].freeze
|
|
503
|
+
include ATTRIBUTE_SET::Definitions
|
|
504
|
+
def initialize(dp_ifindex, attributes = [])
|
|
505
|
+
@dp_ifindex = dp_ifindex
|
|
506
|
+
@attributes = attributes
|
|
507
|
+
end
|
|
508
|
+
# @private
|
|
509
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
510
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
511
|
+
new(
|
|
512
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
|
|
513
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
514
|
+
)
|
|
515
|
+
end
|
|
516
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
517
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
518
|
+
def self.decode(decoder)
|
|
519
|
+
value_0 = decoder.get_host_u32
|
|
520
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
521
|
+
end
|
|
522
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
523
|
+
FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
|
|
524
|
+
encode_attributes(encoder, external_selectors:)
|
|
525
|
+
end
|
|
475
526
|
# @rbs return: ::Integer
|
|
476
527
|
# @return [Integer]
|
|
477
|
-
def dp_ifindex;
|
|
528
|
+
def dp_ifindex; @dp_ifindex; end
|
|
478
529
|
# @rbs return: ::Integer
|
|
479
530
|
# @return [Integer]
|
|
480
|
-
|
|
481
|
-
def port_no; attributes[:"port_no"]&.value; end
|
|
531
|
+
def port_no; self[:"port_no"]; end
|
|
482
532
|
# Known enum values are defined in {Enums::VportType}.
|
|
483
533
|
# @rbs return: ::Integer
|
|
484
534
|
# @return [Integer]
|
|
485
|
-
|
|
486
|
-
def type; attributes[:"type"]&.value; end
|
|
535
|
+
def type; self[:"type"]; end
|
|
487
536
|
# @rbs return: ::String
|
|
488
537
|
# @return [String]
|
|
489
|
-
|
|
490
|
-
def name; attributes[:"name"]&.value; end
|
|
538
|
+
def name; self[:"name"]; end
|
|
491
539
|
# @rbs return: ::Array[::Integer]
|
|
492
540
|
# @return [Array<Integer>]
|
|
493
|
-
|
|
494
|
-
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
541
|
+
def upcall_pid; self[:"upcall_pid"]; end
|
|
495
542
|
# @rbs return: Structs::OvsVportStats
|
|
496
543
|
# @return [Structs::OvsVportStats]
|
|
497
|
-
|
|
498
|
-
def stats; attributes[:"stats"]&.value; end
|
|
544
|
+
def stats; self[:"stats"]; end
|
|
499
545
|
# @rbs return: ::Integer
|
|
500
546
|
# @return [Integer]
|
|
501
|
-
|
|
502
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
547
|
+
def ifindex; self[:"ifindex"]; end
|
|
503
548
|
# @rbs return: ::Integer
|
|
504
549
|
# @return [Integer]
|
|
505
|
-
|
|
506
|
-
def netnsid; attributes[:"netnsid"]&.value; end
|
|
550
|
+
def netnsid; self[:"netnsid"]; end
|
|
507
551
|
# @rbs return: AttributeSets::UpcallStats
|
|
508
552
|
# @return [AttributeSets::UpcallStats]
|
|
509
|
-
|
|
510
|
-
def upcall_stats; attributes[:"upcall_stats"]&.value; end
|
|
553
|
+
def upcall_stats; self[:"upcall_stats"]; end
|
|
511
554
|
end
|
|
512
555
|
end
|
|
513
556
|
module Notifications
|
|
514
557
|
end
|
|
515
558
|
# @private
|
|
516
|
-
NOTIFICATIONS =
|
|
559
|
+
NOTIFICATIONS = {}.freeze #: Hash[::Integer, ::Class]
|
|
517
560
|
# Create a new OVS vport
|
|
518
561
|
# @rbs (?dp_ifindex: ::Integer, ?type: ::Integer, ?name: ::String, ?options: (AttributeSets::VportOptions | ::Hash[::Symbol, untyped]), ?upcall_pid: ::Array[::Integer], ?ifindex: ::Integer) -> void
|
|
519
562
|
# @param [Hash] args
|