nl-linux 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/NLSPEC_VERSION +1 -1
  4. data/generated/nl/linux/binder.rb +103 -187
  5. data/generated/nl/linux/conntrack.rb +1053 -1649
  6. data/generated/nl/linux/dev_energymodel.rb +303 -265
  7. data/generated/nl/linux/devlink.rb +4904 -5576
  8. data/generated/nl/linux/dpll.rb +1097 -1467
  9. data/generated/nl/linux/drm_ras.rb +235 -195
  10. data/generated/nl/linux/ethtool.rb +6652 -7415
  11. data/generated/nl/linux/fou.rb +234 -255
  12. data/generated/nl/linux/handshake.rb +208 -280
  13. data/generated/nl/linux/lockd.rb +99 -73
  14. data/generated/nl/linux/mptcp_pm.rb +589 -687
  15. data/generated/nl/linux/net_shaper.rb +520 -615
  16. data/generated/nl/linux/netdev.rb +1640 -1987
  17. data/generated/nl/linux/nfsd.rb +1341 -1215
  18. data/generated/nl/linux/nftables.rb +5143 -4870
  19. data/generated/nl/linux/nl80211.rb +2542 -6316
  20. data/generated/nl/linux/nlctrl.rb +338 -483
  21. data/generated/nl/linux/ovpn.rb +1006 -1522
  22. data/generated/nl/linux/ovs_datapath.rb +291 -186
  23. data/generated/nl/linux/ovs_flow.rb +1393 -2065
  24. data/generated/nl/linux/ovs_packet.rb +186 -223
  25. data/generated/nl/linux/ovs_vport.rb +328 -285
  26. data/generated/nl/linux/psp.rb +812 -717
  27. data/generated/nl/linux/rt_addr.rb +513 -243
  28. data/generated/nl/linux/rt_link.rb +4504 -7238
  29. data/generated/nl/linux/rt_neigh.rb +935 -847
  30. data/generated/nl/linux/rt_route.rb +1198 -871
  31. data/generated/nl/linux/rt_rule.rb +680 -659
  32. data/generated/nl/linux/sunrpc_cache.rb +323 -321
  33. data/generated/nl/linux/tc.rb +9058 -10454
  34. data/generated/nl/linux/tcp_metrics.rb +258 -367
  35. data/generated/nl/linux/team.rb +327 -345
  36. data/generated/nl/linux/wireguard.rb +270 -434
  37. data/lib/nl/linux/nlctrl_resolver.rb +1 -1
  38. data/lib/nl/linux/version.rb +1 -1
  39. data/linux/conntrack.yaml +18 -3
  40. data/linux/devlink.yaml +26 -4
  41. data/linux/dpll.yaml +19 -0
  42. data/linux/netdev.yaml +21 -0
  43. data/linux/nfsd.yaml +111 -0
  44. data/linux/nl80211.yaml +2 -2
  45. data/linux/rt-addr.yaml +4 -0
  46. data/linux/rt-link.yaml +7 -0
  47. data/linux/rt-neigh.yaml +3 -0
  48. data/linux/rt-route.yaml +83 -2
  49. data/sig/generated/nl/linux/binder.rbs +77 -220
  50. data/sig/generated/nl/linux/conntrack.rbs +770 -1954
  51. data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
  52. data/sig/generated/nl/linux/devlink.rbs +3318 -6068
  53. data/sig/generated/nl/linux/dpll.rbs +791 -1589
  54. data/sig/generated/nl/linux/drm_ras.rbs +160 -208
  55. data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
  56. data/sig/generated/nl/linux/fou.rbs +139 -254
  57. data/sig/generated/nl/linux/handshake.rbs +144 -319
  58. data/sig/generated/nl/linux/lockd.rbs +64 -74
  59. data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
  60. data/sig/generated/nl/linux/net_shaper.rbs +351 -644
  61. data/sig/generated/nl/linux/netdev.rbs +1151 -2146
  62. data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
  63. data/sig/generated/nl/linux/nftables.rbs +2907 -5030
  64. data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
  65. data/sig/generated/nl/linux/nlctrl.rbs +220 -544
  66. data/sig/generated/nl/linux/ovpn.rbs +835 -1859
  67. data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
  68. data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
  69. data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
  70. data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
  71. data/sig/generated/nl/linux/psp.rbs +550 -741
  72. data/sig/generated/nl/linux/rt_addr.rbs +188 -226
  73. data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
  74. data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
  75. data/sig/generated/nl/linux/rt_route.rbs +632 -862
  76. data/sig/generated/nl/linux/rt_rule.rbs +217 -639
  77. data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
  78. data/sig/generated/nl/linux/tc.rbs +6199 -13391
  79. data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
  80. data/sig/generated/nl/linux/team.rbs +232 -391
  81. data/sig/generated/nl/linux/wireguard.rbs +197 -502
  82. 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/conntrack.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/conntrack.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 Conntrack < ::Nl::Raw::Family
25
25
  super
26
26
  end
27
27
  # @private
28
- MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
28
+ MCAST_GROUPS = {}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
29
29
  module Enums
30
30
  module NfCtTcpState
31
31
  None = 0
@@ -100,14 +100,30 @@ class Conntrack < ::Nl::Raw::Family
100
100
  # @!attribute [rw] res_id
101
101
  # @return [Integer]
102
102
  # @private
103
- MEMBERS = Ractor.make_shareable({nfgen_family: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), version: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), res_id: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
103
+ MEMBERS = {nfgen_family: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, version: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, res_id: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
104
+ Ractor.make_shareable(MEMBERS) if defined?(Ractor)
105
+ # @private
106
+ # @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
107
+ def self.from_params(params, context: nil)
108
+ unknown = params.keys - members
109
+ raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
110
+ self.new(
111
+ MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0), context:),
112
+ MEMBERS[:"version"].coerce(params.fetch(:"version", 0), context:),
113
+ MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0), context:),
114
+ )
115
+ end
104
116
  # Decodes the struct.
105
117
  # @rbs decoder: ::Nl::Decoder
106
118
  # @rbs return: instance
107
119
  # @param [Nl::Decoder] decoder
108
120
  # @return [self]
109
121
  def self.decode(decoder)
110
- self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
122
+ word = decoder.get_u32
123
+ value_0 = ((word >> 0) & 0xff)
124
+ value_1 = ((word >> 8) & 0xff)
125
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
126
+ self.new(value_0, value_1, value_2)
111
127
  end
112
128
  # Encodes the struct.
113
129
  # @rbs encoder: ::Nl::Encoder
@@ -115,7 +131,9 @@ class Conntrack < ::Nl::Raw::Family
115
131
  # @param [Nl::Encoder] encoder
116
132
  # @return [void]
117
133
  def encode(encoder)
118
- MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
134
+ MEMBERS[:"nfgen_family"].encode(encoder, public_send(:"nfgen_family"))
135
+ MEMBERS[:"version"].encode(encoder, public_send(:"version"))
136
+ MEMBERS[:"res_id"].encode(encoder, public_send(:"res_id"))
119
137
  end
120
138
  end
