nl-linux 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
2
|
#
|
|
3
|
-
# This file is based on Documentation/netlink/specs/rt-rule.yaml from Linux v7.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/rt-rule.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.
|
|
@@ -25,7 +25,7 @@ class RtRule < ::Nl::Raw::Family
|
|
|
25
25
|
super
|
|
26
26
|
end
|
|
27
27
|
# @private
|
|
28
|
-
MCAST_GROUPS =
|
|
28
|
+
MCAST_GROUPS = {:"rtnlgrp_ipv4_rule" => ::Nl::McastGroup.new("rtnlgrp-ipv4-rule", 8), :"rtnlgrp_ipv6_rule" => ::Nl::McastGroup.new("rtnlgrp-ipv6-rule", 19)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
29
29
|
module Enums
|
|
30
30
|
module FrAct
|
|
31
31
|
Unspec = 0
|
|
@@ -42,22 +42,31 @@ class RtRule < ::Nl::Raw::Family
|
|
|
42
42
|
module Structs
|
|
43
43
|
Rtgenmsg = Struct.new(
|
|
44
44
|
:"family", #: ::Integer
|
|
45
|
-
:"pad", #: nil
|
|
46
45
|
)
|
|
47
46
|
class Rtgenmsg
|
|
48
47
|
# @!attribute [rw] family
|
|
49
48
|
# @return [Integer]
|
|
50
|
-
# @!attribute [rw] pad
|
|
51
|
-
# @return [nil]
|
|
52
49
|
# @private
|
|
53
|
-
MEMBERS =
|
|
50
|
+
MEMBERS = {family: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
51
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
52
|
+
# @private
|
|
53
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
54
|
+
def self.from_params(params, context: nil)
|
|
55
|
+
unknown = params.keys - members
|
|
56
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
57
|
+
self.new(
|
|
58
|
+
MEMBERS[:"family"].coerce(params.fetch(:"family", 0), context:),
|
|
59
|
+
)
|
|
60
|
+
end
|
|
54
61
|
# Decodes the struct.
|
|
55
62
|
# @rbs decoder: ::Nl::Decoder
|
|
56
63
|
# @rbs return: instance
|
|
57
64
|
# @param [Nl::Decoder] decoder
|
|
58
65
|
# @return [self]
|
|
59
66
|
def self.decode(decoder)
|
|
60
|
-
|
|
67
|
+
word = decoder.get_u32
|
|
68
|
+
value_0 = ((word >> 0) & 0xff)
|
|
69
|
+
self.new(value_0)
|
|
61
70
|
end
|
|
62
71
|
# Encodes the struct.
|
|
63
72
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -65,7 +74,8 @@ class RtRule < ::Nl::Raw::Family
|
|
|
65
74
|
# @param [Nl::Encoder] encoder
|
|
66
75
|
# @return [void]
|
|
67
76
|
def encode(encoder)
|
|
68
|
-
MEMBERS.
|
|
77
|
+
MEMBERS[:"family"].encode(encoder, public_send(:"family"))
|
|
78
|
+
encoder.put_string("\x00\x00\x00")
|
|
69
79
|
end
|
|
70
80
|
end
|
|
71
81
|
FibRuleHdr = Struct.new(
|
|
@@ -74,8 +84,6 @@ class RtRule < ::Nl::Raw::Family
|
|
|
74
84
|
:"src_len", #: ::Integer
|
|
75
85
|
:"tos", #: ::Integer
|
|
76
86
|
:"table", #: ::Integer
|
|
77
|
-
:"res1", #: nil
|
|
78
|
-
:"res2", #: nil
|
|
79
87
|
:"action", #: ::Integer
|
|
80
88
|
:"flags", #: ::Integer
|
|
81
89
|
)
|
|
@@ -90,23 +98,44 @@ class RtRule < ::Nl::Raw::Family
|
|
|
90
98
|
# @return [Integer]
|
|
91
99
|
# @!attribute [rw] table
|
|
92
100
|
# @return [Integer]
|
|
93
|
-
# @!attribute [rw] res1
|
|
94
|
-
# @return [nil]
|
|
95
|
-
# @!attribute [rw] res2
|
|
96
|
-
# @return [nil]
|
|
97
101
|
# @!attribute [rw] action
|
|
98
102
|
# @return [Integer]
|
|
99
103
|
# @!attribute [rw] flags
|
|
100
104
|
# @return [Integer]
|
|
101
105
|
# @private
|
|
102
|
-
MEMBERS =
|
|
106
|
+
MEMBERS = {family: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, dst_len: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, src_len: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, tos: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, table: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, action: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, flags: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].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[:"family"].coerce(params.fetch(:"family", 0), context:),
|
|
115
|
+
MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0), context:),
|
|
116
|
+
MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0), context:),
|
|
117
|
+
MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0), context:),
|
|
118
|
+
MEMBERS[:"table"].coerce(params.fetch(:"table", 0), context:),
|
|
119
|
+
MEMBERS[:"action"].coerce(params.fetch(:"action", 0), context:),
|
|
120
|
+
MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0), context:),
|
|
121
|
+
)
|
|
122
|
+
end
|
|
103
123
|
# Decodes the struct.
|
|
104
124
|
# @rbs decoder: ::Nl::Decoder
|
|
105
125
|
# @rbs return: instance
|
|
106
126
|
# @param [Nl::Decoder] decoder
|
|
107
127
|
# @return [self]
|
|
108
128
|
def self.decode(decoder)
|
|
109
|
-
|
|
129
|
+
word = decoder.get_u32
|
|
130
|
+
value_0 = ((word >> 0) & 0xff)
|
|
131
|
+
value_1 = ((word >> 8) & 0xff)
|
|
132
|
+
value_2 = ((word >> 16) & 0xff)
|
|
133
|
+
value_3 = ((word >> 24) & 0xff)
|
|
134
|
+
word = decoder.get_u32
|
|
135
|
+
value_4 = ((word >> 0) & 0xff)
|
|
136
|
+
value_7 = ((word >> 24) & 0xff)
|
|
137
|
+
value_8 = decoder.get_host_u32
|
|
138
|
+
self.new(value_0, value_1, value_2, value_3, value_4, value_7, value_8)
|
|
110
139
|
end
|
|
111
140
|
# Encodes the struct.
|
|
112
141
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -114,7 +143,15 @@ class RtRule < ::Nl::Raw::Family
|
|
|
114
143
|
# @param [Nl::Encoder] encoder
|
|
115
144
|
# @return [void]
|
|
116
145
|
def encode(encoder)
|
|
117
|
-
MEMBERS.
|
|
146
|
+
MEMBERS[:"family"].encode(encoder, public_send(:"family"))
|
|
147
|
+
MEMBERS[:"dst_len"].encode(encoder, public_send(:"dst_len"))
|
|
148
|
+
MEMBERS[:"src_len"].encode(encoder, public_send(:"src_len"))
|
|
149
|
+
MEMBERS[:"tos"].encode(encoder, public_send(:"tos"))
|
|
150
|
+
MEMBERS[:"table"].encode(encoder, public_send(:"table"))
|
|
151
|
+
encoder.put_string("\x00")
|
|
152
|
+
encoder.put_string("\x00")
|
|
153
|
+
MEMBERS[:"action"].encode(encoder, public_send(:"action"))
|
|
154
|
+
MEMBERS[:"flags"].encode(encoder, public_send(:"flags"))
|
|
118
155
|
end
|
|
119
156
|
end
|
|
120
157
|
FibRulePortRange = Struct.new(
|
|
@@ -127,14 +164,28 @@ class RtRule < ::Nl::Raw::Family
|
|
|
127
164
|
# @!attribute [rw] end
|
|
128
165
|
# @return [Integer]
|
|
129
166
|
# @private
|
|
130
|
-
MEMBERS =
|
|
167
|
+
MEMBERS = {start: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, end: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
168
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
169
|
+
# @private
|
|
170
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
171
|
+
def self.from_params(params, context: nil)
|
|
172
|
+
unknown = params.keys - members
|
|
173
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
174
|
+
self.new(
|
|
175
|
+
MEMBERS[:"start"].coerce(params.fetch(:"start", 0), context:),
|
|
176
|
+
MEMBERS[:"end"].coerce(params.fetch(:"end", 0), context:),
|
|
177
|
+
)
|
|
178
|
+
end
|
|
131
179
|
# Decodes the struct.
|
|
132
180
|
# @rbs decoder: ::Nl::Decoder
|
|
133
181
|
# @rbs return: instance
|
|
134
182
|
# @param [Nl::Decoder] decoder
|
|
135
183
|
# @return [self]
|
|
136
184
|
def self.decode(decoder)
|
|
137
|
-
|
|
185
|
+
word = decoder.get_u32
|
|
186
|
+
value_0 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
187
|
+
value_1 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 16) & 0xffff) : ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff)))
|
|
188
|
+
self.new(value_0, value_1)
|
|
138
189
|
end
|
|
139
190
|
# Encodes the struct.
|
|
140
191
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -142,7 +193,8 @@ class RtRule < ::Nl::Raw::Family
|
|
|
142
193
|
# @param [Nl::Encoder] encoder
|
|
143
194
|
# @return [void]
|
|
144
195
|
def encode(encoder)
|
|
145
|
-
MEMBERS.
|
|
196
|
+
MEMBERS[:"start"].encode(encoder, public_send(:"start"))
|
|
197
|
+
MEMBERS[:"end"].encode(encoder, public_send(:"end"))
|
|
146
198
|
end
|
|
147
199
|
end
|
|
148
200
|
FibRuleUidRange = Struct.new(
|
|
@@ -155,14 +207,27 @@ class RtRule < ::Nl::Raw::Family
|
|
|
155
207
|
# @!attribute [rw] end
|
|
156
208
|
# @return [Integer]
|
|
157
209
|
# @private
|
|
158
|
-
MEMBERS =
|
|
210
|
+
MEMBERS = {start: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, end: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
211
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
212
|
+
# @private
|
|
213
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
214
|
+
def self.from_params(params, context: nil)
|
|
215
|
+
unknown = params.keys - members
|
|
216
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
217
|
+
self.new(
|
|
218
|
+
MEMBERS[:"start"].coerce(params.fetch(:"start", 0), context:),
|
|
219
|
+
MEMBERS[:"end"].coerce(params.fetch(:"end", 0), context:),
|
|
220
|
+
)
|
|
221
|
+
end
|
|
159
222
|
# Decodes the struct.
|
|
160
223
|
# @rbs decoder: ::Nl::Decoder
|
|
161
224
|
# @rbs return: instance
|
|
162
225
|
# @param [Nl::Decoder] decoder
|
|
163
226
|
# @return [self]
|
|
164
227
|
def self.decode(decoder)
|
|
165
|
-
|
|
228
|
+
value_0 = decoder.get_host_u32
|
|
229
|
+
value_1 = decoder.get_host_u32
|
|
230
|
+
self.new(value_0, value_1)
|
|
166
231
|
end
|
|
167
232
|
# Encodes the struct.
|
|
168
233
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -170,994 +235,950 @@ class RtRule < ::Nl::Raw::Family
|
|
|
170
235
|
# @param [Nl::Encoder] encoder
|
|
171
236
|
# @return [void]
|
|
172
237
|
def encode(encoder)
|
|
173
|
-
MEMBERS.
|
|
238
|
+
MEMBERS[:"start"].encode(encoder, public_send(:"start"))
|
|
239
|
+
MEMBERS[:"end"].encode(encoder, public_send(:"end"))
|
|
174
240
|
end
|
|
175
241
|
end
|
|
176
242
|
end
|
|
177
243
|
module AttributeSets
|
|
178
244
|
class FibRuleAttrs < ::Nl::AttributeSet
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
# @
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
# @
|
|
194
|
-
|
|
195
|
-
# @
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
# @
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
# @
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
# @
|
|
218
|
-
|
|
219
|
-
# @
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
# @
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
# @
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
# @
|
|
242
|
-
|
|
243
|
-
# @
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
# @
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
TYPE = 10
|
|
256
|
-
NAME = :"fwmark"
|
|
257
|
-
# @private
|
|
258
|
-
ORDER = 9
|
|
259
|
-
# @private
|
|
260
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
261
|
-
end
|
|
262
|
-
class Flow < Attribute
|
|
263
|
-
TYPE = 11
|
|
264
|
-
NAME = :"flow"
|
|
265
|
-
# @private
|
|
266
|
-
ORDER = 10
|
|
267
|
-
# @private
|
|
268
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
269
|
-
end
|
|
270
|
-
class TunId < Attribute
|
|
271
|
-
TYPE = 12
|
|
272
|
-
NAME = :"tun_id"
|
|
273
|
-
# @private
|
|
274
|
-
ORDER = 11
|
|
275
|
-
# @private
|
|
276
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
277
|
-
end
|
|
278
|
-
class SuppressIfgroup < Attribute
|
|
279
|
-
TYPE = 13
|
|
280
|
-
NAME = :"suppress_ifgroup"
|
|
281
|
-
# @private
|
|
282
|
-
ORDER = 12
|
|
283
|
-
# @private
|
|
284
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
245
|
+
module Definitions
|
|
246
|
+
# @rbs return: ::String
|
|
247
|
+
# @return [String]
|
|
248
|
+
def dst; self[:"dst"]; end
|
|
249
|
+
# @rbs return: ::String
|
|
250
|
+
# @return [String]
|
|
251
|
+
def src; self[:"src"]; end
|
|
252
|
+
# @rbs return: ::String
|
|
253
|
+
# @return [String]
|
|
254
|
+
def iifname; self[:"iifname"]; end
|
|
255
|
+
# @rbs return: ::Integer
|
|
256
|
+
# @return [Integer]
|
|
257
|
+
def goto; self[:"goto"]; end
|
|
258
|
+
# @rbs return: ::Integer
|
|
259
|
+
# @return [Integer]
|
|
260
|
+
def priority; self[:"priority"]; end
|
|
261
|
+
# @rbs return: ::Integer
|
|
262
|
+
# @return [Integer]
|
|
263
|
+
def fwmark; self[:"fwmark"]; end
|
|
264
|
+
# @rbs return: ::Integer
|
|
265
|
+
# @return [Integer]
|
|
266
|
+
def flow; self[:"flow"]; end
|
|
267
|
+
# @rbs return: ::Integer
|
|
268
|
+
# @return [Integer]
|
|
269
|
+
def tun_id; self[:"tun_id"]; end
|
|
270
|
+
# @rbs return: ::Integer
|
|
271
|
+
# @return [Integer]
|
|
272
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
273
|
+
# @rbs return: ::Integer
|
|
274
|
+
# @return [Integer]
|
|
275
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
276
|
+
# @rbs return: ::Integer
|
|
277
|
+
# @return [Integer]
|
|
278
|
+
def table; self[:"table"]; end
|
|
279
|
+
# @rbs return: ::Integer
|
|
280
|
+
# @return [Integer]
|
|
281
|
+
def fwmask; self[:"fwmask"]; end
|
|
282
|
+
# @rbs return: ::String
|
|
283
|
+
# @return [String]
|
|
284
|
+
def oifname; self[:"oifname"]; end
|
|
285
|
+
# @rbs return: ::Integer
|
|
286
|
+
# @return [Integer]
|
|
287
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
288
|
+
# @rbs return: Structs::FibRuleUidRange
|
|
289
|
+
# @return [Structs::FibRuleUidRange]
|
|
290
|
+
def uid_range; self[:"uid_range"]; end
|
|
291
|
+
# @rbs return: ::Integer
|
|
292
|
+
# @return [Integer]
|
|
293
|
+
def protocol; self[:"protocol"]; end
|
|
294
|
+
# @rbs return: ::Integer
|
|
295
|
+
# @return [Integer]
|
|
296
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
297
|
+
# @rbs return: Structs::FibRulePortRange
|
|
298
|
+
# @return [Structs::FibRulePortRange]
|
|
299
|
+
def sport_range; self[:"sport_range"]; end
|
|
300
|
+
# @rbs return: Structs::FibRulePortRange
|
|
301
|
+
# @return [Structs::FibRulePortRange]
|
|
302
|
+
def dport_range; self[:"dport_range"]; end
|
|
303
|
+
# @rbs return: ::Integer
|
|
304
|
+
# @return [Integer]
|
|
305
|
+
def dscp; self[:"dscp"]; end
|
|
306
|
+
# @rbs return: ::Integer
|
|
307
|
+
# @return [Integer]
|
|
308
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
309
|
+
# @rbs return: ::Integer
|
|
310
|
+
# @return [Integer]
|
|
311
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
312
|
+
# @rbs return: ::Integer
|
|
313
|
+
# @return [Integer]
|
|
314
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
315
|
+
# @rbs return: ::Integer
|
|
316
|
+
# @return [Integer]
|
|
317
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
318
|
+
# @rbs return: ::Integer
|
|
319
|
+
# @return [Integer]
|
|
320
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
285
321
|
end
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
# @private
|
|
292
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
293
|
-
end
|
|
294
|
-
class Table < Attribute
|
|
295
|
-
TYPE = 15
|
|
296
|
-
NAME = :"table"
|
|
297
|
-
# @private
|
|
298
|
-
ORDER = 14
|
|
299
|
-
# @private
|
|
300
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
301
|
-
end
|
|
302
|
-
class Fwmask < Attribute
|
|
303
|
-
TYPE = 16
|
|
304
|
-
NAME = :"fwmask"
|
|
305
|
-
# @private
|
|
306
|
-
ORDER = 15
|
|
307
|
-
# @private
|
|
308
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
309
|
-
end
|
|
310
|
-
class Oifname < Attribute
|
|
311
|
-
TYPE = 17
|
|
312
|
-
NAME = :"oifname"
|
|
313
|
-
# @private
|
|
314
|
-
ORDER = 16
|
|
315
|
-
# @private
|
|
316
|
-
DATATYPE = ::Nl::DataTypes::String.new(check: nil)
|
|
317
|
-
end
|
|
318
|
-
class Pad < Attribute
|
|
319
|
-
TYPE = 18
|
|
320
|
-
NAME = :"pad"
|
|
321
|
-
# @private
|
|
322
|
-
ORDER = 17
|
|
323
|
-
# @private
|
|
324
|
-
DATATYPE = ::Nl::DataTypes::Pad.new()
|
|
325
|
-
end
|
|
326
|
-
class L3mdev < Attribute
|
|
327
|
-
TYPE = 19
|
|
328
|
-
NAME = :"l3mdev"
|
|
329
|
-
# @private
|
|
330
|
-
ORDER = 18
|
|
331
|
-
# @private
|
|
332
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
333
|
-
end
|
|
334
|
-
class UidRange < Attribute
|
|
335
|
-
TYPE = 20
|
|
336
|
-
NAME = :"uid_range"
|
|
337
|
-
# @private
|
|
338
|
-
ORDER = 19
|
|
339
|
-
# @private
|
|
340
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::FibRuleUidRange, check: nil, consume_remaining: true)
|
|
341
|
-
end
|
|
342
|
-
class Protocol < Attribute
|
|
343
|
-
TYPE = 21
|
|
344
|
-
NAME = :"protocol"
|
|
345
|
-
# @private
|
|
346
|
-
ORDER = 20
|
|
347
|
-
# @private
|
|
348
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
349
|
-
end
|
|
350
|
-
class IpProto < Attribute
|
|
351
|
-
TYPE = 22
|
|
352
|
-
NAME = :"ip_proto"
|
|
353
|
-
# @private
|
|
354
|
-
ORDER = 21
|
|
355
|
-
# @private
|
|
356
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
357
|
-
end
|
|
358
|
-
class SportRange < Attribute
|
|
359
|
-
TYPE = 23
|
|
360
|
-
NAME = :"sport_range"
|
|
361
|
-
# @private
|
|
362
|
-
ORDER = 22
|
|
363
|
-
# @private
|
|
364
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::FibRulePortRange, check: nil, consume_remaining: true)
|
|
365
|
-
end
|
|
366
|
-
class DportRange < Attribute
|
|
367
|
-
TYPE = 24
|
|
368
|
-
NAME = :"dport_range"
|
|
369
|
-
# @private
|
|
370
|
-
ORDER = 23
|
|
371
|
-
# @private
|
|
372
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::FibRulePortRange, check: nil, consume_remaining: true)
|
|
373
|
-
end
|
|
374
|
-
class Dscp < Attribute
|
|
375
|
-
TYPE = 25
|
|
376
|
-
NAME = :"dscp"
|
|
377
|
-
# @private
|
|
378
|
-
ORDER = 24
|
|
379
|
-
# @private
|
|
380
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
381
|
-
end
|
|
382
|
-
class Flowlabel < Attribute
|
|
383
|
-
TYPE = 26
|
|
384
|
-
NAME = :"flowlabel"
|
|
385
|
-
# @private
|
|
386
|
-
ORDER = 25
|
|
387
|
-
# @private
|
|
388
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
|
|
389
|
-
end
|
|
390
|
-
class FlowlabelMask < Attribute
|
|
391
|
-
TYPE = 27
|
|
392
|
-
NAME = :"flowlabel_mask"
|
|
393
|
-
# @private
|
|
394
|
-
ORDER = 26
|
|
395
|
-
# @private
|
|
396
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
|
|
397
|
-
end
|
|
398
|
-
class SportMask < Attribute
|
|
399
|
-
TYPE = 28
|
|
400
|
-
NAME = :"sport_mask"
|
|
401
|
-
# @private
|
|
402
|
-
ORDER = 27
|
|
403
|
-
# @private
|
|
404
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
405
|
-
end
|
|
406
|
-
class DportMask < Attribute
|
|
407
|
-
TYPE = 29
|
|
408
|
-
NAME = :"dport_mask"
|
|
409
|
-
# @private
|
|
410
|
-
ORDER = 28
|
|
411
|
-
# @private
|
|
412
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
322
|
+
include Definitions
|
|
323
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
324
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
325
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
326
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
413
327
|
end
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
module AttributeSets
|
|
331
|
+
class FibRuleAttrs
|
|
332
|
+
module Definitions
|
|
417
333
|
# @private
|
|
418
|
-
|
|
334
|
+
BY_TYPE = ::Array.new(31).tap do |definitions|
|
|
335
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dst", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 0, selector_slot: nil)
|
|
336
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"src", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 1, selector_slot: nil)
|
|
337
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"iifname", datatype: ::Nl::DataTypes::String.new, multi: false, order: 2, selector_slot: nil)
|
|
338
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"goto", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
|
|
339
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"unused2", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 4, selector_slot: nil)
|
|
340
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"priority", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
|
|
341
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"unused3", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 6, selector_slot: nil)
|
|
342
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"unused4", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 7, selector_slot: nil)
|
|
343
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"unused5", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 8, selector_slot: nil)
|
|
344
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"fwmark", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 9, selector_slot: nil)
|
|
345
|
+
definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"flow", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 10, selector_slot: nil)
|
|
346
|
+
definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"tun_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 11, selector_slot: nil)
|
|
347
|
+
definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"suppress_ifgroup", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 12, selector_slot: nil)
|
|
348
|
+
definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"suppress_prefixlen", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 13, selector_slot: nil)
|
|
349
|
+
definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"table", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 14, selector_slot: nil)
|
|
350
|
+
definitions[16] = ::Nl::AttributeSet::Definition.new(id: 16, name: :"fwmask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 15, selector_slot: nil)
|
|
351
|
+
definitions[17] = ::Nl::AttributeSet::Definition.new(id: 17, name: :"oifname", datatype: ::Nl::DataTypes::String.new, multi: false, order: 16, selector_slot: nil)
|
|
352
|
+
definitions[18] = ::Nl::AttributeSet::Definition.new(id: 18, name: :"pad", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 17, selector_slot: nil)
|
|
353
|
+
definitions[19] = ::Nl::AttributeSet::Definition.new(id: 19, name: :"l3mdev", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 18, selector_slot: nil)
|
|
354
|
+
definitions[20] = ::Nl::AttributeSet::Definition.new(id: 20, name: :"uid_range", datatype: ::Nl::DataTypes::Struct.new(Structs::FibRuleUidRange, consume_remaining: true), multi: false, order: 19, selector_slot: nil)
|
|
355
|
+
definitions[21] = ::Nl::AttributeSet::Definition.new(id: 21, name: :"protocol", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 20, selector_slot: nil)
|
|
356
|
+
definitions[22] = ::Nl::AttributeSet::Definition.new(id: 22, name: :"ip_proto", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 21, selector_slot: nil)
|
|
357
|
+
definitions[23] = ::Nl::AttributeSet::Definition.new(id: 23, name: :"sport_range", datatype: ::Nl::DataTypes::Struct.new(Structs::FibRulePortRange, consume_remaining: true), multi: false, order: 22, selector_slot: nil)
|
|
358
|
+
definitions[24] = ::Nl::AttributeSet::Definition.new(id: 24, name: :"dport_range", datatype: ::Nl::DataTypes::Struct.new(Structs::FibRulePortRange, consume_remaining: true), multi: false, order: 23, selector_slot: nil)
|
|
359
|
+
definitions[25] = ::Nl::AttributeSet::Definition.new(id: 25, name: :"dscp", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 24, selector_slot: nil)
|
|
360
|
+
definitions[26] = ::Nl::AttributeSet::Definition.new(id: 26, name: :"flowlabel", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 25, selector_slot: nil)
|
|
361
|
+
definitions[27] = ::Nl::AttributeSet::Definition.new(id: 27, name: :"flowlabel_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 26, selector_slot: nil)
|
|
362
|
+
definitions[28] = ::Nl::AttributeSet::Definition.new(id: 28, name: :"sport_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 27, selector_slot: nil)
|
|
363
|
+
definitions[29] = ::Nl::AttributeSet::Definition.new(id: 29, name: :"dport_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 28, selector_slot: nil)
|
|
364
|
+
definitions[30] = ::Nl::AttributeSet::Definition.new(id: 30, name: :"dscp_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 29, selector_slot: nil)
|
|
365
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
366
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
419
367
|
# @private
|
|
420
|
-
|
|
421
|
-
end
|
|
422
|
-
# @private
|
|
423
|
-
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]
|
|
424
|
-
# @private
|
|
425
|
-
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]
|
|
426
|
-
# @rbs return: ::String
|
|
427
|
-
# @return [String]
|
|
428
|
-
# @see Dst
|
|
429
|
-
def dst; self[:"dst"]&.value; end
|
|
430
|
-
# @rbs return: ::String
|
|
431
|
-
# @return [String]
|
|
432
|
-
# @see Src
|
|
433
|
-
def src; self[:"src"]&.value; end
|
|
434
|
-
# @rbs return: ::String
|
|
435
|
-
# @return [String]
|
|
436
|
-
# @see Iifname
|
|
437
|
-
def iifname; self[:"iifname"]&.value; end
|
|
438
|
-
# @rbs return: ::Integer
|
|
439
|
-
# @return [Integer]
|
|
440
|
-
# @see Goto
|
|
441
|
-
def goto; self[:"goto"]&.value; end
|
|
442
|
-
# @rbs return: ::Integer
|
|
443
|
-
# @return [Integer]
|
|
444
|
-
# @see Priority
|
|
445
|
-
def priority; self[:"priority"]&.value; end
|
|
446
|
-
# @rbs return: ::Integer
|
|
447
|
-
# @return [Integer]
|
|
448
|
-
# @see Fwmark
|
|
449
|
-
def fwmark; self[:"fwmark"]&.value; end
|
|
450
|
-
# @rbs return: ::Integer
|
|
451
|
-
# @return [Integer]
|
|
452
|
-
# @see Flow
|
|
453
|
-
def flow; self[:"flow"]&.value; end
|
|
454
|
-
# @rbs return: ::Integer
|
|
455
|
-
# @return [Integer]
|
|
456
|
-
# @see TunId
|
|
457
|
-
def tun_id; self[:"tun_id"]&.value; end
|
|
458
|
-
# @rbs return: ::Integer
|
|
459
|
-
# @return [Integer]
|
|
460
|
-
# @see SuppressIfgroup
|
|
461
|
-
def suppress_ifgroup; self[:"suppress_ifgroup"]&.value; end
|
|
462
|
-
# @rbs return: ::Integer
|
|
463
|
-
# @return [Integer]
|
|
464
|
-
# @see SuppressPrefixlen
|
|
465
|
-
def suppress_prefixlen; self[:"suppress_prefixlen"]&.value; end
|
|
466
|
-
# @rbs return: ::Integer
|
|
467
|
-
# @return [Integer]
|
|
468
|
-
# @see Table
|
|
469
|
-
def table; self[:"table"]&.value; end
|
|
470
|
-
# @rbs return: ::Integer
|
|
471
|
-
# @return [Integer]
|
|
472
|
-
# @see Fwmask
|
|
473
|
-
def fwmask; self[:"fwmask"]&.value; end
|
|
474
|
-
# @rbs return: ::String
|
|
475
|
-
# @return [String]
|
|
476
|
-
# @see Oifname
|
|
477
|
-
def oifname; self[:"oifname"]&.value; end
|
|
478
|
-
# @rbs return: ::Integer
|
|
479
|
-
# @return [Integer]
|
|
480
|
-
# @see L3mdev
|
|
481
|
-
def l3mdev; self[:"l3mdev"]&.value; end
|
|
482
|
-
# @rbs return: Structs::FibRuleUidRange
|
|
483
|
-
# @return [Structs::FibRuleUidRange]
|
|
484
|
-
# @see UidRange
|
|
485
|
-
def uid_range; self[:"uid_range"]&.value; end
|
|
486
|
-
# @rbs return: ::Integer
|
|
487
|
-
# @return [Integer]
|
|
488
|
-
# @see Protocol
|
|
489
|
-
def protocol; self[:"protocol"]&.value; end
|
|
490
|
-
# @rbs return: ::Integer
|
|
491
|
-
# @return [Integer]
|
|
492
|
-
# @see IpProto
|
|
493
|
-
def ip_proto; self[:"ip_proto"]&.value; end
|
|
494
|
-
# @rbs return: Structs::FibRulePortRange
|
|
495
|
-
# @return [Structs::FibRulePortRange]
|
|
496
|
-
# @see SportRange
|
|
497
|
-
def sport_range; self[:"sport_range"]&.value; end
|
|
498
|
-
# @rbs return: Structs::FibRulePortRange
|
|
499
|
-
# @return [Structs::FibRulePortRange]
|
|
500
|
-
# @see DportRange
|
|
501
|
-
def dport_range; self[:"dport_range"]&.value; end
|
|
502
|
-
# @rbs return: ::Integer
|
|
503
|
-
# @return [Integer]
|
|
504
|
-
# @see Dscp
|
|
505
|
-
def dscp; self[:"dscp"]&.value; end
|
|
506
|
-
# @rbs return: ::Integer
|
|
507
|
-
# @return [Integer]
|
|
508
|
-
# @see Flowlabel
|
|
509
|
-
def flowlabel; self[:"flowlabel"]&.value; end
|
|
510
|
-
# @rbs return: ::Integer
|
|
511
|
-
# @return [Integer]
|
|
512
|
-
# @see FlowlabelMask
|
|
513
|
-
def flowlabel_mask; self[:"flowlabel_mask"]&.value; end
|
|
514
|
-
# @rbs return: ::Integer
|
|
515
|
-
# @return [Integer]
|
|
516
|
-
# @see SportMask
|
|
517
|
-
def sport_mask; self[:"sport_mask"]&.value; end
|
|
518
|
-
# @rbs return: ::Integer
|
|
519
|
-
# @return [Integer]
|
|
520
|
-
# @see DportMask
|
|
521
|
-
def dport_mask; self[:"dport_mask"]&.value; end
|
|
522
|
-
# @rbs return: ::Integer
|
|
523
|
-
# @return [Integer]
|
|
524
|
-
# @see DscpMask
|
|
525
|
-
def dscp_mask; self[:"dscp_mask"]&.value; end
|
|
526
|
-
class << self
|
|
527
|
-
# Looks up Attribute class by name.
|
|
528
|
-
# @rbs name: Symbol
|
|
529
|
-
# @rbs return: Attribute
|
|
530
|
-
# @param [Symbol] name
|
|
531
|
-
# @return [Attribute]
|
|
532
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
533
|
-
# Looks up Attribute class by type value.
|
|
534
|
-
# @rbs type: Integer
|
|
535
|
-
# @rbs return: Attribute
|
|
536
|
-
# @param [Integer] type
|
|
537
|
-
# @return [Attribute]
|
|
538
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
368
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
539
369
|
end
|
|
540
370
|
end
|
|
541
371
|
end
|
|
542
372
|
module Messages
|
|
543
373
|
# Add new FIB rule
|
|
544
|
-
class DoNewruleRequest < ::Nl::
|
|
374
|
+
class DoNewruleRequest < ::Nl::Message
|
|
545
375
|
TYPE = 32
|
|
546
376
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
547
377
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
548
|
-
ATTRIBUTES =
|
|
378
|
+
ATTRIBUTES = %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].freeze
|
|
379
|
+
include ATTRIBUTE_SET::Definitions
|
|
380
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
381
|
+
@family = family
|
|
382
|
+
@dst_len = dst_len
|
|
383
|
+
@src_len = src_len
|
|
384
|
+
@tos = tos
|
|
385
|
+
@table = table
|
|
386
|
+
@action = action
|
|
387
|
+
@flags = flags
|
|
388
|
+
@attributes = attributes
|
|
389
|
+
end
|
|
390
|
+
# @private
|
|
391
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
392
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
393
|
+
new(
|
|
394
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
395
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
396
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
397
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
398
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
399
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
400
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
401
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
402
|
+
)
|
|
403
|
+
end
|
|
404
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
405
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
406
|
+
def self.decode(decoder)
|
|
407
|
+
word = decoder.get_u32
|
|
408
|
+
value_0 = ((word >> 0) & 0xff)
|
|
409
|
+
value_1 = ((word >> 8) & 0xff)
|
|
410
|
+
value_2 = ((word >> 16) & 0xff)
|
|
411
|
+
value_3 = ((word >> 24) & 0xff)
|
|
412
|
+
word = decoder.get_u32
|
|
413
|
+
value_4 = ((word >> 0) & 0xff)
|
|
414
|
+
value_7 = ((word >> 24) & 0xff)
|
|
415
|
+
value_8 = decoder.get_host_u32
|
|
416
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
417
|
+
end
|
|
418
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
419
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
420
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
421
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
422
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
423
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
424
|
+
encoder.put_string("\x00")
|
|
425
|
+
encoder.put_string("\x00")
|
|
426
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
427
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
428
|
+
encode_attributes(encoder, external_selectors:)
|
|
429
|
+
end
|
|
549
430
|
# @rbs return: ::Integer
|
|
550
431
|
# @return [Integer]
|
|
551
|
-
def family;
|
|
432
|
+
def family; @family; end
|
|
552
433
|
# @rbs return: ::Integer
|
|
553
434
|
# @return [Integer]
|
|
554
|
-
def dst_len;
|
|
435
|
+
def dst_len; @dst_len; end
|
|
555
436
|
# @rbs return: ::Integer
|
|
556
437
|
# @return [Integer]
|
|
557
|
-
def src_len;
|
|
438
|
+
def src_len; @src_len; end
|
|
558
439
|
# @rbs return: ::Integer
|
|
559
440
|
# @return [Integer]
|
|
560
|
-
def tos;
|
|
441
|
+
def tos; @tos; end
|
|
561
442
|
# @rbs return: ::Integer
|
|
562
443
|
# @return [Integer]
|
|
563
|
-
def action;
|
|
444
|
+
def action; @action; end
|
|
564
445
|
# @rbs return: ::Integer
|
|
565
446
|
# @return [Integer]
|
|
566
|
-
def flags;
|
|
447
|
+
def flags; @flags; end
|
|
567
448
|
# @rbs return: ::String
|
|
568
449
|
# @return [String]
|
|
569
|
-
|
|
570
|
-
def iifname; attributes[:"iifname"]&.value; end
|
|
450
|
+
def iifname; self[:"iifname"]; end
|
|
571
451
|
# @rbs return: ::Integer
|
|
572
452
|
# @return [Integer]
|
|
573
|
-
|
|
574
|
-
def goto; attributes[:"goto"]&.value; end
|
|
453
|
+
def goto; self[:"goto"]; end
|
|
575
454
|
# @rbs return: ::Integer
|
|
576
455
|
# @return [Integer]
|
|
577
|
-
|
|
578
|
-
def priority; attributes[:"priority"]&.value; end
|
|
456
|
+
def priority; self[:"priority"]; end
|
|
579
457
|
# @rbs return: ::Integer
|
|
580
458
|
# @return [Integer]
|
|
581
|
-
|
|
582
|
-
def fwmark; attributes[:"fwmark"]&.value; end
|
|
459
|
+
def fwmark; self[:"fwmark"]; end
|
|
583
460
|
# @rbs return: ::Integer
|
|
584
461
|
# @return [Integer]
|
|
585
|
-
|
|
586
|
-
def flow; attributes[:"flow"]&.value; end
|
|
462
|
+
def flow; self[:"flow"]; end
|
|
587
463
|
# @rbs return: ::Integer
|
|
588
464
|
# @return [Integer]
|
|
589
|
-
|
|
590
|
-
def tun_id; attributes[:"tun_id"]&.value; end
|
|
465
|
+
def tun_id; self[:"tun_id"]; end
|
|
591
466
|
# @rbs return: ::Integer
|
|
592
467
|
# @return [Integer]
|
|
593
|
-
|
|
594
|
-
def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
|
|
468
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
595
469
|
# @rbs return: ::Integer
|
|
596
470
|
# @return [Integer]
|
|
597
|
-
|
|
598
|
-
def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
|
|
471
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
599
472
|
# @rbs return: ::Integer
|
|
600
473
|
# @return [Integer]
|
|
601
|
-
|
|
602
|
-
def table; attributes[:"table"]&.value || fixed_header.table; end
|
|
474
|
+
def table; self[:"table"] || @table; end
|
|
603
475
|
# @rbs return: ::Integer
|
|
604
476
|
# @return [Integer]
|
|
605
|
-
|
|
606
|
-
def fwmask; attributes[:"fwmask"]&.value; end
|
|
477
|
+
def fwmask; self[:"fwmask"]; end
|
|
607
478
|
# @rbs return: ::String
|
|
608
479
|
# @return [String]
|
|
609
|
-
|
|
610
|
-
def oifname; attributes[:"oifname"]&.value; end
|
|
480
|
+
def oifname; self[:"oifname"]; end
|
|
611
481
|
# @rbs return: ::Integer
|
|
612
482
|
# @return [Integer]
|
|
613
|
-
|
|
614
|
-
def l3mdev; attributes[:"l3mdev"]&.value; end
|
|
483
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
615
484
|
# @rbs return: Structs::FibRuleUidRange
|
|
616
485
|
# @return [Structs::FibRuleUidRange]
|
|
617
|
-
|
|
618
|
-
def uid_range; attributes[:"uid_range"]&.value; end
|
|
486
|
+
def uid_range; self[:"uid_range"]; end
|
|
619
487
|
# @rbs return: ::Integer
|
|
620
488
|
# @return [Integer]
|
|
621
|
-
|
|
622
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
489
|
+
def protocol; self[:"protocol"]; end
|
|
623
490
|
# @rbs return: ::Integer
|
|
624
491
|
# @return [Integer]
|
|
625
|
-
|
|
626
|
-
def ip_proto; attributes[:"ip_proto"]&.value; end
|
|
492
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
627
493
|
# @rbs return: Structs::FibRulePortRange
|
|
628
494
|
# @return [Structs::FibRulePortRange]
|
|
629
|
-
|
|
630
|
-
def sport_range; attributes[:"sport_range"]&.value; end
|
|
495
|
+
def sport_range; self[:"sport_range"]; end
|
|
631
496
|
# @rbs return: Structs::FibRulePortRange
|
|
632
497
|
# @return [Structs::FibRulePortRange]
|
|
633
|
-
|
|
634
|
-
def dport_range; attributes[:"dport_range"]&.value; end
|
|
498
|
+
def dport_range; self[:"dport_range"]; end
|
|
635
499
|
# @rbs return: ::Integer
|
|
636
500
|
# @return [Integer]
|
|
637
|
-
|
|
638
|
-
def dscp; attributes[:"dscp"]&.value; end
|
|
501
|
+
def dscp; self[:"dscp"]; end
|
|
639
502
|
# @rbs return: ::Integer
|
|
640
503
|
# @return [Integer]
|
|
641
|
-
|
|
642
|
-
def flowlabel; attributes[:"flowlabel"]&.value; end
|
|
504
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
643
505
|
# @rbs return: ::Integer
|
|
644
506
|
# @return [Integer]
|
|
645
|
-
|
|
646
|
-
def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
|
|
507
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
647
508
|
# @rbs return: ::Integer
|
|
648
509
|
# @return [Integer]
|
|
649
|
-
|
|
650
|
-
def sport_mask; attributes[:"sport_mask"]&.value; end
|
|
510
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
651
511
|
# @rbs return: ::Integer
|
|
652
512
|
# @return [Integer]
|
|
653
|
-
|
|
654
|
-
def dport_mask; attributes[:"dport_mask"]&.value; end
|
|
513
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
655
514
|
# @rbs return: ::Integer
|
|
656
515
|
# @return [Integer]
|
|
657
|
-
|
|
658
|
-
def dscp_mask; attributes[:"dscp_mask"]&.value; end
|
|
516
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
659
517
|
end
|
|
660
518
|
# Remove an existing FIB rule
|
|
661
|
-
class DoDelruleRequest < ::Nl::
|
|
519
|
+
class DoDelruleRequest < ::Nl::Message
|
|
662
520
|
TYPE = 33
|
|
663
521
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
664
522
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
665
|
-
ATTRIBUTES =
|
|
523
|
+
ATTRIBUTES = %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].freeze
|
|
524
|
+
include ATTRIBUTE_SET::Definitions
|
|
525
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
526
|
+
@family = family
|
|
527
|
+
@dst_len = dst_len
|
|
528
|
+
@src_len = src_len
|
|
529
|
+
@tos = tos
|
|
530
|
+
@table = table
|
|
531
|
+
@action = action
|
|
532
|
+
@flags = flags
|
|
533
|
+
@attributes = attributes
|
|
534
|
+
end
|
|
535
|
+
# @private
|
|
536
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
537
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
538
|
+
new(
|
|
539
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
540
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
541
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
542
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
543
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
544
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
545
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
546
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
547
|
+
)
|
|
548
|
+
end
|
|
549
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
550
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
551
|
+
def self.decode(decoder)
|
|
552
|
+
word = decoder.get_u32
|
|
553
|
+
value_0 = ((word >> 0) & 0xff)
|
|
554
|
+
value_1 = ((word >> 8) & 0xff)
|
|
555
|
+
value_2 = ((word >> 16) & 0xff)
|
|
556
|
+
value_3 = ((word >> 24) & 0xff)
|
|
557
|
+
word = decoder.get_u32
|
|
558
|
+
value_4 = ((word >> 0) & 0xff)
|
|
559
|
+
value_7 = ((word >> 24) & 0xff)
|
|
560
|
+
value_8 = decoder.get_host_u32
|
|
561
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
562
|
+
end
|
|
563
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
564
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
565
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
566
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
567
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
568
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
569
|
+
encoder.put_string("\x00")
|
|
570
|
+
encoder.put_string("\x00")
|
|
571
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
572
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
573
|
+
encode_attributes(encoder, external_selectors:)
|
|
574
|
+
end
|
|
666
575
|
# @rbs return: ::Integer
|
|
667
576
|
# @return [Integer]
|
|
668
|
-
def family;
|
|
577
|
+
def family; @family; end
|
|
669
578
|
# @rbs return: ::Integer
|
|
670
579
|
# @return [Integer]
|
|
671
|
-
def dst_len;
|
|
580
|
+
def dst_len; @dst_len; end
|
|
672
581
|
# @rbs return: ::Integer
|
|
673
582
|
# @return [Integer]
|
|
674
|
-
def src_len;
|
|
583
|
+
def src_len; @src_len; end
|
|
675
584
|
# @rbs return: ::Integer
|
|
676
585
|
# @return [Integer]
|
|
677
|
-
def tos;
|
|
586
|
+
def tos; @tos; end
|
|
678
587
|
# @rbs return: ::Integer
|
|
679
588
|
# @return [Integer]
|
|
680
|
-
def action;
|
|
589
|
+
def action; @action; end
|
|
681
590
|
# @rbs return: ::Integer
|
|
682
591
|
# @return [Integer]
|
|
683
|
-
def flags;
|
|
592
|
+
def flags; @flags; end
|
|
684
593
|
# @rbs return: ::String
|
|
685
594
|
# @return [String]
|
|
686
|
-
|
|
687
|
-
def iifname; attributes[:"iifname"]&.value; end
|
|
595
|
+
def iifname; self[:"iifname"]; end
|
|
688
596
|
# @rbs return: ::Integer
|
|
689
597
|
# @return [Integer]
|
|
690
|
-
|
|
691
|
-
def goto; attributes[:"goto"]&.value; end
|
|
598
|
+
def goto; self[:"goto"]; end
|
|
692
599
|
# @rbs return: ::Integer
|
|
693
600
|
# @return [Integer]
|
|
694
|
-
|
|
695
|
-
def priority; attributes[:"priority"]&.value; end
|
|
601
|
+
def priority; self[:"priority"]; end
|
|
696
602
|
# @rbs return: ::Integer
|
|
697
603
|
# @return [Integer]
|
|
698
|
-
|
|
699
|
-
def fwmark; attributes[:"fwmark"]&.value; end
|
|
604
|
+
def fwmark; self[:"fwmark"]; end
|
|
700
605
|
# @rbs return: ::Integer
|
|
701
606
|
# @return [Integer]
|
|
702
|
-
|
|
703
|
-
def flow; attributes[:"flow"]&.value; end
|
|
607
|
+
def flow; self[:"flow"]; end
|
|
704
608
|
# @rbs return: ::Integer
|
|
705
609
|
# @return [Integer]
|
|
706
|
-
|
|
707
|
-
def tun_id; attributes[:"tun_id"]&.value; end
|
|
610
|
+
def tun_id; self[:"tun_id"]; end
|
|
708
611
|
# @rbs return: ::Integer
|
|
709
612
|
# @return [Integer]
|
|
710
|
-
|
|
711
|
-
def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
|
|
613
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
712
614
|
# @rbs return: ::Integer
|
|
713
615
|
# @return [Integer]
|
|
714
|
-
|
|
715
|
-
def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
|
|
616
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
716
617
|
# @rbs return: ::Integer
|
|
717
618
|
# @return [Integer]
|
|
718
|
-
|
|
719
|
-
def table; attributes[:"table"]&.value || fixed_header.table; end
|
|
619
|
+
def table; self[:"table"] || @table; end
|
|
720
620
|
# @rbs return: ::Integer
|
|
721
621
|
# @return [Integer]
|
|
722
|
-
|
|
723
|
-
def fwmask; attributes[:"fwmask"]&.value; end
|
|
622
|
+
def fwmask; self[:"fwmask"]; end
|
|
724
623
|
# @rbs return: ::String
|
|
725
624
|
# @return [String]
|
|
726
|
-
|
|
727
|
-
def oifname; attributes[:"oifname"]&.value; end
|
|
625
|
+
def oifname; self[:"oifname"]; end
|
|
728
626
|
# @rbs return: ::Integer
|
|
729
627
|
# @return [Integer]
|
|
730
|
-
|
|
731
|
-
def l3mdev; attributes[:"l3mdev"]&.value; end
|
|
628
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
732
629
|
# @rbs return: Structs::FibRuleUidRange
|
|
733
630
|
# @return [Structs::FibRuleUidRange]
|
|
734
|
-
|
|
735
|
-
def uid_range; attributes[:"uid_range"]&.value; end
|
|
631
|
+
def uid_range; self[:"uid_range"]; end
|
|
736
632
|
# @rbs return: ::Integer
|
|
737
633
|
# @return [Integer]
|
|
738
|
-
|
|
739
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
634
|
+
def protocol; self[:"protocol"]; end
|
|
740
635
|
# @rbs return: ::Integer
|
|
741
636
|
# @return [Integer]
|
|
742
|
-
|
|
743
|
-
def ip_proto; attributes[:"ip_proto"]&.value; end
|
|
637
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
744
638
|
# @rbs return: Structs::FibRulePortRange
|
|
745
639
|
# @return [Structs::FibRulePortRange]
|
|
746
|
-
|
|
747
|
-
def sport_range; attributes[:"sport_range"]&.value; end
|
|
640
|
+
def sport_range; self[:"sport_range"]; end
|
|
748
641
|
# @rbs return: Structs::FibRulePortRange
|
|
749
642
|
# @return [Structs::FibRulePortRange]
|
|
750
|
-
|
|
751
|
-
def dport_range; attributes[:"dport_range"]&.value; end
|
|
643
|
+
def dport_range; self[:"dport_range"]; end
|
|
752
644
|
# @rbs return: ::Integer
|
|
753
645
|
# @return [Integer]
|
|
754
|
-
|
|
755
|
-
def dscp; attributes[:"dscp"]&.value; end
|
|
646
|
+
def dscp; self[:"dscp"]; end
|
|
756
647
|
# @rbs return: ::Integer
|
|
757
648
|
# @return [Integer]
|
|
758
|
-
|
|
759
|
-
def flowlabel; attributes[:"flowlabel"]&.value; end
|
|
649
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
760
650
|
# @rbs return: ::Integer
|
|
761
651
|
# @return [Integer]
|
|
762
|
-
|
|
763
|
-
def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
|
|
652
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
764
653
|
# @rbs return: ::Integer
|
|
765
654
|
# @return [Integer]
|
|
766
|
-
|
|
767
|
-
def sport_mask; attributes[:"sport_mask"]&.value; end
|
|
655
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
768
656
|
# @rbs return: ::Integer
|
|
769
657
|
# @return [Integer]
|
|
770
|
-
|
|
771
|
-
def dport_mask; attributes[:"dport_mask"]&.value; end
|
|
658
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
772
659
|
# @rbs return: ::Integer
|
|
773
660
|
# @return [Integer]
|
|
774
|
-
|
|
775
|
-
def dscp_mask; attributes[:"dscp_mask"]&.value; end
|
|
661
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
776
662
|
end
|
|
777
663
|
# Dump all FIB rules
|
|
778
|
-
class DumpGetruleRequest < ::Nl::
|
|
664
|
+
class DumpGetruleRequest < ::Nl::Message
|
|
779
665
|
TYPE = 34
|
|
780
666
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
781
667
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
782
|
-
ATTRIBUTES =
|
|
668
|
+
ATTRIBUTES = %i[].freeze
|
|
669
|
+
include ATTRIBUTE_SET::Definitions
|
|
670
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
671
|
+
@family = family
|
|
672
|
+
@dst_len = dst_len
|
|
673
|
+
@src_len = src_len
|
|
674
|
+
@tos = tos
|
|
675
|
+
@table = table
|
|
676
|
+
@action = action
|
|
677
|
+
@flags = flags
|
|
678
|
+
@attributes = attributes
|
|
679
|
+
end
|
|
680
|
+
# @private
|
|
681
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
682
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
683
|
+
new(
|
|
684
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
685
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
686
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
687
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
688
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
689
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
690
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
691
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
692
|
+
)
|
|
693
|
+
end
|
|
694
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
695
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
696
|
+
def self.decode(decoder)
|
|
697
|
+
word = decoder.get_u32
|
|
698
|
+
value_0 = ((word >> 0) & 0xff)
|
|
699
|
+
value_1 = ((word >> 8) & 0xff)
|
|
700
|
+
value_2 = ((word >> 16) & 0xff)
|
|
701
|
+
value_3 = ((word >> 24) & 0xff)
|
|
702
|
+
word = decoder.get_u32
|
|
703
|
+
value_4 = ((word >> 0) & 0xff)
|
|
704
|
+
value_7 = ((word >> 24) & 0xff)
|
|
705
|
+
value_8 = decoder.get_host_u32
|
|
706
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
707
|
+
end
|
|
708
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
709
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
710
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
711
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
712
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
713
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
714
|
+
encoder.put_string("\x00")
|
|
715
|
+
encoder.put_string("\x00")
|
|
716
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
717
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
718
|
+
encode_attributes(encoder, external_selectors:)
|
|
719
|
+
end
|
|
783
720
|
# @rbs return: ::Integer
|
|
784
721
|
# @return [Integer]
|
|
785
|
-
def family;
|
|
722
|
+
def family; @family; end
|
|
786
723
|
# @rbs return: ::Integer
|
|
787
724
|
# @return [Integer]
|
|
788
|
-
def dst_len;
|
|
725
|
+
def dst_len; @dst_len; end
|
|
789
726
|
# @rbs return: ::Integer
|
|
790
727
|
# @return [Integer]
|
|
791
|
-
def src_len;
|
|
728
|
+
def src_len; @src_len; end
|
|
792
729
|
# @rbs return: ::Integer
|
|
793
730
|
# @return [Integer]
|
|
794
|
-
def tos;
|
|
731
|
+
def tos; @tos; end
|
|
795
732
|
# @rbs return: ::Integer
|
|
796
733
|
# @return [Integer]
|
|
797
|
-
def table;
|
|
734
|
+
def table; @table; end
|
|
798
735
|
# @rbs return: ::Integer
|
|
799
736
|
# @return [Integer]
|
|
800
|
-
def action;
|
|
737
|
+
def action; @action; end
|
|
801
738
|
# @rbs return: ::Integer
|
|
802
739
|
# @return [Integer]
|
|
803
|
-
def flags;
|
|
740
|
+
def flags; @flags; end
|
|
804
741
|
end
|
|
805
742
|
# Dump all FIB rules
|
|
806
|
-
class DumpGetruleReply < ::Nl::
|
|
743
|
+
class DumpGetruleReply < ::Nl::Message
|
|
807
744
|
TYPE = 32
|
|
808
745
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
809
746
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
810
|
-
ATTRIBUTES =
|
|
747
|
+
ATTRIBUTES = %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].freeze
|
|
748
|
+
include ATTRIBUTE_SET::Definitions
|
|
749
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
750
|
+
@family = family
|
|
751
|
+
@dst_len = dst_len
|
|
752
|
+
@src_len = src_len
|
|
753
|
+
@tos = tos
|
|
754
|
+
@table = table
|
|
755
|
+
@action = action
|
|
756
|
+
@flags = flags
|
|
757
|
+
@attributes = attributes
|
|
758
|
+
end
|
|
759
|
+
# @private
|
|
760
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
761
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
762
|
+
new(
|
|
763
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
764
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
765
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
766
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
767
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
768
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
769
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
770
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
771
|
+
)
|
|
772
|
+
end
|
|
773
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
774
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
775
|
+
def self.decode(decoder)
|
|
776
|
+
word = decoder.get_u32
|
|
777
|
+
value_0 = ((word >> 0) & 0xff)
|
|
778
|
+
value_1 = ((word >> 8) & 0xff)
|
|
779
|
+
value_2 = ((word >> 16) & 0xff)
|
|
780
|
+
value_3 = ((word >> 24) & 0xff)
|
|
781
|
+
word = decoder.get_u32
|
|
782
|
+
value_4 = ((word >> 0) & 0xff)
|
|
783
|
+
value_7 = ((word >> 24) & 0xff)
|
|
784
|
+
value_8 = decoder.get_host_u32
|
|
785
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
786
|
+
end
|
|
787
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
788
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
789
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
790
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
791
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
792
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
793
|
+
encoder.put_string("\x00")
|
|
794
|
+
encoder.put_string("\x00")
|
|
795
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
796
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
797
|
+
encode_attributes(encoder, external_selectors:)
|
|
798
|
+
end
|
|
811
799
|
# @rbs return: ::Integer
|
|
812
800
|
# @return [Integer]
|
|
813
|
-
def family;
|
|
801
|
+
def family; @family; end
|
|
814
802
|
# @rbs return: ::Integer
|
|
815
803
|
# @return [Integer]
|
|
816
|
-
def dst_len;
|
|
804
|
+
def dst_len; @dst_len; end
|
|
817
805
|
# @rbs return: ::Integer
|
|
818
806
|
# @return [Integer]
|
|
819
|
-
def src_len;
|
|
807
|
+
def src_len; @src_len; end
|
|
820
808
|
# @rbs return: ::Integer
|
|
821
809
|
# @return [Integer]
|
|
822
|
-
def tos;
|
|
810
|
+
def tos; @tos; end
|
|
823
811
|
# @rbs return: ::Integer
|
|
824
812
|
# @return [Integer]
|
|
825
|
-
def action;
|
|
813
|
+
def action; @action; end
|
|
826
814
|
# @rbs return: ::Integer
|
|
827
815
|
# @return [Integer]
|
|
828
|
-
def flags;
|
|
816
|
+
def flags; @flags; end
|
|
829
817
|
# @rbs return: ::String
|
|
830
818
|
# @return [String]
|
|
831
|
-
|
|
832
|
-
def iifname; attributes[:"iifname"]&.value; end
|
|
819
|
+
def iifname; self[:"iifname"]; end
|
|
833
820
|
# @rbs return: ::Integer
|
|
834
821
|
# @return [Integer]
|
|
835
|
-
|
|
836
|
-
def goto; attributes[:"goto"]&.value; end
|
|
822
|
+
def goto; self[:"goto"]; end
|
|
837
823
|
# @rbs return: ::Integer
|
|
838
824
|
# @return [Integer]
|
|
839
|
-
|
|
840
|
-
def priority; attributes[:"priority"]&.value; end
|
|
825
|
+
def priority; self[:"priority"]; end
|
|
841
826
|
# @rbs return: ::Integer
|
|
842
827
|
# @return [Integer]
|
|
843
|
-
|
|
844
|
-
def fwmark; attributes[:"fwmark"]&.value; end
|
|
828
|
+
def fwmark; self[:"fwmark"]; end
|
|
845
829
|
# @rbs return: ::Integer
|
|
846
830
|
# @return [Integer]
|
|
847
|
-
|
|
848
|
-
def flow; attributes[:"flow"]&.value; end
|
|
831
|
+
def flow; self[:"flow"]; end
|
|
849
832
|
# @rbs return: ::Integer
|
|
850
833
|
# @return [Integer]
|
|
851
|
-
|
|
852
|
-
def tun_id; attributes[:"tun_id"]&.value; end
|
|
834
|
+
def tun_id; self[:"tun_id"]; end
|
|
853
835
|
# @rbs return: ::Integer
|
|
854
836
|
# @return [Integer]
|
|
855
|
-
|
|
856
|
-
def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
|
|
837
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
857
838
|
# @rbs return: ::Integer
|
|
858
839
|
# @return [Integer]
|
|
859
|
-
|
|
860
|
-
def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
|
|
840
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
861
841
|
# @rbs return: ::Integer
|
|
862
842
|
# @return [Integer]
|
|
863
|
-
|
|
864
|
-
def table; attributes[:"table"]&.value || fixed_header.table; end
|
|
843
|
+
def table; self[:"table"] || @table; end
|
|
865
844
|
# @rbs return: ::Integer
|
|
866
845
|
# @return [Integer]
|
|
867
|
-
|
|
868
|
-
def fwmask; attributes[:"fwmask"]&.value; end
|
|
846
|
+
def fwmask; self[:"fwmask"]; end
|
|
869
847
|
# @rbs return: ::String
|
|
870
848
|
# @return [String]
|
|
871
|
-
|
|
872
|
-
def oifname; attributes[:"oifname"]&.value; end
|
|
849
|
+
def oifname; self[:"oifname"]; end
|
|
873
850
|
# @rbs return: ::Integer
|
|
874
851
|
# @return [Integer]
|
|
875
|
-
|
|
876
|
-
def l3mdev; attributes[:"l3mdev"]&.value; end
|
|
852
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
877
853
|
# @rbs return: Structs::FibRuleUidRange
|
|
878
854
|
# @return [Structs::FibRuleUidRange]
|
|
879
|
-
|
|
880
|
-
def uid_range; attributes[:"uid_range"]&.value; end
|
|
855
|
+
def uid_range; self[:"uid_range"]; end
|
|
881
856
|
# @rbs return: ::Integer
|
|
882
857
|
# @return [Integer]
|
|
883
|
-
|
|
884
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
858
|
+
def protocol; self[:"protocol"]; end
|
|
885
859
|
# @rbs return: ::Integer
|
|
886
860
|
# @return [Integer]
|
|
887
|
-
|
|
888
|
-
def ip_proto; attributes[:"ip_proto"]&.value; end
|
|
861
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
889
862
|
# @rbs return: Structs::FibRulePortRange
|
|
890
863
|
# @return [Structs::FibRulePortRange]
|
|
891
|
-
|
|
892
|
-
def sport_range; attributes[:"sport_range"]&.value; end
|
|
864
|
+
def sport_range; self[:"sport_range"]; end
|
|
893
865
|
# @rbs return: Structs::FibRulePortRange
|
|
894
866
|
# @return [Structs::FibRulePortRange]
|
|
895
|
-
|
|
896
|
-
def dport_range; attributes[:"dport_range"]&.value; end
|
|
867
|
+
def dport_range; self[:"dport_range"]; end
|
|
897
868
|
# @rbs return: ::Integer
|
|
898
869
|
# @return [Integer]
|
|
899
|
-
|
|
900
|
-
def dscp; attributes[:"dscp"]&.value; end
|
|
870
|
+
def dscp; self[:"dscp"]; end
|
|
901
871
|
# @rbs return: ::Integer
|
|
902
872
|
# @return [Integer]
|
|
903
|
-
|
|
904
|
-
def flowlabel; attributes[:"flowlabel"]&.value; end
|
|
873
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
905
874
|
# @rbs return: ::Integer
|
|
906
875
|
# @return [Integer]
|
|
907
|
-
|
|
908
|
-
def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
|
|
876
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
909
877
|
# @rbs return: ::Integer
|
|
910
878
|
# @return [Integer]
|
|
911
|
-
|
|
912
|
-
def sport_mask; attributes[:"sport_mask"]&.value; end
|
|
879
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
913
880
|
# @rbs return: ::Integer
|
|
914
881
|
# @return [Integer]
|
|
915
|
-
|
|
916
|
-
def dport_mask; attributes[:"dport_mask"]&.value; end
|
|
882
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
917
883
|
# @rbs return: ::Integer
|
|
918
884
|
# @return [Integer]
|
|
919
|
-
|
|
920
|
-
def dscp_mask; attributes[:"dscp_mask"]&.value; end
|
|
885
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
921
886
|
end
|
|
922
887
|
end
|
|
923
888
|
module Notifications
|
|
924
889
|
# Notify a rule creation
|
|
925
|
-
class NewruleNtf < ::Nl::
|
|
890
|
+
class NewruleNtf < ::Nl::Message
|
|
926
891
|
TYPE = 32
|
|
927
892
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
928
893
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
929
|
-
ATTRIBUTES =
|
|
894
|
+
ATTRIBUTES = %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].freeze
|
|
895
|
+
include ATTRIBUTE_SET::Definitions
|
|
896
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
897
|
+
@family = family
|
|
898
|
+
@dst_len = dst_len
|
|
899
|
+
@src_len = src_len
|
|
900
|
+
@tos = tos
|
|
901
|
+
@table = table
|
|
902
|
+
@action = action
|
|
903
|
+
@flags = flags
|
|
904
|
+
@attributes = attributes
|
|
905
|
+
end
|
|
906
|
+
# @private
|
|
907
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
908
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
909
|
+
new(
|
|
910
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
911
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
912
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
913
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
914
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
915
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
916
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
917
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
918
|
+
)
|
|
919
|
+
end
|
|
920
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
921
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
922
|
+
def self.decode(decoder)
|
|
923
|
+
word = decoder.get_u32
|
|
924
|
+
value_0 = ((word >> 0) & 0xff)
|
|
925
|
+
value_1 = ((word >> 8) & 0xff)
|
|
926
|
+
value_2 = ((word >> 16) & 0xff)
|
|
927
|
+
value_3 = ((word >> 24) & 0xff)
|
|
928
|
+
word = decoder.get_u32
|
|
929
|
+
value_4 = ((word >> 0) & 0xff)
|
|
930
|
+
value_7 = ((word >> 24) & 0xff)
|
|
931
|
+
value_8 = decoder.get_host_u32
|
|
932
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
933
|
+
end
|
|
934
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
935
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
936
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
937
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
938
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
939
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
940
|
+
encoder.put_string("\x00")
|
|
941
|
+
encoder.put_string("\x00")
|
|
942
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
943
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
944
|
+
encode_attributes(encoder, external_selectors:)
|
|
945
|
+
end
|
|
930
946
|
# @rbs return: ::Integer
|
|
931
947
|
# @return [Integer]
|
|
932
|
-
def family;
|
|
948
|
+
def family; @family; end
|
|
933
949
|
# @rbs return: ::Integer
|
|
934
950
|
# @return [Integer]
|
|
935
|
-
def dst_len;
|
|
951
|
+
def dst_len; @dst_len; end
|
|
936
952
|
# @rbs return: ::Integer
|
|
937
953
|
# @return [Integer]
|
|
938
|
-
def src_len;
|
|
954
|
+
def src_len; @src_len; end
|
|
939
955
|
# @rbs return: ::Integer
|
|
940
956
|
# @return [Integer]
|
|
941
|
-
def tos;
|
|
957
|
+
def tos; @tos; end
|
|
942
958
|
# @rbs return: ::Integer
|
|
943
959
|
# @return [Integer]
|
|
944
|
-
def action;
|
|
960
|
+
def action; @action; end
|
|
945
961
|
# @rbs return: ::Integer
|
|
946
962
|
# @return [Integer]
|
|
947
|
-
def flags;
|
|
963
|
+
def flags; @flags; end
|
|
948
964
|
# @rbs return: ::String
|
|
949
965
|
# @return [String]
|
|
950
|
-
|
|
951
|
-
def iifname; attributes[:"iifname"]&.value; end
|
|
966
|
+
def iifname; self[:"iifname"]; end
|
|
952
967
|
# @rbs return: ::Integer
|
|
953
968
|
# @return [Integer]
|
|
954
|
-
|
|
955
|
-
def goto; attributes[:"goto"]&.value; end
|
|
969
|
+
def goto; self[:"goto"]; end
|
|
956
970
|
# @rbs return: ::Integer
|
|
957
971
|
# @return [Integer]
|
|
958
|
-
|
|
959
|
-
def priority; attributes[:"priority"]&.value; end
|
|
972
|
+
def priority; self[:"priority"]; end
|
|
960
973
|
# @rbs return: ::Integer
|
|
961
974
|
# @return [Integer]
|
|
962
|
-
|
|
963
|
-
def fwmark; attributes[:"fwmark"]&.value; end
|
|
975
|
+
def fwmark; self[:"fwmark"]; end
|
|
964
976
|
# @rbs return: ::Integer
|
|
965
977
|
# @return [Integer]
|
|
966
|
-
|
|
967
|
-
def flow; attributes[:"flow"]&.value; end
|
|
978
|
+
def flow; self[:"flow"]; end
|
|
968
979
|
# @rbs return: ::Integer
|
|
969
980
|
# @return [Integer]
|
|
970
|
-
|
|
971
|
-
def tun_id; attributes[:"tun_id"]&.value; end
|
|
981
|
+
def tun_id; self[:"tun_id"]; end
|
|
972
982
|
# @rbs return: ::Integer
|
|
973
983
|
# @return [Integer]
|
|
974
|
-
|
|
975
|
-
def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
|
|
984
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
976
985
|
# @rbs return: ::Integer
|
|
977
986
|
# @return [Integer]
|
|
978
|
-
|
|
979
|
-
def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
|
|
987
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
980
988
|
# @rbs return: ::Integer
|
|
981
989
|
# @return [Integer]
|
|
982
|
-
|
|
983
|
-
def table; attributes[:"table"]&.value || fixed_header.table; end
|
|
990
|
+
def table; self[:"table"] || @table; end
|
|
984
991
|
# @rbs return: ::Integer
|
|
985
992
|
# @return [Integer]
|
|
986
|
-
|
|
987
|
-
def fwmask; attributes[:"fwmask"]&.value; end
|
|
993
|
+
def fwmask; self[:"fwmask"]; end
|
|
988
994
|
# @rbs return: ::String
|
|
989
995
|
# @return [String]
|
|
990
|
-
|
|
991
|
-
def oifname; attributes[:"oifname"]&.value; end
|
|
996
|
+
def oifname; self[:"oifname"]; end
|
|
992
997
|
# @rbs return: ::Integer
|
|
993
998
|
# @return [Integer]
|
|
994
|
-
|
|
995
|
-
def l3mdev; attributes[:"l3mdev"]&.value; end
|
|
999
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
996
1000
|
# @rbs return: Structs::FibRuleUidRange
|
|
997
1001
|
# @return [Structs::FibRuleUidRange]
|
|
998
|
-
|
|
999
|
-
def uid_range; attributes[:"uid_range"]&.value; end
|
|
1002
|
+
def uid_range; self[:"uid_range"]; end
|
|
1000
1003
|
# @rbs return: ::Integer
|
|
1001
1004
|
# @return [Integer]
|
|
1002
|
-
|
|
1003
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
1005
|
+
def protocol; self[:"protocol"]; end
|
|
1004
1006
|
# @rbs return: ::Integer
|
|
1005
1007
|
# @return [Integer]
|
|
1006
|
-
|
|
1007
|
-
def ip_proto; attributes[:"ip_proto"]&.value; end
|
|
1008
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
1008
1009
|
# @rbs return: Structs::FibRulePortRange
|
|
1009
1010
|
# @return [Structs::FibRulePortRange]
|
|
1010
|
-
|
|
1011
|
-
def sport_range; attributes[:"sport_range"]&.value; end
|
|
1011
|
+
def sport_range; self[:"sport_range"]; end
|
|
1012
1012
|
# @rbs return: Structs::FibRulePortRange
|
|
1013
1013
|
# @return [Structs::FibRulePortRange]
|
|
1014
|
-
|
|
1015
|
-
def dport_range; attributes[:"dport_range"]&.value; end
|
|
1014
|
+
def dport_range; self[:"dport_range"]; end
|
|
1016
1015
|
# @rbs return: ::Integer
|
|
1017
1016
|
# @return [Integer]
|
|
1018
|
-
|
|
1019
|
-
def dscp; attributes[:"dscp"]&.value; end
|
|
1017
|
+
def dscp; self[:"dscp"]; end
|
|
1020
1018
|
# @rbs return: ::Integer
|
|
1021
1019
|
# @return [Integer]
|
|
1022
|
-
|
|
1023
|
-
def flowlabel; attributes[:"flowlabel"]&.value; end
|
|
1020
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
1024
1021
|
# @rbs return: ::Integer
|
|
1025
1022
|
# @return [Integer]
|
|
1026
|
-
|
|
1027
|
-
def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
|
|
1023
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
1028
1024
|
# @rbs return: ::Integer
|
|
1029
1025
|
# @return [Integer]
|
|
1030
|
-
|
|
1031
|
-
def sport_mask; attributes[:"sport_mask"]&.value; end
|
|
1026
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
1032
1027
|
# @rbs return: ::Integer
|
|
1033
1028
|
# @return [Integer]
|
|
1034
|
-
|
|
1035
|
-
def dport_mask; attributes[:"dport_mask"]&.value; end
|
|
1029
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
1036
1030
|
# @rbs return: ::Integer
|
|
1037
1031
|
# @return [Integer]
|
|
1038
|
-
|
|
1039
|
-
def dscp_mask; attributes[:"dscp_mask"]&.value; end
|
|
1032
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
1040
1033
|
end
|
|
1041
1034
|
# Notify a rule deletion
|
|
1042
|
-
class DelruleNtf < ::Nl::
|
|
1035
|
+
class DelruleNtf < ::Nl::Message
|
|
1043
1036
|
TYPE = 33
|
|
1044
1037
|
FIXED_HEADER = Structs::FibRuleHdr
|
|
1045
1038
|
ATTRIBUTE_SET = AttributeSets::FibRuleAttrs
|
|
1046
|
-
ATTRIBUTES =
|
|
1039
|
+
ATTRIBUTES = %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].freeze
|
|
1040
|
+
include ATTRIBUTE_SET::Definitions
|
|
1041
|
+
def initialize(family, dst_len, src_len, tos, table, action, flags, attributes = [])
|
|
1042
|
+
@family = family
|
|
1043
|
+
@dst_len = dst_len
|
|
1044
|
+
@src_len = src_len
|
|
1045
|
+
@tos = tos
|
|
1046
|
+
@table = table
|
|
1047
|
+
@action = action
|
|
1048
|
+
@flags = flags
|
|
1049
|
+
@attributes = attributes
|
|
1050
|
+
end
|
|
1051
|
+
# @private
|
|
1052
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1053
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1054
|
+
new(
|
|
1055
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
1056
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].coerce(params.fetch(:"dst_len", 0)),
|
|
1057
|
+
FIXED_HEADER::MEMBERS[:"src_len"].coerce(params.fetch(:"src_len", 0)),
|
|
1058
|
+
FIXED_HEADER::MEMBERS[:"tos"].coerce(params.fetch(:"tos", 0)),
|
|
1059
|
+
FIXED_HEADER::MEMBERS[:"table"].coerce(params.fetch(:"table", 0)),
|
|
1060
|
+
FIXED_HEADER::MEMBERS[:"action"].coerce(params.fetch(:"action", 0)),
|
|
1061
|
+
FIXED_HEADER::MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0)),
|
|
1062
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1063
|
+
)
|
|
1064
|
+
end
|
|
1065
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1066
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1067
|
+
def self.decode(decoder)
|
|
1068
|
+
word = decoder.get_u32
|
|
1069
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1070
|
+
value_1 = ((word >> 8) & 0xff)
|
|
1071
|
+
value_2 = ((word >> 16) & 0xff)
|
|
1072
|
+
value_3 = ((word >> 24) & 0xff)
|
|
1073
|
+
word = decoder.get_u32
|
|
1074
|
+
value_4 = ((word >> 0) & 0xff)
|
|
1075
|
+
value_7 = ((word >> 24) & 0xff)
|
|
1076
|
+
value_8 = decoder.get_host_u32
|
|
1077
|
+
new(value_0, value_1, value_2, value_3, value_4, value_7, value_8, decode_attributes(decoder, BY_TYPE, 0))
|
|
1078
|
+
end
|
|
1079
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1080
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
1081
|
+
FIXED_HEADER::MEMBERS[:"dst_len"].encode(encoder, @dst_len)
|
|
1082
|
+
FIXED_HEADER::MEMBERS[:"src_len"].encode(encoder, @src_len)
|
|
1083
|
+
FIXED_HEADER::MEMBERS[:"tos"].encode(encoder, @tos)
|
|
1084
|
+
FIXED_HEADER::MEMBERS[:"table"].encode(encoder, @table)
|
|
1085
|
+
encoder.put_string("\x00")
|
|
1086
|
+
encoder.put_string("\x00")
|
|
1087
|
+
FIXED_HEADER::MEMBERS[:"action"].encode(encoder, @action)
|
|
1088
|
+
FIXED_HEADER::MEMBERS[:"flags"].encode(encoder, @flags)
|
|
1089
|
+
encode_attributes(encoder, external_selectors:)
|
|
1090
|
+
end
|
|
1047
1091
|
# @rbs return: ::Integer
|
|
1048
1092
|
# @return [Integer]
|
|
1049
|
-
def family;
|
|
1093
|
+
def family; @family; end
|
|
1050
1094
|
# @rbs return: ::Integer
|
|
1051
1095
|
# @return [Integer]
|
|
1052
|
-
def dst_len;
|
|
1096
|
+
def dst_len; @dst_len; end
|
|
1053
1097
|
# @rbs return: ::Integer
|
|
1054
1098
|
# @return [Integer]
|
|
1055
|
-
def src_len;
|
|
1099
|
+
def src_len; @src_len; end
|
|
1056
1100
|
# @rbs return: ::Integer
|
|
1057
1101
|
# @return [Integer]
|
|
1058
|
-
def tos;
|
|
1102
|
+
def tos; @tos; end
|
|
1059
1103
|
# @rbs return: ::Integer
|
|
1060
1104
|
# @return [Integer]
|
|
1061
|
-
def action;
|
|
1105
|
+
def action; @action; end
|
|
1062
1106
|
# @rbs return: ::Integer
|
|
1063
1107
|
# @return [Integer]
|
|
1064
|
-
def flags;
|
|
1108
|
+
def flags; @flags; end
|
|
1065
1109
|
# @rbs return: ::String
|
|
1066
1110
|
# @return [String]
|
|
1067
|
-
|
|
1068
|
-
def iifname; attributes[:"iifname"]&.value; end
|
|
1111
|
+
def iifname; self[:"iifname"]; end
|
|
1069
1112
|
# @rbs return: ::Integer
|
|
1070
1113
|
# @return [Integer]
|
|
1071
|
-
|
|
1072
|
-
def goto; attributes[:"goto"]&.value; end
|
|
1114
|
+
def goto; self[:"goto"]; end
|
|
1073
1115
|
# @rbs return: ::Integer
|
|
1074
1116
|
# @return [Integer]
|
|
1075
|
-
|
|
1076
|
-
def priority; attributes[:"priority"]&.value; end
|
|
1117
|
+
def priority; self[:"priority"]; end
|
|
1077
1118
|
# @rbs return: ::Integer
|
|
1078
1119
|
# @return [Integer]
|
|
1079
|
-
|
|
1080
|
-
def fwmark; attributes[:"fwmark"]&.value; end
|
|
1120
|
+
def fwmark; self[:"fwmark"]; end
|
|
1081
1121
|
# @rbs return: ::Integer
|
|
1082
1122
|
# @return [Integer]
|
|
1083
|
-
|
|
1084
|
-
def flow; attributes[:"flow"]&.value; end
|
|
1123
|
+
def flow; self[:"flow"]; end
|
|
1085
1124
|
# @rbs return: ::Integer
|
|
1086
1125
|
# @return [Integer]
|
|
1087
|
-
|
|
1088
|
-
def tun_id; attributes[:"tun_id"]&.value; end
|
|
1126
|
+
def tun_id; self[:"tun_id"]; end
|
|
1089
1127
|
# @rbs return: ::Integer
|
|
1090
1128
|
# @return [Integer]
|
|
1091
|
-
|
|
1092
|
-
def suppress_ifgroup; attributes[:"suppress_ifgroup"]&.value; end
|
|
1129
|
+
def suppress_ifgroup; self[:"suppress_ifgroup"]; end
|
|
1093
1130
|
# @rbs return: ::Integer
|
|
1094
1131
|
# @return [Integer]
|
|
1095
|
-
|
|
1096
|
-
def suppress_prefixlen; attributes[:"suppress_prefixlen"]&.value; end
|
|
1132
|
+
def suppress_prefixlen; self[:"suppress_prefixlen"]; end
|
|
1097
1133
|
# @rbs return: ::Integer
|
|
1098
1134
|
# @return [Integer]
|
|
1099
|
-
|
|
1100
|
-
def table; attributes[:"table"]&.value || fixed_header.table; end
|
|
1135
|
+
def table; self[:"table"] || @table; end
|
|
1101
1136
|
# @rbs return: ::Integer
|
|
1102
1137
|
# @return [Integer]
|
|
1103
|
-
|
|
1104
|
-
def fwmask; attributes[:"fwmask"]&.value; end
|
|
1138
|
+
def fwmask; self[:"fwmask"]; end
|
|
1105
1139
|
# @rbs return: ::String
|
|
1106
1140
|
# @return [String]
|
|
1107
|
-
|
|
1108
|
-
def oifname; attributes[:"oifname"]&.value; end
|
|
1141
|
+
def oifname; self[:"oifname"]; end
|
|
1109
1142
|
# @rbs return: ::Integer
|
|
1110
1143
|
# @return [Integer]
|
|
1111
|
-
|
|
1112
|
-
def l3mdev; attributes[:"l3mdev"]&.value; end
|
|
1144
|
+
def l3mdev; self[:"l3mdev"]; end
|
|
1113
1145
|
# @rbs return: Structs::FibRuleUidRange
|
|
1114
1146
|
# @return [Structs::FibRuleUidRange]
|
|
1115
|
-
|
|
1116
|
-
def uid_range; attributes[:"uid_range"]&.value; end
|
|
1147
|
+
def uid_range; self[:"uid_range"]; end
|
|
1117
1148
|
# @rbs return: ::Integer
|
|
1118
1149
|
# @return [Integer]
|
|
1119
|
-
|
|
1120
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
1150
|
+
def protocol; self[:"protocol"]; end
|
|
1121
1151
|
# @rbs return: ::Integer
|
|
1122
1152
|
# @return [Integer]
|
|
1123
|
-
|
|
1124
|
-
def ip_proto; attributes[:"ip_proto"]&.value; end
|
|
1153
|
+
def ip_proto; self[:"ip_proto"]; end
|
|
1125
1154
|
# @rbs return: Structs::FibRulePortRange
|
|
1126
1155
|
# @return [Structs::FibRulePortRange]
|
|
1127
|
-
|
|
1128
|
-
def sport_range; attributes[:"sport_range"]&.value; end
|
|
1156
|
+
def sport_range; self[:"sport_range"]; end
|
|
1129
1157
|
# @rbs return: Structs::FibRulePortRange
|
|
1130
1158
|
# @return [Structs::FibRulePortRange]
|
|
1131
|
-
|
|
1132
|
-
def dport_range; attributes[:"dport_range"]&.value; end
|
|
1159
|
+
def dport_range; self[:"dport_range"]; end
|
|
1133
1160
|
# @rbs return: ::Integer
|
|
1134
1161
|
# @return [Integer]
|
|
1135
|
-
|
|
1136
|
-
def dscp; attributes[:"dscp"]&.value; end
|
|
1162
|
+
def dscp; self[:"dscp"]; end
|
|
1137
1163
|
# @rbs return: ::Integer
|
|
1138
1164
|
# @return [Integer]
|
|
1139
|
-
|
|
1140
|
-
def flowlabel; attributes[:"flowlabel"]&.value; end
|
|
1165
|
+
def flowlabel; self[:"flowlabel"]; end
|
|
1141
1166
|
# @rbs return: ::Integer
|
|
1142
1167
|
# @return [Integer]
|
|
1143
|
-
|
|
1144
|
-
def flowlabel_mask; attributes[:"flowlabel_mask"]&.value; end
|
|
1168
|
+
def flowlabel_mask; self[:"flowlabel_mask"]; end
|
|
1145
1169
|
# @rbs return: ::Integer
|
|
1146
1170
|
# @return [Integer]
|
|
1147
|
-
|
|
1148
|
-
def sport_mask; attributes[:"sport_mask"]&.value; end
|
|
1171
|
+
def sport_mask; self[:"sport_mask"]; end
|
|
1149
1172
|
# @rbs return: ::Integer
|
|
1150
1173
|
# @return [Integer]
|
|
1151
|
-
|
|
1152
|
-
def dport_mask; attributes[:"dport_mask"]&.value; end
|
|
1174
|
+
def dport_mask; self[:"dport_mask"]; end
|
|
1153
1175
|
# @rbs return: ::Integer
|
|
1154
1176
|
# @return [Integer]
|
|
1155
|
-
|
|
1156
|
-
def dscp_mask; attributes[:"dscp_mask"]&.value; end
|
|
1177
|
+
def dscp_mask; self[:"dscp_mask"]; end
|
|
1157
1178
|
end
|
|
1158
1179
|
end
|
|
1159
1180
|
# @private
|
|
1160
|
-
NOTIFICATIONS =
|
|
1181
|
+
NOTIFICATIONS = {32 => Notifications::NewruleNtf, 33 => Notifications::DelruleNtf}.freeze #: Hash[::Integer, ::Class]
|
|
1161
1182
|
# Add new FIB rule
|
|
1162
1183
|
# @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: (Structs::FibRuleUidRange | ::Hash[::Symbol, untyped]), ?protocol: ::Integer, ?ip_proto: ::Integer, ?sport_range: (Structs::FibRulePortRange | ::Hash[::Symbol, untyped]), ?dport_range: (Structs::FibRulePortRange | ::Hash[::Symbol, untyped]), ?dscp: ::Integer, ?flowlabel: ::Integer, ?flowlabel_mask: ::Integer, ?sport_mask: ::Integer, ?dport_mask: ::Integer, ?dscp_mask: ::Integer) -> void
|
|
1163
1184
|
# @param [Hash] args
|