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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Rakefile +31 -5
  4. data/generated/nl/linux/binder.rb +96 -0
  5. data/generated/nl/linux/conntrack.rb +1227 -0
  6. data/generated/nl/linux/dev_energymodel.rb +235 -0
  7. data/generated/nl/linux/devlink.rb +5177 -0
  8. data/generated/nl/linux/dpll.rb +944 -0
  9. data/generated/nl/linux/ethtool.rb +7121 -0
  10. data/generated/nl/linux/fou.rb +332 -0
  11. data/generated/nl/linux/handshake.rb +238 -0
  12. data/generated/nl/linux/lockd.rb +99 -0
  13. data/generated/nl/linux/mptcp_pm.rb +607 -0
  14. data/generated/nl/linux/net_shaper.rb +731 -0
  15. data/generated/nl/linux/netdev.rb +1450 -0
  16. data/generated/nl/linux/nfsd.rb +500 -0
  17. data/generated/nl/linux/nftables.rb +2924 -0
  18. data/generated/nl/linux/nl80211.rb +3393 -0
  19. data/generated/nl/linux/nlctrl.rb +397 -0
  20. data/generated/nl/linux/ovpn.rb +964 -0
  21. data/generated/nl/linux/ovs_datapath.rb +321 -0
  22. data/generated/nl/linux/ovs_flow.rb +1447 -0
  23. data/generated/nl/linux/ovs_vport.rb +391 -0
  24. data/generated/nl/linux/psp.rb +463 -0
  25. data/generated/nl/linux/rt_addr.rb +448 -0
  26. data/generated/nl/linux/rt_link.rb +4613 -0
  27. data/generated/nl/linux/rt_neigh.rb +897 -0
  28. data/generated/nl/linux/rt_route.rb +1126 -0
  29. data/generated/nl/linux/rt_rule.rb +708 -0
  30. data/generated/nl/linux/tc.rb +7066 -0
  31. data/generated/nl/linux/tcp_metrics.rb +317 -0
  32. data/generated/nl/linux/team.rb +339 -0
  33. data/generated/nl/linux/wireguard.rb +430 -0
  34. data/generated/nl/linux.rb +35 -0
  35. data/lib/nl/linux/version.rb +1 -1
  36. data/lib/nl-linux.rb +1 -1
  37. metadata +37 -7
  38. data/lib/nl/linux.rb +0 -3