121
139
  NfCtTcpFlagsMask = Struct.new(
@@ -128,14 +146,28 @@ class Conntrack < ::Nl::Raw::Family
128
146
  # @!attribute [rw] mask
129
147
  # @return [Integer]
130
148
  # @private
131
- MEMBERS = Ractor.make_shareable({flags: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil), mask: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
149
+ MEMBERS = {flags: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, mask: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
150
+ Ractor.make_shareable(MEMBERS) if defined?(Ractor)
151
+ # @private
152
+ # @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
153
+ def self.from_params(params, context: nil)
154
+ unknown = params.keys - members
155
+ raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
156
+ self.new(
157
+ MEMBERS[:"flags"].coerce(params.fetch(:"flags", 0), context:),
158
+ MEMBERS[:"mask"].coerce(params.fetch(:"mask", 0), context:),
159
+ )
160
+ end
132
161
  # Decodes the struct.
133
162
  # @rbs decoder: ::Nl::Decoder
134
163
  # @rbs return: instance
135
164
  # @param [Nl::Decoder] decoder
136
165
  # @return [self]
137
166
  def self.decode(decoder)
138
- self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
167
+ word = decoder.get_u16
168
+ value_0 = ((word >> 0) & 0xff)
169
+ value_1 = ((word >> 8) & 0xff)
170
+ self.new(value_0, value_1)
139
171
  end
140
172
  # Encodes the struct.
141
173
  # @rbs encoder: ::Nl::Encoder
@@ -143,1920 +175,1274 @@ class Conntrack < ::Nl::Raw::Family
143
175
  # @param [Nl::Encoder] encoder
144
176
  # @return [void]
145
177
  def encode(encoder)
146
- MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
178
+ MEMBERS[:"flags"].encode(encoder, public_send(:"flags"))
179
+ MEMBERS[:"mask"].encode(encoder, public_send(:"mask"))
147
180
  end
148
181
  end
149
182
  end
150
183
  module AttributeSets
151
184
  class CounterAttrs < ::Nl::AttributeSet
152
- # Abstract class
153
- class Attribute < ::Nl::AttributeSet::Attribute
154
- end
155
- class Packets < Attribute
156
- TYPE = 1
157
- NAME = :"packets"
158
- # @private
159
- ORDER = 0
160
- # @private
161
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U64, check: nil)
162
- end
163
- class Bytes < Attribute
164
- TYPE = 2
165
- NAME = :"bytes"
166
- # @private
167
- ORDER = 1
168
- # @private
169
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U64, check: nil)
170
- end
171
- class PacketsOld < Attribute
172
- TYPE = 3
173
- NAME = :"packets_old"
174
- # @private
175
- ORDER = 2
176
- # @private
177
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
178
- end
179
- class BytesOld < Attribute
180
- TYPE = 4
181
- NAME = :"bytes_old"
182
- # @private
183
- ORDER = 3
184
- # @private
185
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
186
- end
187
- class Pad < Attribute
188
- TYPE = 5
189
- NAME = :"pad"
190
- # @private
191
- ORDER = 4
192
- # @private
193
- DATATYPE = ::Nl::DataTypes::Pad.new()
194
- end
195
- # @private
196
- BY_NAME = Ractor.make_shareable({:"packets" => Packets, :"bytes" => Bytes, :"packets_old" => PacketsOld, :"bytes_old" => BytesOld, :"pad" => Pad}) #: Hash[::Symbol, Attribute]
197
- # @private
198
- BY_TYPE = Ractor.make_shareable({1 => Packets, 2 => Bytes, 3 => PacketsOld, 4 => BytesOld, 5 => Pad}) #: Hash[::Integer, Attribute]
199
- # @rbs return: ::Integer
200
- # @return [Integer]
201
- # @see Packets
202
- def packets; self[:"packets"]&.value; end
203
- # @rbs return: ::Integer
204
- # @return [Integer]
205
- # @see Bytes
206
- def bytes; self[:"bytes"]&.value; end
207
- # @rbs return: ::Integer
208
- # @return [Integer]
209
- # @see PacketsOld
210
- def packets_old; self[:"packets_old"]&.value; end
211
- # @rbs return: ::Integer
212
- # @return [Integer]
213
- # @see BytesOld
214
- def bytes_old; self[:"bytes_old"]&.value; end
215
- class << self
216
- # Looks up Attribute class by name.
217
- # @rbs name: Symbol
218
- # @rbs return: Attribute
219
- # @param [Symbol] name
220
- # @return [Attribute]
221
- def by_name(name); BY_NAME.fetch(name); end
222
- # Looks up Attribute class by type value.
223
- # @rbs type: Integer
224
- # @rbs return: Attribute
225
- # @param [Integer] type
226
- # @return [Attribute]
227
- def by_type(type); BY_TYPE.fetch(type); end
185
+ module Definitions
186
+ # @rbs return: ::Integer
187
+ # @return [Integer]
188
+ def packets; self[:"packets"]; end
189
+ # @rbs return: ::Integer
190
+ # @return [Integer]
191
+ def bytes; self[:"bytes"]; end
192
+ # @rbs return: ::Integer
193
+ # @return [Integer]
194
+ def packets_old; self[:"packets_old"]; end
195
+ # @rbs return: ::Integer
196
+ # @return [Integer]
197
+ def bytes_old; self[:"bytes_old"]; end
198
+ end
199
+ include Definitions
200
+ # Decodes attributes from the decoder into a new attribute set.
201
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
202
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
203
+ super(decoder, BY_TYPE, 0, external_selectors)
228
204
  end
229
205
  end
230
206
  class TupleProtoAttrs < ::Nl::AttributeSet
231
- # Abstract class
232
- class Attribute < ::Nl::AttributeSet::Attribute
233
- end
234
- # l4 protocol number
235
- class ProtoNum < Attribute
236
- TYPE = 1
237
- NAME = :"proto_num"
238
- # @private
239
- ORDER = 0
240
- # @private
241
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
242
- end
243
- # l4 source port
244
- class ProtoSrcPort < Attribute
245
- TYPE = 2
246
- NAME = :"proto_src_port"
247
- # @private
248
- ORDER = 1
249
- # @private
250
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
251
- end
252
- # l4 source port
253
- class ProtoDstPort < Attribute
254
- TYPE = 3
255
- NAME = :"proto_dst_port"
256
- # @private
257
- ORDER = 2
258
- # @private
259
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
260
- end
261
- # l4 icmp id
262
- class ProtoIcmpId < Attribute
263
- TYPE = 4
264
- NAME = :"proto_icmp_id"
265
- # @private
266
- ORDER = 3
267
- # @private
268
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
269
- end
270
- class ProtoIcmpType < Attribute
271
- TYPE = 5
272
- NAME = :"proto_icmp_type"
273
- # @private
274
- ORDER = 4
275
- # @private
276
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
277
- end
278
- class ProtoIcmpCode < Attribute
279
- TYPE = 6
280
- NAME = :"proto_icmp_code"
281
- # @private
282
- ORDER = 5
283
- # @private
284
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
285
- end
286
- # l4 icmp id
287
- class ProtoIcmpv6Id < Attribute
288
- TYPE = 7
289
- NAME = :"proto_icmpv6_id"
290
- # @private
291
- ORDER = 6
292
- # @private
293
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
294
- end
295
- class ProtoIcmpv6Type < Attribute
296
- TYPE = 8
297
- NAME = :"proto_icmpv6_type"
298
- # @private
299
- ORDER = 7
300
- # @private
301
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
302
- end
303
- class ProtoIcmpv6Code < Attribute
304
- TYPE = 9
305
- NAME = :"proto_icmpv6_code"
306
- # @private
307
- ORDER = 8
308
- # @private
309
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
310
- end
311
- # @private
312
- BY_NAME = Ractor.make_shareable({:"proto_num" => ProtoNum, :"proto_src_port" => ProtoSrcPort, :"proto_dst_port" => ProtoDstPort, :"proto_icmp_id" => ProtoIcmpId, :"proto_icmp_type" => ProtoIcmpType, :"proto_icmp_code" => ProtoIcmpCode, :"proto_icmpv6_id" => ProtoIcmpv6Id, :"proto_icmpv6_type" => ProtoIcmpv6Type, :"proto_icmpv6_code" => ProtoIcmpv6Code}) #: Hash[::Symbol, Attribute]
313
- # @private
314
- BY_TYPE = Ractor.make_shareable({1 => ProtoNum, 2 => ProtoSrcPort, 3 => ProtoDstPort, 4 => ProtoIcmpId, 5 => ProtoIcmpType, 6 => ProtoIcmpCode, 7 => ProtoIcmpv6Id, 8 => ProtoIcmpv6Type, 9 => ProtoIcmpv6Code}) #: Hash[::Integer, Attribute]
315
- # l4 protocol number
316
- # @rbs return: ::Integer
317
- # @return [Integer]
318
- # @see ProtoNum
319
- def proto_num; self[:"proto_num"]&.value; end
320
- # l4 source port
321
- # @rbs return: ::Integer
322
- # @return [Integer]
323
- # @see ProtoSrcPort
324
- def proto_src_port; self[:"proto_src_port"]&.value; end
325
- # l4 source port
326
- # @rbs return: ::Integer
327
- # @return [Integer]
328
- # @see ProtoDstPort
329
- def proto_dst_port; self[:"proto_dst_port"]&.value; end
330
- # l4 icmp id
331
- # @rbs return: ::Integer
332
- # @return [Integer]
333
- # @see ProtoIcmpId
334
- def proto_icmp_id; self[:"proto_icmp_id"]&.value; end
335
- # @rbs return: ::Integer
336
- # @return [Integer]
337
- # @see ProtoIcmpType
338
- def proto_icmp_type; self[:"proto_icmp_type"]&.value; end
339
- # @rbs return: ::Integer
340
- # @return [Integer]
341
- # @see ProtoIcmpCode
342
- def proto_icmp_code; self[:"proto_icmp_code"]&.value; end
343
- # l4 icmp id
344
- # @rbs return: ::Integer
345
- # @return [Integer]
346
- # @see ProtoIcmpv6Id
347
- def proto_icmpv6_id; self[:"proto_icmpv6_id"]&.value; end
348
- # @rbs return: ::Integer
349
- # @return [Integer]
350
- # @see ProtoIcmpv6Type
351
- def proto_icmpv6_type; self[:"proto_icmpv6_type"]&.value; end
352
- # @rbs return: ::Integer
353
- # @return [Integer]
354
- # @see ProtoIcmpv6Code
355
- def proto_icmpv6_code; self[:"proto_icmpv6_code"]&.value; end
356
- class << self
357
- # Looks up Attribute class by name.
358
- # @rbs name: Symbol
359
- # @rbs return: Attribute
360
- # @param [Symbol] name
361
- # @return [Attribute]
362
- def by_name(name); BY_NAME.fetch(name); end
363
- # Looks up Attribute class by type value.
364
- # @rbs type: Integer
365
- # @rbs return: Attribute
366
- # @param [Integer] type
367
- # @return [Attribute]
368
- def by_type(type); BY_TYPE.fetch(type); end
207
+ module Definitions
208
+ # l4 protocol number
209
+ # @rbs return: ::Integer
210
+ # @return [Integer]
211
+ def proto_num; self[:"proto_num"]; end
212
+ # l4 source port
213
+ # @rbs return: ::Integer
214
+ # @return [Integer]
215
+ def proto_src_port; self[:"proto_src_port"]; end
216
+ # l4 source port
217
+ # @rbs return: ::Integer
218
+ # @return [Integer]
219
+ def proto_dst_port; self[:"proto_dst_port"]; end
220
+ # l4 icmp id
221
+ # @rbs return: ::Integer
222
+ # @return [Integer]
223
+ def proto_icmp_id; self[:"proto_icmp_id"]; end
224
+ # @rbs return: ::Integer
225
+ # @return [Integer]
226
+ def proto_icmp_type; self[:"proto_icmp_type"]; end
227
+ # @rbs return: ::Integer
228
+ # @return [Integer]
229
+ def proto_icmp_code; self[:"proto_icmp_code"]; end
230
+ # l4 icmp id
231
+ # @rbs return: ::Integer
232
+ # @return [Integer]
233
+ def proto_icmpv6_id; self[:"proto_icmpv6_id"]; end
234
+ # @rbs return: ::Integer
235
+ # @return [Integer]
236
+ def proto_icmpv6_type; self[:"proto_icmpv6_type"]; end
237
+ # @rbs return: ::Integer
238
+ # @return [Integer]
239
+ def proto_icmpv6_code; self[:"proto_icmpv6_code"]; end
240
+ end
241
+ include Definitions
242
+ # Decodes attributes from the decoder into a new attribute set.
243
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
244
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
245
+ super(decoder, BY_TYPE, 0, external_selectors)
369
246
  end
370
247
  end
371
248
  class TupleIpAttrs < ::Nl::AttributeSet
372
- # Abstract class
373
- class Attribute < ::Nl::AttributeSet::Attribute
374
- end
375
- # ipv4 source address
376
- class IpV4Src < Attribute
377
- TYPE = 1
378
- NAME = :"ip_v4_src"
379
- # @private
380
- ORDER = 0
381
- # @private
382
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
383
- end
384
- # ipv4 destination address
385
- class IpV4Dst < Attribute
386
- TYPE = 2
387
- NAME = :"ip_v4_dst"
388
- # @private
389
- ORDER = 1
390
- # @private
391
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
392
- end
393
- # ipv6 source address
394
- class IpV6Src < Attribute
395
- TYPE = 3
396
- NAME = :"ip_v6_src"
397
- # @private
398
- ORDER = 2
399
- # @private
400
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
401
- end
402
- # ipv6 destination address
403
- class IpV6Dst < Attribute
404
- TYPE = 4
405
- NAME = :"ip_v6_dst"
406
- # @private
407
- ORDER = 3
408
- # @private
409
- DATATYPE = ::Nl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 })
410
- end
411
- # @private
412
- BY_NAME = Ractor.make_shareable({:"ip_v4_src" => IpV4Src, :"ip_v4_dst" => IpV4Dst, :"ip_v6_src" => IpV6Src, :"ip_v6_dst" => IpV6Dst}) #: Hash[::Symbol, Attribute]
413
- # @private
414
- BY_TYPE = Ractor.make_shareable({1 => IpV4Src, 2 => IpV4Dst, 3 => IpV6Src, 4 => IpV6Dst}) #: Hash[::Integer, Attribute]
415
- # ipv4 source address
416
- # @rbs return: ::Integer
417
- # @return [Integer]
418
- # @see IpV4Src
419
- def ip_v4_src; self[:"ip_v4_src"]&.value; end
420
- # ipv4 destination address
421
- # @rbs return: ::Integer
422
- # @return [Integer]
423
- # @see IpV4Dst
424
- def ip_v4_dst; self[:"ip_v4_dst"]&.value; end
425
- # ipv6 source address
426
- # @rbs return: ::String
427
- # @return [String]
428
- # @see IpV6Src
429
- def ip_v6_src; self[:"ip_v6_src"]&.value; end
430
- # ipv6 destination address
431
- # @rbs return: ::String
432
- # @return [String]
433
- # @see IpV6Dst
434
- def ip_v6_dst; self[:"ip_v6_dst"]&.value; end
435
- class << self
436
- # Looks up Attribute class by name.
437
- # @rbs name: Symbol
438
- # @rbs return: Attribute
439
- # @param [Symbol] name
440
- # @return [Attribute]
441
- def by_name(name); BY_NAME.fetch(name); end
442
- # Looks up Attribute class by type value.
443
- # @rbs type: Integer
444
- # @rbs return: Attribute
445
- # @param [Integer] type
446
- # @return [Attribute]
447
- def by_type(type); BY_TYPE.fetch(type); end
448
- end
449
- end
450
- class TupleAttrs < ::Nl::AttributeSet
451
- # Abstract class
452
- class Attribute < ::Nl::AttributeSet::Attribute
453
- end
454
- # conntrack l3 information
455
- class TupleIp < Attribute
456
- TYPE = 1
457
- NAME = :"tuple_ip"
458
- # @private
459
- ORDER = 0
460
- end
461
- # conntrack l4 information
462
- class TupleProto < Attribute
463
- TYPE = 2
464
- NAME = :"tuple_proto"
465
- # @private
466
- ORDER = 1
467
- end
468
- # conntrack zone id
469
- class TupleZone < Attribute
470
- TYPE = 3
471
- NAME = :"tuple_zone"
472
- # @private
473
- ORDER = 2
474
- # @private
475
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
476
- end
477
- # @private
478
- BY_NAME = Ractor.make_shareable({:"tuple_ip" => TupleIp, :"tuple_proto" => TupleProto, :"tuple_zone" => TupleZone}) #: Hash[::Symbol, Attribute]
479
- # @private
480
- BY_TYPE = Ractor.make_shareable({1 => TupleIp, 2 => TupleProto, 3 => TupleZone}) #: Hash[::Integer, Attribute]
481
- # conntrack l3 information
482
- # @rbs return: AttributeSets::TupleIpAttrs
483
- # @return [AttributeSets::TupleIpAttrs]
484
- # @see TupleIp
485
- def tuple_ip; self[:"tuple_ip"]&.value; end
486
- # conntrack l4 information
487
- # @rbs return: AttributeSets::TupleProtoAttrs
488
- # @return [AttributeSets::TupleProtoAttrs]
489
- # @see TupleProto
490
- def tuple_proto; self[:"tuple_proto"]&.value; end
491
- # conntrack zone id
492
- # @rbs return: ::Integer
493
- # @return [Integer]
494
- # @see TupleZone
495
- def tuple_zone; self[:"tuple_zone"]&.value; end
496
- class << self
497
- # Looks up Attribute class by name.
498
- # @rbs name: Symbol
499
- # @rbs return: Attribute
500
- # @param [Symbol] name
501
- # @return [Attribute]
502
- def by_name(name); BY_NAME.fetch(name); end
503
- # Looks up Attribute class by type value.
504
- # @rbs type: Integer
505
- # @rbs return: Attribute
506
- # @param [Integer] type
507
- # @return [Attribute]
508
- def by_type(type); BY_TYPE.fetch(type); end
509
- end
510
- end
511
- class ProtoinfoTcpAttrs < ::Nl::AttributeSet
512
- # Abstract class
513
- class Attribute < ::Nl::AttributeSet::Attribute
514
- end
515
- # tcp connection state
516
- #
517
- # Known enum values are defined in {Enums::NfCtTcpState}.
518
- class TcpState < Attribute
519
- TYPE = 1
520
- NAME = :"tcp_state"
521
- # @private
522
- ORDER = 0
523
- # @private
524
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
525
- end
526
- # window scaling factor in original direction
527
- class TcpWscaleOriginal < Attribute
528
- TYPE = 2
529
- NAME = :"tcp_wscale_original"
530
- # @private
531
- ORDER = 1
532
- # @private
533
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
534
- end
535
- # window scaling factor in reply direction
536
- class TcpWscaleReply < Attribute
537
- TYPE = 3
538
- NAME = :"tcp_wscale_reply"
539
- # @private
540
- ORDER = 2
541
- # @private
542
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
543
- end
544
- class TcpFlagsOriginal < Attribute
545
- TYPE = 4
546
- NAME = :"tcp_flags_original"
547
- # @private
548
- ORDER = 3
549
- # @private
550
- DATATYPE = ::Nl::DataTypes::Struct.new(Structs::NfCtTcpFlagsMask, check: nil, consume_remaining: true)
551
- end
552
- class TcpFlagsReply < Attribute
553
- TYPE = 5
554
- NAME = :"tcp_flags_reply"
555
- # @private
556
- ORDER = 4
557
- # @private
558
- DATATYPE = ::Nl::DataTypes::Struct.new(Structs::NfCtTcpFlagsMask, check: nil, consume_remaining: true)
559
- end
560
- # @private
561
- BY_NAME = Ractor.make_shareable({:"tcp_state" => TcpState, :"tcp_wscale_original" => TcpWscaleOriginal, :"tcp_wscale_reply" => TcpWscaleReply, :"tcp_flags_original" => TcpFlagsOriginal, :"tcp_flags_reply" => TcpFlagsReply}) #: Hash[::Symbol, Attribute]
562
- # @private
563
- BY_TYPE = Ractor.make_shareable({1 => TcpState, 2 => TcpWscaleOriginal, 3 => TcpWscaleReply, 4 => TcpFlagsOriginal, 5 => TcpFlagsReply}) #: Hash[::Integer, Attribute]
564
- # tcp connection state
565
- #
566
- # Known enum values are defined in {Enums::NfCtTcpState}.
567
- # @rbs return: ::Integer
568
- # @return [Integer]
569
- # @see TcpState
570
- def tcp_state; self[:"tcp_state"]&.value; end
571
- # window scaling factor in original direction
572
- # @rbs return: ::Integer
573
- # @return [Integer]
574
- # @see TcpWscaleOriginal
575
- def tcp_wscale_original; self[:"tcp_wscale_original"]&.value; end
576
- # window scaling factor in reply direction
577
- # @rbs return: ::Integer
578
- # @return [Integer]
579
- # @see TcpWscaleReply
580
- def tcp_wscale_reply; self[:"tcp_wscale_reply"]&.value; end
581
- # @rbs return: Structs::NfCtTcpFlagsMask
582
- # @return [Structs::NfCtTcpFlagsMask]
583
- # @see TcpFlagsOriginal
584
- def tcp_flags_original; self[:"tcp_flags_original"]&.value; end
585
- # @rbs return: Structs::NfCtTcpFlagsMask
586
- # @return [Structs::NfCtTcpFlagsMask]
587
- # @see TcpFlagsReply
588
- def tcp_flags_reply; self[:"tcp_flags_reply"]&.value; end
589
- class << self
590
- # Looks up Attribute class by name.
591
- # @rbs name: Symbol
592
- # @rbs return: Attribute
593
- # @param [Symbol] name
594
- # @return [Attribute]
595
- def by_name(name); BY_NAME.fetch(name); end
596
- # Looks up Attribute class by type value.
597
- # @rbs type: Integer
598
- # @rbs return: Attribute
599
- # @param [Integer] type
600
- # @return [Attribute]
601
- def by_type(type); BY_TYPE.fetch(type); end
602
- end
603
- end
604
- class ProtoinfoDccpAttrs < ::Nl::AttributeSet
605
- # Abstract class
606
- class Attribute < ::Nl::AttributeSet::Attribute
607
- end
608
- # dccp connection state
609
- class DccpState < Attribute
610
- TYPE = 1
611
- NAME = :"dccp_state"
612
- # @private
613
- ORDER = 0
614
- # @private
615
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
616
- end
617
- class DccpRole < Attribute
618
- TYPE = 2
619
- NAME = :"dccp_role"
620
- # @private
621
- ORDER = 1
622
- # @private
623
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
624
- end
625
- class DccpHandshakeSeq < Attribute
626
- TYPE = 3
627
- NAME = :"dccp_handshake_seq"
628
- # @private
629
- ORDER = 2
630
- # @private
631
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U64, check: nil)
632
- end
633
- class DccpPad < Attribute
634
- TYPE = 4
635
- NAME = :"dccp_pad"
636
- # @private
637
- ORDER = 3
638
- # @private
639
- DATATYPE = ::Nl::DataTypes::Pad.new()
640
- end
641
- # @private
642
- BY_NAME = Ractor.make_shareable({:"dccp_state" => DccpState, :"dccp_role" => DccpRole, :"dccp_handshake_seq" => DccpHandshakeSeq, :"dccp_pad" => DccpPad}) #: Hash[::Symbol, Attribute]
643
- # @private
644
- BY_TYPE = Ractor.make_shareable({1 => DccpState, 2 => DccpRole, 3 => DccpHandshakeSeq, 4 => DccpPad}) #: Hash[::Integer, Attribute]
645
- # dccp connection state
646
- # @rbs return: ::Integer
647
- # @return [Integer]
648
- # @see DccpState
649
- def dccp_state; self[:"dccp_state"]&.value; end
650
- # @rbs return: ::Integer
651
- # @return [Integer]
652
- # @see DccpRole
653
- def dccp_role; self[:"dccp_role"]&.value; end
654
- # @rbs return: ::Integer
655
- # @return [Integer]
656
- # @see DccpHandshakeSeq
657
- def dccp_handshake_seq; self[:"dccp_handshake_seq"]&.value; end
658
- class << self
659
- # Looks up Attribute class by name.
660
- # @rbs name: Symbol
661
- # @rbs return: Attribute
662
- # @param [Symbol] name
663
- # @return [Attribute]
664
- def by_name(name); BY_NAME.fetch(name); end
665
- # Looks up Attribute class by type value.
666
- # @rbs type: Integer
667
- # @rbs return: Attribute
668
- # @param [Integer] type
669
- # @return [Attribute]
670
- def by_type(type); BY_TYPE.fetch(type); end
671
- end
672
- end
673
- class ProtoinfoSctpAttrs < ::Nl::AttributeSet
674
- # Abstract class
675
- class Attribute < ::Nl::AttributeSet::Attribute
676
- end
677
- # sctp connection state
678
- #
679
- # Known enum values are defined in {Enums::NfCtSctpState}.
680
- class SctpState < Attribute
681
- TYPE = 1
682
- NAME = :"sctp_state"
683
- # @private
684
- ORDER = 0
685
- # @private
686
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
687
- end
688
- class VtagOriginal < Attribute
689
- TYPE = 2
690
- NAME = :"vtag_original"
691
- # @private
692
- ORDER = 1
693
- # @private
694
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
695
- end
696
- class VtagReply < Attribute
697
- TYPE = 3
698
- NAME = :"vtag_reply"
699
- # @private
700
- ORDER = 2
701
- # @private
702
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
703
- end
704
- # @private
705
- BY_NAME = Ractor.make_shareable({:"sctp_state" => SctpState, :"vtag_original" => VtagOriginal, :"vtag_reply" => VtagReply}) #: Hash[::Symbol, Attribute]
706
- # @private
707
- BY_TYPE = Ractor.make_shareable({1 => SctpState, 2 => VtagOriginal, 3 => VtagReply}) #: Hash[::Integer, Attribute]
708
- # sctp connection state
709
- #
710
- # Known enum values are defined in {Enums::NfCtSctpState}.
711
- # @rbs return: ::Integer
712
- # @return [Integer]
713
- # @see SctpState
714
- def sctp_state; self[:"sctp_state"]&.value; end
715
- # @rbs return: ::Integer
716
- # @return [Integer]
717
- # @see VtagOriginal
718
- def vtag_original; self[:"vtag_original"]&.value; end
719
- # @rbs return: ::Integer
720
- # @return [Integer]
721
- # @see VtagReply
722
- def vtag_reply; self[:"vtag_reply"]&.value; end
723
- class << self
724
- # Looks up Attribute class by name.
725
- # @rbs name: Symbol
726
- # @rbs return: Attribute
727
- # @param [Symbol] name
728
- # @return [Attribute]
729
- def by_name(name); BY_NAME.fetch(name); end
730
- # Looks up Attribute class by type value.
731
- # @rbs type: Integer
732
- # @rbs return: Attribute
733
- # @param [Integer] type
734
- # @return [Attribute]
735
- def by_type(type); BY_TYPE.fetch(type); end
736
- end
737
- end
738
- class ProtoinfoAttrs < ::Nl::AttributeSet
739
- # Abstract class
740
- class Attribute < ::Nl::AttributeSet::Attribute
741
- end
742
- # conntrack tcp state information
743
- class ProtoinfoTcp < Attribute
744
- TYPE = 1
745
- NAME = :"protoinfo_tcp"
746
- # @private
747
- ORDER = 0
748
- end
749
- # conntrack dccp state information
750
- class ProtoinfoDccp < Attribute
751
- TYPE = 2
752
- NAME = :"protoinfo_dccp"
753
- # @private
754
- ORDER = 1
755
- end
756
- # conntrack sctp state information
757
- class ProtoinfoSctp < Attribute
758
- TYPE = 3
759
- NAME = :"protoinfo_sctp"
760
- # @private
761
- ORDER = 2
762
- end
763
- # @private
764
- BY_NAME = Ractor.make_shareable({:"protoinfo_tcp" => ProtoinfoTcp, :"protoinfo_dccp" => ProtoinfoDccp, :"protoinfo_sctp" => ProtoinfoSctp}) #: Hash[::Symbol, Attribute]
765
- # @private
766
- BY_TYPE = Ractor.make_shareable({1 => ProtoinfoTcp, 2 => ProtoinfoDccp, 3 => ProtoinfoSctp}) #: Hash[::Integer, Attribute]
767
- # conntrack tcp state information
768
- # @rbs return: AttributeSets::ProtoinfoTcpAttrs
769
- # @return [AttributeSets::ProtoinfoTcpAttrs]
770
- # @see ProtoinfoTcp
771
- def protoinfo_tcp; self[:"protoinfo_tcp"]&.value; end
772
- # conntrack dccp state information
773
- # @rbs return: AttributeSets::ProtoinfoDccpAttrs
774
- # @return [AttributeSets::ProtoinfoDccpAttrs]
775
- # @see ProtoinfoDccp
776
- def protoinfo_dccp; self[:"protoinfo_dccp"]&.value; end
777
- # conntrack sctp state information
778
- # @rbs return: AttributeSets::ProtoinfoSctpAttrs
779
- # @return [AttributeSets::ProtoinfoSctpAttrs]
780
- # @see ProtoinfoSctp
781
- def protoinfo_sctp; self[:"protoinfo_sctp"]&.value; end
782
- class << self
783
- # Looks up Attribute class by name.
784
- # @rbs name: Symbol
785
- # @rbs return: Attribute
786
- # @param [Symbol] name
787
- # @return [Attribute]
788
- def by_name(name); BY_NAME.fetch(name); end
789
- # Looks up Attribute class by type value.
790
- # @rbs type: Integer
791
- # @rbs return: Attribute
792
- # @param [Integer] type
793
- # @return [Attribute]
794
- def by_type(type); BY_TYPE.fetch(type); end
795
- end
796
- end
797
- class HelpAttrs < ::Nl::AttributeSet
798
- # Abstract class
799
- class Attribute < ::Nl::AttributeSet::Attribute
800
- end
801
- # helper name
802
- class HelpName < Attribute
803
- TYPE = 1
804
- NAME = :"help_name"
805
- # @private
806
- ORDER = 0
807
- # @private
808
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
809
- end
810
- # @private
811
- BY_NAME = Ractor.make_shareable({:"help_name" => HelpName}) #: Hash[::Symbol, Attribute]
812
- # @private
813
- BY_TYPE = Ractor.make_shareable({1 => HelpName}) #: Hash[::Integer, Attribute]
814
- # helper name
815
- # @rbs return: ::String
816
- # @return [String]
817
- # @see HelpName
818
- def help_name; self[:"help_name"]&.value; end
819
- class << self
820
- # Looks up Attribute class by name.
821
- # @rbs name: Symbol
822
- # @rbs return: Attribute
823
- # @param [Symbol] name
824
- # @return [Attribute]
825
- def by_name(name); BY_NAME.fetch(name); end
826
- # Looks up Attribute class by type value.
827
- # @rbs type: Integer
828
- # @rbs return: Attribute
829
- # @param [Integer] type
830
- # @return [Attribute]
831
- def by_type(type); BY_TYPE.fetch(type); end
832
- end
833
- end
834
- class NatProtoAttrs < ::Nl::AttributeSet
835
- # Abstract class
836
- class Attribute < ::Nl::AttributeSet::Attribute
837
- end
838
- class NatPortMin < Attribute
839
- TYPE = 1
840
- NAME = :"nat_port_min"
841
- # @private
842
- ORDER = 0
843
- # @private
844
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
845
- end
846
- class NatPortMax < Attribute
847
- TYPE = 2
848
- NAME = :"nat_port_max"
849
- # @private
850
- ORDER = 1
851
- # @private
852
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
853
- end
854
- # @private
855
- BY_NAME = Ractor.make_shareable({:"nat_port_min" => NatPortMin, :"nat_port_max" => NatPortMax}) #: Hash[::Symbol, Attribute]
856
- # @private
857
- BY_TYPE = Ractor.make_shareable({1 => NatPortMin, 2 => NatPortMax}) #: Hash[::Integer, Attribute]
858
- # @rbs return: ::Integer
859
- # @return [Integer]
860
- # @see NatPortMin
861
- def nat_port_min; self[:"nat_port_min"]&.value; end
862
- # @rbs return: ::Integer
863
- # @return [Integer]
864
- # @see NatPortMax
865
- def nat_port_max; self[:"nat_port_max"]&.value; end
866
- class << self
867
- # Looks up Attribute class by name.
868
- # @rbs name: Symbol
869
- # @rbs return: Attribute
870
- # @param [Symbol] name
871
- # @return [Attribute]
872
- def by_name(name); BY_NAME.fetch(name); end
873
- # Looks up Attribute class by type value.
874
- # @rbs type: Integer
875
- # @rbs return: Attribute
876
- # @param [Integer] type
877
- # @return [Attribute]
878
- def by_type(type); BY_TYPE.fetch(type); end
879
- end
880
- end
881
- class NatAttrs < ::Nl::AttributeSet
882
- # Abstract class
883
- class Attribute < ::Nl::AttributeSet::Attribute
884
- end
885
- class NatV4Minip < Attribute
886
- TYPE = 1
887
- NAME = :"nat_v4_minip"
888
- # @private
889
- ORDER = 0
890
- # @private
891
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
892
- end
893
- class NatV4Maxip < Attribute
894
- TYPE = 2
895
- NAME = :"nat_v4_maxip"
896
- # @private
897
- ORDER = 1
898
- # @private
899
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
900
- end
901
- class NatV6Minip < Attribute
902
- TYPE = 3
903
- NAME = :"nat_v6_minip"
904
- # @private
905
- ORDER = 2
906
- # @private
907
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
908
- end
909
- class NatV6Maxip < Attribute
910
- TYPE = 4
911
- NAME = :"nat_v6_maxip"
912
- # @private
913
- ORDER = 3
914
- # @private
915
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
916
- end
917
- class NatProto < Attribute
918
- TYPE = 5
919
- NAME = :"nat_proto"
920
- # @private
921
- ORDER = 4
922
- end
923
- # @private
924
- BY_NAME = Ractor.make_shareable({:"nat_v4_minip" => NatV4Minip, :"nat_v4_maxip" => NatV4Maxip, :"nat_v6_minip" => NatV6Minip, :"nat_v6_maxip" => NatV6Maxip, :"nat_proto" => NatProto}) #: Hash[::Symbol, Attribute]
925
- # @private
926
- BY_TYPE = Ractor.make_shareable({1 => NatV4Minip, 2 => NatV4Maxip, 3 => NatV6Minip, 4 => NatV6Maxip, 5 => NatProto}) #: Hash[::Integer, Attribute]
927
- # @rbs return: ::Integer
928
- # @return [Integer]
929
- # @see NatV4Minip
930
- def nat_v4_minip; self[:"nat_v4_minip"]&.value; end
931
- # @rbs return: ::Integer
932
- # @return [Integer]
933
- # @see NatV4Maxip
934
- def nat_v4_maxip; self[:"nat_v4_maxip"]&.value; end
935
- # @rbs return: ::String
936
- # @return [String]
937
- # @see NatV6Minip
938
- def nat_v6_minip; self[:"nat_v6_minip"]&.value; end
939
- # @rbs return: ::String
940
- # @return [String]
941
- # @see NatV6Maxip
942
- def nat_v6_maxip; self[:"nat_v6_maxip"]&.value; end
943
- # @rbs return: AttributeSets::NatProtoAttrs
944
- # @return [AttributeSets::NatProtoAttrs]
945
- # @see NatProto
946
- def nat_proto; self[:"nat_proto"]&.value; end
947
- class << self
948
- # Looks up Attribute class by name.
949
- # @rbs name: Symbol
950
- # @rbs return: Attribute
951
- # @param [Symbol] name
952
- # @return [Attribute]
953
- def by_name(name); BY_NAME.fetch(name); end
954
- # Looks up Attribute class by type value.
955
- # @rbs type: Integer
956
- # @rbs return: Attribute
957
- # @param [Integer] type
958
- # @return [Attribute]
959
- def by_type(type); BY_TYPE.fetch(type); end
960
- end
961
- end
962
- class SeqadjAttrs < ::Nl::AttributeSet
963
- # Abstract class
964
- class Attribute < ::Nl::AttributeSet::Attribute
965
- end
966
- class CorrectionPos < Attribute
967
- TYPE = 1
968
- NAME = :"correction_pos"
969
- # @private
970
- ORDER = 0
971
- # @private
972
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
973
- end
974
- class OffsetBefore < Attribute
975
- TYPE = 2
976
- NAME = :"offset_before"
977
- # @private
978
- ORDER = 1
979
- # @private
980
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
981
- end
982
- class OffsetAfter < Attribute
983
- TYPE = 3
984
- NAME = :"offset_after"
985
- # @private
986
- ORDER = 2
987
- # @private
988
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
989
- end
990
- # @private
991
- BY_NAME = Ractor.make_shareable({:"correction_pos" => CorrectionPos, :"offset_before" => OffsetBefore, :"offset_after" => OffsetAfter}) #: Hash[::Symbol, Attribute]
992
- # @private
993
- BY_TYPE = Ractor.make_shareable({1 => CorrectionPos, 2 => OffsetBefore, 3 => OffsetAfter}) #: Hash[::Integer, Attribute]
994
- # @rbs return: ::Integer
995
- # @return [Integer]
996
- # @see CorrectionPos
997
- def correction_pos; self[:"correction_pos"]&.value; end
998
- # @rbs return: ::Integer
999
- # @return [Integer]
1000
- # @see OffsetBefore
1001
- def offset_before; self[:"offset_before"]&.value; end
1002
- # @rbs return: ::Integer
1003
- # @return [Integer]
1004
- # @see OffsetAfter
1005
- def offset_after; self[:"offset_after"]&.value; end
1006
- class << self
1007
- # Looks up Attribute class by name.
1008
- # @rbs name: Symbol
1009
- # @rbs return: Attribute
1010
- # @param [Symbol] name
1011
- # @return [Attribute]
1012
- def by_name(name); BY_NAME.fetch(name); end
1013
- # Looks up Attribute class by type value.
1014
- # @rbs type: Integer
1015
- # @rbs return: Attribute
1016
- # @param [Integer] type
1017
- # @return [Attribute]
1018
- def by_type(type); BY_TYPE.fetch(type); end
1019
- end
1020
- end
1021
- class SecctxAttrs < ::Nl::AttributeSet
1022
- # Abstract class
1023
- class Attribute < ::Nl::AttributeSet::Attribute
1024
- end
1025
- class SecctxName < Attribute
1026
- TYPE = 1
1027
- NAME = :"secctx_name"
1028
- # @private
1029
- ORDER = 0
1030
- # @private
1031
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
1032
- end
1033
- # @private
1034
- BY_NAME = Ractor.make_shareable({:"secctx_name" => SecctxName}) #: Hash[::Symbol, Attribute]
1035
- # @private
1036
- BY_TYPE = Ractor.make_shareable({1 => SecctxName}) #: Hash[::Integer, Attribute]
1037
- # @rbs return: ::String
1038
- # @return [String]
1039
- # @see SecctxName
1040
- def secctx_name; self[:"secctx_name"]&.value; end
1041
- class << self
1042
- # Looks up Attribute class by name.
1043
- # @rbs name: Symbol
1044
- # @rbs return: Attribute
1045
- # @param [Symbol] name
1046
- # @return [Attribute]
1047
- def by_name(name); BY_NAME.fetch(name); end
1048
- # Looks up Attribute class by type value.
1049
- # @rbs type: Integer
1050
- # @rbs return: Attribute
1051
- # @param [Integer] type
1052
- # @return [Attribute]
1053
- def by_type(type); BY_TYPE.fetch(type); end
1054
- end
1055
- end
1056
- class SynproxyAttrs < ::Nl::AttributeSet
1057
- # Abstract class
1058
- class Attribute < ::Nl::AttributeSet::Attribute
1059
- end
1060
- class Isn < Attribute
1061
- TYPE = 1
1062
- NAME = :"isn"
1063
- # @private
1064
- ORDER = 0
1065
- # @private
1066
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1067
- end
1068
- class Its < Attribute
1069
- TYPE = 2
1070
- NAME = :"its"
1071
- # @private
1072
- ORDER = 1
1073
- # @private
1074
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1075
- end
1076
- class Tsoff < Attribute
1077
- TYPE = 3
1078
- NAME = :"tsoff"
1079
- # @private
1080
- ORDER = 2
1081
- # @private
1082
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1083
- end
1084
- # @private
1085
- BY_NAME = Ractor.make_shareable({:"isn" => Isn, :"its" => Its, :"tsoff" => Tsoff}) #: Hash[::Symbol, Attribute]
1086
- # @private
1087
- BY_TYPE = Ractor.make_shareable({1 => Isn, 2 => Its, 3 => Tsoff}) #: Hash[::Integer, Attribute]
1088
- # @rbs return: ::Integer
1089
- # @return [Integer]
1090
- # @see Isn
1091
- def isn; self[:"isn"]&.value; end
1092
- # @rbs return: ::Integer
1093
- # @return [Integer]
1094
- # @see Its
1095
- def its; self[:"its"]&.value; end
1096
- # @rbs return: ::Integer
1097
- # @return [Integer]
1098
- # @see Tsoff
1099
- def tsoff; self[:"tsoff"]&.value; end
1100
- class << self
1101
- # Looks up Attribute class by name.
1102
- # @rbs name: Symbol
1103
- # @rbs return: Attribute
1104
- # @param [Symbol] name
1105
- # @return [Attribute]
1106
- def by_name(name); BY_NAME.fetch(name); end
1107
- # Looks up Attribute class by type value.
1108
- # @rbs type: Integer
1109
- # @rbs return: Attribute
1110
- # @param [Integer] type
1111
- # @return [Attribute]
1112
- def by_type(type); BY_TYPE.fetch(type); end
1113
- end
1114
- end
1115
- class ConntrackAttrs < ::Nl::AttributeSet
1116
- # Abstract class
1117
- class Attribute < ::Nl::AttributeSet::Attribute
1118
- end
1119
- # conntrack l3+l4 protocol information, original direction
1120
- class TupleOrig < Attribute
1121
- TYPE = 1
1122
- NAME = :"tuple_orig"
1123
- # @private
1124
- ORDER = 0
1125
- end
1126
- # conntrack l3+l4 protocol information, reply direction
1127
- class TupleReply < Attribute
1128
- TYPE = 2
1129
- NAME = :"tuple_reply"
1130
- # @private
1131
- ORDER = 1
1132
- end
1133
- # conntrack flag bits
1134
- #
1135
- # Known flags are defined in {Flags::NfCtStatus}.
1136
- class Status < Attribute
1137
- TYPE = 3
1138
- NAME = :"status"
1139
- # @private
1140
- ORDER = 2
1141
- # @private
1142
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1143
- end
1144
- class Protoinfo < Attribute
1145
- TYPE = 4
1146
- NAME = :"protoinfo"
1147
- # @private
1148
- ORDER = 3
1149
- end
1150
- class Help < Attribute
1151
- TYPE = 5
1152
- NAME = :"help"
1153
- # @private
1154
- ORDER = 4
1155
- end
1156
- class NatSrc < Attribute
1157
- TYPE = 6
1158
- NAME = :"nat_src"
1159
- # @private
1160
- ORDER = 5
1161
- end
1162
- class Timeout < Attribute
1163
- TYPE = 7
1164
- NAME = :"timeout"
1165
- # @private
1166
- ORDER = 6
1167
- # @private
1168
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1169
- end
1170
- class Mark < Attribute
1171
- TYPE = 8
1172
- NAME = :"mark"
1173
- # @private
1174
- ORDER = 7
1175
- # @private
1176
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1177
- end
1178
- class CountersOrig < Attribute
1179
- TYPE = 9
1180
- NAME = :"counters_orig"
1181
- # @private
1182
- ORDER = 8
1183
- end
1184
- class CountersReply < Attribute
1185
- TYPE = 10
1186
- NAME = :"counters_reply"
1187
- # @private
1188
- ORDER = 9
1189
- end
1190
- class Use < Attribute
1191
- TYPE = 11
1192
- NAME = :"use"
1193
- # @private
1194
- ORDER = 10
1195
- # @private
1196
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1197
- end
1198
- class Id < Attribute
1199
- TYPE = 12
1200
- NAME = :"id"
1201
- # @private
1202
- ORDER = 11
1203
- # @private
1204
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
1205
- end
1206
- class NatDst < Attribute
1207
- TYPE = 13
1208
- NAME = :"nat_dst"
1209
- # @private
1210
- ORDER = 12
1211
- end
1212
- class TupleMaster < Attribute
1213
- TYPE = 14
1214
- NAME = :"tuple_master"
1215
- # @private
1216
- ORDER = 13
249
+ module Definitions
250
+ # ipv4 source address
251
+ # @rbs return: ::Integer
252
+ # @return [Integer]
253
+ def ip_v4_src; self[:"ip_v4_src"]; end
254
+ # ipv4 destination address
255
+ # @rbs return: ::Integer
256
+ # @return [Integer]
257
+ def ip_v4_dst; self[:"ip_v4_dst"]; end
258
+ # ipv6 source address
259
+ # @rbs return: ::String
260
+ # @return [String]
261
+ def ip_v6_src; self[:"ip_v6_src"]; end
262
+ # ipv6 destination address
263
+ # @rbs return: ::String
264
+ # @return [String]
265
+ def ip_v6_dst; self[:"ip_v6_dst"]; end
266
+ end
267
+ include Definitions
268
+ # Decodes attributes from the decoder into a new attribute set.
269
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
270
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
271
+ super(decoder, BY_TYPE, 0, external_selectors)
1217
272
  end
