nl-linux 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,706 @@
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
+ # FIB rule management over rtnetlink.
8
+ class Nl::Linux::RtRule < ::Nl::Family
9
+ NAME = "rt-rule"
10
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Raw.new("rt-rule", 0))
11
+ module Structs
12
+ Rtgenmsg = Struct.new(
13
+ :"family", #: ::Integer
14
+ :"pad", #: nil
15
+ )
16
+ class Rtgenmsg
17
+ # :nodoc:
18
+ MEMBERS = Ractor.make_shareable({family: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), pad: ::Nl::Protocols::Raw::DataTypes::Pad.new(3)}) #: 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
+ FibRuleHdr = Struct.new(
35
+ :"family", #: ::Integer
36
+ :"dst_len", #: ::Integer
37
+ :"src_len", #: ::Integer
38
+ :"tos", #: ::Integer
39
+ :"table", #: ::Integer
40
+ :"res1", #: nil
41
+ :"res2", #: nil
42
+ :"action", #: ::Integer
43
+ :"flags", #: ::Integer
44
+ )
45
+ class FibRuleHdr
46
+ # :nodoc:
47
+ MEMBERS = Ractor.make_shareable({family: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), dst_len: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), src_len: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), tos: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), table: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), res1: ::Nl::Protocols::Raw::DataTypes::Pad.new(1), res2: ::Nl::Protocols::Raw::DataTypes::Pad.new(1), action: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), flags: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
48
+ # Decodes the struct.
49
+ #--
50
+ # @rbs decoder: ::Nl::Decoder
51
+ # @rbs return: instance
52
+ def self.decode(decoder)
53
+ self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
54
+ end
55
+ # Encodes the struct.
56
+ #--
57
+ # @rbs encoder: ::Nl::Encoder
58
+ # @rbs return: void
59
+ def encode(encoder)
60
+ MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
61
+ end
62
+ end
63
+ FibRulePortRange = Struct.new(
64
+ :"start", #: ::Integer
65
+ :"end", #: ::Integer
66
+ )
67
+ class FibRulePortRange
68
+ # :nodoc:
69
+ MEMBERS = Ractor.make_shareable({start: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil), end: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
70
+ # Decodes the struct.
71
+ #--
72
+ # @rbs decoder: ::Nl::Decoder
73
+ # @rbs return: instance
74
+ def self.decode(decoder)
75
+ self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
76
+ end
77
+ # Encodes the struct.
78
+ #--
79
+ # @rbs encoder: ::Nl::Encoder
80
+ # @rbs return: void
81
+ def encode(encoder)
82
+ MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
83
+ end
84
+ end
85
+ FibRuleUidRange = Struct.new(
86
+ :"start", #: ::Integer
87
+ :"end", #: ::Integer
88
+ )
89
+ class FibRuleUidRange
90
+ # :nodoc:
91
+ MEMBERS = Ractor.make_shareable({start: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), end: ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
92
+ # Decodes the struct.
93
+ #--
94
+ # @rbs decoder: ::Nl::Decoder
95
+ # @rbs return: instance
96
+ def self.decode(decoder)
97
+ self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
98
+ end
99
+ # Encodes the struct.
100
+ #--
101
+ # @rbs encoder: ::Nl::Encoder
102
+ # @rbs return: void
103
+ def encode(encoder)
104
+ MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
105
+ end
106
+ end
107
+ end
108
+ module AttributeSets
109
+ class FibRuleAttrs < ::Nl::Protocols::Raw::AttributeSet
110
+ # Abstract class
111
+ class Attribute < ::Nl::Protocols::Raw::AttributeSet::Attribute
112
+ end
113
+ class Dst < Attribute
114
+ TYPE = 1
115
+ NAME = :"dst"
116
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Binary.new(check: nil)
117
+ end
118
+ class Src < Attribute
119
+ TYPE = 2
120
+ NAME = :"src"
121
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Binary.new(check: nil)
122
+ end
123
+ class Iifname < Attribute
124
+ TYPE = 3
125
+ NAME = :"iifname"
126
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::String.new(check: nil)
127
+ end
128
+ class Goto < Attribute
129
+ TYPE = 4
130
+ NAME = :"goto"
131
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
132
+ end
133
+ class Unused2 < Attribute
134
+ TYPE = 5
135
+ NAME = :"unused2"
136
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Pad.new()
137
+ end
138
+ class Priority < Attribute
139
+ TYPE = 6
140
+ NAME = :"priority"
141
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
142
+ end
143
+ class Unused3 < Attribute
144
+ TYPE = 7
145
+ NAME = :"unused3"
146
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Pad.new()
147
+ end
148
+ class Unused4 < Attribute
149
+ TYPE = 8
150
+ NAME = :"unused4"
151
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Pad.new()
152
+ end
153
+ class Unused5 < Attribute
154
+ TYPE = 9
155
+ NAME = :"unused5"
156
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Pad.new()
157
+ end
158
+ class Fwmark < Attribute
159
+ TYPE = 10
160
+ NAME = :"fwmark"
161
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
162
+ end
163
+ class Flow < Attribute
164
+ TYPE = 11
165
+ NAME = :"flow"
166
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
167
+ end
168
+ class TunId < Attribute
169
+ TYPE = 12
170
+ NAME = :"tun_id"
171
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
172
+ end
173
+ class SuppressIfgroup < Attribute
174
+ TYPE = 13
175
+ NAME = :"suppress_ifgroup"
176
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
177
+ end
178
+ class SuppressPrefixlen < Attribute
179
+ TYPE = 14
180
+ NAME = :"suppress_prefixlen"
181
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
182
+ end
183
+ class Table < Attribute
184
+ TYPE = 15
185
+ NAME = :"table"
186
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
187
+ end
188
+ class Fwmask < Attribute
189
+ TYPE = 16
190
+ NAME = :"fwmask"
191
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
192
+ end
193
+ class Oifname < Attribute
194
+ TYPE = 17
195
+ NAME = :"oifname"
196
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::String.new(check: nil)
197
+ end
198
+ class Pad < Attribute
199
+ TYPE = 18
200
+ NAME = :"pad"
201
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Pad.new()
202
+ end
203
+ class L3mdev < Attribute
204
+ TYPE = 19
205
+ NAME = :"l3mdev"
206
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
207
+ end
208
+ class UidRange < Attribute
209
+ TYPE = 20
210
+ NAME = :"uid_range"
211
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Binary.new(check: nil)
212
+ end
213
+ class Protocol < Attribute
214
+ TYPE = 21
215
+ NAME = :"protocol"
216
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
217
+ end
218
+ class IpProto < Attribute
219
+ TYPE = 22
220
+ NAME = :"ip_proto"
221
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
222
+ end
223
+ class SportRange < Attribute
224
+ TYPE = 23
225
+ NAME = :"sport_range"
226
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Binary.new(check: nil)
227
+ end
228
+ class DportRange < Attribute
229
+ TYPE = 24
230
+ NAME = :"dport_range"
231
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Binary.new(check: nil)
232
+ end
233
+ class Dscp < Attribute
234
+ TYPE = 25
235
+ NAME = :"dscp"
236
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
237
+ end
238
+ class Flowlabel < Attribute
239
+ TYPE = 26
240
+ NAME = :"flowlabel"
241
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
242
+ end
243
+ class FlowlabelMask < Attribute
244
+ TYPE = 27
245
+ NAME = :"flowlabel_mask"
246
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
247
+ end
248
+ class SportMask < Attribute
249
+ TYPE = 28
250
+ NAME = :"sport_mask"
251
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
252
+ end
253
+ class DportMask < Attribute
254
+ TYPE = 29
255
+ NAME = :"dport_mask"
256
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
257
+ end
258
+ class DscpMask < Attribute
259
+ TYPE = 30
260
+ NAME = :"dscp_mask"
261
+ DATATYPE = ::Nl::Protocols::Raw::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
262
+ end
263
+ # :nodoc:
264
+ BY_NAME = Ractor.make_shareable({:"dst" => Dst, :"src" => Src, :"iifname" => Iifname, :"goto" => Goto, :"unused2" => Unused2, :"priority" => Priority, :"unused3" => Unused3, :"unused4" => Unused4, :"unused5" => Unused5, :"fwmark" => Fwmark, :"flow" => Flow, :"tun_id" => TunId, :"suppress_ifgroup" => SuppressIfgroup, :"suppress_prefixlen" => SuppressPrefixlen, :"table" => Table, :"fwmask" => Fwmask, :"oifname" => Oifname, :"pad" => Pad, :"l3mdev" => L3mdev, :"uid_range" => UidRange, :"protocol" => Protocol, :"ip_proto" => IpProto, :"sport_range" => SportRange, :"dport_range" => DportRange, :"dscp" => Dscp, :"flowlabel" => Flowlabel, :"flowlabel_mask" => FlowlabelMask, :"sport_mask" => SportMask, :"dport_mask" => DportMask, :"dscp_mask" => DscpMask}) #: Hash[::Symbol, Attribute]
265
+ # :nodoc:
266
+ BY_TYPE = Ractor.make_shareable({1 => Dst, 2 => Src, 3 => Iifname, 4 => Goto, 5 => Unused2, 6 => Priority, 7 => Unused3, 8 => Unused4, 9 => Unused5, 10 => Fwmark, 11 => Flow, 12 => TunId, 13 => SuppressIfgroup, 14 => SuppressPrefixlen, 15 => Table, 16 => Fwmask, 17 => Oifname, 18 => Pad, 19 => L3mdev, 20 => UidRange, 21 => Protocol, 22 => IpProto, 23 => SportRange, 24 => DportRange, 25 => Dscp, 26 => Flowlabel, 27 => FlowlabelMask, 28 => SportMask, 29 => DportMask, 30 => DscpMask}) #: Hash[::Integer, Attribute]
267
+ class << self
268
+ # Looks up Attribute class by name.
269
+ #--
270
+ # @rbs name: Symbol
271
+ # @rbs return: Attribute
272
+ def by_name(name); BY_NAME.fetch(name); end
273
+ # Looks up Attribute class by type value.
274
+ #--
275
+ # @rbs type: Integer
276
+ # @rbs return: Attribute
277
+ def by_type(type); BY_TYPE.fetch(type); end
278
+ end
279
+ end
280
+ end
281
+ module Messages
282
+ # Add new FIB rule
283
+ class DoNewruleRequest < ::Nl::Protocols::Raw::Message
284
+ TYPE = 32
285
+ FIXED_HEADER = Structs::FibRuleHdr
286
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
287
+ ATTRIBUTES = Ractor.make_shareable(%i[iifname goto priority fwmark flow tun_id suppress_ifgroup suppress_prefixlen table fwmask oifname l3mdev uid_range protocol ip_proto sport_range dport_range dscp flowlabel flowlabel_mask sport_mask dport_mask dscp_mask])
288
+ # Gets the value of `family` field in the message's fixed header.
289
+ #--
290
+ # @rbs return: ::Integer
291
+ def family; fixed_header.family; end
292
+ # Gets the value of `dst-len` field in the message's fixed header.
293
+ #--
294
+ # @rbs return: ::Integer
295
+ def dst_len; fixed_header.dst_len; end
296
+ # Gets the value of `src-len` field in the message's fixed header.
297
+ #--
298
+ # @rbs return: ::Integer
299
+ def src_len; fixed_header.src_len; end
300
+ # Gets the value of `tos` field in the message's fixed header.
301
+ #--
302
+ # @rbs return: ::Integer
303
+ def tos; fixed_header.tos; end
304
+ # Gets the value of `action` field in the message's fixed header.
305
+ #--
306
+ # @rbs return: ::Integer
307
+ def action; fixed_header.action; end
308
+ # Gets the value of `flags` field in the message's fixed header.
309
+ #--
310
+ # @rbs return: ::Integer
311
+ def flags; fixed_header.flags; end
312
+ # Gets the value of `iifname` attribute in the message.
313
+ #--
314
+ # @rbs return: ::String
315
+ def iifname; attributes[:"iifname"]&.value; end
316
+ # Gets the value of `goto` attribute in the message.
317
+ #--
318
+ # @rbs return: ::Integer
319
+ def goto; attributes[:"goto"]&.value; end
320
+ # Gets the value of `priority` attribute in the message.
321
+ #--
322
+ # @rbs return: ::Integer
323
+ def priority; attributes[:"priority"]&.value; end
324
+ # Gets the value of `fwmark` attribute in the message.
325
+ #--
326
+ # @rbs return: ::Integer
327
+ def fwmark; attributes[:"fwmark"]&.value; end
328
+ # Gets the value of `flow` attribute in the message.
329
+ #--
330
+ # @rbs return: ::Integer
331
+ def flow; attributes[:"flow"]&.value; end
332
+ # Gets the value of `tun-id` attribute in the message.
333
+ #--
334
+ # @rbs return: ::Integer
335
+ def tun_id; attributes[:"tun_id"]&.value; end
336
+ # Gets the value of `suppress-ifgroup` attribute in the message.
337
+ #--
338
+ # @rbs return: ::Integer
339
+ def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
340
+ # Gets the value of `suppress-prefixlen` attribute in the message.
341
+ #--
342
+ # @rbs return: ::Integer
343
+ def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
344
+ # Gets the value of `table` attribute or fixed header in the message.
345
+ #--
346
+ # @rbs return: ::Integer
347
+ def table; attributes[:"table"]&.value || fixed_header.table; end
348
+ # Gets the value of `fwmask` attribute in the message.
349
+ #--
350
+ # @rbs return: ::Integer
351
+ def fwmask; attributes[:"fwmask"]&.value; end
352
+ # Gets the value of `oifname` attribute in the message.
353
+ #--
354
+ # @rbs return: ::String
355
+ def oifname; attributes[:"oifname"]&.value; end
356
+ # Gets the value of `l3mdev` attribute in the message.
357
+ #--
358
+ # @rbs return: ::Integer
359
+ def l3mdev; attributes[:"l3mdev"]&.value; end
360
+ # Gets the value of `uid-range` attribute in the message.
361
+ #--
362
+ # @rbs return: untyped
363
+ def uid_range; attributes[:"uid_range"]&.value; end
364
+ # Gets the value of `protocol` attribute in the message.
365
+ #--
366
+ # @rbs return: ::Integer
367
+ def protocol; attributes[:"protocol"]&.value; end
368
+ # Gets the value of `ip-proto` attribute in the message.
369
+ #--
370
+ # @rbs return: ::Integer
371
+ def ip_proto; attributes[:"ip_proto"]&.value; end
372
+ # Gets the value of `sport-range` attribute in the message.
373
+ #--
374
+ # @rbs return: untyped
375
+ def sport_range; attributes[:"sport_range"]&.value; end
376
+ # Gets the value of `dport-range` attribute in the message.
377
+ #--
378
+ # @rbs return: untyped
379
+ def dport_range; attributes[:"dport_range"]&.value; end
380
+ # Gets the value of `dscp` attribute in the message.
381
+ #--
382
+ # @rbs return: ::Integer
383
+ def dscp; attributes[:"dscp"]&.value; end
384
+ # Gets the value of `flowlabel` attribute in the message.
385
+ #--
386
+ # @rbs return: ::Integer
387
+ def flowlabel; attributes[:"flowlabel"]&.value; end
388
+ # Gets the value of `flowlabel-mask` attribute in the message.
389
+ #--
390
+ # @rbs return: ::Integer
391
+ def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
392
+ # Gets the value of `sport-mask` attribute in the message.
393
+ #--
394
+ # @rbs return: ::Integer
395
+ def sport_mask; attributes[:"sport_mask"]&.value; end
396
+ # Gets the value of `dport-mask` attribute in the message.
397
+ #--
398
+ # @rbs return: ::Integer
399
+ def dport_mask; attributes[:"dport_mask"]&.value; end
400
+ # Gets the value of `dscp-mask` attribute in the message.
401
+ #--
402
+ # @rbs return: ::Integer
403
+ def dscp_mask; attributes[:"dscp_mask"]&.value; end
404
+ end
405
+ # Remove an existing FIB rule
406
+ class DoDelruleRequest < ::Nl::Protocols::Raw::Message
407
+ TYPE = 33
408
+ FIXED_HEADER = Structs::FibRuleHdr
409
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
410
+ ATTRIBUTES = Ractor.make_shareable(%i[iifname goto priority fwmark flow tun_id suppress_ifgroup suppress_prefixlen table fwmask oifname l3mdev uid_range protocol ip_proto sport_range dport_range dscp flowlabel flowlabel_mask sport_mask dport_mask dscp_mask])
411
+ # Gets the value of `family` field in the message's fixed header.
412
+ #--
413
+ # @rbs return: ::Integer
414
+ def family; fixed_header.family; end
415
+ # Gets the value of `dst-len` field in the message's fixed header.
416
+ #--
417
+ # @rbs return: ::Integer
418
+ def dst_len; fixed_header.dst_len; end
419
+ # Gets the value of `src-len` field in the message's fixed header.
420
+ #--
421
+ # @rbs return: ::Integer
422
+ def src_len; fixed_header.src_len; end
423
+ # Gets the value of `tos` field in the message's fixed header.
424
+ #--
425
+ # @rbs return: ::Integer
426
+ def tos; fixed_header.tos; end
427
+ # Gets the value of `action` field in the message's fixed header.
428
+ #--
429
+ # @rbs return: ::Integer
430
+ def action; fixed_header.action; end
431
+ # Gets the value of `flags` field in the message's fixed header.
432
+ #--
433
+ # @rbs return: ::Integer
434
+ def flags; fixed_header.flags; end
435
+ # Gets the value of `iifname` attribute in the message.
436
+ #--
437
+ # @rbs return: ::String
438
+ def iifname; attributes[:"iifname"]&.value; end
439
+ # Gets the value of `goto` attribute in the message.
440
+ #--
441
+ # @rbs return: ::Integer
442
+ def goto; attributes[:"goto"]&.value; end
443
+ # Gets the value of `priority` attribute in the message.
444
+ #--
445
+ # @rbs return: ::Integer
446
+ def priority; attributes[:"priority"]&.value; end
447
+ # Gets the value of `fwmark` attribute in the message.
448
+ #--
449
+ # @rbs return: ::Integer
450
+ def fwmark; attributes[:"fwmark"]&.value; end
451
+ # Gets the value of `flow` attribute in the message.
452
+ #--
453
+ # @rbs return: ::Integer
454
+ def flow; attributes[:"flow"]&.value; end
455
+ # Gets the value of `tun-id` attribute in the message.
456
+ #--
457
+ # @rbs return: ::Integer
458
+ def tun_id; attributes[:"tun_id"]&.value; end
459
+ # Gets the value of `suppress-ifgroup` attribute in the message.
460
+ #--
461
+ # @rbs return: ::Integer
462
+ def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
463
+ # Gets the value of `suppress-prefixlen` attribute in the message.
464
+ #--
465
+ # @rbs return: ::Integer
466
+ def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
467
+ # Gets the value of `table` attribute or fixed header in the message.
468
+ #--
469
+ # @rbs return: ::Integer
470
+ def table; attributes[:"table"]&.value || fixed_header.table; end
471
+ # Gets the value of `fwmask` attribute in the message.
472
+ #--
473
+ # @rbs return: ::Integer
474
+ def fwmask; attributes[:"fwmask"]&.value; end
475
+ # Gets the value of `oifname` attribute in the message.
476
+ #--
477
+ # @rbs return: ::String
478
+ def oifname; attributes[:"oifname"]&.value; end
479
+ # Gets the value of `l3mdev` attribute in the message.
480
+ #--
481
+ # @rbs return: ::Integer
482
+ def l3mdev; attributes[:"l3mdev"]&.value; end
483
+ # Gets the value of `uid-range` attribute in the message.
484
+ #--
485
+ # @rbs return: untyped
486
+ def uid_range; attributes[:"uid_range"]&.value; end
487
+ # Gets the value of `protocol` attribute in the message.
488
+ #--
489
+ # @rbs return: ::Integer
490
+ def protocol; attributes[:"protocol"]&.value; end
491
+ # Gets the value of `ip-proto` attribute in the message.
492
+ #--
493
+ # @rbs return: ::Integer
494
+ def ip_proto; attributes[:"ip_proto"]&.value; end
495
+ # Gets the value of `sport-range` attribute in the message.
496
+ #--
497
+ # @rbs return: untyped
498
+ def sport_range; attributes[:"sport_range"]&.value; end
499
+ # Gets the value of `dport-range` attribute in the message.
500
+ #--
501
+ # @rbs return: untyped
502
+ def dport_range; attributes[:"dport_range"]&.value; end
503
+ # Gets the value of `dscp` attribute in the message.
504
+ #--
505
+ # @rbs return: ::Integer
506
+ def dscp; attributes[:"dscp"]&.value; end
507
+ # Gets the value of `flowlabel` attribute in the message.
508
+ #--
509
+ # @rbs return: ::Integer
510
+ def flowlabel; attributes[:"flowlabel"]&.value; end
511
+ # Gets the value of `flowlabel-mask` attribute in the message.
512
+ #--
513
+ # @rbs return: ::Integer
514
+ def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
515
+ # Gets the value of `sport-mask` attribute in the message.
516
+ #--
517
+ # @rbs return: ::Integer
518
+ def sport_mask; attributes[:"sport_mask"]&.value; end
519
+ # Gets the value of `dport-mask` attribute in the message.
520
+ #--
521
+ # @rbs return: ::Integer
522
+ def dport_mask; attributes[:"dport_mask"]&.value; end
523
+ # Gets the value of `dscp-mask` attribute in the message.
524
+ #--
525
+ # @rbs return: ::Integer
526
+ def dscp_mask; attributes[:"dscp_mask"]&.value; end
527
+ end
528
+ # Dump all FIB rules
529
+ class DumpGetruleRequest < ::Nl::Protocols::Raw::Message
530
+ TYPE = 34
531
+ FIXED_HEADER = Structs::FibRuleHdr
532
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
533
+ ATTRIBUTES = Ractor.make_shareable(%i[])
534
+ # Gets the value of `family` field in the message's fixed header.
535
+ #--
536
+ # @rbs return: ::Integer
537
+ def family; fixed_header.family; end
538
+ # Gets the value of `dst-len` field in the message's fixed header.
539
+ #--
540
+ # @rbs return: ::Integer
541
+ def dst_len; fixed_header.dst_len; end
542
+ # Gets the value of `src-len` field in the message's fixed header.
543
+ #--
544
+ # @rbs return: ::Integer
545
+ def src_len; fixed_header.src_len; end
546
+ # Gets the value of `tos` field in the message's fixed header.
547
+ #--
548
+ # @rbs return: ::Integer
549
+ def tos; fixed_header.tos; end
550
+ # Gets the value of `table` field in the message's fixed header.
551
+ #--
552
+ # @rbs return: ::Integer
553
+ def table; fixed_header.table; end
554
+ # Gets the value of `action` field in the message's fixed header.
555
+ #--
556
+ # @rbs return: ::Integer
557
+ def action; fixed_header.action; end
558
+ # Gets the value of `flags` field in the message's fixed header.
559
+ #--
560
+ # @rbs return: ::Integer
561
+ def flags; fixed_header.flags; end
562
+ end
563
+ # Dump all FIB rules
564
+ class DumpGetruleReply < ::Nl::Protocols::Raw::Message
565
+ TYPE = 32
566
+ FIXED_HEADER = Structs::FibRuleHdr
567
+ ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
568
+ ATTRIBUTES = Ractor.make_shareable(%i[iifname goto priority fwmark flow tun_id suppress_ifgroup suppress_prefixlen table fwmask oifname l3mdev uid_range protocol ip_proto sport_range dport_range dscp flowlabel flowlabel_mask sport_mask dport_mask dscp_mask])
569
+ # Gets the value of `family` field in the message's fixed header.
570
+ #--
571
+ # @rbs return: ::Integer
572
+ def family; fixed_header.family; end
573
+ # Gets the value of `dst-len` field in the message's fixed header.
574
+ #--
575
+ # @rbs return: ::Integer
576
+ def dst_len; fixed_header.dst_len; end
577
+ # Gets the value of `src-len` field in the message's fixed header.
578
+ #--
579
+ # @rbs return: ::Integer
580
+ def src_len; fixed_header.src_len; end
581
+ # Gets the value of `tos` field in the message's fixed header.
582
+ #--
583
+ # @rbs return: ::Integer
584
+ def tos; fixed_header.tos; end
585
+ # Gets the value of `action` field in the message's fixed header.
586
+ #--
587
+ # @rbs return: ::Integer
588
+ def action; fixed_header.action; end
589
+ # Gets the value of `flags` field in the message's fixed header.
590
+ #--
591
+ # @rbs return: ::Integer
592
+ def flags; fixed_header.flags; end
593
+ # Gets the value of `iifname` attribute in the message.
594
+ #--
595
+ # @rbs return: ::String
596
+ def iifname; attributes[:"iifname"]&.value; end
597
+ # Gets the value of `goto` attribute in the message.
598
+ #--
599
+ # @rbs return: ::Integer
600
+ def goto; attributes[:"goto"]&.value; end
601
+ # Gets the value of `priority` attribute in the message.
602
+ #--
603
+ # @rbs return: ::Integer
604
+ def priority; attributes[:"priority"]&.value; end
605
+ # Gets the value of `fwmark` attribute in the message.
606
+ #--
607
+ # @rbs return: ::Integer
608
+ def fwmark; attributes[:"fwmark"]&.value; end
609
+ # Gets the value of `flow` attribute in the message.
610
+ #--
611
+ # @rbs return: ::Integer
612
+ def flow; attributes[:"flow"]&.value; end
613
+ # Gets the value of `tun-id` attribute in the message.
614
+ #--
615
+ # @rbs return: ::Integer
616
+ def tun_id; attributes[:"tun_id"]&.value; end
617
+ # Gets the value of `suppress-ifgroup` attribute in the message.
618
+ #--
619
+ # @rbs return: ::Integer
620
+ def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
621
+ # Gets the value of `suppress-prefixlen` attribute in the message.
622
+ #--
623
+ # @rbs return: ::Integer
624
+ def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
625
+ # Gets the value of `table` attribute or fixed header in the message.
626
+ #--
627
+ # @rbs return: ::Integer
628
+ def table; attributes[:"table"]&.value || fixed_header.table; end
629
+ # Gets the value of `fwmask` attribute in the message.
630
+ #--
631
+ # @rbs return: ::Integer
632
+ def fwmask; attributes[:"fwmask"]&.value; end
633
+ # Gets the value of `oifname` attribute in the message.
634
+ #--
635
+ # @rbs return: ::String
636
+ def oifname; attributes[:"oifname"]&.value; end
637
+ # Gets the value of `l3mdev` attribute in the message.
638
+ #--
639
+ # @rbs return: ::Integer
640
+ def l3mdev; attributes[:"l3mdev"]&.value; end
641
+ # Gets the value of `uid-range` attribute in the message.
642
+ #--
643
+ # @rbs return: untyped
644
+ def uid_range; attributes[:"uid_range"]&.value; end
645
+ # Gets the value of `protocol` attribute in the message.
646
+ #--
647
+ # @rbs return: ::Integer
648
+ def protocol; attributes[:"protocol"]&.value; end
649
+ # Gets the value of `ip-proto` attribute in the message.
650
+ #--
651
+ # @rbs return: ::Integer
652
+ def ip_proto; attributes[:"ip_proto"]&.value; end
653
+ # Gets the value of `sport-range` attribute in the message.
654
+ #--
655
+ # @rbs return: untyped
656
+ def sport_range; attributes[:"sport_range"]&.value; end
657
+ # Gets the value of `dport-range` attribute in the message.
658
+ #--
659
+ # @rbs return: untyped
660
+ def dport_range; attributes[:"dport_range"]&.value; end
661
+ # Gets the value of `dscp` attribute in the message.
662
+ #--
663
+ # @rbs return: ::Integer
664
+ def dscp; attributes[:"dscp"]&.value; end
665
+ # Gets the value of `flowlabel` attribute in the message.
666
+ #--
667
+ # @rbs return: ::Integer
668
+ def flowlabel; attributes[:"flowlabel"]&.value; end
669
+ # Gets the value of `flowlabel-mask` attribute in the message.
670
+ #--
671
+ # @rbs return: ::Integer
672
+ def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
673
+ # Gets the value of `sport-mask` attribute in the message.
674
+ #--
675
+ # @rbs return: ::Integer
676
+ def sport_mask; attributes[:"sport_mask"]&.value; end
677
+ # Gets the value of `dport-mask` attribute in the message.
678
+ #--
679
+ # @rbs return: ::Integer
680
+ def dport_mask; attributes[:"dport_mask"]&.value; end
681
+ # Gets the value of `dscp-mask` attribute in the message.
682
+ #--
683
+ # @rbs return: ::Integer
684
+ def dscp_mask; attributes[:"dscp_mask"]&.value; end
685
+ end
686
+ end
687
+ # Add new FIB rule
688
+ #--
689
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: untyped, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: untyped, ?dport_range: untyped, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
690
+ def do_newrule(**args)
691
+ exchange_message(:"do", Messages::DoNewruleRequest, nil, args)
692
+ end
693
+ # Remove an existing FIB rule
694
+ #--
695
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer, ?iifname: ::String, ?goto: ::Integer, ?priority: ::Integer, ?fwmark: ::Integer, ?flow: ::Integer, ?tun_id: ::Integer, ?suppress_ifgroup: ::Integer, ?suppress_prefixlen: ::Integer, ?fwmask: ::Integer, ?oifname: ::String, ?l3mdev: ::Integer, ?uid_range: untyped, ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: untyped, ?dport_range: untyped, ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
696
+ def do_delrule(**args)
697
+ exchange_message(:"do", Messages::DoDelruleRequest, nil, args)
698
+ end
699
+ # Dump all FIB rules
700
+ #--
701
+ # @rbs (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer) -> Enumerable[Messages::DumpGetruleReply]
702
+ # | (?family: ::Integer, ?dst_len: ::Integer, ?src_len: ::Integer, ?tos: ::Integer, ?table: ::Integer, ?action: ::Integer, ?flags: ::Integer) { (Messages::DumpGetruleReply) -> void } -> void
703
+ def dump_getrule(**args, &block)
704
+ exchange_message(:"dump", Messages::DumpGetruleRequest, Messages::DumpGetruleReply, args, &block)
705
+ end
706
+ end