@@ -0,0 +1,391 @@
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 vport configuration over generic netlink.
9
+ class OvsVport < ::Nl::Family
10
+ NAME = "ovs_vport"
11
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("ovs_vport"))
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
+ OvsVportStats = Struct.new(
35
+ :"rx_packets", #: ::Integer
36
+ :"tx_packets", #: ::Integer
37
+ :"rx_bytes", #: ::Integer
38
+ :"tx_bytes", #: ::Integer
39
+ :"rx_errors", #: ::Integer
40
+ :"tx_errors", #: ::Integer
41
+ :"rx_dropped", #: ::Integer
42
+ :"tx_dropped", #: ::Integer
43
+ )
44
+ class OvsVportStats
45
+ # :nodoc:
46
+ MEMBERS = Ractor.make_shareable({rx_packets: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), tx_packets: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), rx_bytes: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), tx_bytes: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), rx_errors: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), tx_errors: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), rx_dropped: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), tx_dropped: ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
47
+ # Decodes the struct.
48
+ #--
49
+ # @rbs decoder: ::Nl::Decoder
50
+ # @rbs return: instance
51
+ def self.decode(decoder)
52
+ self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
53
+ end
54
+ # Encodes the struct.
55
+ #--
56
+ # @rbs encoder: ::Nl::Encoder
57
+ # @rbs return: void
58
+ def encode(encoder)
59
+ MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
60
+ end
61
+ end
62
+ end
63
+ module AttributeSets
64
+ class VportOptions < ::Nl::Protocols::Genl::AttributeSet
65
+ # Abstract class
66
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
67
+ end
68
+ class DstPort < Attribute
69
+ TYPE = 1
70
+ NAME = :"dst_port"
71
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
72
+ end
73
+ class Extension < Attribute
74
+ TYPE = 2
75
+ NAME = :"extension"
76
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
77
+ end
78
+ # :nodoc:
79
+ BY_NAME = Ractor.make_shareable({:"dst_port" => DstPort, :"extension" => Extension}) #: Hash[::Symbol, Attribute]
80
+ # :nodoc:
81
+ BY_TYPE = Ractor.make_shareable({1 => DstPort, 2 => Extension}) #: Hash[::Integer, Attribute]
82
+ class << self
83
+ # Looks up Attribute class by name.
84
+ #--
85
+ # @rbs name: Symbol
86
+ # @rbs return: Attribute
87
+ def by_name(name); BY_NAME.fetch(name); end
88
+ # Looks up Attribute class by type value.
89
+ #--
90
+ # @rbs type: Integer
91
+ # @rbs return: Attribute
92
+ def by_type(type); BY_TYPE.fetch(type); end
93
+ end
94
+ end
95
+ class UpcallStats < ::Nl::Protocols::Genl::AttributeSet
96
+ # Abstract class
97
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
98
+ end
99
+ class Success < Attribute
100
+ TYPE = 0
101
+ NAME = :"success"
102
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
103
+ end
104
+ class Fail < Attribute
105
+ TYPE = 1
106
+ NAME = :"fail"
107
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
108
+ end
109
+ # :nodoc:
110
+ BY_NAME = Ractor.make_shareable({:"success" => Success, :"fail" => Fail}) #: Hash[::Symbol, Attribute]
111
+ # :nodoc:
112
+ BY_TYPE = Ractor.make_shareable({0 => Success, 1 => Fail}) #: Hash[::Integer, Attribute]
113
+ class << self
114
+ # Looks up Attribute class by name.
115
+ #--
116
+ # @rbs name: Symbol
117
+ # @rbs return: Attribute
118
+ def by_name(name); BY_NAME.fetch(name); end
119
+ # Looks up Attribute class by type value.
120
+ #--
121
+ # @rbs type: Integer
122
+ # @rbs return: Attribute
123
+ def by_type(type); BY_TYPE.fetch(type); end
124
+ end
125
+ end
126
+ class Vport < ::Nl::Protocols::Genl::AttributeSet
127
+ # Abstract class
128
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
129
+ end
130
+ class PortNo < Attribute
131
+ TYPE = 1
132
+ NAME = :"port_no"
133
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
134
+ end
135
+ class Type < Attribute
136
+ TYPE = 2
137
+ NAME = :"type"
138
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
139
+ end
140
+ class Name < Attribute
141
+ TYPE = 3
142
+ NAME = :"name"
143
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
144
+ end
145
+ class Options < Attribute
146
+ TYPE = 4
147
+ NAME = :"options"
148
+ end
149
+ class UpcallPid < Attribute
150
+ TYPE = 5
151
+ NAME = :"upcall_pid"
152
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
153
+ end
154
+ class Stats < Attribute
155
+ TYPE = 6
156
+ NAME = :"stats"
157
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: nil)
158
+ end
159
+ class Ifindex < Attribute
160
+ TYPE = 7
161
+ NAME = :"ifindex"
162
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
163
+ end
164
+ class Netnsid < Attribute
165
+ TYPE = 8
166
+ NAME = :"netnsid"
167
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
168
+ end
169
+ class UpcallStats < Attribute
170
+ TYPE = 9
171
+ NAME = :"upcall_stats"
172
+ end
173
+ # :nodoc:
174
+ 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]
175
+ # :nodoc:
176
+ BY_TYPE = Ractor.make_shareable({1 => PortNo, 2 => Type, 3 => Name, 4 => Options, 5 => UpcallPid, 6 => Stats, 7 => Ifindex, 8 => Netnsid, 9 => UpcallStats}) #: Hash[::Integer, Attribute]
177
+ class << self
178
+ # Looks up Attribute class by name.
179
+ #--
180
+ # @rbs name: Symbol
181
+ # @rbs return: Attribute
182
+ def by_name(name); BY_NAME.fetch(name); end
183
+ # Looks up Attribute class by type value.
184
+ #--
185
+ # @rbs type: Integer
186
+ # @rbs return: Attribute
187
+ def by_type(type); BY_TYPE.fetch(type); end
188
+ end
189
+ end
190
+ Vport::Options::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(VportOptions)
191
+ Vport::UpcallStats::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(UpcallStats)
192
+ end
193
+ module Messages
194
+ # Create a new OVS vport
195
+ class DoNewRequest < ::Nl::Protocols::Genl::Message
196
+ TYPE = 1
197
+ FIXED_HEADER = Structs::OvsHeader
198
+ ATTRIBUTE_SET = AttributeSets::Vport
199
+ ATTRIBUTES = Ractor.make_shareable(%i[type name options upcall_pid ifindex])
200
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
201
+ #--
202
+ # @rbs return: ::Integer
203
+ def dp_ifindex; fixed_header.dp_ifindex; end
204
+ # Gets the value of `type` attribute in the message.
205
+ #--
206
+ # @rbs return: ::Integer
207
+ def type; attributes[:"type"]&.value; end
208
+ # Gets the value of `name` attribute in the message.
209
+ #--
210
+ # @rbs return: ::String
211
+ def name; attributes[:"name"]&.value; end
212
+ # Gets the value of `options` attribute in the message.
213
+ #--
214
+ # @rbs return: AttributeSets::VportOptions
215
+ def options; attributes[:"options"]&.value; end
216
+ # Gets the value of `upcall-pid` attribute in the message.
217
+ #--
218
+ # @rbs return: untyped
219
+ def upcall_pid; attributes[:"upcall_pid"]&.value; end
220
+ # Gets the value of `ifindex` attribute in the message.
221
+ #--
222
+ # @rbs return: ::Integer
223
+ def ifindex; attributes[:"ifindex"]&.value; end
224
+ end
225
+ # Delete existing OVS vport from a data path
226
+ class DoDelRequest < ::Nl::Protocols::Genl::Message
227
+ TYPE = 2
228
+ FIXED_HEADER = Structs::OvsHeader
229
+ ATTRIBUTE_SET = AttributeSets::Vport
230
+ ATTRIBUTES = Ractor.make_shareable(%i[port_no type name])
231
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
232
+ #--
233
+ # @rbs return: ::Integer
234
+ def dp_ifindex; fixed_header.dp_ifindex; end
235
+ # Gets the value of `port-no` attribute in the message.
236
+ #--
237
+ # @rbs return: ::Integer
238
+ def port_no; attributes[:"port_no"]&.value; end
239
+ # Gets the value of `type` attribute in the message.
240
+ #--
241
+ # @rbs return: ::Integer
242
+ def type; attributes[:"type"]&.value; end
243
+ # Gets the value of `name` attribute in the message.
244
+ #--
245
+ # @rbs return: ::String
246
+ def name; attributes[:"name"]&.value; end
247
+ end
248
+ # Get / dump OVS vport configuration and state
249
+ class DoGetRequest < ::Nl::Protocols::Genl::Message
250
+ TYPE = 3
251
+ FIXED_HEADER = Structs::OvsHeader
252
+ ATTRIBUTE_SET = AttributeSets::Vport
253
+ ATTRIBUTES = Ractor.make_shareable(%i[name])
254
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
255
+ #--
256
+ # @rbs return: ::Integer
257
+ def dp_ifindex; fixed_header.dp_ifindex; end
258
+ # Gets the value of `name` attribute in the message.
259
+ #--
260
+ # @rbs return: ::String
261
+ def name; attributes[:"name"]&.value; end
262
+ end
263
+ # Get / dump OVS vport configuration and state
264
+ class DoGetReply < ::Nl::Protocols::Genl::Message
265
+ TYPE = 3
266
+ FIXED_HEADER = Structs::OvsHeader
267
+ ATTRIBUTE_SET = AttributeSets::Vport
268
+ ATTRIBUTES = Ractor.make_shareable(%i[port_no type name upcall_pid stats ifindex netnsid upcall_stats])
269
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
270
+ #--
271
+ # @rbs return: ::Integer
272
+ def dp_ifindex; fixed_header.dp_ifindex; end
273
+ # Gets the value of `port-no` attribute in the message.
274
+ #--
275
+ # @rbs return: ::Integer
276
+ def port_no; attributes[:"port_no"]&.value; end
277
+ # Gets the value of `type` attribute in the message.
278
+ #--
279
+ # @rbs return: ::Integer
280
+ def type; attributes[:"type"]&.value; end
281
+ # Gets the value of `name` attribute in the message.
282
+ #--
283
+ # @rbs return: ::String
284
+ def name; attributes[:"name"]&.value; end
285
+ # Gets the value of `upcall-pid` attribute in the message.
286
+ #--
287
+ # @rbs return: untyped
288
+ def upcall_pid; attributes[:"upcall_pid"]&.value; end
289
+ # Gets the value of `stats` attribute in the message.
290
+ #--
291
+ # @rbs return: untyped
292
+ def stats; attributes[:"stats"]&.value; end
293
+ # Gets the value of `ifindex` attribute in the message.
294
+ #--
295
+ # @rbs return: ::Integer
296
+ def ifindex; attributes[:"ifindex"]&.value; end
297
+ # Gets the value of `netnsid` attribute in the message.
298
+ #--
299
+ # @rbs return: ::Integer
300
+ def netnsid; attributes[:"netnsid"]&.value; end
301
+ # Gets the value of `upcall-stats` attribute in the message.
302
+ #--
303
+ # @rbs return: AttributeSets::UpcallStats
304
+ def upcall_stats; attributes[:"upcall_stats"]&.value; end
305
+ end
306
+ # Get / dump OVS vport configuration and state
307
+ class DumpGetRequest < ::Nl::Protocols::Genl::Message
308
+ TYPE = 3
309
+ FIXED_HEADER = Structs::OvsHeader
310
+ ATTRIBUTE_SET = AttributeSets::Vport
311
+ ATTRIBUTES = Ractor.make_shareable(%i[name])
312
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
313
+ #--
314
+ # @rbs return: ::Integer
315
+ def dp_ifindex; fixed_header.dp_ifindex; end
316
+ # Gets the value of `name` attribute in the message.
317
+ #--
318
+ # @rbs return: ::String
319
+ def name; attributes[:"name"]&.value; end
320
+ end
321
+ # Get / dump OVS vport configuration and state
322
+ class DumpGetReply < ::Nl::Protocols::Genl::Message
323
+ TYPE = 3
324
+ FIXED_HEADER = Structs::OvsHeader
325
+ ATTRIBUTE_SET = AttributeSets::Vport
326
+ ATTRIBUTES = Ractor.make_shareable(%i[port_no type name upcall_pid stats ifindex netnsid upcall_stats])
327
+ # Gets the value of `dp-ifindex` field in the message's fixed header.
328
+ #--
329
+ # @rbs return: ::Integer
330
+ def dp_ifindex; fixed_header.dp_ifindex; end
331
+ # Gets the value of `port-no` attribute in the message.
332
+ #--
333
+ # @rbs return: ::Integer
334
+ def port_no; attributes[:"port_no"]&.value; end
335
+ # Gets the value of `type` attribute in the message.
336
+ #--
337
+ # @rbs return: ::Integer
338
+ def type; attributes[:"type"]&.value; end
339
+ # Gets the value of `name` attribute in the message.
340
+ #--
341
+ # @rbs return: ::String
342
+ def name; attributes[:"name"]&.value; end
343
+ # Gets the value of `upcall-pid` attribute in the message.
344
+ #--
345
+ # @rbs return: untyped
346
+ def upcall_pid; attributes[:"upcall_pid"]&.value; end
347
+ # Gets the value of `stats` attribute in the message.
348
+ #--
349
+ # @rbs return: untyped
350
+ def stats; attributes[:"stats"]&.value; end
351
+ # Gets the value of `ifindex` attribute in the message.
352
+ #--
353
+ # @rbs return: ::Integer
354
+ def ifindex; attributes[:"ifindex"]&.value; end
355
+ # Gets the value of `netnsid` attribute in the message.
356
+ #--
357
+ # @rbs return: ::Integer
358
+ def netnsid; attributes[:"netnsid"]&.value; end
359
+ # Gets the value of `upcall-stats` attribute in the message.
360
+ #--
361
+ # @rbs return: AttributeSets::UpcallStats
362
+ def upcall_stats; attributes[:"upcall_stats"]&.value; end
363
+ end
364
+ end
365
+ # Create a new OVS vport
366
+ #--
367
+ # @rbs (?dp_ifindex: ::Integer, ?type: ::Integer, ?name: ::String, ?options: AttributeSets::VportOptions, ?upcall_pid: untyped, ?ifindex: ::Integer) -> void
368
+ def do_new(**args)
369
+ exchange_message(:"do", Messages::DoNewRequest, nil, args)
370
+ end
371
+ # Delete existing OVS vport from a data path
372
+ #--
373
+ # @rbs (?dp_ifindex: ::Integer, ?port_no: ::Integer, ?type: ::Integer, ?name: ::String) -> void
374
+ def do_del(**args)
375
+ exchange_message(:"do", Messages::DoDelRequest, nil, args)
376
+ end
377
+ # Get / dump OVS vport configuration and state
378
+ #--
379
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Messages::DoGetReply
380
+ def do_get(**args)
381
+ exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
382
+ end
383
+ # Get / dump OVS vport configuration and state
384
+ #--
385
+ # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Enumerable[Messages::DumpGetReply]
386
+ # | (?dp_ifindex: ::Integer, ?name: ::String) { (Messages::DumpGetReply) -> void } -> void
387
+ def dump_get(**args, &block)
388
+ exchange_message(:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block)
389
+ end
390
+ end
391
+ end; end