1218
- class SeqAdjOrig < Attribute
1219
- TYPE = 15
1220
- NAME = :"seq_adj_orig"
1221
- # @private
1222
- ORDER = 14
273
+ end
274
+ class TupleAttrs < ::Nl::AttributeSet
275
+ module Definitions
276
+ # conntrack l3 information
277
+ # @rbs return: AttributeSets::TupleIpAttrs
278
+ # @return [AttributeSets::TupleIpAttrs]
279
+ def tuple_ip; self[:"tuple_ip"]; end
280
+ # conntrack l4 information
281
+ # @rbs return: AttributeSets::TupleProtoAttrs
282
+ # @return [AttributeSets::TupleProtoAttrs]
283
+ def tuple_proto; self[:"tuple_proto"]; end
284
+ # conntrack zone id
285
+ # @rbs return: ::Integer
286
+ # @return [Integer]
287
+ def tuple_zone; self[:"tuple_zone"]; end
288
+ end
289
+ include Definitions
290
+ # Decodes attributes from the decoder into a new attribute set.
291
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
292
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
293
+ super(decoder, BY_TYPE, 0, external_selectors)
1223
294
  end
1224
- class SeqAdjReply < Attribute
1225
- TYPE = 16
1226
- NAME = :"seq_adj_reply"
1227
- # @private
1228
- ORDER = 15
295
+ end
296
+ class ProtoinfoTcpAttrs < ::Nl::AttributeSet
297
+ module Definitions
298
+ # tcp connection state
299
+ #
300
+ # Known enum values are defined in {Enums::NfCtTcpState}.
301
+ # @rbs return: ::Integer
302
+ # @return [Integer]
303
+ def tcp_state; self[:"tcp_state"]; end
304
+ # window scaling factor in original direction
305
+ # @rbs return: ::Integer
306
+ # @return [Integer]
307
+ def tcp_wscale_original; self[:"tcp_wscale_original"]; end
308
+ # window scaling factor in reply direction
309
+ # @rbs return: ::Integer
310
+ # @return [Integer]
311
+ def tcp_wscale_reply; self[:"tcp_wscale_reply"]; end
312
+ # @rbs return: Structs::NfCtTcpFlagsMask
313
+ # @return [Structs::NfCtTcpFlagsMask]
314
+ def tcp_flags_original; self[:"tcp_flags_original"]; end
315
+ # @rbs return: Structs::NfCtTcpFlagsMask
316
+ # @return [Structs::NfCtTcpFlagsMask]
317
+ def tcp_flags_reply; self[:"tcp_flags_reply"]; end
318
+ end
319
+ include Definitions
320
+ # Decodes attributes from the decoder into a new attribute set.
321
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
322
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
323
+ super(decoder, BY_TYPE, 0, external_selectors)
1229
324
  end
