nl-linux 0.2.0 → 0.2.2
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 +4 -0
- data/Rakefile +31 -5
- data/generated/nl/linux/binder.rb +96 -0
- data/generated/nl/linux/conntrack.rb +1227 -0
- data/generated/nl/linux/dev_energymodel.rb +235 -0
- data/generated/nl/linux/devlink.rb +5177 -0
- data/generated/nl/linux/dpll.rb +944 -0
- data/generated/nl/linux/ethtool.rb +7121 -0
- data/generated/nl/linux/fou.rb +332 -0
- data/generated/nl/linux/handshake.rb +238 -0
- data/generated/nl/linux/lockd.rb +99 -0
- data/generated/nl/linux/mptcp_pm.rb +607 -0
- data/generated/nl/linux/net_shaper.rb +731 -0
- data/generated/nl/linux/netdev.rb +1450 -0
- data/generated/nl/linux/nfsd.rb +500 -0
- data/generated/nl/linux/nftables.rb +2924 -0
- data/generated/nl/linux/nl80211.rb +3393 -0
- data/generated/nl/linux/nlctrl.rb +397 -0
- data/generated/nl/linux/ovpn.rb +964 -0
- data/generated/nl/linux/ovs_datapath.rb +321 -0
- data/generated/nl/linux/ovs_flow.rb +1447 -0
- data/generated/nl/linux/ovs_vport.rb +391 -0
- data/generated/nl/linux/psp.rb +463 -0
- data/generated/nl/linux/rt_addr.rb +448 -0
- data/generated/nl/linux/rt_link.rb +4613 -0
- data/generated/nl/linux/rt_neigh.rb +897 -0
- data/generated/nl/linux/rt_route.rb +1126 -0
- data/generated/nl/linux/rt_rule.rb +708 -0
- data/generated/nl/linux/tc.rb +7066 -0
- data/generated/nl/linux/tcp_metrics.rb +317 -0
- data/generated/nl/linux/team.rb +339 -0
- data/generated/nl/linux/wireguard.rb +430 -0
- data/generated/nl/linux.rb +35 -0
- data/lib/nl/linux/version.rb +1 -1
- data/lib/nl-linux.rb +1 -1
- metadata +37 -7
- data/lib/nl/linux.rb +0 -3
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
|
+
#--
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# rbs_inline: enabled
|
|
5
|
+
# This code is generated by Ynl::Generator. DO NOT EDIT.
|
|
6
|
+
require 'nl'
|
|
7
|
+
module Nl; module Linux
|
|
8
|
+
# OVS datapath configuration over generic netlink.
|
|
9
|
+
class OvsDatapath < ::Nl::Family
|
|
10
|
+
NAME = "ovs_datapath"
|
|
11
|
+
PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_datapath"))
|
|
12
|
+
module Structs
|
|
13
|
+
OvsHeader = Struct.new(
|
|
14
|
+
:"dp_ifindex", #: ::Integer
|
|
15
|
+
)
|
|
16
|
+
class OvsHeader
|
|
17
|
+
# :nodoc:
|
|
18
|
+
MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
|
|
19
|
+
# Decodes the struct.
|
|
20
|
+
#--
|
|
21
|
+
# @rbs decoder: ::Nl::Decoder
|
|
22
|
+
# @rbs return: instance
|
|
23
|
+
def self.decode(decoder)
|
|
24
|
+
self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
|
|
25
|
+
end
|
|
26
|
+
# Encodes the struct.
|
|
27
|
+
#--
|
|
28
|
+
# @rbs encoder: ::Nl::Encoder
|
|
29
|
+
# @rbs return: void
|
|
30
|
+
def encode(encoder)
|
|
31
|
+
MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
OvsDpStats = Struct.new(
|
|
35
|
+
:"n_hit", #: ::Integer
|
|
36
|
+
:"n_missed", #: ::Integer
|
|
37
|
+
:"n_lost", #: ::Integer
|
|
38
|
+
:"n_flows", #: ::Integer
|
|
39
|
+
)
|
|
40
|
+
class OvsDpStats
|
|
41
|
+
# :nodoc:
|
|
42
|
+
MEMBERS = Ractor.make_shareable({n_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_missed: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_lost: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_flows: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
|
|
43
|
+
# Decodes the struct.
|
|
44
|
+
#--
|
|
45
|
+
# @rbs decoder: ::Nl::Decoder
|
|
46
|
+
# @rbs return: instance
|
|
47
|
+
def self.decode(decoder)
|
|
48
|
+
self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
|
|
49
|
+
end
|
|
50
|
+
# Encodes the struct.
|
|
51
|
+
#--
|
|
52
|
+
# @rbs encoder: ::Nl::Encoder
|
|
53
|
+
# @rbs return: void
|
|
54
|
+
def encode(encoder)
|
|
55
|
+
MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
OvsDpMegaflowStats = Struct.new(
|
|
59
|
+
:"n_mask_hit", #: ::Integer
|
|
60
|
+
:"n_masks", #: ::Integer
|
|
61
|
+
:"padding", #: ::Integer
|
|
62
|
+
:"n_cache_hit", #: ::Integer
|
|
63
|
+
:"pad1", #: ::Integer
|
|
64
|
+
)
|
|
65
|
+
class OvsDpMegaflowStats
|
|
66
|
+
# :nodoc:
|
|
67
|
+
MEMBERS = Ractor.make_shareable({n_mask_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_masks: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), padding: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), n_cache_hit: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), pad1: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
|
|
68
|
+
# Decodes the struct.
|
|
69
|
+
#--
|
|
70
|
+
# @rbs decoder: ::Nl::Decoder
|
|
71
|
+
# @rbs return: instance
|
|
72
|
+
def self.decode(decoder)
|
|
73
|
+
self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
|
|
74
|
+
end
|
|
75
|
+
# Encodes the struct.
|
|
76
|
+
#--
|
|
77
|
+
# @rbs encoder: ::Nl::Encoder
|
|
78
|
+
# @rbs return: void
|
|
79
|
+
def encode(encoder)
|
|
80
|
+
MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
module AttributeSets
|
|
85
|
+
class Datapath < ::Nl::Protocols::Genl::AttributeSet
|
|
86
|
+
# Abstract class
|
|
87
|
+
class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
|
|
88
|
+
end
|
|
89
|
+
class Name < Attribute
|
|
90
|
+
TYPE = 1
|
|
91
|
+
NAME = :"name"
|
|
92
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
|
|
93
|
+
end
|
|
94
|
+
class UpcallPid < Attribute
|
|
95
|
+
TYPE = 2
|
|
96
|
+
NAME = :"upcall_pid"
|
|
97
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
98
|
+
end
|
|
99
|
+
class Stats < Attribute
|
|
100
|
+
TYPE = 3
|
|
101
|
+
NAME = :"stats"
|
|
102
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
|
|
103
|
+
end
|
|
104
|
+
class MegaflowStats < Attribute
|
|
105
|
+
TYPE = 4
|
|
106
|
+
NAME = :"megaflow_stats"
|
|
107
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
|
|
108
|
+
end
|
|
109
|
+
class UserFeatures < Attribute
|
|
110
|
+
TYPE = 5
|
|
111
|
+
NAME = :"user_features"
|
|
112
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
113
|
+
end
|
|
114
|
+
class MasksCacheSize < Attribute
|
|
115
|
+
TYPE = 6
|
|
116
|
+
NAME = :"masks_cache_size"
|
|
117
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
118
|
+
end
|
|
119
|
+
class PerCpuPids < Attribute
|
|
120
|
+
TYPE = 7
|
|
121
|
+
NAME = :"per_cpu_pids"
|
|
122
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
|
|
123
|
+
end
|
|
124
|
+
class Ifindex < Attribute
|
|
125
|
+
TYPE = 8
|
|
126
|
+
NAME = :"ifindex"
|
|
127
|
+
DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
128
|
+
end
|
|
129
|
+
# :nodoc:
|
|
130
|
+
BY_NAME = Ractor.make_shareable({:"name" => Name, :"upcall_pid" => UpcallPid, :"stats" => Stats, :"megaflow_stats" => MegaflowStats, :"user_features" => UserFeatures, :"masks_cache_size" => MasksCacheSize, :"per_cpu_pids" => PerCpuPids, :"ifindex" => Ifindex}) #: Hash[::Symbol, Attribute]
|
|
131
|
+
# :nodoc:
|
|
132
|
+
BY_TYPE = Ractor.make_shareable({1 => Name, 2 => UpcallPid, 3 => Stats, 4 => MegaflowStats, 5 => UserFeatures, 6 => MasksCacheSize, 7 => PerCpuPids, 8 => Ifindex}) #: Hash[::Integer, Attribute]
|
|
133
|
+
class << self
|
|
134
|
+
# Looks up Attribute class by name.
|
|
135
|
+
#--
|
|
136
|
+
# @rbs name: Symbol
|
|
137
|
+
# @rbs return: Attribute
|
|
138
|
+
def by_name(name); BY_NAME.fetch(name); end
|
|
139
|
+
# Looks up Attribute class by type value.
|
|
140
|
+
#--
|
|
141
|
+
# @rbs type: Integer
|
|
142
|
+
# @rbs return: Attribute
|
|
143
|
+
def by_type(type); BY_TYPE.fetch(type); end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
module Messages
|
|
148
|
+
# Get / dump OVS data path configuration and state
|
|
149
|
+
class DoGetRequest < ::Nl::Protocols::Genl::Message
|
|
150
|
+
TYPE = 3
|
|
151
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
152
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
153
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name])
|
|
154
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
155
|
+
#--
|
|
156
|
+
# @rbs return: ::Integer
|
|
157
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
158
|
+
# Gets the value of `name` attribute in the message.
|
|
159
|
+
#--
|
|
160
|
+
# @rbs return: ::String
|
|
161
|
+
def name; attributes[:"name"]&.value; end
|
|
162
|
+
end
|
|
163
|
+
# Get / dump OVS data path configuration and state
|
|
164
|
+
class DoGetReply < ::Nl::Protocols::Genl::Message
|
|
165
|
+
TYPE = 3
|
|
166
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
167
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
168
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
|
|
169
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
170
|
+
#--
|
|
171
|
+
# @rbs return: ::Integer
|
|
172
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
173
|
+
# Gets the value of `name` attribute in the message.
|
|
174
|
+
#--
|
|
175
|
+
# @rbs return: ::String
|
|
176
|
+
def name; attributes[:"name"]&.value; end
|
|
177
|
+
# Gets the value of `upcall-pid` attribute in the message.
|
|
178
|
+
#--
|
|
179
|
+
# @rbs return: ::Integer
|
|
180
|
+
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
181
|
+
# Gets the value of `stats` attribute in the message.
|
|
182
|
+
#--
|
|
183
|
+
# @rbs return: untyped
|
|
184
|
+
def stats; attributes[:"stats"]&.value; end
|
|
185
|
+
# Gets the value of `megaflow-stats` attribute in the message.
|
|
186
|
+
#--
|
|
187
|
+
# @rbs return: untyped
|
|
188
|
+
def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
|
|
189
|
+
# Gets the value of `user-features` attribute in the message.
|
|
190
|
+
#--
|
|
191
|
+
# @rbs return: ::Integer
|
|
192
|
+
def user_features; attributes[:"user_features"]&.value; end
|
|
193
|
+
# Gets the value of `masks-cache-size` attribute in the message.
|
|
194
|
+
#--
|
|
195
|
+
# @rbs return: ::Integer
|
|
196
|
+
def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
|
|
197
|
+
# Gets the value of `per-cpu-pids` attribute in the message.
|
|
198
|
+
#--
|
|
199
|
+
# @rbs return: untyped
|
|
200
|
+
def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
|
|
201
|
+
end
|
|
202
|
+
# Get / dump OVS data path configuration and state
|
|
203
|
+
class DumpGetRequest < ::Nl::Protocols::Genl::Message
|
|
204
|
+
TYPE = 3
|
|
205
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
206
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
207
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name])
|
|
208
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
209
|
+
#--
|
|
210
|
+
# @rbs return: ::Integer
|
|
211
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
212
|
+
# Gets the value of `name` attribute in the message.
|
|
213
|
+
#--
|
|
214
|
+
# @rbs return: ::String
|
|
215
|
+
def name; attributes[:"name"]&.value; end
|
|
216
|
+
end
|
|
217
|
+
# Get / dump OVS data path configuration and state
|
|
218
|
+
class DumpGetReply < ::Nl::Protocols::Genl::Message
|
|
219
|
+
TYPE = 3
|
|
220
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
221
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
222
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
|
|
223
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
224
|
+
#--
|
|
225
|
+
# @rbs return: ::Integer
|
|
226
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
227
|
+
# Gets the value of `name` attribute in the message.
|
|
228
|
+
#--
|
|
229
|
+
# @rbs return: ::String
|
|
230
|
+
def name; attributes[:"name"]&.value; end
|
|
231
|
+
# Gets the value of `upcall-pid` attribute in the message.
|
|
232
|
+
#--
|
|
233
|
+
# @rbs return: ::Integer
|
|
234
|
+
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
235
|
+
# Gets the value of `stats` attribute in the message.
|
|
236
|
+
#--
|
|
237
|
+
# @rbs return: untyped
|
|
238
|
+
def stats; attributes[:"stats"]&.value; end
|
|
239
|
+
# Gets the value of `megaflow-stats` attribute in the message.
|
|
240
|
+
#--
|
|
241
|
+
# @rbs return: untyped
|
|
242
|
+
def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
|
|
243
|
+
# Gets the value of `user-features` attribute in the message.
|
|
244
|
+
#--
|
|
245
|
+
# @rbs return: ::Integer
|
|
246
|
+
def user_features; attributes[:"user_features"]&.value; end
|
|
247
|
+
# Gets the value of `masks-cache-size` attribute in the message.
|
|
248
|
+
#--
|
|
249
|
+
# @rbs return: ::Integer
|
|
250
|
+
def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
|
|
251
|
+
# Gets the value of `per-cpu-pids` attribute in the message.
|
|
252
|
+
#--
|
|
253
|
+
# @rbs return: untyped
|
|
254
|
+
def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
|
|
255
|
+
end
|
|
256
|
+
# Create new OVS data path
|
|
257
|
+
class DoNewRequest < ::Nl::Protocols::Genl::Message
|
|
258
|
+
TYPE = 1
|
|
259
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
260
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
261
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid user_features])
|
|
262
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
263
|
+
#--
|
|
264
|
+
# @rbs return: ::Integer
|
|
265
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
266
|
+
# Gets the value of `name` attribute in the message.
|
|
267
|
+
#--
|
|
268
|
+
# @rbs return: ::String
|
|
269
|
+
def name; attributes[:"name"]&.value; end
|
|
270
|
+
# Gets the value of `upcall-pid` attribute in the message.
|
|
271
|
+
#--
|
|
272
|
+
# @rbs return: ::Integer
|
|
273
|
+
def upcall_pid; attributes[:"upcall_pid"]&.value; end
|
|
274
|
+
# Gets the value of `user-features` attribute in the message.
|
|
275
|
+
#--
|
|
276
|
+
# @rbs return: ::Integer
|
|
277
|
+
def user_features; attributes[:"user_features"]&.value; end
|
|
278
|
+
end
|
|
279
|
+
# Delete existing OVS data path
|
|
280
|
+
class DoDelRequest < ::Nl::Protocols::Genl::Message
|
|
281
|
+
TYPE = 2
|
|
282
|
+
FIXED_HEADER = Structs::OvsHeader
|
|
283
|
+
ATTRIBUTE_SET = AttributeSets::Datapath
|
|
284
|
+
ATTRIBUTES = Ractor.make_shareable(%i[name])
|
|
285
|
+
# Gets the value of `dp-ifindex` field in the message's fixed header.
|
|
286
|
+
#--
|
|
287
|
+
# @rbs return: ::Integer
|
|
288
|
+
def dp_ifindex; fixed_header.dp_ifindex; end
|
|
289
|
+
# Gets the value of `name` attribute in the message.
|
|
290
|
+
#--
|
|
291
|
+
# @rbs return: ::String
|
|
292
|
+
def name; attributes[:"name"]&.value; end
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
# Get / dump OVS data path configuration and state
|
|
296
|
+
#--
|
|
297
|
+
# @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Messages::DoGetReply
|
|
298
|
+
def do_get(**args)
|
|
299
|
+
exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
|
|
300
|
+
end
|
|
301
|
+
# Get / dump OVS data path configuration and state
|
|
302
|
+
#--
|
|
303
|
+
# @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Enumerable[Messages::DumpGetReply]
|
|
304
|
+
# | (?dp_ifindex: ::Integer, ?name: ::String) { (Messages::DumpGetReply) -> void } -> void
|
|
305
|
+
def dump_get(**args, &block)
|
|
306
|
+
exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
|
|
307
|
+
end
|
|
308
|
+
# Create new OVS data path
|
|
309
|
+
#--
|
|
310
|
+
# @rbs (?dp_ifindex: ::Integer, ?name: ::String, ?upcall_pid: ::Integer, ?user_features: ::Integer) -> void
|
|
311
|
+
def do_new(**args)
|
|
312
|
+
exchange_message(:"do", Messages::DoNewRequest, nil, args)
|
|
313
|
+
end
|
|
314
|
+
# Delete existing OVS data path
|
|
315
|
+
#--
|
|
316
|
+
# @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> void
|
|
317
|
+
def do_del(**args)
|
|
318
|
+
exchange_message(:"do", Messages::DoDelRequest, nil, args)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
end; end
|