1230
- # obsolete
1231
- class Secmark < Attribute
1232
- TYPE = 17
1233
- NAME = :"secmark"
1234
- # @private
1235
- ORDER = 16
1236
- # @private
1237
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
325
+ end
326
+ class ProtoinfoDccpAttrs < ::Nl::AttributeSet
327
+ module Definitions
328
+ # dccp connection state
329
+ # @rbs return: ::Integer
330
+ # @return [Integer]
331
+ def dccp_state; self[:"dccp_state"]; end
332
+ # @rbs return: ::Integer
333
+ # @return [Integer]
334
+ def dccp_role; self[:"dccp_role"]; end
335
+ # @rbs return: ::Integer
336
+ # @return [Integer]
337
+ def dccp_handshake_seq; self[:"dccp_handshake_seq"]; end
338
+ end
339
+ include Definitions
340
+ # Decodes attributes from the decoder into a new attribute set.
341
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
342
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
343
+ super(decoder, BY_TYPE, 0, external_selectors)
1238
344
  end
1239
- # conntrack zone id
1240
- class Zone < Attribute
1241
- TYPE = 18
1242
- NAME = :"zone"
1243
- # @private
1244
- ORDER = 17
1245
- # @private
1246
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
345
+ end
346
+ class ProtoinfoSctpAttrs < ::Nl::AttributeSet
347
+ module Definitions
348
+ # sctp connection state
349
+ #
350
+ # Known enum values are defined in {Enums::NfCtSctpState}.
351
+ # @rbs return: ::Integer
352
+ # @return [Integer]
353
+ def sctp_state; self[:"sctp_state"]; end
354
+ # @rbs return: ::Integer
355
+ # @return [Integer]
356
+ def vtag_original; self[:"vtag_original"]; end
357
+ # @rbs return: ::Integer
358
+ # @return [Integer]
359
+ def vtag_reply; self[:"vtag_reply"]; end
360
+ end
361
+ include Definitions
362
+ # Decodes attributes from the decoder into a new attribute set.
363
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
364
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
365
+ super(decoder, BY_TYPE, 0, external_selectors)
1247
366
  end
1248
- class Secctx < Attribute
1249
- TYPE = 19
1250
- NAME = :"secctx"
1251
- # @private
1252
- ORDER = 18
367
+ end
368
+ class ProtoinfoAttrs < ::Nl::AttributeSet
369
+ module Definitions
370
+ # conntrack tcp state information
371
+ # @rbs return: AttributeSets::ProtoinfoTcpAttrs
372
+ # @return [AttributeSets::ProtoinfoTcpAttrs]
373
+ def protoinfo_tcp; self[:"protoinfo_tcp"]; end
374
+ # conntrack dccp state information
375
+ # @rbs return: AttributeSets::ProtoinfoDccpAttrs
376
+ # @return [AttributeSets::ProtoinfoDccpAttrs]
377
+ def protoinfo_dccp; self[:"protoinfo_dccp"]; end
378
+ # conntrack sctp state information
379
+ # @rbs return: AttributeSets::ProtoinfoSctpAttrs
380
+ # @return [AttributeSets::ProtoinfoSctpAttrs]
381
+ def protoinfo_sctp; self[:"protoinfo_sctp"]; end
382
+ end
383
+ include Definitions
384
+ # Decodes attributes from the decoder into a new attribute set.
385
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
386
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
387
+ super(decoder, BY_TYPE, 0, external_selectors)
1253
388
  end
1254
- class Timestamp < Attribute
1255
- TYPE = 20
1256
- NAME = :"timestamp"
1257
- # @private
1258
- ORDER = 19
1259
- # @private
1260
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U64, check: nil)
389
+ end
390
+ class HelpAttrs < ::Nl::AttributeSet
391
+ module Definitions
392
+ # helper name
393
+ # @rbs return: ::String
394
+ # @return [String]
395
+ def help_name; self[:"help_name"]; end
396
+ end
397
+ include Definitions
398
+ # Decodes attributes from the decoder into a new attribute set.
399
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
400
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
401
+ super(decoder, BY_TYPE, 0, external_selectors)
1261
402
  end
1262
- class MarkMask < Attribute
1263
- TYPE = 21
1264
- NAME = :"mark_mask"
1265
- # @private
1266
- ORDER = 20
1267
- # @private
1268
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
403
+ end
404
+ class NatProtoAttrs < ::Nl::AttributeSet
405
+ module Definitions
406
+ # @rbs return: ::Integer
407
+ # @return [Integer]
408
+ def nat_port_min; self[:"nat_port_min"]; end
409
+ # @rbs return: ::Integer
410
+ # @return [Integer]
411
+ def nat_port_max; self[:"nat_port_max"]; end
412
+ end
413
+ include Definitions
414
+ # Decodes attributes from the decoder into a new attribute set.
415
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
416
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
417
+ super(decoder, BY_TYPE, 0, external_selectors)
1269
418
  end
1270
- class Labels < Attribute
1271
- TYPE = 22
1272
- NAME = :"labels"
1273
- # @private
1274
- ORDER = 21
1275
- # @private
1276
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
419
+ end
420
+ class NatAttrs < ::Nl::AttributeSet
421
+ module Definitions
422
+ # @rbs return: ::Integer
423
+ # @return [Integer]
424
+ def nat_v4_minip; self[:"nat_v4_minip"]; end
425
+ # @rbs return: ::Integer
426
+ # @return [Integer]
427
+ def nat_v4_maxip; self[:"nat_v4_maxip"]; end
428
+ # @rbs return: ::String
429
+ # @return [String]
430
+ def nat_v6_minip; self[:"nat_v6_minip"]; end
431
+ # @rbs return: ::String
432
+ # @return [String]
433
+ def nat_v6_maxip; self[:"nat_v6_maxip"]; end
434
+ # @rbs return: AttributeSets::NatProtoAttrs
435
+ # @return [AttributeSets::NatProtoAttrs]
436
+ def nat_proto; self[:"nat_proto"]; end
437
+ end
438
+ include Definitions
439
+ # Decodes attributes from the decoder into a new attribute set.
440
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
441
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
442
+ super(decoder, BY_TYPE, 0, external_selectors)
1277
443
  end
1278
- class LabelsMask < Attribute
1279
- TYPE = 23
1280
- NAME = :"labels_mask"
1281
- # @private
1282
- ORDER = 22
1283
- # @private
1284
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
444
+ end
445
+ class SeqadjAttrs < ::Nl::AttributeSet
446
+ module Definitions
447
+ # @rbs return: ::Integer
448
+ # @return [Integer]
449
+ def correction_pos; self[:"correction_pos"]; end
450
+ # @rbs return: ::Integer
451
+ # @return [Integer]
452
+ def offset_before; self[:"offset_before"]; end
453
+ # @rbs return: ::Integer
454
+ # @return [Integer]
455
+ def offset_after; self[:"offset_after"]; end
456
+ end
457
+ include Definitions
458
+ # Decodes attributes from the decoder into a new attribute set.
459
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
460
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
461
+ super(decoder, BY_TYPE, 0, external_selectors)
1285
462
  end
1286
- class Synproxy < Attribute
1287
- TYPE = 24
1288
- NAME = :"synproxy"
1289
- # @private
1290
- ORDER = 23
463
+ end
464
+ class SecctxAttrs < ::Nl::AttributeSet
465
+ module Definitions
466
+ # @rbs return: ::String
467
+ # @return [String]
468
+ def secctx_name; self[:"secctx_name"]; end
1291
469
  end
1292
- class Filter < Attribute
1293
- TYPE = 25
1294
- NAME = :"filter"
1295
- # @private
1296
- ORDER = 24
470
+ include Definitions
471
+ # Decodes attributes from the decoder into a new attribute set.
472
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
473
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
474
+ super(decoder, BY_TYPE, 0, external_selectors)
1297
475
  end
1298
- # conntrack flag bits to change
1299
- #
1300
- # Known flags are defined in {Flags::NfCtStatus}.
1301
- class StatusMask < Attribute
1302
- TYPE = 26
1303
- NAME = :"status_mask"
1304
- # @private
1305
- ORDER = 25
1306
- # @private
1307
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
476
+ end
477
+ class SynproxyAttrs < ::Nl::AttributeSet
478
+ module Definitions
479
+ # @rbs return: ::Integer
480
+ # @return [Integer]
481
+ def isn; self[:"isn"]; end
482
+ # @rbs return: ::Integer
483
+ # @return [Integer]
484
+ def its; self[:"its"]; end
485
+ # @rbs return: ::Integer
486
+ # @return [Integer]
487
+ def tsoff; self[:"tsoff"]; end
488
+ end
489
+ include Definitions
490
+ # Decodes attributes from the decoder into a new attribute set.
491
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
492
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
493
+ super(decoder, BY_TYPE, 0, external_selectors)
1308
494
  end
1309
- class TimestampEvent < Attribute
1310
- TYPE = 27
1311
- NAME = :"timestamp_event"
1312
- # @private
1313
- ORDER = 26
1314
- # @private
1315
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U64, check: nil)
495
+ end
496
+ class FilterAttrs < ::Nl::AttributeSet
497
+ module Definitions
498
+ # bitmask of tuple fields to filter on, original direction
499
+ # @rbs return: ::Integer
500
+ # @return [Integer]
501
+ def orig_flags; self[:"orig_flags"]; end
502
+ # bitmask of tuple fields to filter on, reply direction
503
+ # @rbs return: ::Integer
504
+ # @return [Integer]
505
+ def reply_flags; self[:"reply_flags"]; end
506
+ end
507
+ include Definitions
508
+ # Decodes attributes from the decoder into a new attribute set.
509
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
510
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
511
+ super(decoder, BY_TYPE, 0, external_selectors)
1316
512
  end
1317
- # @private
1318
- BY_NAME = Ractor.make_shareable({:"tuple_orig" => TupleOrig, :"tuple_reply" => TupleReply, :"status" => Status, :"protoinfo" => Protoinfo, :"help" => Help, :"nat_src" => NatSrc, :"timeout" => Timeout, :"mark" => Mark, :"counters_orig" => CountersOrig, :"counters_reply" => CountersReply, :"use" => Use, :"id" => Id, :"nat_dst" => NatDst, :"tuple_master" => TupleMaster, :"seq_adj_orig" => SeqAdjOrig, :"seq_adj_reply" => SeqAdjReply, :"secmark" => Secmark, :"zone" => Zone, :"secctx" => Secctx, :"timestamp" => Timestamp, :"mark_mask" => MarkMask, :"labels" => Labels, :"labels_mask" => LabelsMask, :"synproxy" => Synproxy, :"filter" => Filter, :"status_mask" => StatusMask, :"timestamp_event" => TimestampEvent}) #: Hash[::Symbol, Attribute]
1319
- # @private
1320
- BY_TYPE = Ractor.make_shareable({1 => TupleOrig, 2 => TupleReply, 3 => Status, 4 => Protoinfo, 5 => Help, 6 => NatSrc, 7 => Timeout, 8 => Mark, 9 => CountersOrig, 10 => CountersReply, 11 => Use, 12 => Id, 13 => NatDst, 14 => TupleMaster, 15 => SeqAdjOrig, 16 => SeqAdjReply, 17 => Secmark, 18 => Zone, 19 => Secctx, 20 => Timestamp, 21 => MarkMask, 22 => Labels, 23 => LabelsMask, 24 => Synproxy, 25 => Filter, 26 => StatusMask, 27 => TimestampEvent}) #: Hash[::Integer, Attribute]
1321
- # conntrack l3+l4 protocol information, original direction
1322
- # @rbs return: AttributeSets::TupleAttrs
1323
- # @return [AttributeSets::TupleAttrs]
1324
- # @see TupleOrig
1325
- def tuple_orig; self[:"tuple_orig"]&.value; end
1326
- # conntrack l3+l4 protocol information, reply direction
1327
- # @rbs return: AttributeSets::TupleAttrs
1328
- # @return [AttributeSets::TupleAttrs]
1329
- # @see TupleReply
1330
- def tuple_reply; self[:"tuple_reply"]&.value; end
1331
- # conntrack flag bits
1332
- #
1333
- # Known flags are defined in {Flags::NfCtStatus}.
1334
- # @rbs return: ::Integer
1335
- # @return [Integer]
1336
- # @see Status
1337
- def status; self[:"status"]&.value; end
1338
- # @rbs return: AttributeSets::ProtoinfoAttrs
1339
- # @return [AttributeSets::ProtoinfoAttrs]
1340
- # @see Protoinfo
1341
- def protoinfo; self[:"protoinfo"]&.value; end
1342
- # @rbs return: AttributeSets::HelpAttrs
1343
- # @return [AttributeSets::HelpAttrs]
1344
- # @see Help
1345
- def help; self[:"help"]&.value; end
1346
- # @rbs return: AttributeSets::NatAttrs
1347
- # @return [AttributeSets::NatAttrs]
1348
- # @see NatSrc
1349
- def nat_src; self[:"nat_src"]&.value; end
1350
- # @rbs return: ::Integer
1351
- # @return [Integer]
1352
- # @see Timeout
1353
- def timeout; self[:"timeout"]&.value; end
1354
- # @rbs return: ::Integer
1355
- # @return [Integer]
1356
- # @see Mark
1357
- def mark; self[:"mark"]&.value; end
1358
- # @rbs return: AttributeSets::CounterAttrs
1359
- # @return [AttributeSets::CounterAttrs]
1360
- # @see CountersOrig
1361
- def counters_orig; self[:"counters_orig"]&.value; end
1362
- # @rbs return: AttributeSets::CounterAttrs
1363
- # @return [AttributeSets::CounterAttrs]
1364
- # @see CountersReply
1365
- def counters_reply; self[:"counters_reply"]&.value; end
1366
- # @rbs return: ::Integer
1367
- # @return [Integer]
1368
- # @see Use
1369
- def use; self[:"use"]&.value; end
1370
- # @rbs return: ::Integer
1371
- # @return [Integer]
1372
- # @see Id
1373
- def id; self[:"id"]&.value; end
1374
- # @rbs return: AttributeSets::NatAttrs
1375
- # @return [AttributeSets::NatAttrs]
1376
- # @see NatDst
1377
- def nat_dst; self[:"nat_dst"]&.value; end
1378
- # @rbs return: AttributeSets::TupleAttrs
1379
- # @return [AttributeSets::TupleAttrs]
1380
- # @see TupleMaster
1381
- def tuple_master; self[:"tuple_master"]&.value; end
1382
- # @rbs return: AttributeSets::SeqadjAttrs
1383
- # @return [AttributeSets::SeqadjAttrs]
1384
- # @see SeqAdjOrig
1385
- def seq_adj_orig; self[:"seq_adj_orig"]&.value; end
1386
- # @rbs return: AttributeSets::SeqadjAttrs
1387
- # @return [AttributeSets::SeqadjAttrs]
1388
- # @see SeqAdjReply
1389
- def seq_adj_reply; self[:"seq_adj_reply"]&.value; end
1390
- # obsolete
1391
- # @rbs return: ::String
1392
- # @return [String]
1393
- # @see Secmark
1394
- def secmark; self[:"secmark"]&.value; end
1395
- # conntrack zone id
1396
- # @rbs return: ::Integer
1397
- # @return [Integer]
1398
- # @see Zone
1399
- def zone; self[:"zone"]&.value; end
1400
- # @rbs return: AttributeSets::SecctxAttrs
1401
- # @return [AttributeSets::SecctxAttrs]
1402
- # @see Secctx
1403
- def secctx; self[:"secctx"]&.value; end
1404
- # @rbs return: ::Integer
1405
- # @return [Integer]
1406
- # @see Timestamp
1407
- def timestamp; self[:"timestamp"]&.value; end
1408
- # @rbs return: ::Integer
1409
- # @return [Integer]
1410
- # @see MarkMask
1411
- def mark_mask; self[:"mark_mask"]&.value; end
1412
- # @rbs return: ::String
1413
- # @return [String]
1414
- # @see Labels
1415
- def labels; self[:"labels"]&.value; end
1416
- # @rbs return: ::String
1417
- # @return [String]
1418
- # @see LabelsMask
1419
- def labels_mask; self[:"labels_mask"]&.value; end
1420
- # @rbs return: AttributeSets::SynproxyAttrs
1421
- # @return [AttributeSets::SynproxyAttrs]
1422
- # @see Synproxy
1423
- def synproxy; self[:"synproxy"]&.value; end
1424
- # @rbs return: AttributeSets::TupleAttrs
1425
- # @return [AttributeSets::TupleAttrs]
1426
- # @see Filter
1427
- def filter; self[:"filter"]&.value; end
1428
- # conntrack flag bits to change
1429
- #
1430
- # Known flags are defined in {Flags::NfCtStatus}.
1431
- # @rbs return: ::Integer
1432
- # @return [Integer]
1433
- # @see StatusMask
1434
- def status_mask; self[:"status_mask"]&.value; end
1435
- # @rbs return: ::Integer
1436
- # @return [Integer]
1437
- # @see TimestampEvent
1438
- def timestamp_event; self[:"timestamp_event"]&.value; end
1439
- class << self
1440
- # Looks up Attribute class by name.
1441
- # @rbs name: Symbol
1442
- # @rbs return: Attribute
1443
- # @param [Symbol] name
1444
- # @return [Attribute]
1445
- def by_name(name); BY_NAME.fetch(name); end
1446
- # Looks up Attribute class by type value.
1447
- # @rbs type: Integer
1448
- # @rbs return: Attribute
1449
- # @param [Integer] type
1450
- # @return [Attribute]
1451
- def by_type(type); BY_TYPE.fetch(type); end
513
+ end
514
+ class ConntrackAttrs < ::Nl::AttributeSet
515
+ module Definitions
516
+ # conntrack l3+l4 protocol information, original direction
517
+ # @rbs return: AttributeSets::TupleAttrs
518
+ # @return [AttributeSets::TupleAttrs]
519
+ def tuple_orig; self[:"tuple_orig"]; end
520
+ # conntrack l3+l4 protocol information, reply direction
521
+ # @rbs return: AttributeSets::TupleAttrs
522
+ # @return [AttributeSets::TupleAttrs]
523
+ def tuple_reply; self[:"tuple_reply"]; end
524
+ # conntrack flag bits
525
+ #
526
+ # Known flags are defined in {Flags::NfCtStatus}.
527
+ # @rbs return: ::Integer
528
+ # @return [Integer]
529
+ def status; self[:"status"]; end
530
+ # @rbs return: AttributeSets::ProtoinfoAttrs
531
+ # @return [AttributeSets::ProtoinfoAttrs]
532
+ def protoinfo; self[:"protoinfo"]; end
533
+ # @rbs return: AttributeSets::HelpAttrs
534
+ # @return [AttributeSets::HelpAttrs]
535
+ def help; self[:"help"]; end
536
+ # @rbs return: AttributeSets::NatAttrs
537
+ # @return [AttributeSets::NatAttrs]
538
+ def nat_src; self[:"nat_src"]; end
539
+ # @rbs return: ::Integer
540
+ # @return [Integer]
541
+ def timeout; self[:"timeout"]; end
542
+ # @rbs return: ::Integer
543
+ # @return [Integer]
544
+ def mark; self[:"mark"]; end
545
+ # @rbs return: AttributeSets::CounterAttrs
546
+ # @return [AttributeSets::CounterAttrs]
547
+ def counters_orig; self[:"counters_orig"]; end
548
+ # @rbs return: AttributeSets::CounterAttrs
549
+ # @return [AttributeSets::CounterAttrs]
550
+ def counters_reply; self[:"counters_reply"]; end
551
+ # @rbs return: ::Integer
552
+ # @return [Integer]
553
+ def use; self[:"use"]; end
554
+ # @rbs return: ::Integer
555
+ # @return [Integer]
556
+ def id; self[:"id"]; end
557
+ # @rbs return: AttributeSets::NatAttrs
558
+ # @return [AttributeSets::NatAttrs]
559
+ def nat_dst; self[:"nat_dst"]; end
560
+ # @rbs return: AttributeSets::TupleAttrs
561
+ # @return [AttributeSets::TupleAttrs]
562
+ def tuple_master; self[:"tuple_master"]; end
563
+ # @rbs return: AttributeSets::SeqadjAttrs
564
+ # @return [AttributeSets::SeqadjAttrs]
565
+ def seq_adj_orig; self[:"seq_adj_orig"]; end
566
+ # @rbs return: AttributeSets::SeqadjAttrs
567
+ # @return [AttributeSets::SeqadjAttrs]
568
+ def seq_adj_reply; self[:"seq_adj_reply"]; end
569
+ # obsolete
570
+ # @rbs return: ::String
571
+ # @return [String]
572
+ def secmark; self[:"secmark"]; end
573
+ # conntrack zone id
574
+ # @rbs return: ::Integer
575
+ # @return [Integer]
576
+ def zone; self[:"zone"]; end
577
+ # @rbs return: AttributeSets::SecctxAttrs
578
+ # @return [AttributeSets::SecctxAttrs]
579
+ def secctx; self[:"secctx"]; end
580
+ # @rbs return: ::Integer
581
+ # @return [Integer]
582
+ def timestamp; self[:"timestamp"]; end
583
+ # @rbs return: ::Integer
584
+ # @return [Integer]
585
+ def mark_mask; self[:"mark_mask"]; end
586
+ # @rbs return: ::String
587
+ # @return [String]
588
+ def labels; self[:"labels"]; end
589
+ # @rbs return: ::String
590
+ # @return [String]
591
+ def labels_mask; self[:"labels_mask"]; end
592
+ # @rbs return: AttributeSets::SynproxyAttrs
593
+ # @return [AttributeSets::SynproxyAttrs]
594
+ def synproxy; self[:"synproxy"]; end
595
+ # @rbs return: AttributeSets::FilterAttrs
596
+ # @return [AttributeSets::FilterAttrs]
597
+ def filter; self[:"filter"]; end
598
+ # conntrack flag bits to change
599
+ #
600
+ # Known flags are defined in {Flags::NfCtStatus}.
601
+ # @rbs return: ::Integer
602
+ # @return [Integer]
603
+ def status_mask; self[:"status_mask"]; end
604
+ # @rbs return: ::Integer
605
+ # @return [Integer]
606
+ def timestamp_event; self[:"timestamp_event"]; end
607
+ end
608
+ include Definitions
609
+ # Decodes attributes from the decoder into a new attribute set.
610
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
611
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
612
+ super(decoder, BY_TYPE, 0, external_selectors)
1452
613
  end
1453
614
  end
1454
615
  class ConntrackStatsAttrs < ::Nl::AttributeSet
1455
- # Abstract class
1456
- class Attribute < ::Nl::AttributeSet::Attribute
616
+ module Definitions
617
+ # obsolete
618
+ # @rbs return: ::Integer
619
+ # @return [Integer]
620
+ def searched; self[:"searched"]; end
621
+ # @rbs return: ::Integer
622
+ # @return [Integer]
623
+ def found; self[:"found"]; end
624
+ # obsolete
625
+ # @rbs return: ::Integer
626
+ # @return [Integer]
627
+ def new; self[:"new"]; end
628
+ # obsolete
629
+ # @rbs return: ::Integer
630
+ # @return [Integer]
631
+ def invalid; self[:"invalid"]; end
632
+ # obsolete
633
+ # @rbs return: ::Integer
634
+ # @return [Integer]
635
+ def ignore; self[:"ignore"]; end
636
+ # obsolete
637
+ # @rbs return: ::Integer
638
+ # @return [Integer]
639
+ def delete; self[:"delete"]; end
640
+ # obsolete
641
+ # @rbs return: ::Integer
642
+ # @return [Integer]
643
+ def delete_list; self[:"delete_list"]; end
644
+ # @rbs return: ::Integer
645
+ # @return [Integer]
646
+ def insert; self[:"insert"]; end
647
+ # @rbs return: ::Integer
648
+ # @return [Integer]
649
+ def insert_failed; self[:"insert_failed"]; end
650
+ # @rbs return: ::Integer
651
+ # @return [Integer]
652
+ def drop; self[:"drop"]; end
653
+ # @rbs return: ::Integer
654
+ # @return [Integer]
655
+ def early_drop; self[:"early_drop"]; end
656
+ # @rbs return: ::Integer
657
+ # @return [Integer]
658
+ def error; self[:"error"]; end
659
+ # @rbs return: ::Integer
660
+ # @return [Integer]
661
+ def search_restart; self[:"search_restart"]; end
662
+ # @rbs return: ::Integer
663
+ # @return [Integer]
664
+ def clash_resolve; self[:"clash_resolve"]; end
665
+ # @rbs return: ::Integer
666
+ # @return [Integer]
667
+ def chain_toolong; self[:"chain_toolong"]; end
668
+ end
669
+ include Definitions
670
+ # Decodes attributes from the decoder into a new attribute set.
671
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
672
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
673
+ super(decoder, BY_TYPE, 0, external_selectors)
1457
674
  end
1458
- # obsolete
1459
- class Searched < Attribute
1460
- TYPE = 1
1461
- NAME = :"searched"
675
+ end
676
+ end
677
+ module AttributeSets
678
+ class CounterAttrs
679
+ module Definitions
1462
680
  # @private
1463
- ORDER = 0
681
+ BY_TYPE = ::Array.new(6).tap do |definitions|
682
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"packets", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U64].new, multi: false, order: 0, selector_slot: nil)
683
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"bytes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U64].new, multi: false, order: 1, selector_slot: nil)
684
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"packets_old", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 2, selector_slot: nil)
685
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"bytes_old", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
686
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"pad", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 4, selector_slot: nil)
687
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
688
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1464
689
  # @private
1465
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
690
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1466
691
  end
1467
- class Found < Attribute
1468
- TYPE = 2
1469
- NAME = :"found"
1470
- # @private
1471
- ORDER = 1
1472
- # @private
1473
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
692
+ end
693
+ class TupleProtoAttrs
694
+ module Definitions
695
+ # @private
696
+ BY_TYPE = ::Array.new(10).tap do |definitions|
697
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"proto_num", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 0, selector_slot: nil)
698
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"proto_src_port", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 1, selector_slot: nil)
699
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"proto_dst_port", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 2, selector_slot: nil)
700
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"proto_icmp_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 3, selector_slot: nil)
701
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"proto_icmp_type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 4, selector_slot: nil)
702
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"proto_icmp_code", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 5, selector_slot: nil)
703
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"proto_icmpv6_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 6, selector_slot: nil)
704
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"proto_icmpv6_type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 7, selector_slot: nil)
705
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"proto_icmpv6_code", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 8, selector_slot: nil)
706
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
707
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
708
+ # @private
709
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1474
710
  end
1475
- # obsolete
1476
- class New < Attribute
1477
- TYPE = 3
1478
- NAME = :"new"
711
+ end
712
+ class TupleIpAttrs
713
+ module Definitions
1479
714
  # @private
1480
- ORDER = 2
715
+ BY_TYPE = ::Array.new(5).tap do |definitions|
716
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ip_v4_src", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 0, selector_slot: nil)
717
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"ip_v4_dst", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
718
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"ip_v6_src", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 } }), multi: false, order: 2, selector_slot: nil)
719
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"ip_v6_dst", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Binary.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is shorter than minimum length 16" unless it.bytesize >= 16 } }), multi: false, order: 3, selector_slot: nil)
720
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
721
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1481
722
  # @private
1482
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
723
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1483
724
  end
1484
- # obsolete
1485
- class Invalid < Attribute
1486
- TYPE = 4
1487
- NAME = :"invalid"
725
+ end
726
+ class TupleAttrs
727
+ module Definitions
1488
728
  # @private
1489
- ORDER = 3
729
+ BY_TYPE = ::Array.new(4).tap do |definitions|
730
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"tuple_ip", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleIpAttrs, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
731
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"tuple_proto", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleProtoAttrs, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
732
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"tuple_zone", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 2, selector_slot: nil)
733
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
734
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1490
735
  # @private
1491
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
736
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1492
737
  end
1493
- # obsolete
1494
- class Ignore < Attribute
1495
- TYPE = 5
1496
- NAME = :"ignore"
738
+ end
739
+ class ProtoinfoTcpAttrs
740
+ module Definitions
1497
741
  # @private
1498
- ORDER = 4
742
+ BY_TYPE = ::Array.new(6).tap do |definitions|
743
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"tcp_state", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 0, selector_slot: nil)
744
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"tcp_wscale_original", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 1, selector_slot: nil)
745
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"tcp_wscale_reply", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 2, selector_slot: nil)
746
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"tcp_flags_original", datatype: ::Nl::DataTypes::Struct.new(Structs::NfCtTcpFlagsMask, consume_remaining: true), multi: false, order: 3, selector_slot: nil)
747
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"tcp_flags_reply", datatype: ::Nl::DataTypes::Struct.new(Structs::NfCtTcpFlagsMask, consume_remaining: true), multi: false, order: 4, selector_slot: nil)
748
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
749
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1499
750
  # @private
1500
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
751
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1501
752
  end
1502
- # obsolete
1503
- class Delete < Attribute
1504
- TYPE = 6
1505
- NAME = :"delete"
753
+ end
754
+ class ProtoinfoDccpAttrs
755
+ module Definitions
1506
756
  # @private
1507
- ORDER = 5
757
+ BY_TYPE = ::Array.new(5).tap do |definitions|
758
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dccp_state", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 0, selector_slot: nil)
759
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"dccp_role", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 1, selector_slot: nil)
760
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"dccp_handshake_seq", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U64].new, multi: false, order: 2, selector_slot: nil)
761
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"dccp_pad", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 3, selector_slot: nil)
762
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
763
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1508
764
  # @private
1509
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
765
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1510
766
  end
1511
- # obsolete
1512
- class DeleteList < Attribute
1513
- TYPE = 7
1514
- NAME = :"delete_list"
767
+ end
768
+ class ProtoinfoSctpAttrs
769
+ module Definitions
1515
770
  # @private
1516
- ORDER = 6
771
+ BY_TYPE = ::Array.new(4).tap do |definitions|
772
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"sctp_state", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 0, selector_slot: nil)
773
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"vtag_original", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
774
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"vtag_reply", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 2, selector_slot: nil)
775
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
776
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1517
777
  # @private
1518
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
778
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1519
779
  end
1520
- class Insert < Attribute
1521
- TYPE = 8
1522
- NAME = :"insert"
780
+ end
781
+ class ProtoinfoAttrs
782
+ module Definitions
1523
783
  # @private
1524
- ORDER = 7
784
+ BY_TYPE = ::Array.new(4).tap do |definitions|
785
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"protoinfo_tcp", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoTcpAttrs, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
786
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"protoinfo_dccp", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoDccpAttrs, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
787
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"protoinfo_sctp", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoSctpAttrs, selector_bindings: []), multi: false, order: 2, selector_slot: nil)
788
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
789
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1525
790
  # @private
1526
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
791
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1527
792
  end
1528
- class InsertFailed < Attribute
1529
- TYPE = 9
1530
- NAME = :"insert_failed"
793
+ end
794
+ class HelpAttrs
795
+ module Definitions
1531
796
  # @private
1532
- ORDER = 8
797
+ BY_TYPE = ::Array.new(2).tap do |definitions|
798
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"help_name", datatype: ::Nl::DataTypes::String.new, multi: false, order: 0, selector_slot: nil)
799
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
800
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1533
801
  # @private
1534
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
802
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1535
803
  end
1536
- class Drop < Attribute
1537
- TYPE = 10
1538
- NAME = :"drop"
804
+ end
805
+ class NatProtoAttrs
806
+ module Definitions
1539
807
  # @private
1540
- ORDER = 9
808
+ BY_TYPE = ::Array.new(3).tap do |definitions|
809
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"nat_port_min", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 0, selector_slot: nil)
810
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"nat_port_max", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 1, selector_slot: nil)
811
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
812
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1541
813
  # @private
1542
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
814
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1543
815
  end
1544
- class EarlyDrop < Attribute
1545
- TYPE = 11
1546
- NAME = :"early_drop"
816
+ end
817
+ class NatAttrs
818
+ module Definitions
1547
819
  # @private
1548
- ORDER = 10
820
+ BY_TYPE = ::Array.new(6).tap do |definitions|
821
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"nat_v4_minip", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 0, selector_slot: nil)
822
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"nat_v4_maxip", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
823
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"nat_v6_minip", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 2, selector_slot: nil)
824
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"nat_v6_maxip", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 3, selector_slot: nil)
825
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"nat_proto", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatProtoAttrs, selector_bindings: []), multi: false, order: 4, selector_slot: nil)
826
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
827
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1549
828
  # @private
1550
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
829
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1551
830
  end
1552
- class Error < Attribute
1553
- TYPE = 12
1554
- NAME = :"error"
831
+ end
832
+ class SeqadjAttrs
833
+ module Definitions
1555
834
  # @private
1556
- ORDER = 11
835
+ BY_TYPE = ::Array.new(4).tap do |definitions|
836
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"correction_pos", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 0, selector_slot: nil)
837
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"offset_before", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
838
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"offset_after", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 2, selector_slot: nil)
839
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
840
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1557
841
  # @private
1558
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
842
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1559
843
  end
1560
- class SearchRestart < Attribute
1561
- TYPE = 13
1562
- NAME = :"search_restart"
844
+ end
845
+ class SecctxAttrs
846
+ module Definitions
1563
847
  # @private
1564
- ORDER = 12
848
+ BY_TYPE = ::Array.new(2).tap do |definitions|
849
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"secctx_name", datatype: ::Nl::DataTypes::String.new, multi: false, order: 0, selector_slot: nil)
850
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
851
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1565
852
  # @private
1566
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
853
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1567
854
  end
1568
- class ClashResolve < Attribute
1569
- TYPE = 14
1570
- NAME = :"clash_resolve"
855
+ end
856
+ class SynproxyAttrs
857
+ module Definitions
1571
858
  # @private
1572
- ORDER = 13
859
+ BY_TYPE = ::Array.new(4).tap do |definitions|
860
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"isn", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 0, selector_slot: nil)
861
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"its", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
862
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"tsoff", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 2, selector_slot: nil)
863
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
864
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1573
865
  # @private
1574
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
866
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1575
867
  end
1576
- class ChainToolong < Attribute
1577
- TYPE = 15
1578
- NAME = :"chain_toolong"
868
+ end
869
+ class FilterAttrs
870
+ module Definitions
1579
871
  # @private
1580
- ORDER = 14
872
+ BY_TYPE = ::Array.new(3).tap do |definitions|
873
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"orig_flags", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
874
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"reply_flags", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
875
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
876
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
1581
877
  # @private
1582
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Big::U32, check: nil)
878
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1583
879
  end
1584
- # @private
1585
- BY_NAME = Ractor.make_shareable({:"searched" => Searched, :"found" => Found, :"new" => New, :"invalid" => Invalid, :"ignore" => Ignore, :"delete" => Delete, :"delete_list" => DeleteList, :"insert" => Insert, :"insert_failed" => InsertFailed, :"drop" => Drop, :"early_drop" => EarlyDrop, :"error" => Error, :"search_restart" => SearchRestart, :"clash_resolve" => ClashResolve, :"chain_toolong" => ChainToolong}) #: Hash[::Symbol, Attribute]
1586
- # @private
1587
- BY_TYPE = Ractor.make_shareable({1 => Searched, 2 => Found, 3 => New, 4 => Invalid, 5 => Ignore, 6 => Delete, 7 => DeleteList, 8 => Insert, 9 => InsertFailed, 10 => Drop, 11 => EarlyDrop, 12 => Error, 13 => SearchRestart, 14 => ClashResolve, 15 => ChainToolong}) #: Hash[::Integer, Attribute]
1588
- # obsolete
1589
- # @rbs return: ::Integer
1590
- # @return [Integer]
1591
- # @see Searched
1592
- def searched; self[:"searched"]&.value; end
1593
- # @rbs return: ::Integer
1594
- # @return [Integer]
1595
- # @see Found
1596
- def found; self[:"found"]&.value; end
1597
- # obsolete
1598
- # @rbs return: ::Integer
1599
- # @return [Integer]
1600
- # @see New
1601
- def new; self[:"new"]&.value; end
1602
- # obsolete
1603
- # @rbs return: ::Integer
1604
- # @return [Integer]
1605
- # @see Invalid
1606
- def invalid; self[:"invalid"]&.value; end
1607
- # obsolete
1608
- # @rbs return: ::Integer
1609
- # @return [Integer]
1610
- # @see Ignore
1611
- def ignore; self[:"ignore"]&.value; end
1612
- # obsolete
1613
- # @rbs return: ::Integer
1614
- # @return [Integer]
1615
- # @see Delete
1616
- def delete; self[:"delete"]&.value; end
1617
- # obsolete
1618
- # @rbs return: ::Integer
1619
- # @return [Integer]
1620
- # @see DeleteList
1621
- def delete_list; self[:"delete_list"]&.value; end
1622
- # @rbs return: ::Integer
1623
- # @return [Integer]
1624
- # @see Insert
1625
- def insert; self[:"insert"]&.value; end
1626
- # @rbs return: ::Integer
1627
- # @return [Integer]
1628
- # @see InsertFailed
1629
- def insert_failed; self[:"insert_failed"]&.value; end
1630
- # @rbs return: ::Integer
1631
- # @return [Integer]
1632
- # @see Drop
1633
- def drop; self[:"drop"]&.value; end
1634
- # @rbs return: ::Integer
1635
- # @return [Integer]
1636
- # @see EarlyDrop
1637
- def early_drop; self[:"early_drop"]&.value; end
1638
- # @rbs return: ::Integer
1639
- # @return [Integer]
1640
- # @see Error
1641
- def error; self[:"error"]&.value; end
1642
- # @rbs return: ::Integer
1643
- # @return [Integer]
1644
- # @see SearchRestart
1645
- def search_restart; self[:"search_restart"]&.value; end
1646
- # @rbs return: ::Integer
1647
- # @return [Integer]
1648
- # @see ClashResolve
1649
- def clash_resolve; self[:"clash_resolve"]&.value; end
1650
- # @rbs return: ::Integer
1651
- # @return [Integer]
1652
- # @see ChainToolong
1653
- def chain_toolong; self[:"chain_toolong"]&.value; end
1654
- class << self
1655
- # Looks up Attribute class by name.
1656
- # @rbs name: Symbol
1657
- # @rbs return: Attribute
1658
- # @param [Symbol] name
1659
- # @return [Attribute]
1660
- def by_name(name); BY_NAME.fetch(name); end
1661
- # Looks up Attribute class by type value.
1662
- # @rbs type: Integer
1663
- # @rbs return: Attribute
1664
- # @param [Integer] type
1665
- # @return [Attribute]
1666
- def by_type(type); BY_TYPE.fetch(type); end
880
+ end
881
+ class ConntrackAttrs
882
+ module Definitions
883
+ # @private
884
+ BY_TYPE = ::Array.new(28).tap do |definitions|
885
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"tuple_orig", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
886
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"tuple_reply", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
887
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"status", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 2, selector_slot: nil)
888
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"protoinfo", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoAttrs, selector_bindings: []), multi: false, order: 3, selector_slot: nil)
889
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"help", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::HelpAttrs, selector_bindings: []), multi: false, order: 4, selector_slot: nil)
890
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"nat_src", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatAttrs, selector_bindings: []), multi: false, order: 5, selector_slot: nil)
891
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"timeout", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 6, selector_slot: nil)
892
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"mark", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 7, selector_slot: nil)
893
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"counters_orig", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::CounterAttrs, selector_bindings: []), multi: false, order: 8, selector_slot: nil)
894
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"counters_reply", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::CounterAttrs, selector_bindings: []), multi: false, order: 9, selector_slot: nil)
895
+ definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"use", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 10, selector_slot: nil)
896
+ definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 11, selector_slot: nil)
897
+ definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"nat_dst", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatAttrs, selector_bindings: []), multi: false, order: 12, selector_slot: nil)
898
+ definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"tuple_master", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: []), multi: false, order: 13, selector_slot: nil)
899
+ definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"seq_adj_orig", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SeqadjAttrs, selector_bindings: []), multi: false, order: 14, selector_slot: nil)
900
+ definitions[16] = ::Nl::AttributeSet::Definition.new(id: 16, name: :"seq_adj_reply", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SeqadjAttrs, selector_bindings: []), multi: false, order: 15, selector_slot: nil)
901
+ definitions[17] = ::Nl::AttributeSet::Definition.new(id: 17, name: :"secmark", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 16, selector_slot: nil)
902
+ definitions[18] = ::Nl::AttributeSet::Definition.new(id: 18, name: :"zone", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U16].new, multi: false, order: 17, selector_slot: nil)
903
+ definitions[19] = ::Nl::AttributeSet::Definition.new(id: 19, name: :"secctx", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SecctxAttrs, selector_bindings: []), multi: false, order: 18, selector_slot: nil)
904
+ definitions[20] = ::Nl::AttributeSet::Definition.new(id: 20, name: :"timestamp", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U64].new, multi: false, order: 19, selector_slot: nil)
905
+ definitions[21] = ::Nl::AttributeSet::Definition.new(id: 21, name: :"mark_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 20, selector_slot: nil)
906
+ definitions[22] = ::Nl::AttributeSet::Definition.new(id: 22, name: :"labels", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 21, selector_slot: nil)
907
+ definitions[23] = ::Nl::AttributeSet::Definition.new(id: 23, name: :"labels_mask", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 22, selector_slot: nil)
908
+ definitions[24] = ::Nl::AttributeSet::Definition.new(id: 24, name: :"synproxy", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SynproxyAttrs, selector_bindings: []), multi: false, order: 23, selector_slot: nil)
909
+ definitions[25] = ::Nl::AttributeSet::Definition.new(id: 25, name: :"filter", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::FilterAttrs, selector_bindings: []), multi: false, order: 24, selector_slot: nil)
910
+ definitions[26] = ::Nl::AttributeSet::Definition.new(id: 26, name: :"status_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 25, selector_slot: nil)
911
+ definitions[27] = ::Nl::AttributeSet::Definition.new(id: 27, name: :"timestamp_event", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U64].new, multi: false, order: 26, selector_slot: nil)
912
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
913
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
914
+ # @private
915
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
916
+ end
917
+ end
918
+ class ConntrackStatsAttrs
919
+ module Definitions
920
+ # @private
921
+ BY_TYPE = ::Array.new(16).tap do |definitions|
922
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"searched", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 0, selector_slot: nil)
923
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"found", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 1, selector_slot: nil)
924
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"new", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 2, selector_slot: nil)
925
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"invalid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 3, selector_slot: nil)
926
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"ignore", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 4, selector_slot: nil)
927
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"delete", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 5, selector_slot: nil)
928
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"delete_list", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 6, selector_slot: nil)
929
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"insert", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 7, selector_slot: nil)
930
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"insert_failed", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 8, selector_slot: nil)
931
+ definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"drop", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 9, selector_slot: nil)
932
+ definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"early_drop", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 10, selector_slot: nil)
933
+ definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"error", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 11, selector_slot: nil)
934
+ definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"search_restart", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 12, selector_slot: nil)
935
+ definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"clash_resolve", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 13, selector_slot: nil)
936
+ definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"chain_toolong", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Big::U32].new, multi: false, order: 14, selector_slot: nil)
937
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
938
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
939
+ # @private
940
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
1667
941
  end
1668
942
  end
1669
- # @private
1670
- TupleAttrs::TupleIp::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleIpAttrs, selector_bindings: Ractor.make_shareable([]))
1671
- # @private
1672
- TupleAttrs::TupleProto::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleProtoAttrs, selector_bindings: Ractor.make_shareable([]))
1673
- # @private
1674
- ProtoinfoAttrs::ProtoinfoTcp::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoTcpAttrs, selector_bindings: Ractor.make_shareable([]))
1675
- # @private
1676
- ProtoinfoAttrs::ProtoinfoDccp::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoDccpAttrs, selector_bindings: Ractor.make_shareable([]))
1677
- # @private
1678
- ProtoinfoAttrs::ProtoinfoSctp::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoSctpAttrs, selector_bindings: Ractor.make_shareable([]))
1679
- # @private
1680
- NatAttrs::NatProto::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatProtoAttrs, selector_bindings: Ractor.make_shareable([]))
1681
- # @private
1682
- ConntrackAttrs::TupleOrig::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: Ractor.make_shareable([]))
1683
- # @private
1684
- ConntrackAttrs::TupleReply::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: Ractor.make_shareable([]))
1685
- # @private
1686
- ConntrackAttrs::Protoinfo::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ProtoinfoAttrs, selector_bindings: Ractor.make_shareable([]))
1687
- # @private
1688
- ConntrackAttrs::Help::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::HelpAttrs, selector_bindings: Ractor.make_shareable([]))
1689
- # @private
1690
- ConntrackAttrs::NatSrc::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatAttrs, selector_bindings: Ractor.make_shareable([]))
1691
- # @private
1692
- ConntrackAttrs::CountersOrig::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::CounterAttrs, selector_bindings: Ractor.make_shareable([]))
1693
- # @private
1694
- ConntrackAttrs::CountersReply::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::CounterAttrs, selector_bindings: Ractor.make_shareable([]))
1695
- # @private
1696
- ConntrackAttrs::NatDst::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NatAttrs, selector_bindings: Ractor.make_shareable([]))
1697
- # @private
1698
- ConntrackAttrs::TupleMaster::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: Ractor.make_shareable([]))
1699
- # @private
1700
- ConntrackAttrs::SeqAdjOrig::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SeqadjAttrs, selector_bindings: Ractor.make_shareable([]))
1701
- # @private
1702
- ConntrackAttrs::SeqAdjReply::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SeqadjAttrs, selector_bindings: Ractor.make_shareable([]))
1703
- # @private
1704
- ConntrackAttrs::Secctx::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SecctxAttrs, selector_bindings: Ractor.make_shareable([]))
1705
- # @private
1706
- ConntrackAttrs::Synproxy::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::SynproxyAttrs, selector_bindings: Ractor.make_shareable([]))
1707
- # @private
1708
- ConntrackAttrs::Filter::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::TupleAttrs, selector_bindings: Ractor.make_shareable([]))
1709
943
  end
1710
944
  module Messages
1711
945
  # get / dump entries
1712
- class DoGetRequest < ::Nl::Raw::Message
946
+ class DoGetRequest < ::Nl::Message
1713
947
  TYPE = 257
1714
948
  FIXED_HEADER = Structs::Nfgenmsg
1715
949
  ATTRIBUTE_SET = AttributeSets::ConntrackAttrs
1716
- ATTRIBUTES = Ractor.make_shareable(%i[tuple_orig tuple_reply zone])
950
+ ATTRIBUTES = %i[tuple_orig tuple_reply zone].freeze
951
+ include ATTRIBUTE_SET::Definitions
952
+ def initialize(nfgen_family, version, res_id, attributes = [])
953
+ @nfgen_family = nfgen_family
954
+ @version = version
955
+ @res_id = res_id
956
+ @attributes = attributes
957
+ end
958
+ # @private
959
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
960
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
961
+ new(
962
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
963
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
964
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
965
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
966
+ )
967
+ end
968
+ # Decodes a message payload from the decoder into a new instance.
969
+ # @rbs (::Nl::Decoder decoder) -> instance
970
+ def self.decode(decoder)
971
+ word = decoder.get_u32
972
+ value_0 = ((word >> 0) & 0xff)
973
+ value_1 = ((word >> 8) & 0xff)
974
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
975
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
976
+ end
977
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
978
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
979
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
980
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
981
+ encode_attributes(encoder, external_selectors:)
982
+ end
1717
983
  # @rbs return: ::Integer
1718
984
  # @return [Integer]
1719
- def nfgen_family; fixed_header.nfgen_family; end
985
+ def nfgen_family; @nfgen_family; end
1720
986
  # @rbs return: ::Integer
1721
987
  # @return [Integer]
1722
- def version; fixed_header.version; end
988
+ def version; @version; end
1723
989
  # @rbs return: ::Integer
1724
990
  # @return [Integer]
1725
- def res_id; fixed_header.res_id; end
991
+ def res_id; @res_id; end
1726
992
  # conntrack l3+l4 protocol information, original direction
1727
993
  # @rbs return: AttributeSets::TupleAttrs
1728
994
  # @return [AttributeSets::TupleAttrs]
1729
- # @see AttributeSets::ConntrackAttrs::TupleOrig
1730
- def tuple_orig; attributes[:"tuple_orig"]&.value; end
995
+ def tuple_orig; self[:"tuple_orig"]; end
1731
996
  # conntrack l3+l4 protocol information, reply direction
1732
997
  # @rbs return: AttributeSets::TupleAttrs
1733
998
  # @return [AttributeSets::TupleAttrs]
1734
- # @see AttributeSets::ConntrackAttrs::TupleReply
1735
- def tuple_reply; attributes[:"tuple_reply"]&.value; end
999
+ def tuple_reply; self[:"tuple_reply"]; end
1736
1000
  # conntrack zone id
1737
1001
  # @rbs return: ::Integer
1738
1002
  # @return [Integer]
1739
- # @see AttributeSets::ConntrackAttrs::Zone
1740
- def zone; attributes[:"zone"]&.value; end
1003
+ def zone; self[:"zone"]; end
1741
1004
  end
1742
1005
  # get / dump entries
1743
- class DoGetReply < ::Nl::Raw::Message
1006
+ class DoGetReply < ::Nl::Message
1744
1007
  TYPE = 256
1745
1008
  FIXED_HEADER = Structs::Nfgenmsg
1746
1009
  ATTRIBUTE_SET = AttributeSets::ConntrackAttrs
1747
- ATTRIBUTES = Ractor.make_shareable(%i[tuple_orig tuple_reply status protoinfo help nat_src timeout mark counters_orig counters_reply use id nat_dst tuple_master seq_adj_orig seq_adj_reply zone secctx labels synproxy])
1010
+ ATTRIBUTES = %i[tuple_orig tuple_reply status protoinfo help nat_src timeout mark counters_orig counters_reply use id nat_dst tuple_master seq_adj_orig seq_adj_reply zone secctx labels synproxy].freeze
1011
+ include ATTRIBUTE_SET::Definitions
1012
+ def initialize(nfgen_family, version, res_id, attributes = [])
1013
+ @nfgen_family = nfgen_family
1014
+ @version = version
1015
+ @res_id = res_id
1016
+ @attributes = attributes
1017
+ end
1018
+ # @private
1019
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1020
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
1021
+ new(
1022
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
1023
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
1024
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
1025
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1026
+ )
1027
+ end
1028
+ # Decodes a message payload from the decoder into a new instance.
1029
+ # @rbs (::Nl::Decoder decoder) -> instance
1030
+ def self.decode(decoder)
1031
+ word = decoder.get_u32
1032
+ value_0 = ((word >> 0) & 0xff)
1033
+ value_1 = ((word >> 8) & 0xff)
1034
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
1035
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
1036
+ end
1037
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1038
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
1039
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
1040
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
1041
+ encode_attributes(encoder, external_selectors:)
1042
+ end
1748
1043
  # @rbs return: ::Integer
1749
1044
  # @return [Integer]
1750
- def nfgen_family; fixed_header.nfgen_family; end
1045
+ def nfgen_family; @nfgen_family; end
1751
1046
  # @rbs return: ::Integer
1752
1047
  # @return [Integer]
1753
- def version; fixed_header.version; end
1048
+ def version; @version; end
1754
1049
  # @rbs return: ::Integer
1755
1050
  # @return [Integer]
1756
- def res_id; fixed_header.res_id; end
1051
+ def res_id; @res_id; end
1757
1052
  # conntrack l3+l4 protocol information, original direction
1758
1053
  # @rbs return: AttributeSets::TupleAttrs
1759
1054
  # @return [AttributeSets::TupleAttrs]
1760
- # @see AttributeSets::ConntrackAttrs::TupleOrig
1761
- def tuple_orig; attributes[:"tuple_orig"]&.value; end
1055
+ def tuple_orig; self[:"tuple_orig"]; end
1762
1056
  # conntrack l3+l4 protocol information, reply direction
1763
1057
  # @rbs return: AttributeSets::TupleAttrs
1764
1058
  # @return [AttributeSets::TupleAttrs]
1765
- # @see AttributeSets::ConntrackAttrs::TupleReply
1766
- def tuple_reply; attributes[:"tuple_reply"]&.value; end
1059
+ def tuple_reply; self[:"tuple_reply"]; end
1767
1060
  # conntrack flag bits
1768
1061
  #
1769
1062
  # Known flags are defined in {Flags::NfCtStatus}.
1770
1063
  # @rbs return: ::Integer
1771
1064
  # @return [Integer]
1772
- # @see AttributeSets::ConntrackAttrs::Status
1773
- def status; attributes[:"status"]&.value; end
1065
+ def status; self[:"status"]; end
1774
1066
  # @rbs return: AttributeSets::ProtoinfoAttrs
1775
1067
  # @return [AttributeSets::ProtoinfoAttrs]
1776
- # @see AttributeSets::ConntrackAttrs::Protoinfo
1777
- def protoinfo; attributes[:"protoinfo"]&.value; end
1068
+ def protoinfo; self[:"protoinfo"]; end
1778
1069
  # @rbs return: AttributeSets::HelpAttrs
1779
1070
  # @return [AttributeSets::HelpAttrs]
1780
- # @see AttributeSets::ConntrackAttrs::Help
1781
- def help; attributes[:"help"]&.value; end
1071
+ def help; self[:"help"]; end
1782
1072
  # @rbs return: AttributeSets::NatAttrs
1783
1073
  # @return [AttributeSets::NatAttrs]
1784
- # @see AttributeSets::ConntrackAttrs::NatSrc
1785
- def nat_src; attributes[:"nat_src"]&.value; end
1074
+ def nat_src; self[:"nat_src"]; end
1786
1075
  # @rbs return: ::Integer
1787
1076
  # @return [Integer]
1788
- # @see AttributeSets::ConntrackAttrs::Timeout
1789
- def timeout; attributes[:"timeout"]&.value; end
1077
+ def timeout; self[:"timeout"]; end
1790
1078
  # @rbs return: ::Integer
1791
1079
  # @return [Integer]
1792
- # @see AttributeSets::ConntrackAttrs::Mark
1793
- def mark; attributes[:"mark"]&.value; end
1080
+ def mark; self[:"mark"]; end
1794
1081
  # @rbs return: AttributeSets::CounterAttrs
1795
1082
  # @return [AttributeSets::CounterAttrs]
1796
- # @see AttributeSets::ConntrackAttrs::CountersOrig
1797
- def counters_orig; attributes[:"counters_orig"]&.value; end
1083
+ def counters_orig; self[:"counters_orig"]; end
1798
1084
  # @rbs return: AttributeSets::CounterAttrs
1799
1085
  # @return [AttributeSets::CounterAttrs]
1800
- # @see AttributeSets::ConntrackAttrs::CountersReply
1801
- def counters_reply; attributes[:"counters_reply"]&.value; end
1086
+ def counters_reply; self[:"counters_reply"]; end
1802
1087
  # @rbs return: ::Integer
1803
1088
  # @return [Integer]
1804
- # @see AttributeSets::ConntrackAttrs::Use
1805
- def use; attributes[:"use"]&.value; end
1089
+ def use; self[:"use"]; end
1806
1090
  # @rbs return: ::Integer
1807
1091
  # @return [Integer]
1808
- # @see AttributeSets::ConntrackAttrs::Id
1809
- def id; attributes[:"id"]&.value; end
1092
+ def id; self[:"id"]; end
1810
1093
  # @rbs return: AttributeSets::NatAttrs
1811
1094
  # @return [AttributeSets::NatAttrs]
1812
- # @see AttributeSets::ConntrackAttrs::NatDst
1813
- def nat_dst; attributes[:"nat_dst"]&.value; end
1095
+ def nat_dst; self[:"nat_dst"]; end
1814
1096
  # @rbs return: AttributeSets::TupleAttrs
1815
1097
  # @return [AttributeSets::TupleAttrs]
1816
- # @see AttributeSets::ConntrackAttrs::TupleMaster
1817
- def tuple_master; attributes[:"tuple_master"]&.value; end
1098
+ def tuple_master; self[:"tuple_master"]; end
1818
1099
  # @rbs return: AttributeSets::SeqadjAttrs
1819
1100
  # @return [AttributeSets::SeqadjAttrs]
1820
- # @see AttributeSets::ConntrackAttrs::SeqAdjOrig
1821
- def seq_adj_orig; attributes[:"seq_adj_orig"]&.value; end
1101
+ def seq_adj_orig; self[:"seq_adj_orig"]; end
1822
1102
  # @rbs return: AttributeSets::SeqadjAttrs
1823
1103
  # @return [AttributeSets::SeqadjAttrs]
1824
- # @see AttributeSets::ConntrackAttrs::SeqAdjReply
1825
- def seq_adj_reply; attributes[:"seq_adj_reply"]&.value; end
1104
+ def seq_adj_reply; self[:"seq_adj_reply"]; end
1826
1105
  # conntrack zone id
1827
1106
  # @rbs return: ::Integer
1828
1107
  # @return [Integer]
1829
- # @see AttributeSets::ConntrackAttrs::Zone
1830
- def zone; attributes[:"zone"]&.value; end
1108
+ def zone; self[:"zone"]; end
1831
1109
  # @rbs return: AttributeSets::SecctxAttrs
1832
1110
  # @return [AttributeSets::SecctxAttrs]
1833
- # @see AttributeSets::ConntrackAttrs::Secctx
1834
- def secctx; attributes[:"secctx"]&.value; end
1111
+ def secctx; self[:"secctx"]; end
1835
1112
  # @rbs return: ::String
1836
1113
  # @return [String]
1837
- # @see AttributeSets::ConntrackAttrs::Labels
1838
- def labels; attributes[:"labels"]&.value; end
1114
+ def labels; self[:"labels"]; end
1839
1115
  # @rbs return: AttributeSets::SynproxyAttrs
1840
1116
  # @return [AttributeSets::SynproxyAttrs]
1841
- # @see AttributeSets::ConntrackAttrs::Synproxy
1842
- def synproxy; attributes[:"synproxy"]&.value; end
1117
+ def synproxy; self[:"synproxy"]; end
1843
1118
  end
1844
1119
  # get / dump entries
1845
- class DumpGetRequest < ::Nl::Raw::Message
1120
+ class DumpGetRequest < ::Nl::Message
1846
1121
  TYPE = 257
1847
1122
  FIXED_HEADER = Structs::Nfgenmsg
1848
1123
  ATTRIBUTE_SET = AttributeSets::ConntrackAttrs
1849
- ATTRIBUTES = Ractor.make_shareable(%i[status mark zone filter])
1124
+ ATTRIBUTES = %i[tuple_orig tuple_reply status mark zone mark_mask filter status_mask].freeze
1125
+ include ATTRIBUTE_SET::Definitions
1126
+ def initialize(nfgen_family, version, res_id, attributes = [])
1127
+ @nfgen_family = nfgen_family
1128
+ @version = version
1129
+ @res_id = res_id
1130
+ @attributes = attributes
1131
+ end
1132
+ # @private
1133
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1134
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
1135
+ new(
1136
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
1137
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
1138
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
1139
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1140
+ )
1141
+ end
1142
+ # Decodes a message payload from the decoder into a new instance.
1143
+ # @rbs (::Nl::Decoder decoder) -> instance
1144
+ def self.decode(decoder)
1145
+ word = decoder.get_u32
1146
+ value_0 = ((word >> 0) & 0xff)
1147
+ value_1 = ((word >> 8) & 0xff)
1148
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
1149
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
1150
+ end
1151
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1152
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
1153
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
1154
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
1155
+ encode_attributes(encoder, external_selectors:)
1156
+ end
1850
1157
  # @rbs return: ::Integer
1851
1158
  # @return [Integer]
1852
- def nfgen_family; fixed_header.nfgen_family; end
1159
+ def nfgen_family; @nfgen_family; end
1853
1160
  # @rbs return: ::Integer
1854
1161
  # @return [Integer]
1855
- def version; fixed_header.version; end
1162
+ def version; @version; end
1856
1163
  # @rbs return: ::Integer
1857
1164
  # @return [Integer]
1858
- def res_id; fixed_header.res_id; end
1165
+ def res_id; @res_id; end
1166
+ # conntrack l3+l4 protocol information, original direction
1167
+ # @rbs return: AttributeSets::TupleAttrs
1168
+ # @return [AttributeSets::TupleAttrs]
1169
+ def tuple_orig; self[:"tuple_orig"]; end
1170
+ # conntrack l3+l4 protocol information, reply direction
1171
+ # @rbs return: AttributeSets::TupleAttrs
1172
+ # @return [AttributeSets::TupleAttrs]
1173
+ def tuple_reply; self[:"tuple_reply"]; end
1859
1174
  # conntrack flag bits
1860
1175
  #
1861
1176
  # Known flags are defined in {Flags::NfCtStatus}.
1862
1177
  # @rbs return: ::Integer
1863
1178
  # @return [Integer]
1864
- # @see AttributeSets::ConntrackAttrs::Status
1865
- def status; attributes[:"status"]&.value; end
1179
+ def status; self[:"status"]; end
1866
1180
  # @rbs return: ::Integer
1867
1181
  # @return [Integer]
1868
- # @see AttributeSets::ConntrackAttrs::Mark
1869
- def mark; attributes[:"mark"]&.value; end
1182
+ def mark; self[:"mark"]; end
1870
1183
  # conntrack zone id
1871
1184
  # @rbs return: ::Integer
1872
1185
  # @return [Integer]
1873
- # @see AttributeSets::ConntrackAttrs::Zone
1874
- def zone; attributes[:"zone"]&.value; end
1875
- # @rbs return: AttributeSets::TupleAttrs
1876
- # @return [AttributeSets::TupleAttrs]
1877
- # @see AttributeSets::ConntrackAttrs::Filter
1878
- def filter; attributes[:"filter"]&.value; end
1186
+ def zone; self[:"zone"]; end
1187
+ # @rbs return: ::Integer
1188
+ # @return [Integer]
1189
+ def mark_mask; self[:"mark_mask"]; end
1190
+ # @rbs return: AttributeSets::FilterAttrs
1191
+ # @return [AttributeSets::FilterAttrs]
1192
+ def filter; self[:"filter"]; end
1193
+ # conntrack flag bits to change
1194
+ #
1195
+ # Known flags are defined in {Flags::NfCtStatus}.
1196
+ # @rbs return: ::Integer
1197
+ # @return [Integer]
1198
+ def status_mask; self[:"status_mask"]; end
1879
1199
  end
1880
1200
  # get / dump entries
1881
- class DumpGetReply < ::Nl::Raw::Message
1201
+ class DumpGetReply < ::Nl::Message
1882
1202
  TYPE = 256
1883
1203
  FIXED_HEADER = Structs::Nfgenmsg
1884
1204
  ATTRIBUTE_SET = AttributeSets::ConntrackAttrs
1885
- ATTRIBUTES = Ractor.make_shareable(%i[tuple_orig tuple_reply status protoinfo help nat_src timeout mark counters_orig counters_reply use id nat_dst tuple_master seq_adj_orig seq_adj_reply zone secctx labels synproxy])
1205
+ ATTRIBUTES = %i[tuple_orig tuple_reply status protoinfo help nat_src timeout mark counters_orig counters_reply use id nat_dst tuple_master seq_adj_orig seq_adj_reply zone secctx labels synproxy].freeze
1206
+ include ATTRIBUTE_SET::Definitions
1207
+ def initialize(nfgen_family, version, res_id, attributes = [])
1208
+ @nfgen_family = nfgen_family
1209
+ @version = version
1210
+ @res_id = res_id
1211
+ @attributes = attributes
1212
+ end
1213
+ # @private
1214
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1215
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
1216
+ new(
1217
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
1218
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
1219
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
1220
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1221
+ )
1222
+ end
1223
+ # Decodes a message payload from the decoder into a new instance.
1224
+ # @rbs (::Nl::Decoder decoder) -> instance
1225
+ def self.decode(decoder)
1226
+ word = decoder.get_u32
1227
+ value_0 = ((word >> 0) & 0xff)
1228
+ value_1 = ((word >> 8) & 0xff)
1229
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
1230
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
1231
+ end
1232
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1233
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
1234
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
1235
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
1236
+ encode_attributes(encoder, external_selectors:)
1237
+ end
1886
1238
  # @rbs return: ::Integer
1887
1239
  # @return [Integer]
1888
- def nfgen_family; fixed_header.nfgen_family; end
1240
+ def nfgen_family; @nfgen_family; end
1889
1241
  # @rbs return: ::Integer
1890
1242
  # @return [Integer]
1891
- def version; fixed_header.version; end
1243
+ def version; @version; end
1892
1244
  # @rbs return: ::Integer
1893
1245
  # @return [Integer]
1894
- def res_id; fixed_header.res_id; end
1246
+ def res_id; @res_id; end
1895
1247
  # conntrack l3+l4 protocol information, original direction
1896
1248
  # @rbs return: AttributeSets::TupleAttrs
1897
1249
  # @return [AttributeSets::TupleAttrs]
1898
- # @see AttributeSets::ConntrackAttrs::TupleOrig
1899
- def tuple_orig; attributes[:"tuple_orig"]&.value; end
1250
+ def tuple_orig; self[:"tuple_orig"]; end
1900
1251
  # conntrack l3+l4 protocol information, reply direction
1901
1252
  # @rbs return: AttributeSets::TupleAttrs
1902
1253
  # @return [AttributeSets::TupleAttrs]
1903
- # @see AttributeSets::ConntrackAttrs::TupleReply
1904
- def tuple_reply; attributes[:"tuple_reply"]&.value; end
1254
+ def tuple_reply; self[:"tuple_reply"]; end
1905
1255
  # conntrack flag bits
1906
1256
  #
1907
1257
  # Known flags are defined in {Flags::NfCtStatus}.
1908
1258
  # @rbs return: ::Integer
1909
1259
  # @return [Integer]
1910
- # @see AttributeSets::ConntrackAttrs::Status
1911
- def status; attributes[:"status"]&.value; end
1260
+ def status; self[:"status"]; end
1912
1261
  # @rbs return: AttributeSets::ProtoinfoAttrs
1913
1262
  # @return [AttributeSets::ProtoinfoAttrs]
1914
- # @see AttributeSets::ConntrackAttrs::Protoinfo
1915
- def protoinfo; attributes[:"protoinfo"]&.value; end
1263
+ def protoinfo; self[:"protoinfo"]; end
1916
1264
  # @rbs return: AttributeSets::HelpAttrs
1917
1265
  # @return [AttributeSets::HelpAttrs]
1918
- # @see AttributeSets::ConntrackAttrs::Help
1919
- def help; attributes[:"help"]&.value; end
1266
+ def help; self[:"help"]; end
1920
1267
  # @rbs return: AttributeSets::NatAttrs
1921
1268
  # @return [AttributeSets::NatAttrs]
1922
- # @see AttributeSets::ConntrackAttrs::NatSrc
1923
- def nat_src; attributes[:"nat_src"]&.value; end
1269
+ def nat_src; self[:"nat_src"]; end
1924
1270
  # @rbs return: ::Integer
1925
1271
  # @return [Integer]
1926
- # @see AttributeSets::ConntrackAttrs::Timeout
1927
- def timeout; attributes[:"timeout"]&.value; end
1272
+ def timeout; self[:"timeout"]; end
1928
1273
  # @rbs return: ::Integer
1929
1274
  # @return [Integer]
1930
- # @see AttributeSets::ConntrackAttrs::Mark
1931
- def mark; attributes[:"mark"]&.value; end
1275
+ def mark; self[:"mark"]; end
1932
1276
  # @rbs return: AttributeSets::CounterAttrs
1933
1277
  # @return [AttributeSets::CounterAttrs]
1934
- # @see AttributeSets::ConntrackAttrs::CountersOrig
1935
- def counters_orig; attributes[:"counters_orig"]&.value; end
1278
+ def counters_orig; self[:"counters_orig"]; end
1936
1279
  # @rbs return: AttributeSets::CounterAttrs
1937
1280
  # @return [AttributeSets::CounterAttrs]
1938
- # @see AttributeSets::ConntrackAttrs::CountersReply
1939
- def counters_reply; attributes[:"counters_reply"]&.value; end
1281
+ def counters_reply; self[:"counters_reply"]; end
1940
1282
  # @rbs return: ::Integer
1941
1283
  # @return [Integer]
1942
- # @see AttributeSets::ConntrackAttrs::Use
1943
- def use; attributes[:"use"]&.value; end
1284
+ def use; self[:"use"]; end
1944
1285
  # @rbs return: ::Integer
1945
1286
  # @return [Integer]
1946
- # @see AttributeSets::ConntrackAttrs::Id
1947
- def id; attributes[:"id"]&.value; end
1287
+ def id; self[:"id"]; end
1948
1288
  # @rbs return: AttributeSets::NatAttrs
1949
1289
  # @return [AttributeSets::NatAttrs]
1950
- # @see AttributeSets::ConntrackAttrs::NatDst
1951
- def nat_dst; attributes[:"nat_dst"]&.value; end
1290
+ def nat_dst; self[:"nat_dst"]; end
1952
1291
  # @rbs return: AttributeSets::TupleAttrs
1953
1292
  # @return [AttributeSets::TupleAttrs]
1954
- # @see AttributeSets::ConntrackAttrs::TupleMaster
1955
- def tuple_master; attributes[:"tuple_master"]&.value; end
1293
+ def tuple_master; self[:"tuple_master"]; end
1956
1294
  # @rbs return: AttributeSets::SeqadjAttrs
1957
1295
  # @return [AttributeSets::SeqadjAttrs]
1958
- # @see AttributeSets::ConntrackAttrs::SeqAdjOrig
1959
- def seq_adj_orig; attributes[:"seq_adj_orig"]&.value; end
1296
+ def seq_adj_orig; self[:"seq_adj_orig"]; end
1960
1297
  # @rbs return: AttributeSets::SeqadjAttrs
1961
1298
  # @return [AttributeSets::SeqadjAttrs]
1962
- # @see AttributeSets::ConntrackAttrs::SeqAdjReply
1963
- def seq_adj_reply; attributes[:"seq_adj_reply"]&.value; end
1299
+ def seq_adj_reply; self[:"seq_adj_reply"]; end
1964
1300
  # conntrack zone id
1965
1301
  # @rbs return: ::Integer
1966
1302
  # @return [Integer]
1967
- # @see AttributeSets::ConntrackAttrs::Zone
1968
- def zone; attributes[:"zone"]&.value; end
1303
+ def zone; self[:"zone"]; end
1969
1304
  # @rbs return: AttributeSets::SecctxAttrs
1970
1305
  # @return [AttributeSets::SecctxAttrs]
1971
- # @see AttributeSets::ConntrackAttrs::Secctx
1972
- def secctx; attributes[:"secctx"]&.value; end
1306
+ def secctx; self[:"secctx"]; end
1973
1307
  # @rbs return: ::String
1974
1308
  # @return [String]
1975
- # @see AttributeSets::ConntrackAttrs::Labels
1976
- def labels; attributes[:"labels"]&.value; end
1309
+ def labels; self[:"labels"]; end
1977
1310
  # @rbs return: AttributeSets::SynproxyAttrs
1978
1311
  # @return [AttributeSets::SynproxyAttrs]
1979
- # @see AttributeSets::ConntrackAttrs::Synproxy
1980
- def synproxy; attributes[:"synproxy"]&.value; end
1312
+ def synproxy; self[:"synproxy"]; end
1981
1313
  end
1982
1314
  # dump pcpu conntrack stats
1983
- class DumpGetStatsRequest < ::Nl::Raw::Message
1315
+ class DumpGetStatsRequest < ::Nl::Message
1984
1316
  TYPE = 260
1985
1317
  FIXED_HEADER = Structs::Nfgenmsg
1986
1318
  ATTRIBUTE_SET = AttributeSets::ConntrackStatsAttrs
1987
- ATTRIBUTES = Ractor.make_shareable(%i[])
1319
+ ATTRIBUTES = %i[].freeze
1320
+ include ATTRIBUTE_SET::Definitions
1321
+ def initialize(nfgen_family, version, res_id, attributes = [])
1322
+ @nfgen_family = nfgen_family
1323
+ @version = version
1324
+ @res_id = res_id
1325
+ @attributes = attributes
1326
+ end
1327
+ # @private
1328
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1329
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
1330
+ new(
1331
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
1332
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
1333
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
1334
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1335
+ )
1336
+ end
1337
+ # Decodes a message payload from the decoder into a new instance.
1338
+ # @rbs (::Nl::Decoder decoder) -> instance
1339
+ def self.decode(decoder)
1340
+ word = decoder.get_u32
1341
+ value_0 = ((word >> 0) & 0xff)
1342
+ value_1 = ((word >> 8) & 0xff)
1343
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
1344
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
1345
+ end
1346
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1347
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
1348
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
1349
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
1350
+ encode_attributes(encoder, external_selectors:)
1351
+ end
1988
1352
  # @rbs return: ::Integer
1989
1353
  # @return [Integer]
1990
- def nfgen_family; fixed_header.nfgen_family; end
1354
+ def nfgen_family; @nfgen_family; end
1991
1355
  # @rbs return: ::Integer
1992
1356
  # @return [Integer]
1993
- def version; fixed_header.version; end
1357
+ def version; @version; end
1994
1358
  # @rbs return: ::Integer
1995
1359
  # @return [Integer]
1996
- def res_id; fixed_header.res_id; end
1360
+ def res_id; @res_id; end
1997
1361
  end
1998
1362
  # dump pcpu conntrack stats
1999
- class DumpGetStatsReply < ::Nl::Raw::Message
1363
+ class DumpGetStatsReply < ::Nl::Message
2000
1364
  TYPE = 260
2001
1365
  FIXED_HEADER = Structs::Nfgenmsg
2002
1366
  ATTRIBUTE_SET = AttributeSets::ConntrackStatsAttrs
2003
- ATTRIBUTES = Ractor.make_shareable(%i[searched found insert insert_failed drop early_drop error search_restart clash_resolve chain_toolong])
1367
+ ATTRIBUTES = %i[searched found insert insert_failed drop early_drop error search_restart clash_resolve chain_toolong].freeze
1368
+ include ATTRIBUTE_SET::Definitions
1369
+ def initialize(nfgen_family, version, res_id, attributes = [])
1370
+ @nfgen_family = nfgen_family
1371
+ @version = version
1372
+ @res_id = res_id
1373
+ @attributes = attributes
1374
+ end
1375
+ # @private
1376
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1377
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
1378
+ new(
1379
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].coerce(params.fetch(:"nfgen_family", 0)),
1380
+ FIXED_HEADER::MEMBERS[:"version"].coerce(params.fetch(:"version", 0)),
1381
+ FIXED_HEADER::MEMBERS[:"res_id"].coerce(params.fetch(:"res_id", 0)),
1382
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
1383
+ )
1384
+ end
1385
+ # Decodes a message payload from the decoder into a new instance.
1386
+ # @rbs (::Nl::Decoder decoder) -> instance
1387
+ def self.decode(decoder)
1388
+ word = decoder.get_u32
1389
+ value_0 = ((word >> 0) & 0xff)
1390
+ value_1 = ((word >> 8) & 0xff)
1391
+ value_2 = ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff))
1392
+ new(value_0, value_1, value_2, decode_attributes(decoder, BY_TYPE, 0))
1393
+ end
1394
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
1395
+ FIXED_HEADER::MEMBERS[:"nfgen_family"].encode(encoder, @nfgen_family)
1396
+ FIXED_HEADER::MEMBERS[:"version"].encode(encoder, @version)
1397
+ FIXED_HEADER::MEMBERS[:"res_id"].encode(encoder, @res_id)
1398
+ encode_attributes(encoder, external_selectors:)
1399
+ end
2004
1400
  # @rbs return: ::Integer
2005
1401
  # @return [Integer]
2006
- def nfgen_family; fixed_header.nfgen_family; end
1402
+ def nfgen_family; @nfgen_family; end
2007
1403
  # @rbs return: ::Integer
2008
1404
  # @return [Integer]
2009
- def version; fixed_header.version; end
1405
+ def version; @version; end
2010
1406
  # @rbs return: ::Integer
2011
1407
  # @return [Integer]
2012
- def res_id; fixed_header.res_id; end
1408
+ def res_id; @res_id; end
2013
1409
  # obsolete
2014
1410
  # @rbs return: ::Integer
2015
1411
  # @return [Integer]
2016
- # @see AttributeSets::ConntrackStatsAttrs::Searched
2017
- def searched; attributes[:"searched"]&.value; end
1412
+ def searched; self[:"searched"]; end
2018
1413
  # @rbs return: ::Integer
2019
1414
  # @return [Integer]
2020
- # @see AttributeSets::ConntrackStatsAttrs::Found
2021
- def found; attributes[:"found"]&.value; end
1415
+ def found; self[:"found"]; end
2022
1416
  # @rbs return: ::Integer
2023
1417
  # @return [Integer]
2024
- # @see AttributeSets::ConntrackStatsAttrs::Insert
2025
- def insert; attributes[:"insert"]&.value; end
1418
+ def insert; self[:"insert"]; end
2026
1419
  # @rbs return: ::Integer
2027
1420
  # @return [Integer]
2028
- # @see AttributeSets::ConntrackStatsAttrs::InsertFailed
2029
- def insert_failed; attributes[:"insert_failed"]&.value; end
1421
+ def insert_failed; self[:"insert_failed"]; end
2030
1422
  # @rbs return: ::Integer
2031
1423
  # @return [Integer]
2032
- # @see AttributeSets::ConntrackStatsAttrs::Drop
2033
- def drop; attributes[:"drop"]&.value; end
1424
+ def drop; self[:"drop"]; end
2034
1425
  # @rbs return: ::Integer
2035
1426
  # @return [Integer]
2036
- # @see AttributeSets::ConntrackStatsAttrs::EarlyDrop
2037
- def early_drop; attributes[:"early_drop"]&.value; end
1427
+ def early_drop; self[:"early_drop"]; end
2038
1428
  # @rbs return: ::Integer
2039
1429
  # @return [Integer]
2040
- # @see AttributeSets::ConntrackStatsAttrs::Error
2041
- def error; attributes[:"error"]&.value; end
1430
+ def error; self[:"error"]; end
2042
1431
  # @rbs return: ::Integer
2043
1432
  # @return [Integer]
2044
- # @see AttributeSets::ConntrackStatsAttrs::SearchRestart
2045
- def search_restart; attributes[:"search_restart"]&.value; end
1433
+ def search_restart; self[:"search_restart"]; end
2046
1434
  # @rbs return: ::Integer
2047
1435
  # @return [Integer]
2048
- # @see AttributeSets::ConntrackStatsAttrs::ClashResolve
2049
- def clash_resolve; attributes[:"clash_resolve"]&.value; end
1436
+ def clash_resolve; self[:"clash_resolve"]; end
2050
1437
  # @rbs return: ::Integer
2051
1438
  # @return [Integer]
2052
- # @see AttributeSets::ConntrackStatsAttrs::ChainToolong
2053
- def chain_toolong; attributes[:"chain_toolong"]&.value; end
1439
+ def chain_toolong; self[:"chain_toolong"]; end
2054
1440
  end
2055
1441
  end
2056
1442
  module Notifications
2057
1443
  end
2058
1444
  # @private
2059
- NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
1445
+ NOTIFICATIONS = {}.freeze #: Hash[::Integer, ::Class]
2060
1446
  # get / dump entries
2061
1447
  # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?tuple_reply: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?zone: ::Integer) -> Messages::DoGetReply
2062
1448
  # @param [Hash] args
@@ -2072,20 +1458,26 @@ class Conntrack < ::Nl::Raw::Family
2072
1458
  exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
2073
1459
  end
2074
1460
  # get / dump entries
2075
- # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?filter: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped])) -> Array[Messages::DumpGetReply]
2076
- # | (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?filter: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped])) { (Messages::DumpGetReply) -> void } -> void
1461
+ # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?tuple_reply: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?mark_mask: ::Integer, ?filter: (AttributeSets::FilterAttrs | ::Hash[::Symbol, untyped]), ?status_mask: ::Integer) -> Array[Messages::DumpGetReply]
1462
+ # | (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?tuple_reply: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?mark_mask: ::Integer, ?filter: (AttributeSets::FilterAttrs | ::Hash[::Symbol, untyped]), ?status_mask: ::Integer) { (Messages::DumpGetReply) -> void } -> void
2077
1463
  # @overload dump_get(**args)
2078
1464
  # Returns an array when no block is given.
2079
1465
  # @param [Hash] args
2080
1466
  # @option args [Integer] nfgen_family
2081
1467
  # @option args [Integer] version
2082
1468
  # @option args [Integer] res_id
1469
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_orig conntrack l3+l4 protocol information, original direction
1470
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_reply conntrack l3+l4 protocol information, reply direction
2083
1471
  # @option args [Integer] status conntrack flag bits
2084
1472
  #
2085
1473
  # Known flags are defined in {Flags::NfCtStatus}.
2086
1474
  # @option args [Integer] mark
2087
1475
  # @option args [Integer] zone conntrack zone id
2088
- # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] filter
1476
+ # @option args [Integer] mark_mask
1477
+ # @option args [AttributeSets::FilterAttrs, Hash<Symbol, Object>] filter
1478
+ # @option args [Integer] status_mask conntrack flag bits to change
1479
+ #
1480
+ # Known flags are defined in {Flags::NfCtStatus}.
2089
1481
  # @return [Array<Messages::DumpGetReply>]
2090
1482
  # @overload dump_get(**args, &block)
2091
1483
  # Yields each reply when a block is given.
@@ -2093,12 +1485,18 @@ class Conntrack < ::Nl::Raw::Family
2093
1485
  # @option args [Integer] nfgen_family
2094
1486
  # @option args [Integer] version
2095
1487
  # @option args [Integer] res_id
1488
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_orig conntrack l3+l4 protocol information, original direction
1489
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_reply conntrack l3+l4 protocol information, reply direction
2096
1490
  # @option args [Integer] status conntrack flag bits
2097
1491
  #
2098
1492
  # Known flags are defined in {Flags::NfCtStatus}.
2099
1493
  # @option args [Integer] mark
2100
1494
  # @option args [Integer] zone conntrack zone id
2101
- # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] filter
1495
+ # @option args [Integer] mark_mask
1496
+ # @option args [AttributeSets::FilterAttrs, Hash<Symbol, Object>] filter
1497
+ # @option args [Integer] status_mask conntrack flag bits to change
1498
+ #
1499
+ # Known flags are defined in {Flags::NfCtStatus}.
2102
1500
  # @yieldparam [Messages::DumpGetReply] reply
2103
1501
  # @return [void]
2104
1502
  # @see Messages::DumpGetRequest
@@ -2147,17 +1545,23 @@ class Conntrack < ::Nl::Raw::Family
2147
1545
  @exchange.call(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
2148
1546
  end
2149
1547
  # get / dump entries
2150
- # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?filter: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped])) -> ::Nl::Async::Stream[Messages::DumpGetReply]
1548
+ # @rbs (?nfgen_family: ::Integer, ?version: ::Integer, ?res_id: ::Integer, ?tuple_orig: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?tuple_reply: (AttributeSets::TupleAttrs | ::Hash[::Symbol, untyped]), ?status: ::Integer, ?mark: ::Integer, ?zone: ::Integer, ?mark_mask: ::Integer, ?filter: (AttributeSets::FilterAttrs | ::Hash[::Symbol, untyped]), ?status_mask: ::Integer) -> ::Nl::Async::Stream[Messages::DumpGetReply]
2151
1549
  # @param [Hash] args
2152
1550
  # @option args [Integer] nfgen_family
2153
1551
  # @option args [Integer] version
2154
1552
  # @option args [Integer] res_id
1553
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_orig conntrack l3+l4 protocol information, original direction
1554
+ # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] tuple_reply conntrack l3+l4 protocol information, reply direction
2155
1555
  # @option args [Integer] status conntrack flag bits
2156
1556
  #
2157
1557
  # Known flags are defined in {Flags::NfCtStatus}.
2158
1558
  # @option args [Integer] mark
2159
1559
  # @option args [Integer] zone conntrack zone id
2160
- # @option args [AttributeSets::TupleAttrs, Hash<Symbol, Object>] filter
1560
+ # @option args [Integer] mark_mask
1561
+ # @option args [AttributeSets::FilterAttrs, Hash<Symbol, Object>] filter
1562
+ # @option args [Integer] status_mask conntrack flag bits to change
1563
+ #
1564
+ # Known flags are defined in {Flags::NfCtStatus}.
2161
1565
  # @return [Nl::Async::Stream<Messages::DumpGetReply>]
2162
1566
  # @see Messages::DumpGetRequest
2163
1567
  def dump_get(**args)