nl-linux 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/NLSPEC_VERSION +1 -1
- data/generated/nl/linux/binder.rb +103 -187
- data/generated/nl/linux/conntrack.rb +1053 -1649
- data/generated/nl/linux/dev_energymodel.rb +303 -265
- data/generated/nl/linux/devlink.rb +4904 -5576
- data/generated/nl/linux/dpll.rb +1097 -1467
- data/generated/nl/linux/drm_ras.rb +235 -195
- data/generated/nl/linux/ethtool.rb +6652 -7415
- data/generated/nl/linux/fou.rb +234 -255
- data/generated/nl/linux/handshake.rb +208 -280
- data/generated/nl/linux/lockd.rb +99 -73
- data/generated/nl/linux/mptcp_pm.rb +589 -687
- data/generated/nl/linux/net_shaper.rb +520 -615
- data/generated/nl/linux/netdev.rb +1640 -1987
- data/generated/nl/linux/nfsd.rb +1341 -1215
- data/generated/nl/linux/nftables.rb +5143 -4870
- data/generated/nl/linux/nl80211.rb +2542 -6316
- data/generated/nl/linux/nlctrl.rb +338 -483
- data/generated/nl/linux/ovpn.rb +1006 -1522
- data/generated/nl/linux/ovs_datapath.rb +291 -186
- data/generated/nl/linux/ovs_flow.rb +1393 -2065
- data/generated/nl/linux/ovs_packet.rb +186 -223
- data/generated/nl/linux/ovs_vport.rb +328 -285
- data/generated/nl/linux/psp.rb +812 -717
- data/generated/nl/linux/rt_addr.rb +513 -243
- data/generated/nl/linux/rt_link.rb +4504 -7238
- data/generated/nl/linux/rt_neigh.rb +935 -847
- data/generated/nl/linux/rt_route.rb +1198 -871
- data/generated/nl/linux/rt_rule.rb +680 -659
- data/generated/nl/linux/sunrpc_cache.rb +323 -321
- data/generated/nl/linux/tc.rb +9058 -10454
- data/generated/nl/linux/tcp_metrics.rb +258 -367
- data/generated/nl/linux/team.rb +327 -345
- data/generated/nl/linux/wireguard.rb +270 -434
- data/lib/nl/linux/nlctrl_resolver.rb +1 -1
- data/lib/nl/linux/version.rb +1 -1
- data/linux/conntrack.yaml +18 -3
- data/linux/devlink.yaml +26 -4
- data/linux/dpll.yaml +19 -0
- data/linux/netdev.yaml +21 -0
- data/linux/nfsd.yaml +111 -0
- data/linux/nl80211.yaml +2 -2
- data/linux/rt-addr.yaml +4 -0
- data/linux/rt-link.yaml +7 -0
- data/linux/rt-neigh.yaml +3 -0
- data/linux/rt-route.yaml +83 -2
- data/sig/generated/nl/linux/binder.rbs +77 -220
- data/sig/generated/nl/linux/conntrack.rbs +770 -1954
- data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
- data/sig/generated/nl/linux/devlink.rbs +3318 -6068
- data/sig/generated/nl/linux/dpll.rbs +791 -1589
- data/sig/generated/nl/linux/drm_ras.rbs +160 -208
- data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
- data/sig/generated/nl/linux/fou.rbs +139 -254
- data/sig/generated/nl/linux/handshake.rbs +144 -319
- data/sig/generated/nl/linux/lockd.rbs +64 -74
- data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
- data/sig/generated/nl/linux/net_shaper.rbs +351 -644
- data/sig/generated/nl/linux/netdev.rbs +1151 -2146
- data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
- data/sig/generated/nl/linux/nftables.rbs +2907 -5030
- data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
- data/sig/generated/nl/linux/nlctrl.rbs +220 -544
- data/sig/generated/nl/linux/ovpn.rbs +835 -1859
- data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
- data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
- data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
- data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
- data/sig/generated/nl/linux/psp.rbs +550 -741
- data/sig/generated/nl/linux/rt_addr.rbs +188 -226
- data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
- data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
- data/sig/generated/nl/linux/rt_route.rbs +632 -862
- data/sig/generated/nl/linux/rt_rule.rbs +217 -639
- data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
- data/sig/generated/nl/linux/tc.rbs +6199 -13391
- data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
- data/sig/generated/nl/linux/team.rbs +232 -391
- data/sig/generated/nl/linux/wireguard.rbs +197 -502
- metadata +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
|
2
2
|
#
|
|
3
|
-
# This file is based on Documentation/netlink/specs/rt-neigh.yaml from Linux v7.
|
|
3
|
+
# This file is based on Documentation/netlink/specs/rt-neigh.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 RtNeigh < ::Nl::Raw::Family
|
|
|
25
25
|
super
|
|
26
26
|
end
|
|
27
27
|
# @private
|
|
28
|
-
MCAST_GROUPS =
|
|
28
|
+
MCAST_GROUPS = {:"rtnlgrp_neigh" => ::Nl::McastGroup.new("rtnlgrp-neigh", 3)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
|
|
29
29
|
module Enums
|
|
30
30
|
module RtmType
|
|
31
31
|
Unspec = 0
|
|
@@ -72,7 +72,6 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
72
72
|
module Structs
|
|
73
73
|
Ndmsg = Struct.new(
|
|
74
74
|
:"ndm_family", #: ::Integer
|
|
75
|
-
:"ndm_pad", #: nil
|
|
76
75
|
:"ndm_ifindex", #: ::Integer
|
|
77
76
|
:"ndm_state", #: ::Integer
|
|
78
77
|
:"ndm_flags", #: ::Integer
|
|
@@ -81,8 +80,6 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
81
80
|
class Ndmsg
|
|
82
81
|
# @!attribute [rw] ndm_family
|
|
83
82
|
# @return [Integer]
|
|
84
|
-
# @!attribute [rw] ndm_pad
|
|
85
|
-
# @return [nil]
|
|
86
83
|
# @!attribute [rw] ndm_ifindex
|
|
87
84
|
# @return [Integer]
|
|
88
85
|
# @!attribute [rw] ndm_state
|
|
@@ -92,14 +89,35 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
92
89
|
# @!attribute [rw] ndm_type
|
|
93
90
|
# @return [Integer]
|
|
94
91
|
# @private
|
|
95
|
-
MEMBERS =
|
|
92
|
+
MEMBERS = {ndm_family: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, ndm_ifindex: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, ndm_state: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, ndm_flags: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, ndm_type: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
93
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
94
|
+
# @private
|
|
95
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
96
|
+
def self.from_params(params, context: nil)
|
|
97
|
+
unknown = params.keys - members
|
|
98
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
99
|
+
self.new(
|
|
100
|
+
MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0), context:),
|
|
101
|
+
MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0), context:),
|
|
102
|
+
MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0), context:),
|
|
103
|
+
MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0), context:),
|
|
104
|
+
MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0), context:),
|
|
105
|
+
)
|
|
106
|
+
end
|
|
96
107
|
# Decodes the struct.
|
|
97
108
|
# @rbs decoder: ::Nl::Decoder
|
|
98
109
|
# @rbs return: instance
|
|
99
110
|
# @param [Nl::Decoder] decoder
|
|
100
111
|
# @return [self]
|
|
101
112
|
def self.decode(decoder)
|
|
102
|
-
|
|
113
|
+
word = decoder.get_u32
|
|
114
|
+
value_0 = ((word >> 0) & 0xff)
|
|
115
|
+
value_2 = decoder.get_host_s32
|
|
116
|
+
word = decoder.get_u32
|
|
117
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
118
|
+
value_4 = ((word >> 16) & 0xff)
|
|
119
|
+
value_5 = ((word >> 24) & 0xff)
|
|
120
|
+
self.new(value_0, value_2, value_3, value_4, value_5)
|
|
103
121
|
end
|
|
104
122
|
# Encodes the struct.
|
|
105
123
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -107,27 +125,41 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
107
125
|
# @param [Nl::Encoder] encoder
|
|
108
126
|
# @return [void]
|
|
109
127
|
def encode(encoder)
|
|
110
|
-
MEMBERS.
|
|
128
|
+
MEMBERS[:"ndm_family"].encode(encoder, public_send(:"ndm_family"))
|
|
129
|
+
encoder.put_string("\x00\x00\x00")
|
|
130
|
+
MEMBERS[:"ndm_ifindex"].encode(encoder, public_send(:"ndm_ifindex"))
|
|
131
|
+
MEMBERS[:"ndm_state"].encode(encoder, public_send(:"ndm_state"))
|
|
132
|
+
MEMBERS[:"ndm_flags"].encode(encoder, public_send(:"ndm_flags"))
|
|
133
|
+
MEMBERS[:"ndm_type"].encode(encoder, public_send(:"ndm_type"))
|
|
111
134
|
end
|
|
112
135
|
end
|
|
113
136
|
Ndtmsg = Struct.new(
|
|
114
137
|
:"family", #: ::Integer
|
|
115
|
-
:"pad", #: nil
|
|
116
138
|
)
|
|
117
139
|
class Ndtmsg
|
|
118
140
|
# @!attribute [rw] family
|
|
119
141
|
# @return [Integer]
|
|
120
|
-
# @!attribute [rw] pad
|
|
121
|
-
# @return [nil]
|
|
122
142
|
# @private
|
|
123
|
-
MEMBERS =
|
|
143
|
+
MEMBERS = {family: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
144
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
145
|
+
# @private
|
|
146
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
147
|
+
def self.from_params(params, context: nil)
|
|
148
|
+
unknown = params.keys - members
|
|
149
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
150
|
+
self.new(
|
|
151
|
+
MEMBERS[:"family"].coerce(params.fetch(:"family", 0), context:),
|
|
152
|
+
)
|
|
153
|
+
end
|
|
124
154
|
# Decodes the struct.
|
|
125
155
|
# @rbs decoder: ::Nl::Decoder
|
|
126
156
|
# @rbs return: instance
|
|
127
157
|
# @param [Nl::Decoder] decoder
|
|
128
158
|
# @return [self]
|
|
129
159
|
def self.decode(decoder)
|
|
130
|
-
|
|
160
|
+
word = decoder.get_u32
|
|
161
|
+
value_0 = ((word >> 0) & 0xff)
|
|
162
|
+
self.new(value_0)
|
|
131
163
|
end
|
|
132
164
|
# Encodes the struct.
|
|
133
165
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -135,7 +167,8 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
135
167
|
# @param [Nl::Encoder] encoder
|
|
136
168
|
# @return [void]
|
|
137
169
|
def encode(encoder)
|
|
138
|
-
MEMBERS.
|
|
170
|
+
MEMBERS[:"family"].encode(encoder, public_send(:"family"))
|
|
171
|
+
encoder.put_string("\x00\x00\x00")
|
|
139
172
|
end
|
|
140
173
|
end
|
|
141
174
|
NdaCacheinfo = Struct.new(
|
|
@@ -154,14 +187,31 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
154
187
|
# @!attribute [rw] refcnt
|
|
155
188
|
# @return [Integer]
|
|
156
189
|
# @private
|
|
157
|
-
MEMBERS =
|
|
190
|
+
MEMBERS = {confirmed: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, used: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, updated: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, refcnt: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
191
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
192
|
+
# @private
|
|
193
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
194
|
+
def self.from_params(params, context: nil)
|
|
195
|
+
unknown = params.keys - members
|
|
196
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
197
|
+
self.new(
|
|
198
|
+
MEMBERS[:"confirmed"].coerce(params.fetch(:"confirmed", 0), context:),
|
|
199
|
+
MEMBERS[:"used"].coerce(params.fetch(:"used", 0), context:),
|
|
200
|
+
MEMBERS[:"updated"].coerce(params.fetch(:"updated", 0), context:),
|
|
201
|
+
MEMBERS[:"refcnt"].coerce(params.fetch(:"refcnt", 0), context:),
|
|
202
|
+
)
|
|
203
|
+
end
|
|
158
204
|
# Decodes the struct.
|
|
159
205
|
# @rbs decoder: ::Nl::Decoder
|
|
160
206
|
# @rbs return: instance
|
|
161
207
|
# @param [Nl::Decoder] decoder
|
|
162
208
|
# @return [self]
|
|
163
209
|
def self.decode(decoder)
|
|
164
|
-
|
|
210
|
+
value_0 = decoder.get_host_u32
|
|
211
|
+
value_1 = decoder.get_host_u32
|
|
212
|
+
value_2 = decoder.get_host_u32
|
|
213
|
+
value_3 = decoder.get_host_u32
|
|
214
|
+
self.new(value_0, value_1, value_2, value_3)
|
|
165
215
|
end
|
|
166
216
|
# Encodes the struct.
|
|
167
217
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -169,7 +219,10 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
169
219
|
# @param [Nl::Encoder] encoder
|
|
170
220
|
# @return [void]
|
|
171
221
|
def encode(encoder)
|
|
172
|
-
MEMBERS.
|
|
222
|
+
MEMBERS[:"confirmed"].encode(encoder, public_send(:"confirmed"))
|
|
223
|
+
MEMBERS[:"used"].encode(encoder, public_send(:"used"))
|
|
224
|
+
MEMBERS[:"updated"].encode(encoder, public_send(:"updated"))
|
|
225
|
+
MEMBERS[:"refcnt"].encode(encoder, public_send(:"refcnt"))
|
|
173
226
|
end
|
|
174
227
|
end
|
|
175
228
|
NdtConfig = Struct.new(
|
|
@@ -203,14 +256,42 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
203
256
|
# @!attribute [rw] proxy_qlen
|
|
204
257
|
# @return [Integer]
|
|
205
258
|
# @private
|
|
206
|
-
MEMBERS =
|
|
259
|
+
MEMBERS = {key_len: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, entry_size: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, entries: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, last_flush: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, last_rand: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, hash_rnd: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, hash_mask: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, hash_chain_gc: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, proxy_qlen: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
260
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
261
|
+
# @private
|
|
262
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
263
|
+
def self.from_params(params, context: nil)
|
|
264
|
+
unknown = params.keys - members
|
|
265
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
266
|
+
self.new(
|
|
267
|
+
MEMBERS[:"key_len"].coerce(params.fetch(:"key_len", 0), context:),
|
|
268
|
+
MEMBERS[:"entry_size"].coerce(params.fetch(:"entry_size", 0), context:),
|
|
269
|
+
MEMBERS[:"entries"].coerce(params.fetch(:"entries", 0), context:),
|
|
270
|
+
MEMBERS[:"last_flush"].coerce(params.fetch(:"last_flush", 0), context:),
|
|
271
|
+
MEMBERS[:"last_rand"].coerce(params.fetch(:"last_rand", 0), context:),
|
|
272
|
+
MEMBERS[:"hash_rnd"].coerce(params.fetch(:"hash_rnd", 0), context:),
|
|
273
|
+
MEMBERS[:"hash_mask"].coerce(params.fetch(:"hash_mask", 0), context:),
|
|
274
|
+
MEMBERS[:"hash_chain_gc"].coerce(params.fetch(:"hash_chain_gc", 0), context:),
|
|
275
|
+
MEMBERS[:"proxy_qlen"].coerce(params.fetch(:"proxy_qlen", 0), context:),
|
|
276
|
+
)
|
|
277
|
+
end
|
|
207
278
|
# Decodes the struct.
|
|
208
279
|
# @rbs decoder: ::Nl::Decoder
|
|
209
280
|
# @rbs return: instance
|
|
210
281
|
# @param [Nl::Decoder] decoder
|
|
211
282
|
# @return [self]
|
|
212
283
|
def self.decode(decoder)
|
|
213
|
-
|
|
284
|
+
word = decoder.get_u32
|
|
285
|
+
value_0 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
286
|
+
value_1 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 16) & 0xffff) : ((((word >> 16) & 0xff) << 8) | ((word >> 24) & 0xff)))
|
|
287
|
+
value_2 = decoder.get_host_u32
|
|
288
|
+
value_3 = decoder.get_host_u32
|
|
289
|
+
value_4 = decoder.get_host_u32
|
|
290
|
+
value_5 = decoder.get_host_u32
|
|
291
|
+
value_6 = decoder.get_host_u32
|
|
292
|
+
value_7 = decoder.get_host_u32
|
|
293
|
+
value_8 = decoder.get_host_u32
|
|
294
|
+
self.new(value_0, value_1, value_2, value_3, value_4, value_5, value_6, value_7, value_8)
|
|
214
295
|
end
|
|
215
296
|
# Encodes the struct.
|
|
216
297
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -218,7 +299,15 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
218
299
|
# @param [Nl::Encoder] encoder
|
|
219
300
|
# @return [void]
|
|
220
301
|
def encode(encoder)
|
|
221
|
-
MEMBERS.
|
|
302
|
+
MEMBERS[:"key_len"].encode(encoder, public_send(:"key_len"))
|
|
303
|
+
MEMBERS[:"entry_size"].encode(encoder, public_send(:"entry_size"))
|
|
304
|
+
MEMBERS[:"entries"].encode(encoder, public_send(:"entries"))
|
|
305
|
+
MEMBERS[:"last_flush"].encode(encoder, public_send(:"last_flush"))
|
|
306
|
+
MEMBERS[:"last_rand"].encode(encoder, public_send(:"last_rand"))
|
|
307
|
+
MEMBERS[:"hash_rnd"].encode(encoder, public_send(:"hash_rnd"))
|
|
308
|
+
MEMBERS[:"hash_mask"].encode(encoder, public_send(:"hash_mask"))
|
|
309
|
+
MEMBERS[:"hash_chain_gc"].encode(encoder, public_send(:"hash_chain_gc"))
|
|
310
|
+
MEMBERS[:"proxy_qlen"].encode(encoder, public_send(:"proxy_qlen"))
|
|
222
311
|
end
|
|
223
312
|
end
|
|
224
313
|
NdtStats = Struct.new(
|
|
@@ -258,14 +347,45 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
258
347
|
# @!attribute [rw] table_fulls
|
|
259
348
|
# @return [Integer]
|
|
260
349
|
# @private
|
|
261
|
-
MEMBERS =
|
|
350
|
+
MEMBERS = {allocs: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, destroys: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, hash_grows: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, res_failed: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, lookups: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, hits: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, rcv_probes_mcast: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, rcv_probes_ucast: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, periodic_gc_runs: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, forced_gc_runs: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, table_fulls: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
|
|
351
|
+
Ractor.make_shareable(MEMBERS) if defined?(Ractor)
|
|
352
|
+
# @private
|
|
353
|
+
# @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
|
|
354
|
+
def self.from_params(params, context: nil)
|
|
355
|
+
unknown = params.keys - members
|
|
356
|
+
raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
|
|
357
|
+
self.new(
|
|
358
|
+
MEMBERS[:"allocs"].coerce(params.fetch(:"allocs", 0), context:),
|
|
359
|
+
MEMBERS[:"destroys"].coerce(params.fetch(:"destroys", 0), context:),
|
|
360
|
+
MEMBERS[:"hash_grows"].coerce(params.fetch(:"hash_grows", 0), context:),
|
|
361
|
+
MEMBERS[:"res_failed"].coerce(params.fetch(:"res_failed", 0), context:),
|
|
362
|
+
MEMBERS[:"lookups"].coerce(params.fetch(:"lookups", 0), context:),
|
|
363
|
+
MEMBERS[:"hits"].coerce(params.fetch(:"hits", 0), context:),
|
|
364
|
+
MEMBERS[:"rcv_probes_mcast"].coerce(params.fetch(:"rcv_probes_mcast", 0), context:),
|
|
365
|
+
MEMBERS[:"rcv_probes_ucast"].coerce(params.fetch(:"rcv_probes_ucast", 0), context:),
|
|
366
|
+
MEMBERS[:"periodic_gc_runs"].coerce(params.fetch(:"periodic_gc_runs", 0), context:),
|
|
367
|
+
MEMBERS[:"forced_gc_runs"].coerce(params.fetch(:"forced_gc_runs", 0), context:),
|
|
368
|
+
MEMBERS[:"table_fulls"].coerce(params.fetch(:"table_fulls", 0), context:),
|
|
369
|
+
)
|
|
370
|
+
end
|
|
262
371
|
# Decodes the struct.
|
|
263
372
|
# @rbs decoder: ::Nl::Decoder
|
|
264
373
|
# @rbs return: instance
|
|
265
374
|
# @param [Nl::Decoder] decoder
|
|
266
375
|
# @return [self]
|
|
267
376
|
def self.decode(decoder)
|
|
268
|
-
|
|
377
|
+
value_0 = decoder.get_host_u64
|
|
378
|
+
value_1 = decoder.get_host_u64
|
|
379
|
+
value_2 = decoder.get_host_u64
|
|
380
|
+
value_3 = decoder.get_host_u64
|
|
381
|
+
value_4 = decoder.get_host_u64
|
|
382
|
+
value_5 = decoder.get_host_u64
|
|
383
|
+
value_6 = decoder.get_host_u64
|
|
384
|
+
value_7 = decoder.get_host_u64
|
|
385
|
+
value_8 = decoder.get_host_u64
|
|
386
|
+
value_9 = decoder.get_host_u64
|
|
387
|
+
value_10 = decoder.get_host_u64
|
|
388
|
+
self.new(value_0, value_1, value_2, value_3, value_4, value_5, value_6, value_7, value_8, value_9, value_10)
|
|
269
389
|
end
|
|
270
390
|
# Encodes the struct.
|
|
271
391
|
# @rbs encoder: ::Nl::Encoder
|
|
@@ -273,1160 +393,1128 @@ class RtNeigh < ::Nl::Raw::Family
|
|
|
273
393
|
# @param [Nl::Encoder] encoder
|
|
274
394
|
# @return [void]
|
|
275
395
|
def encode(encoder)
|
|
276
|
-
MEMBERS.
|
|
396
|
+
MEMBERS[:"allocs"].encode(encoder, public_send(:"allocs"))
|
|
397
|
+
MEMBERS[:"destroys"].encode(encoder, public_send(:"destroys"))
|
|
398
|
+
MEMBERS[:"hash_grows"].encode(encoder, public_send(:"hash_grows"))
|
|
399
|
+
MEMBERS[:"res_failed"].encode(encoder, public_send(:"res_failed"))
|
|
400
|
+
MEMBERS[:"lookups"].encode(encoder, public_send(:"lookups"))
|
|
401
|
+
MEMBERS[:"hits"].encode(encoder, public_send(:"hits"))
|
|
402
|
+
MEMBERS[:"rcv_probes_mcast"].encode(encoder, public_send(:"rcv_probes_mcast"))
|
|
403
|
+
MEMBERS[:"rcv_probes_ucast"].encode(encoder, public_send(:"rcv_probes_ucast"))
|
|
404
|
+
MEMBERS[:"periodic_gc_runs"].encode(encoder, public_send(:"periodic_gc_runs"))
|
|
405
|
+
MEMBERS[:"forced_gc_runs"].encode(encoder, public_send(:"forced_gc_runs"))
|
|
406
|
+
MEMBERS[:"table_fulls"].encode(encoder, public_send(:"table_fulls"))
|
|
277
407
|
end
|
|
278
408
|
end
|
|
279
409
|
end
|
|
280
410
|
module AttributeSets
|
|
281
411
|
class NeighbourAttrs < ::Nl::AttributeSet
|
|
282
|
-
|
|
283
|
-
|
|
412
|
+
module Definitions
|
|
413
|
+
# @rbs return: ::String
|
|
414
|
+
# @return [String]
|
|
415
|
+
def unspec; self[:"unspec"]; end
|
|
416
|
+
# @rbs return: ::String
|
|
417
|
+
# @return [String]
|
|
418
|
+
def dst; self[:"dst"]; end
|
|
419
|
+
# @rbs return: ::String
|
|
420
|
+
# @return [String]
|
|
421
|
+
def lladdr; self[:"lladdr"]; end
|
|
422
|
+
# @rbs return: Structs::NdaCacheinfo
|
|
423
|
+
# @return [Structs::NdaCacheinfo]
|
|
424
|
+
def cacheinfo; self[:"cacheinfo"]; end
|
|
425
|
+
# @rbs return: ::Integer
|
|
426
|
+
# @return [Integer]
|
|
427
|
+
def probes; self[:"probes"]; end
|
|
428
|
+
# @rbs return: ::Integer
|
|
429
|
+
# @return [Integer]
|
|
430
|
+
def vlan; self[:"vlan"]; end
|
|
431
|
+
# @rbs return: ::Integer
|
|
432
|
+
# @return [Integer]
|
|
433
|
+
def port; self[:"port"]; end
|
|
434
|
+
# @rbs return: ::Integer
|
|
435
|
+
# @return [Integer]
|
|
436
|
+
def vni; self[:"vni"]; end
|
|
437
|
+
# @rbs return: ::Integer
|
|
438
|
+
# @return [Integer]
|
|
439
|
+
def ifindex; self[:"ifindex"]; end
|
|
440
|
+
# @rbs return: ::Integer
|
|
441
|
+
# @return [Integer]
|
|
442
|
+
def master; self[:"master"]; end
|
|
443
|
+
# @rbs return: ::Integer
|
|
444
|
+
# @return [Integer]
|
|
445
|
+
def link_netnsid; self[:"link_netnsid"]; end
|
|
446
|
+
# @rbs return: ::Integer
|
|
447
|
+
# @return [Integer]
|
|
448
|
+
def src_vni; self[:"src_vni"]; end
|
|
449
|
+
# @rbs return: ::Integer
|
|
450
|
+
# @return [Integer]
|
|
451
|
+
def protocol; self[:"protocol"]; end
|
|
452
|
+
# @rbs return: ::Integer
|
|
453
|
+
# @return [Integer]
|
|
454
|
+
def nh_id; self[:"nh_id"]; end
|
|
455
|
+
# @rbs return: ::String
|
|
456
|
+
# @return [String]
|
|
457
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
458
|
+
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
459
|
+
# @rbs return: ::Integer
|
|
460
|
+
# @return [Integer]
|
|
461
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
462
|
+
# @rbs return: ::Integer
|
|
463
|
+
# @return [Integer]
|
|
464
|
+
def ndm_state_mask; self[:"ndm_state_mask"]; end
|
|
465
|
+
# @rbs return: ::Integer
|
|
466
|
+
# @return [Integer]
|
|
467
|
+
def ndm_flags_mask; self[:"ndm_flags_mask"]; end
|
|
284
468
|
end
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
# @private
|
|
291
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
292
|
-
end
|
|
293
|
-
class Dst < Attribute
|
|
294
|
-
TYPE = 1
|
|
295
|
-
NAME = :"dst"
|
|
296
|
-
# @private
|
|
297
|
-
ORDER = 1
|
|
298
|
-
# @private
|
|
299
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
300
|
-
end
|
|
301
|
-
class Lladdr < Attribute
|
|
302
|
-
TYPE = 2
|
|
303
|
-
NAME = :"lladdr"
|
|
304
|
-
# @private
|
|
305
|
-
ORDER = 2
|
|
306
|
-
# @private
|
|
307
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
308
|
-
end
|
|
309
|
-
class Cacheinfo < Attribute
|
|
310
|
-
TYPE = 3
|
|
311
|
-
NAME = :"cacheinfo"
|
|
312
|
-
# @private
|
|
313
|
-
ORDER = 3
|
|
314
|
-
# @private
|
|
315
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::NdaCacheinfo, check: nil, consume_remaining: true)
|
|
316
|
-
end
|
|
317
|
-
class Probes < Attribute
|
|
318
|
-
TYPE = 4
|
|
319
|
-
NAME = :"probes"
|
|
320
|
-
# @private
|
|
321
|
-
ORDER = 4
|
|
322
|
-
# @private
|
|
323
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
324
|
-
end
|
|
325
|
-
class Vlan < Attribute
|
|
326
|
-
TYPE = 5
|
|
327
|
-
NAME = :"vlan"
|
|
328
|
-
# @private
|
|
329
|
-
ORDER = 5
|
|
330
|
-
# @private
|
|
331
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
332
|
-
end
|
|
333
|
-
class Port < Attribute
|
|
334
|
-
TYPE = 6
|
|
335
|
-
NAME = :"port"
|
|
336
|
-
# @private
|
|
337
|
-
ORDER = 6
|
|
338
|
-
# @private
|
|
339
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
340
|
-
end
|
|
341
|
-
class Vni < Attribute
|
|
342
|
-
TYPE = 7
|
|
343
|
-
NAME = :"vni"
|
|
344
|
-
# @private
|
|
345
|
-
ORDER = 7
|
|
346
|
-
# @private
|
|
347
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
348
|
-
end
|
|
349
|
-
class Ifindex < Attribute
|
|
350
|
-
TYPE = 8
|
|
351
|
-
NAME = :"ifindex"
|
|
352
|
-
# @private
|
|
353
|
-
ORDER = 8
|
|
354
|
-
# @private
|
|
355
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
356
|
-
end
|
|
357
|
-
class Master < Attribute
|
|
358
|
-
TYPE = 9
|
|
359
|
-
NAME = :"master"
|
|
360
|
-
# @private
|
|
361
|
-
ORDER = 9
|
|
362
|
-
# @private
|
|
363
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
364
|
-
end
|
|
365
|
-
class LinkNetnsid < Attribute
|
|
366
|
-
TYPE = 10
|
|
367
|
-
NAME = :"link_netnsid"
|
|
368
|
-
# @private
|
|
369
|
-
ORDER = 10
|
|
370
|
-
# @private
|
|
371
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
|
|
372
|
-
end
|
|
373
|
-
class SrcVni < Attribute
|
|
374
|
-
TYPE = 11
|
|
375
|
-
NAME = :"src_vni"
|
|
376
|
-
# @private
|
|
377
|
-
ORDER = 11
|
|
378
|
-
# @private
|
|
379
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
380
|
-
end
|
|
381
|
-
class Protocol < Attribute
|
|
382
|
-
TYPE = 12
|
|
383
|
-
NAME = :"protocol"
|
|
384
|
-
# @private
|
|
385
|
-
ORDER = 12
|
|
386
|
-
# @private
|
|
387
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
388
|
-
end
|
|
389
|
-
class NhId < Attribute
|
|
390
|
-
TYPE = 13
|
|
391
|
-
NAME = :"nh_id"
|
|
392
|
-
# @private
|
|
393
|
-
ORDER = 13
|
|
394
|
-
# @private
|
|
395
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
396
|
-
end
|
|
397
|
-
class FdbExtAttrs < Attribute
|
|
398
|
-
TYPE = 14
|
|
399
|
-
NAME = :"fdb_ext_attrs"
|
|
400
|
-
# @private
|
|
401
|
-
ORDER = 14
|
|
402
|
-
# @private
|
|
403
|
-
DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
|
|
404
|
-
end
|
|
405
|
-
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
406
|
-
class FlagsExt < Attribute
|
|
407
|
-
TYPE = 15
|
|
408
|
-
NAME = :"flags_ext"
|
|
409
|
-
# @private
|
|
410
|
-
ORDER = 15
|
|
411
|
-
# @private
|
|
412
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
413
|
-
end
|
|
414
|
-
class NdmStateMask < Attribute
|
|
415
|
-
TYPE = 16
|
|
416
|
-
NAME = :"ndm_state_mask"
|
|
417
|
-
# @private
|
|
418
|
-
ORDER = 16
|
|
419
|
-
# @private
|
|
420
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
|
|
421
|
-
end
|
|
422
|
-
class NdmFlagsMask < Attribute
|
|
423
|
-
TYPE = 17
|
|
424
|
-
NAME = :"ndm_flags_mask"
|
|
425
|
-
# @private
|
|
426
|
-
ORDER = 17
|
|
427
|
-
# @private
|
|
428
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
|
|
429
|
-
end
|
|
430
|
-
# @private
|
|
431
|
-
BY_NAME = Ractor.make_shareable({:"unspec" => Unspec, :"dst" => Dst, :"lladdr" => Lladdr, :"cacheinfo" => Cacheinfo, :"probes" => Probes, :"vlan" => Vlan, :"port" => Port, :"vni" => Vni, :"ifindex" => Ifindex, :"master" => Master, :"link_netnsid" => LinkNetnsid, :"src_vni" => SrcVni, :"protocol" => Protocol, :"nh_id" => NhId, :"fdb_ext_attrs" => FdbExtAttrs, :"flags_ext" => FlagsExt, :"ndm_state_mask" => NdmStateMask, :"ndm_flags_mask" => NdmFlagsMask}) #: Hash[::Symbol, Attribute]
|
|
432
|
-
# @private
|
|
433
|
-
BY_TYPE = Ractor.make_shareable({0 => Unspec, 1 => Dst, 2 => Lladdr, 3 => Cacheinfo, 4 => Probes, 5 => Vlan, 6 => Port, 7 => Vni, 8 => Ifindex, 9 => Master, 10 => LinkNetnsid, 11 => SrcVni, 12 => Protocol, 13 => NhId, 14 => FdbExtAttrs, 15 => FlagsExt, 16 => NdmStateMask, 17 => NdmFlagsMask}) #: Hash[::Integer, Attribute]
|
|
434
|
-
# @rbs return: ::String
|
|
435
|
-
# @return [String]
|
|
436
|
-
# @see Unspec
|
|
437
|
-
def unspec; self[:"unspec"]&.value; end
|
|
438
|
-
# @rbs return: ::String
|
|
439
|
-
# @return [String]
|
|
440
|
-
# @see Dst
|
|
441
|
-
def dst; self[:"dst"]&.value; end
|
|
442
|
-
# @rbs return: ::String
|
|
443
|
-
# @return [String]
|
|
444
|
-
# @see Lladdr
|
|
445
|
-
def lladdr; self[:"lladdr"]&.value; end
|
|
446
|
-
# @rbs return: Structs::NdaCacheinfo
|
|
447
|
-
# @return [Structs::NdaCacheinfo]
|
|
448
|
-
# @see Cacheinfo
|
|
449
|
-
def cacheinfo; self[:"cacheinfo"]&.value; end
|
|
450
|
-
# @rbs return: ::Integer
|
|
451
|
-
# @return [Integer]
|
|
452
|
-
# @see Probes
|
|
453
|
-
def probes; self[:"probes"]&.value; end
|
|
454
|
-
# @rbs return: ::Integer
|
|
455
|
-
# @return [Integer]
|
|
456
|
-
# @see Vlan
|
|
457
|
-
def vlan; self[:"vlan"]&.value; end
|
|
458
|
-
# @rbs return: ::Integer
|
|
459
|
-
# @return [Integer]
|
|
460
|
-
# @see Port
|
|
461
|
-
def port; self[:"port"]&.value; end
|
|
462
|
-
# @rbs return: ::Integer
|
|
463
|
-
# @return [Integer]
|
|
464
|
-
# @see Vni
|
|
465
|
-
def vni; self[:"vni"]&.value; end
|
|
466
|
-
# @rbs return: ::Integer
|
|
467
|
-
# @return [Integer]
|
|
468
|
-
# @see Ifindex
|
|
469
|
-
def ifindex; self[:"ifindex"]&.value; end
|
|
470
|
-
# @rbs return: ::Integer
|
|
471
|
-
# @return [Integer]
|
|
472
|
-
# @see Master
|
|
473
|
-
def master; self[:"master"]&.value; end
|
|
474
|
-
# @rbs return: ::Integer
|
|
475
|
-
# @return [Integer]
|
|
476
|
-
# @see LinkNetnsid
|
|
477
|
-
def link_netnsid; self[:"link_netnsid"]&.value; end
|
|
478
|
-
# @rbs return: ::Integer
|
|
479
|
-
# @return [Integer]
|
|
480
|
-
# @see SrcVni
|
|
481
|
-
def src_vni; self[:"src_vni"]&.value; end
|
|
482
|
-
# @rbs return: ::Integer
|
|
483
|
-
# @return [Integer]
|
|
484
|
-
# @see Protocol
|
|
485
|
-
def protocol; self[:"protocol"]&.value; end
|
|
486
|
-
# @rbs return: ::Integer
|
|
487
|
-
# @return [Integer]
|
|
488
|
-
# @see NhId
|
|
489
|
-
def nh_id; self[:"nh_id"]&.value; end
|
|
490
|
-
# @rbs return: ::String
|
|
491
|
-
# @return [String]
|
|
492
|
-
# @see FdbExtAttrs
|
|
493
|
-
def fdb_ext_attrs; self[:"fdb_ext_attrs"]&.value; end
|
|
494
|
-
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
495
|
-
# @rbs return: ::Integer
|
|
496
|
-
# @return [Integer]
|
|
497
|
-
# @see FlagsExt
|
|
498
|
-
def flags_ext; self[:"flags_ext"]&.value; end
|
|
499
|
-
# @rbs return: ::Integer
|
|
500
|
-
# @return [Integer]
|
|
501
|
-
# @see NdmStateMask
|
|
502
|
-
def ndm_state_mask; self[:"ndm_state_mask"]&.value; end
|
|
503
|
-
# @rbs return: ::Integer
|
|
504
|
-
# @return [Integer]
|
|
505
|
-
# @see NdmFlagsMask
|
|
506
|
-
def ndm_flags_mask; self[:"ndm_flags_mask"]&.value; end
|
|
507
|
-
class << self
|
|
508
|
-
# Looks up Attribute class by name.
|
|
509
|
-
# @rbs name: Symbol
|
|
510
|
-
# @rbs return: Attribute
|
|
511
|
-
# @param [Symbol] name
|
|
512
|
-
# @return [Attribute]
|
|
513
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
514
|
-
# Looks up Attribute class by type value.
|
|
515
|
-
# @rbs type: Integer
|
|
516
|
-
# @rbs return: Attribute
|
|
517
|
-
# @param [Integer] type
|
|
518
|
-
# @return [Attribute]
|
|
519
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
469
|
+
include Definitions
|
|
470
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
471
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
472
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
473
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
520
474
|
end
|
|
521
475
|
end
|
|
522
476
|
class NdtAttrs < ::Nl::AttributeSet
|
|
523
|
-
|
|
524
|
-
|
|
477
|
+
module Definitions
|
|
478
|
+
# @rbs return: ::String
|
|
479
|
+
# @return [String]
|
|
480
|
+
def name; self[:"name"]; end
|
|
481
|
+
# @rbs return: ::Integer
|
|
482
|
+
# @return [Integer]
|
|
483
|
+
def thresh1; self[:"thresh1"]; end
|
|
484
|
+
# @rbs return: ::Integer
|
|
485
|
+
# @return [Integer]
|
|
486
|
+
def thresh2; self[:"thresh2"]; end
|
|
487
|
+
# @rbs return: ::Integer
|
|
488
|
+
# @return [Integer]
|
|
489
|
+
def thresh3; self[:"thresh3"]; end
|
|
490
|
+
# @rbs return: Structs::NdtConfig
|
|
491
|
+
# @return [Structs::NdtConfig]
|
|
492
|
+
def config; self[:"config"]; end
|
|
493
|
+
# @rbs return: AttributeSets::NdtpaAttrs
|
|
494
|
+
# @return [AttributeSets::NdtpaAttrs]
|
|
495
|
+
def parms; self[:"parms"]; end
|
|
496
|
+
# @rbs return: Structs::NdtStats
|
|
497
|
+
# @return [Structs::NdtStats]
|
|
498
|
+
def stats; self[:"stats"]; end
|
|
499
|
+
# @rbs return: ::Integer
|
|
500
|
+
# @return [Integer]
|
|
501
|
+
def gc_interval; self[:"gc_interval"]; end
|
|
525
502
|
end
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
# @private
|
|
532
|
-
DATATYPE = ::Nl::DataTypes::String.new(check: nil)
|
|
533
|
-
end
|
|
534
|
-
class Thresh1 < Attribute
|
|
535
|
-
TYPE = 2
|
|
536
|
-
NAME = :"thresh1"
|
|
537
|
-
# @private
|
|
538
|
-
ORDER = 1
|
|
539
|
-
# @private
|
|
540
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
541
|
-
end
|
|
542
|
-
class Thresh2 < Attribute
|
|
543
|
-
TYPE = 3
|
|
544
|
-
NAME = :"thresh2"
|
|
545
|
-
# @private
|
|
546
|
-
ORDER = 2
|
|
547
|
-
# @private
|
|
548
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
549
|
-
end
|
|
550
|
-
class Thresh3 < Attribute
|
|
551
|
-
TYPE = 4
|
|
552
|
-
NAME = :"thresh3"
|
|
553
|
-
# @private
|
|
554
|
-
ORDER = 3
|
|
555
|
-
# @private
|
|
556
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
557
|
-
end
|
|
558
|
-
class Config < Attribute
|
|
559
|
-
TYPE = 5
|
|
560
|
-
NAME = :"config"
|
|
561
|
-
# @private
|
|
562
|
-
ORDER = 4
|
|
563
|
-
# @private
|
|
564
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::NdtConfig, check: nil, consume_remaining: true)
|
|
565
|
-
end
|
|
566
|
-
class Parms < Attribute
|
|
567
|
-
TYPE = 6
|
|
568
|
-
NAME = :"parms"
|
|
569
|
-
# @private
|
|
570
|
-
ORDER = 5
|
|
571
|
-
end
|
|
572
|
-
class Stats < Attribute
|
|
573
|
-
TYPE = 7
|
|
574
|
-
NAME = :"stats"
|
|
575
|
-
# @private
|
|
576
|
-
ORDER = 6
|
|
577
|
-
# @private
|
|
578
|
-
DATATYPE = ::Nl::DataTypes::Struct.new(Structs::NdtStats, check: nil, consume_remaining: true)
|
|
579
|
-
end
|
|
580
|
-
class GcInterval < Attribute
|
|
581
|
-
TYPE = 8
|
|
582
|
-
NAME = :"gc_interval"
|
|
583
|
-
# @private
|
|
584
|
-
ORDER = 7
|
|
585
|
-
# @private
|
|
586
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
587
|
-
end
|
|
588
|
-
class Pad < Attribute
|
|
589
|
-
TYPE = 9
|
|
590
|
-
NAME = :"pad"
|
|
591
|
-
# @private
|
|
592
|
-
ORDER = 8
|
|
593
|
-
# @private
|
|
594
|
-
DATATYPE = ::Nl::DataTypes::Pad.new()
|
|
595
|
-
end
|
|
596
|
-
# @private
|
|
597
|
-
BY_NAME = Ractor.make_shareable({:"name" => Name, :"thresh1" => Thresh1, :"thresh2" => Thresh2, :"thresh3" => Thresh3, :"config" => Config, :"parms" => Parms, :"stats" => Stats, :"gc_interval" => GcInterval, :"pad" => Pad}) #: Hash[::Symbol, Attribute]
|
|
598
|
-
# @private
|
|
599
|
-
BY_TYPE = Ractor.make_shareable({1 => Name, 2 => Thresh1, 3 => Thresh2, 4 => Thresh3, 5 => Config, 6 => Parms, 7 => Stats, 8 => GcInterval, 9 => Pad}) #: Hash[::Integer, Attribute]
|
|
600
|
-
# @rbs return: ::String
|
|
601
|
-
# @return [String]
|
|
602
|
-
# @see Name
|
|
603
|
-
def name; self[:"name"]&.value; end
|
|
604
|
-
# @rbs return: ::Integer
|
|
605
|
-
# @return [Integer]
|
|
606
|
-
# @see Thresh1
|
|
607
|
-
def thresh1; self[:"thresh1"]&.value; end
|
|
608
|
-
# @rbs return: ::Integer
|
|
609
|
-
# @return [Integer]
|
|
610
|
-
# @see Thresh2
|
|
611
|
-
def thresh2; self[:"thresh2"]&.value; end
|
|
612
|
-
# @rbs return: ::Integer
|
|
613
|
-
# @return [Integer]
|
|
614
|
-
# @see Thresh3
|
|
615
|
-
def thresh3; self[:"thresh3"]&.value; end
|
|
616
|
-
# @rbs return: Structs::NdtConfig
|
|
617
|
-
# @return [Structs::NdtConfig]
|
|
618
|
-
# @see Config
|
|
619
|
-
def config; self[:"config"]&.value; end
|
|
620
|
-
# @rbs return: AttributeSets::NdtpaAttrs
|
|
621
|
-
# @return [AttributeSets::NdtpaAttrs]
|
|
622
|
-
# @see Parms
|
|
623
|
-
def parms; self[:"parms"]&.value; end
|
|
624
|
-
# @rbs return: Structs::NdtStats
|
|
625
|
-
# @return [Structs::NdtStats]
|
|
626
|
-
# @see Stats
|
|
627
|
-
def stats; self[:"stats"]&.value; end
|
|
628
|
-
# @rbs return: ::Integer
|
|
629
|
-
# @return [Integer]
|
|
630
|
-
# @see GcInterval
|
|
631
|
-
def gc_interval; self[:"gc_interval"]&.value; end
|
|
632
|
-
class << self
|
|
633
|
-
# Looks up Attribute class by name.
|
|
634
|
-
# @rbs name: Symbol
|
|
635
|
-
# @rbs return: Attribute
|
|
636
|
-
# @param [Symbol] name
|
|
637
|
-
# @return [Attribute]
|
|
638
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
639
|
-
# Looks up Attribute class by type value.
|
|
640
|
-
# @rbs type: Integer
|
|
641
|
-
# @rbs return: Attribute
|
|
642
|
-
# @param [Integer] type
|
|
643
|
-
# @return [Attribute]
|
|
644
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
503
|
+
include Definitions
|
|
504
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
505
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
506
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
507
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
645
508
|
end
|
|
646
509
|
end
|
|
647
510
|
class NdtpaAttrs < ::Nl::AttributeSet
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
# @
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
# @
|
|
663
|
-
|
|
664
|
-
# @
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
# @
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
# @
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
# @
|
|
687
|
-
|
|
688
|
-
# @
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
# @
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
ORDER = 6
|
|
704
|
-
# @private
|
|
705
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
706
|
-
end
|
|
707
|
-
class QueueLen < Attribute
|
|
708
|
-
TYPE = 8
|
|
709
|
-
NAME = :"queue_len"
|
|
710
|
-
# @private
|
|
711
|
-
ORDER = 7
|
|
712
|
-
# @private
|
|
713
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
714
|
-
end
|
|
715
|
-
class AppProbes < Attribute
|
|
716
|
-
TYPE = 9
|
|
717
|
-
NAME = :"app_probes"
|
|
718
|
-
# @private
|
|
719
|
-
ORDER = 8
|
|
720
|
-
# @private
|
|
721
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
511
|
+
module Definitions
|
|
512
|
+
# @rbs return: ::Integer
|
|
513
|
+
# @return [Integer]
|
|
514
|
+
def ifindex; self[:"ifindex"]; end
|
|
515
|
+
# @rbs return: ::Integer
|
|
516
|
+
# @return [Integer]
|
|
517
|
+
def refcnt; self[:"refcnt"]; end
|
|
518
|
+
# @rbs return: ::Integer
|
|
519
|
+
# @return [Integer]
|
|
520
|
+
def reachable_time; self[:"reachable_time"]; end
|
|
521
|
+
# @rbs return: ::Integer
|
|
522
|
+
# @return [Integer]
|
|
523
|
+
def base_reachable_time; self[:"base_reachable_time"]; end
|
|
524
|
+
# @rbs return: ::Integer
|
|
525
|
+
# @return [Integer]
|
|
526
|
+
def retrans_time; self[:"retrans_time"]; end
|
|
527
|
+
# @rbs return: ::Integer
|
|
528
|
+
# @return [Integer]
|
|
529
|
+
def gc_staletime; self[:"gc_staletime"]; end
|
|
530
|
+
# @rbs return: ::Integer
|
|
531
|
+
# @return [Integer]
|
|
532
|
+
def delay_probe_time; self[:"delay_probe_time"]; end
|
|
533
|
+
# @rbs return: ::Integer
|
|
534
|
+
# @return [Integer]
|
|
535
|
+
def queue_len; self[:"queue_len"]; end
|
|
536
|
+
# @rbs return: ::Integer
|
|
537
|
+
# @return [Integer]
|
|
538
|
+
def app_probes; self[:"app_probes"]; end
|
|
539
|
+
# @rbs return: ::Integer
|
|
540
|
+
# @return [Integer]
|
|
541
|
+
def ucast_probes; self[:"ucast_probes"]; end
|
|
542
|
+
# @rbs return: ::Integer
|
|
543
|
+
# @return [Integer]
|
|
544
|
+
def mcast_probes; self[:"mcast_probes"]; end
|
|
545
|
+
# @rbs return: ::Integer
|
|
546
|
+
# @return [Integer]
|
|
547
|
+
def anycast_delay; self[:"anycast_delay"]; end
|
|
548
|
+
# @rbs return: ::Integer
|
|
549
|
+
# @return [Integer]
|
|
550
|
+
def proxy_delay; self[:"proxy_delay"]; end
|
|
551
|
+
# @rbs return: ::Integer
|
|
552
|
+
# @return [Integer]
|
|
553
|
+
def proxy_qlen; self[:"proxy_qlen"]; end
|
|
554
|
+
# @rbs return: ::Integer
|
|
555
|
+
# @return [Integer]
|
|
556
|
+
def locktime; self[:"locktime"]; end
|
|
557
|
+
# @rbs return: ::Integer
|
|
558
|
+
# @return [Integer]
|
|
559
|
+
def queue_lenbytes; self[:"queue_lenbytes"]; end
|
|
560
|
+
# @rbs return: ::Integer
|
|
561
|
+
# @return [Integer]
|
|
562
|
+
def mcast_reprobes; self[:"mcast_reprobes"]; end
|
|
563
|
+
# @rbs return: ::Integer
|
|
564
|
+
# @return [Integer]
|
|
565
|
+
def interval_probe_time_ms; self[:"interval_probe_time_ms"]; end
|
|
722
566
|
end
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
# @private
|
|
729
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
567
|
+
include Definitions
|
|
568
|
+
# Decodes attributes from the decoder into a new attribute set.
|
|
569
|
+
# @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
|
|
570
|
+
def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
571
|
+
super(decoder, BY_TYPE, 0, external_selectors)
|
|
730
572
|
end
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
# @private
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
# @private
|
|
759
|
-
|
|
760
|
-
# @private
|
|
761
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
762
|
-
end
|
|
763
|
-
class Locktime < Attribute
|
|
764
|
-
TYPE = 15
|
|
765
|
-
NAME = :"locktime"
|
|
766
|
-
# @private
|
|
767
|
-
ORDER = 14
|
|
768
|
-
# @private
|
|
769
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
|
|
770
|
-
end
|
|
771
|
-
class QueueLenbytes < Attribute
|
|
772
|
-
TYPE = 16
|
|
773
|
-
NAME = :"queue_lenbytes"
|
|
774
|
-
# @private
|
|
775
|
-
ORDER = 15
|
|
776
|
-
# @private
|
|
777
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
778
|
-
end
|
|
779
|
-
class McastReprobes < Attribute
|
|
780
|
-
TYPE = 17
|
|
781
|
-
NAME = :"mcast_reprobes"
|
|
782
|
-
# @private
|
|
783
|
-
ORDER = 16
|
|
784
|
-
# @private
|
|
785
|
-
DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
|
|
786
|
-
end
|
|
787
|
-
class Pad < Attribute
|
|
788
|
-
TYPE = 18
|
|
789
|
-
NAME = :"pad"
|
|
790
|
-
# @private
|
|
791
|
-
ORDER = 17
|
|
792
|
-
# @private
|
|
793
|
-
DATATYPE = ::Nl::DataTypes::Pad.new()
|
|
573
|
+
end
|
|
574
|
+
end
|
|
575
|
+
module AttributeSets
|
|
576
|
+
class NeighbourAttrs
|
|
577
|
+
module Definitions
|
|
578
|
+
# @private
|
|
579
|
+
BY_TYPE = ::Array.new(18).tap do |definitions|
|
|
580
|
+
definitions[0] = ::Nl::AttributeSet::Definition.new(id: 0, name: :"unspec", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 0, selector_slot: nil)
|
|
581
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"dst", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 1, selector_slot: nil)
|
|
582
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"lladdr", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 2, selector_slot: nil)
|
|
583
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"cacheinfo", datatype: ::Nl::DataTypes::Struct.new(Structs::NdaCacheinfo, consume_remaining: true), multi: false, order: 3, selector_slot: nil)
|
|
584
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"probes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 4, selector_slot: nil)
|
|
585
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"vlan", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 5, selector_slot: nil)
|
|
586
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"port", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 6, selector_slot: nil)
|
|
587
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"vni", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
|
|
588
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 8, selector_slot: nil)
|
|
589
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"master", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 9, selector_slot: nil)
|
|
590
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"link_netnsid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::S32].new, multi: false, order: 10, selector_slot: nil)
|
|
591
|
+
definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"src_vni", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 11, selector_slot: nil)
|
|
592
|
+
definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"protocol", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 12, selector_slot: nil)
|
|
593
|
+
definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"nh_id", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 13, selector_slot: nil)
|
|
594
|
+
definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"fdb_ext_attrs", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 14, selector_slot: nil)
|
|
595
|
+
definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"flags_ext", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 15, selector_slot: nil)
|
|
596
|
+
definitions[16] = ::Nl::AttributeSet::Definition.new(id: 16, name: :"ndm_state_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U16].new, multi: false, order: 16, selector_slot: nil)
|
|
597
|
+
definitions[17] = ::Nl::AttributeSet::Definition.new(id: 17, name: :"ndm_flags_mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 17, selector_slot: nil)
|
|
598
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
599
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
600
|
+
# @private
|
|
601
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
794
602
|
end
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
# @private
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
603
|
+
end
|
|
604
|
+
class NdtAttrs
|
|
605
|
+
module Definitions
|
|
606
|
+
# @private
|
|
607
|
+
BY_TYPE = ::Array.new(10).tap do |definitions|
|
|
608
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"name", datatype: ::Nl::DataTypes::String.new, multi: false, order: 0, selector_slot: nil)
|
|
609
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"thresh1", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
610
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"thresh2", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 2, selector_slot: nil)
|
|
611
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"thresh3", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
|
|
612
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"config", datatype: ::Nl::DataTypes::Struct.new(Structs::NdtConfig, consume_remaining: true), multi: false, order: 4, selector_slot: nil)
|
|
613
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"parms", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NdtpaAttrs, selector_bindings: []), multi: false, order: 5, selector_slot: nil)
|
|
614
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"stats", datatype: ::Nl::DataTypes::Struct.new(Structs::NdtStats, consume_remaining: true), multi: false, order: 6, selector_slot: nil)
|
|
615
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"gc_interval", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 7, selector_slot: nil)
|
|
616
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"pad", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 8, selector_slot: nil)
|
|
617
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
618
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
619
|
+
# @private
|
|
620
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
802
621
|
end
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
# @rbs return: ::Integer
|
|
832
|
-
# @return [Integer]
|
|
833
|
-
# @see DelayProbeTime
|
|
834
|
-
def delay_probe_time; self[:"delay_probe_time"]&.value; end
|
|
835
|
-
# @rbs return: ::Integer
|
|
836
|
-
# @return [Integer]
|
|
837
|
-
# @see QueueLen
|
|
838
|
-
def queue_len; self[:"queue_len"]&.value; end
|
|
839
|
-
# @rbs return: ::Integer
|
|
840
|
-
# @return [Integer]
|
|
841
|
-
# @see AppProbes
|
|
842
|
-
def app_probes; self[:"app_probes"]&.value; end
|
|
843
|
-
# @rbs return: ::Integer
|
|
844
|
-
# @return [Integer]
|
|
845
|
-
# @see UcastProbes
|
|
846
|
-
def ucast_probes; self[:"ucast_probes"]&.value; end
|
|
847
|
-
# @rbs return: ::Integer
|
|
848
|
-
# @return [Integer]
|
|
849
|
-
# @see McastProbes
|
|
850
|
-
def mcast_probes; self[:"mcast_probes"]&.value; end
|
|
851
|
-
# @rbs return: ::Integer
|
|
852
|
-
# @return [Integer]
|
|
853
|
-
# @see AnycastDelay
|
|
854
|
-
def anycast_delay; self[:"anycast_delay"]&.value; end
|
|
855
|
-
# @rbs return: ::Integer
|
|
856
|
-
# @return [Integer]
|
|
857
|
-
# @see ProxyDelay
|
|
858
|
-
def proxy_delay; self[:"proxy_delay"]&.value; end
|
|
859
|
-
# @rbs return: ::Integer
|
|
860
|
-
# @return [Integer]
|
|
861
|
-
# @see ProxyQlen
|
|
862
|
-
def proxy_qlen; self[:"proxy_qlen"]&.value; end
|
|
863
|
-
# @rbs return: ::Integer
|
|
864
|
-
# @return [Integer]
|
|
865
|
-
# @see Locktime
|
|
866
|
-
def locktime; self[:"locktime"]&.value; end
|
|
867
|
-
# @rbs return: ::Integer
|
|
868
|
-
# @return [Integer]
|
|
869
|
-
# @see QueueLenbytes
|
|
870
|
-
def queue_lenbytes; self[:"queue_lenbytes"]&.value; end
|
|
871
|
-
# @rbs return: ::Integer
|
|
872
|
-
# @return [Integer]
|
|
873
|
-
# @see McastReprobes
|
|
874
|
-
def mcast_reprobes; self[:"mcast_reprobes"]&.value; end
|
|
875
|
-
# @rbs return: ::Integer
|
|
876
|
-
# @return [Integer]
|
|
877
|
-
# @see IntervalProbeTimeMs
|
|
878
|
-
def interval_probe_time_ms; self[:"interval_probe_time_ms"]&.value; end
|
|
879
|
-
class << self
|
|
880
|
-
# Looks up Attribute class by name.
|
|
881
|
-
# @rbs name: Symbol
|
|
882
|
-
# @rbs return: Attribute
|
|
883
|
-
# @param [Symbol] name
|
|
884
|
-
# @return [Attribute]
|
|
885
|
-
def by_name(name); BY_NAME.fetch(name); end
|
|
886
|
-
# Looks up Attribute class by type value.
|
|
887
|
-
# @rbs type: Integer
|
|
888
|
-
# @rbs return: Attribute
|
|
889
|
-
# @param [Integer] type
|
|
890
|
-
# @return [Attribute]
|
|
891
|
-
def by_type(type); BY_TYPE.fetch(type); end
|
|
622
|
+
end
|
|
623
|
+
class NdtpaAttrs
|
|
624
|
+
module Definitions
|
|
625
|
+
# @private
|
|
626
|
+
BY_TYPE = ::Array.new(20).tap do |definitions|
|
|
627
|
+
definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
|
|
628
|
+
definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"refcnt", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
|
|
629
|
+
definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"reachable_time", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 2, selector_slot: nil)
|
|
630
|
+
definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"base_reachable_time", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 3, selector_slot: nil)
|
|
631
|
+
definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"retrans_time", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 4, selector_slot: nil)
|
|
632
|
+
definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"gc_staletime", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 5, selector_slot: nil)
|
|
633
|
+
definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"delay_probe_time", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 6, selector_slot: nil)
|
|
634
|
+
definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"queue_len", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
|
|
635
|
+
definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"app_probes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 8, selector_slot: nil)
|
|
636
|
+
definitions[10] = ::Nl::AttributeSet::Definition.new(id: 10, name: :"ucast_probes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 9, selector_slot: nil)
|
|
637
|
+
definitions[11] = ::Nl::AttributeSet::Definition.new(id: 11, name: :"mcast_probes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 10, selector_slot: nil)
|
|
638
|
+
definitions[12] = ::Nl::AttributeSet::Definition.new(id: 12, name: :"anycast_delay", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 11, selector_slot: nil)
|
|
639
|
+
definitions[13] = ::Nl::AttributeSet::Definition.new(id: 13, name: :"proxy_delay", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 12, selector_slot: nil)
|
|
640
|
+
definitions[14] = ::Nl::AttributeSet::Definition.new(id: 14, name: :"proxy_qlen", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 13, selector_slot: nil)
|
|
641
|
+
definitions[15] = ::Nl::AttributeSet::Definition.new(id: 15, name: :"locktime", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 14, selector_slot: nil)
|
|
642
|
+
definitions[16] = ::Nl::AttributeSet::Definition.new(id: 16, name: :"queue_lenbytes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 15, selector_slot: nil)
|
|
643
|
+
definitions[17] = ::Nl::AttributeSet::Definition.new(id: 17, name: :"mcast_reprobes", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 16, selector_slot: nil)
|
|
644
|
+
definitions[18] = ::Nl::AttributeSet::Definition.new(id: 18, name: :"pad", datatype: ::Nl::DataTypes::Pad.new(), multi: false, order: 17, selector_slot: nil)
|
|
645
|
+
definitions[19] = ::Nl::AttributeSet::Definition.new(id: 19, name: :"interval_probe_time_ms", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1; raise ArgumentError, "Value #{it.inspect} is greater than maximum 86400000" unless it <= 86400000 } }), multi: false, order: 18, selector_slot: nil)
|
|
646
|
+
end.freeze #: Array[::Nl::AttributeSet::Definition?]
|
|
647
|
+
Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
|
|
648
|
+
# @private
|
|
649
|
+
BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
|
|
892
650
|
end
|
|
893
651
|
end
|
|
894
|
-
# @private
|
|
895
|
-
NdtAttrs::Parms::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::NdtpaAttrs, selector_bindings: Ractor.make_shareable([]))
|
|
896
652
|
end
|
|
897
653
|
module Messages
|
|
898
654
|
# Add new neighbour entry
|
|
899
|
-
class DoNewneighRequest < ::Nl::
|
|
655
|
+
class DoNewneighRequest < ::Nl::Message
|
|
900
656
|
TYPE = 28
|
|
901
657
|
FIXED_HEADER = Structs::Ndmsg
|
|
902
658
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
903
|
-
ATTRIBUTES =
|
|
659
|
+
ATTRIBUTES = %i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext].freeze
|
|
660
|
+
include ATTRIBUTE_SET::Definitions
|
|
661
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
662
|
+
@ndm_family = ndm_family
|
|
663
|
+
@ndm_ifindex = ndm_ifindex
|
|
664
|
+
@ndm_state = ndm_state
|
|
665
|
+
@ndm_flags = ndm_flags
|
|
666
|
+
@ndm_type = ndm_type
|
|
667
|
+
@attributes = attributes
|
|
668
|
+
end
|
|
669
|
+
# @private
|
|
670
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
671
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
672
|
+
new(
|
|
673
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
674
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
675
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
676
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
677
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
678
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
679
|
+
)
|
|
680
|
+
end
|
|
681
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
682
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
683
|
+
def self.decode(decoder)
|
|
684
|
+
word = decoder.get_u32
|
|
685
|
+
value_0 = ((word >> 0) & 0xff)
|
|
686
|
+
value_2 = decoder.get_host_s32
|
|
687
|
+
word = decoder.get_u32
|
|
688
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
689
|
+
value_4 = ((word >> 16) & 0xff)
|
|
690
|
+
value_5 = ((word >> 24) & 0xff)
|
|
691
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
692
|
+
end
|
|
693
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
694
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
695
|
+
encoder.put_string("\x00\x00\x00")
|
|
696
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
697
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
698
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
699
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
700
|
+
encode_attributes(encoder, external_selectors:)
|
|
701
|
+
end
|
|
904
702
|
# @rbs return: ::Integer
|
|
905
703
|
# @return [Integer]
|
|
906
|
-
def ndm_family;
|
|
704
|
+
def ndm_family; @ndm_family; end
|
|
907
705
|
# @rbs return: ::Integer
|
|
908
706
|
# @return [Integer]
|
|
909
|
-
def ndm_ifindex;
|
|
707
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
910
708
|
# @rbs return: ::Integer
|
|
911
709
|
# @return [Integer]
|
|
912
|
-
def ndm_state;
|
|
710
|
+
def ndm_state; @ndm_state; end
|
|
913
711
|
# @rbs return: ::Integer
|
|
914
712
|
# @return [Integer]
|
|
915
|
-
def ndm_flags;
|
|
713
|
+
def ndm_flags; @ndm_flags; end
|
|
916
714
|
# @rbs return: ::Integer
|
|
917
715
|
# @return [Integer]
|
|
918
|
-
def ndm_type;
|
|
716
|
+
def ndm_type; @ndm_type; end
|
|
919
717
|
# @rbs return: ::String
|
|
920
718
|
# @return [String]
|
|
921
|
-
|
|
922
|
-
def dst; attributes[:"dst"]&.value; end
|
|
719
|
+
def dst; self[:"dst"]; end
|
|
923
720
|
# @rbs return: ::String
|
|
924
721
|
# @return [String]
|
|
925
|
-
|
|
926
|
-
def lladdr; attributes[:"lladdr"]&.value; end
|
|
722
|
+
def lladdr; self[:"lladdr"]; end
|
|
927
723
|
# @rbs return: ::Integer
|
|
928
724
|
# @return [Integer]
|
|
929
|
-
|
|
930
|
-
def probes; attributes[:"probes"]&.value; end
|
|
725
|
+
def probes; self[:"probes"]; end
|
|
931
726
|
# @rbs return: ::Integer
|
|
932
727
|
# @return [Integer]
|
|
933
|
-
|
|
934
|
-
def vlan; attributes[:"vlan"]&.value; end
|
|
728
|
+
def vlan; self[:"vlan"]; end
|
|
935
729
|
# @rbs return: ::Integer
|
|
936
730
|
# @return [Integer]
|
|
937
|
-
|
|
938
|
-
def port; attributes[:"port"]&.value; end
|
|
731
|
+
def port; self[:"port"]; end
|
|
939
732
|
# @rbs return: ::Integer
|
|
940
733
|
# @return [Integer]
|
|
941
|
-
|
|
942
|
-
def vni; attributes[:"vni"]&.value; end
|
|
734
|
+
def vni; self[:"vni"]; end
|
|
943
735
|
# @rbs return: ::Integer
|
|
944
736
|
# @return [Integer]
|
|
945
|
-
|
|
946
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
737
|
+
def ifindex; self[:"ifindex"]; end
|
|
947
738
|
# @rbs return: ::Integer
|
|
948
739
|
# @return [Integer]
|
|
949
|
-
|
|
950
|
-
def master; attributes[:"master"]&.value; end
|
|
740
|
+
def master; self[:"master"]; end
|
|
951
741
|
# @rbs return: ::Integer
|
|
952
742
|
# @return [Integer]
|
|
953
|
-
|
|
954
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
743
|
+
def protocol; self[:"protocol"]; end
|
|
955
744
|
# @rbs return: ::Integer
|
|
956
745
|
# @return [Integer]
|
|
957
|
-
|
|
958
|
-
def nh_id; attributes[:"nh_id"]&.value; end
|
|
746
|
+
def nh_id; self[:"nh_id"]; end
|
|
959
747
|
# @rbs return: ::String
|
|
960
748
|
# @return [String]
|
|
961
|
-
|
|
962
|
-
def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
|
|
749
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
963
750
|
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
964
751
|
# @rbs return: ::Integer
|
|
965
752
|
# @return [Integer]
|
|
966
|
-
|
|
967
|
-
def flags_ext; attributes[:"flags_ext"]&.value; end
|
|
753
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
968
754
|
end
|
|
969
755
|
# Remove an existing neighbour entry
|
|
970
|
-
class DoDelneighRequest < ::Nl::
|
|
756
|
+
class DoDelneighRequest < ::Nl::Message
|
|
971
757
|
TYPE = 29
|
|
972
758
|
FIXED_HEADER = Structs::Ndmsg
|
|
973
759
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
974
|
-
ATTRIBUTES =
|
|
760
|
+
ATTRIBUTES = %i[dst ifindex].freeze
|
|
761
|
+
include ATTRIBUTE_SET::Definitions
|
|
762
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
763
|
+
@ndm_family = ndm_family
|
|
764
|
+
@ndm_ifindex = ndm_ifindex
|
|
765
|
+
@ndm_state = ndm_state
|
|
766
|
+
@ndm_flags = ndm_flags
|
|
767
|
+
@ndm_type = ndm_type
|
|
768
|
+
@attributes = attributes
|
|
769
|
+
end
|
|
770
|
+
# @private
|
|
771
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
772
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
773
|
+
new(
|
|
774
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
775
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
776
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
777
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
778
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
779
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
780
|
+
)
|
|
781
|
+
end
|
|
782
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
783
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
784
|
+
def self.decode(decoder)
|
|
785
|
+
word = decoder.get_u32
|
|
786
|
+
value_0 = ((word >> 0) & 0xff)
|
|
787
|
+
value_2 = decoder.get_host_s32
|
|
788
|
+
word = decoder.get_u32
|
|
789
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
790
|
+
value_4 = ((word >> 16) & 0xff)
|
|
791
|
+
value_5 = ((word >> 24) & 0xff)
|
|
792
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
793
|
+
end
|
|
794
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
795
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
796
|
+
encoder.put_string("\x00\x00\x00")
|
|
797
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
798
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
799
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
800
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
801
|
+
encode_attributes(encoder, external_selectors:)
|
|
802
|
+
end
|
|
975
803
|
# @rbs return: ::Integer
|
|
976
804
|
# @return [Integer]
|
|
977
|
-
def ndm_family;
|
|
805
|
+
def ndm_family; @ndm_family; end
|
|
978
806
|
# @rbs return: ::Integer
|
|
979
807
|
# @return [Integer]
|
|
980
|
-
def ndm_ifindex;
|
|
808
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
981
809
|
# @rbs return: ::Integer
|
|
982
810
|
# @return [Integer]
|
|
983
|
-
def ndm_state;
|
|
811
|
+
def ndm_state; @ndm_state; end
|
|
984
812
|
# @rbs return: ::Integer
|
|
985
813
|
# @return [Integer]
|
|
986
|
-
def ndm_flags;
|
|
814
|
+
def ndm_flags; @ndm_flags; end
|
|
987
815
|
# @rbs return: ::Integer
|
|
988
816
|
# @return [Integer]
|
|
989
|
-
def ndm_type;
|
|
817
|
+
def ndm_type; @ndm_type; end
|
|
990
818
|
# @rbs return: ::String
|
|
991
819
|
# @return [String]
|
|
992
|
-
|
|
993
|
-
def dst; attributes[:"dst"]&.value; end
|
|
820
|
+
def dst; self[:"dst"]; end
|
|
994
821
|
# @rbs return: ::Integer
|
|
995
822
|
# @return [Integer]
|
|
996
|
-
|
|
997
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
823
|
+
def ifindex; self[:"ifindex"]; end
|
|
998
824
|
end
|
|
999
825
|
# Get or dump neighbour entries
|
|
1000
|
-
class DoGetneighRequest < ::Nl::
|
|
826
|
+
class DoGetneighRequest < ::Nl::Message
|
|
1001
827
|
TYPE = 30
|
|
1002
828
|
FIXED_HEADER = Structs::Ndmsg
|
|
1003
829
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1004
|
-
ATTRIBUTES =
|
|
830
|
+
ATTRIBUTES = %i[dst].freeze
|
|
831
|
+
include ATTRIBUTE_SET::Definitions
|
|
832
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
833
|
+
@ndm_family = ndm_family
|
|
834
|
+
@ndm_ifindex = ndm_ifindex
|
|
835
|
+
@ndm_state = ndm_state
|
|
836
|
+
@ndm_flags = ndm_flags
|
|
837
|
+
@ndm_type = ndm_type
|
|
838
|
+
@attributes = attributes
|
|
839
|
+
end
|
|
840
|
+
# @private
|
|
841
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
842
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
843
|
+
new(
|
|
844
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
845
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
846
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
847
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
848
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
849
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
850
|
+
)
|
|
851
|
+
end
|
|
852
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
853
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
854
|
+
def self.decode(decoder)
|
|
855
|
+
word = decoder.get_u32
|
|
856
|
+
value_0 = ((word >> 0) & 0xff)
|
|
857
|
+
value_2 = decoder.get_host_s32
|
|
858
|
+
word = decoder.get_u32
|
|
859
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
860
|
+
value_4 = ((word >> 16) & 0xff)
|
|
861
|
+
value_5 = ((word >> 24) & 0xff)
|
|
862
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
863
|
+
end
|
|
864
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
865
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
866
|
+
encoder.put_string("\x00\x00\x00")
|
|
867
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
868
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
869
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
870
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
871
|
+
encode_attributes(encoder, external_selectors:)
|
|
872
|
+
end
|
|
1005
873
|
# @rbs return: ::Integer
|
|
1006
874
|
# @return [Integer]
|
|
1007
|
-
def ndm_family;
|
|
875
|
+
def ndm_family; @ndm_family; end
|
|
1008
876
|
# @rbs return: ::Integer
|
|
1009
877
|
# @return [Integer]
|
|
1010
|
-
def ndm_ifindex;
|
|
878
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1011
879
|
# @rbs return: ::Integer
|
|
1012
880
|
# @return [Integer]
|
|
1013
|
-
def ndm_state;
|
|
881
|
+
def ndm_state; @ndm_state; end
|
|
1014
882
|
# @rbs return: ::Integer
|
|
1015
883
|
# @return [Integer]
|
|
1016
|
-
def ndm_flags;
|
|
884
|
+
def ndm_flags; @ndm_flags; end
|
|
1017
885
|
# @rbs return: ::Integer
|
|
1018
886
|
# @return [Integer]
|
|
1019
|
-
def ndm_type;
|
|
887
|
+
def ndm_type; @ndm_type; end
|
|
1020
888
|
# @rbs return: ::String
|
|
1021
889
|
# @return [String]
|
|
1022
|
-
|
|
1023
|
-
def dst; attributes[:"dst"]&.value; end
|
|
890
|
+
def dst; self[:"dst"]; end
|
|
1024
891
|
end
|
|
1025
892
|
# Get or dump neighbour entries
|
|
1026
|
-
class DoGetneighReply < ::Nl::
|
|
893
|
+
class DoGetneighReply < ::Nl::Message
|
|
1027
894
|
TYPE = 28
|
|
1028
895
|
FIXED_HEADER = Structs::Ndmsg
|
|
1029
896
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1030
|
-
ATTRIBUTES =
|
|
897
|
+
ATTRIBUTES = %i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext].freeze
|
|
898
|
+
include ATTRIBUTE_SET::Definitions
|
|
899
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
900
|
+
@ndm_family = ndm_family
|
|
901
|
+
@ndm_ifindex = ndm_ifindex
|
|
902
|
+
@ndm_state = ndm_state
|
|
903
|
+
@ndm_flags = ndm_flags
|
|
904
|
+
@ndm_type = ndm_type
|
|
905
|
+
@attributes = attributes
|
|
906
|
+
end
|
|
907
|
+
# @private
|
|
908
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
909
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
910
|
+
new(
|
|
911
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
912
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
913
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
914
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
915
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
916
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
917
|
+
)
|
|
918
|
+
end
|
|
919
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
920
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
921
|
+
def self.decode(decoder)
|
|
922
|
+
word = decoder.get_u32
|
|
923
|
+
value_0 = ((word >> 0) & 0xff)
|
|
924
|
+
value_2 = decoder.get_host_s32
|
|
925
|
+
word = decoder.get_u32
|
|
926
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
927
|
+
value_4 = ((word >> 16) & 0xff)
|
|
928
|
+
value_5 = ((word >> 24) & 0xff)
|
|
929
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
930
|
+
end
|
|
931
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
932
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
933
|
+
encoder.put_string("\x00\x00\x00")
|
|
934
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
935
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
936
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
937
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
938
|
+
encode_attributes(encoder, external_selectors:)
|
|
939
|
+
end
|
|
1031
940
|
# @rbs return: ::Integer
|
|
1032
941
|
# @return [Integer]
|
|
1033
|
-
def ndm_family;
|
|
942
|
+
def ndm_family; @ndm_family; end
|
|
1034
943
|
# @rbs return: ::Integer
|
|
1035
944
|
# @return [Integer]
|
|
1036
|
-
def ndm_ifindex;
|
|
945
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1037
946
|
# @rbs return: ::Integer
|
|
1038
947
|
# @return [Integer]
|
|
1039
|
-
def ndm_state;
|
|
948
|
+
def ndm_state; @ndm_state; end
|
|
1040
949
|
# @rbs return: ::Integer
|
|
1041
950
|
# @return [Integer]
|
|
1042
|
-
def ndm_flags;
|
|
951
|
+
def ndm_flags; @ndm_flags; end
|
|
1043
952
|
# @rbs return: ::Integer
|
|
1044
953
|
# @return [Integer]
|
|
1045
|
-
def ndm_type;
|
|
954
|
+
def ndm_type; @ndm_type; end
|
|
1046
955
|
# @rbs return: ::String
|
|
1047
956
|
# @return [String]
|
|
1048
|
-
|
|
1049
|
-
def dst; attributes[:"dst"]&.value; end
|
|
957
|
+
def dst; self[:"dst"]; end
|
|
1050
958
|
# @rbs return: ::String
|
|
1051
959
|
# @return [String]
|
|
1052
|
-
|
|
1053
|
-
def lladdr; attributes[:"lladdr"]&.value; end
|
|
960
|
+
def lladdr; self[:"lladdr"]; end
|
|
1054
961
|
# @rbs return: ::Integer
|
|
1055
962
|
# @return [Integer]
|
|
1056
|
-
|
|
1057
|
-
def probes; attributes[:"probes"]&.value; end
|
|
963
|
+
def probes; self[:"probes"]; end
|
|
1058
964
|
# @rbs return: ::Integer
|
|
1059
965
|
# @return [Integer]
|
|
1060
|
-
|
|
1061
|
-
def vlan; attributes[:"vlan"]&.value; end
|
|
966
|
+
def vlan; self[:"vlan"]; end
|
|
1062
967
|
# @rbs return: ::Integer
|
|
1063
968
|
# @return [Integer]
|
|
1064
|
-
|
|
1065
|
-
def port; attributes[:"port"]&.value; end
|
|
969
|
+
def port; self[:"port"]; end
|
|
1066
970
|
# @rbs return: ::Integer
|
|
1067
971
|
# @return [Integer]
|
|
1068
|
-
|
|
1069
|
-
def vni; attributes[:"vni"]&.value; end
|
|
972
|
+
def vni; self[:"vni"]; end
|
|
1070
973
|
# @rbs return: ::Integer
|
|
1071
974
|
# @return [Integer]
|
|
1072
|
-
|
|
1073
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
975
|
+
def ifindex; self[:"ifindex"]; end
|
|
1074
976
|
# @rbs return: ::Integer
|
|
1075
977
|
# @return [Integer]
|
|
1076
|
-
|
|
1077
|
-
def master; attributes[:"master"]&.value; end
|
|
978
|
+
def master; self[:"master"]; end
|
|
1078
979
|
# @rbs return: ::Integer
|
|
1079
980
|
# @return [Integer]
|
|
1080
|
-
|
|
1081
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
981
|
+
def protocol; self[:"protocol"]; end
|
|
1082
982
|
# @rbs return: ::Integer
|
|
1083
983
|
# @return [Integer]
|
|
1084
|
-
|
|
1085
|
-
def nh_id; attributes[:"nh_id"]&.value; end
|
|
984
|
+
def nh_id; self[:"nh_id"]; end
|
|
1086
985
|
# @rbs return: ::String
|
|
1087
986
|
# @return [String]
|
|
1088
|
-
|
|
1089
|
-
def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
|
|
987
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
1090
988
|
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
1091
989
|
# @rbs return: ::Integer
|
|
1092
990
|
# @return [Integer]
|
|
1093
|
-
|
|
1094
|
-
def flags_ext; attributes[:"flags_ext"]&.value; end
|
|
991
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
1095
992
|
end
|
|
1096
993
|
# Get or dump neighbour entries
|
|
1097
|
-
class DumpGetneighRequest < ::Nl::
|
|
994
|
+
class DumpGetneighRequest < ::Nl::Message
|
|
1098
995
|
TYPE = 30
|
|
1099
996
|
FIXED_HEADER = Structs::Ndmsg
|
|
1100
997
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1101
|
-
ATTRIBUTES =
|
|
998
|
+
ATTRIBUTES = %i[ifindex master].freeze
|
|
999
|
+
include ATTRIBUTE_SET::Definitions
|
|
1000
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
1001
|
+
@ndm_family = ndm_family
|
|
1002
|
+
@ndm_ifindex = ndm_ifindex
|
|
1003
|
+
@ndm_state = ndm_state
|
|
1004
|
+
@ndm_flags = ndm_flags
|
|
1005
|
+
@ndm_type = ndm_type
|
|
1006
|
+
@attributes = attributes
|
|
1007
|
+
end
|
|
1008
|
+
# @private
|
|
1009
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1010
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1011
|
+
new(
|
|
1012
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
1013
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
1014
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
1015
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
1016
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
1017
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1018
|
+
)
|
|
1019
|
+
end
|
|
1020
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1021
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1022
|
+
def self.decode(decoder)
|
|
1023
|
+
word = decoder.get_u32
|
|
1024
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1025
|
+
value_2 = decoder.get_host_s32
|
|
1026
|
+
word = decoder.get_u32
|
|
1027
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
1028
|
+
value_4 = ((word >> 16) & 0xff)
|
|
1029
|
+
value_5 = ((word >> 24) & 0xff)
|
|
1030
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
1031
|
+
end
|
|
1032
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1033
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
1034
|
+
encoder.put_string("\x00\x00\x00")
|
|
1035
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
1036
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
1037
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
1038
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
1039
|
+
encode_attributes(encoder, external_selectors:)
|
|
1040
|
+
end
|
|
1102
1041
|
# @rbs return: ::Integer
|
|
1103
1042
|
# @return [Integer]
|
|
1104
|
-
def ndm_family;
|
|
1043
|
+
def ndm_family; @ndm_family; end
|
|
1105
1044
|
# @rbs return: ::Integer
|
|
1106
1045
|
# @return [Integer]
|
|
1107
|
-
def ndm_ifindex;
|
|
1046
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1108
1047
|
# @rbs return: ::Integer
|
|
1109
1048
|
# @return [Integer]
|
|
1110
|
-
def ndm_state;
|
|
1049
|
+
def ndm_state; @ndm_state; end
|
|
1111
1050
|
# @rbs return: ::Integer
|
|
1112
1051
|
# @return [Integer]
|
|
1113
|
-
def ndm_flags;
|
|
1052
|
+
def ndm_flags; @ndm_flags; end
|
|
1114
1053
|
# @rbs return: ::Integer
|
|
1115
1054
|
# @return [Integer]
|
|
1116
|
-
def ndm_type;
|
|
1055
|
+
def ndm_type; @ndm_type; end
|
|
1117
1056
|
# @rbs return: ::Integer
|
|
1118
1057
|
# @return [Integer]
|
|
1119
|
-
|
|
1120
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1058
|
+
def ifindex; self[:"ifindex"]; end
|
|
1121
1059
|
# @rbs return: ::Integer
|
|
1122
1060
|
# @return [Integer]
|
|
1123
|
-
|
|
1124
|
-
def master; attributes[:"master"]&.value; end
|
|
1061
|
+
def master; self[:"master"]; end
|
|
1125
1062
|
end
|
|
1126
1063
|
# Get or dump neighbour entries
|
|
1127
|
-
class DumpGetneighReply < ::Nl::
|
|
1064
|
+
class DumpGetneighReply < ::Nl::Message
|
|
1128
1065
|
TYPE = 28
|
|
1129
1066
|
FIXED_HEADER = Structs::Ndmsg
|
|
1130
1067
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1131
|
-
ATTRIBUTES =
|
|
1068
|
+
ATTRIBUTES = %i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext].freeze
|
|
1069
|
+
include ATTRIBUTE_SET::Definitions
|
|
1070
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
1071
|
+
@ndm_family = ndm_family
|
|
1072
|
+
@ndm_ifindex = ndm_ifindex
|
|
1073
|
+
@ndm_state = ndm_state
|
|
1074
|
+
@ndm_flags = ndm_flags
|
|
1075
|
+
@ndm_type = ndm_type
|
|
1076
|
+
@attributes = attributes
|
|
1077
|
+
end
|
|
1078
|
+
# @private
|
|
1079
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1080
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1081
|
+
new(
|
|
1082
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
1083
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
1084
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
1085
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
1086
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
1087
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1088
|
+
)
|
|
1089
|
+
end
|
|
1090
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1091
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1092
|
+
def self.decode(decoder)
|
|
1093
|
+
word = decoder.get_u32
|
|
1094
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1095
|
+
value_2 = decoder.get_host_s32
|
|
1096
|
+
word = decoder.get_u32
|
|
1097
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
1098
|
+
value_4 = ((word >> 16) & 0xff)
|
|
1099
|
+
value_5 = ((word >> 24) & 0xff)
|
|
1100
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
1101
|
+
end
|
|
1102
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1103
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
1104
|
+
encoder.put_string("\x00\x00\x00")
|
|
1105
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
1106
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
1107
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
1108
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
1109
|
+
encode_attributes(encoder, external_selectors:)
|
|
1110
|
+
end
|
|
1132
1111
|
# @rbs return: ::Integer
|
|
1133
1112
|
# @return [Integer]
|
|
1134
|
-
def ndm_family;
|
|
1113
|
+
def ndm_family; @ndm_family; end
|
|
1135
1114
|
# @rbs return: ::Integer
|
|
1136
1115
|
# @return [Integer]
|
|
1137
|
-
def ndm_ifindex;
|
|
1116
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1138
1117
|
# @rbs return: ::Integer
|
|
1139
1118
|
# @return [Integer]
|
|
1140
|
-
def ndm_state;
|
|
1119
|
+
def ndm_state; @ndm_state; end
|
|
1141
1120
|
# @rbs return: ::Integer
|
|
1142
1121
|
# @return [Integer]
|
|
1143
|
-
def ndm_flags;
|
|
1122
|
+
def ndm_flags; @ndm_flags; end
|
|
1144
1123
|
# @rbs return: ::Integer
|
|
1145
1124
|
# @return [Integer]
|
|
1146
|
-
def ndm_type;
|
|
1125
|
+
def ndm_type; @ndm_type; end
|
|
1147
1126
|
# @rbs return: ::String
|
|
1148
1127
|
# @return [String]
|
|
1149
|
-
|
|
1150
|
-
def dst; attributes[:"dst"]&.value; end
|
|
1128
|
+
def dst; self[:"dst"]; end
|
|
1151
1129
|
# @rbs return: ::String
|
|
1152
1130
|
# @return [String]
|
|
1153
|
-
|
|
1154
|
-
def lladdr; attributes[:"lladdr"]&.value; end
|
|
1131
|
+
def lladdr; self[:"lladdr"]; end
|
|
1155
1132
|
# @rbs return: ::Integer
|
|
1156
1133
|
# @return [Integer]
|
|
1157
|
-
|
|
1158
|
-
def probes; attributes[:"probes"]&.value; end
|
|
1134
|
+
def probes; self[:"probes"]; end
|
|
1159
1135
|
# @rbs return: ::Integer
|
|
1160
1136
|
# @return [Integer]
|
|
1161
|
-
|
|
1162
|
-
def vlan; attributes[:"vlan"]&.value; end
|
|
1137
|
+
def vlan; self[:"vlan"]; end
|
|
1163
1138
|
# @rbs return: ::Integer
|
|
1164
1139
|
# @return [Integer]
|
|
1165
|
-
|
|
1166
|
-
def port; attributes[:"port"]&.value; end
|
|
1140
|
+
def port; self[:"port"]; end
|
|
1167
1141
|
# @rbs return: ::Integer
|
|
1168
1142
|
# @return [Integer]
|
|
1169
|
-
|
|
1170
|
-
def vni; attributes[:"vni"]&.value; end
|
|
1143
|
+
def vni; self[:"vni"]; end
|
|
1171
1144
|
# @rbs return: ::Integer
|
|
1172
1145
|
# @return [Integer]
|
|
1173
|
-
|
|
1174
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1146
|
+
def ifindex; self[:"ifindex"]; end
|
|
1175
1147
|
# @rbs return: ::Integer
|
|
1176
1148
|
# @return [Integer]
|
|
1177
|
-
|
|
1178
|
-
def master; attributes[:"master"]&.value; end
|
|
1149
|
+
def master; self[:"master"]; end
|
|
1179
1150
|
# @rbs return: ::Integer
|
|
1180
1151
|
# @return [Integer]
|
|
1181
|
-
|
|
1182
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
1152
|
+
def protocol; self[:"protocol"]; end
|
|
1183
1153
|
# @rbs return: ::Integer
|
|
1184
1154
|
# @return [Integer]
|
|
1185
|
-
|
|
1186
|
-
def nh_id; attributes[:"nh_id"]&.value; end
|
|
1155
|
+
def nh_id; self[:"nh_id"]; end
|
|
1187
1156
|
# @rbs return: ::String
|
|
1188
1157
|
# @return [String]
|
|
1189
|
-
|
|
1190
|
-
def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
|
|
1158
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
1191
1159
|
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
1192
1160
|
# @rbs return: ::Integer
|
|
1193
1161
|
# @return [Integer]
|
|
1194
|
-
|
|
1195
|
-
def flags_ext; attributes[:"flags_ext"]&.value; end
|
|
1162
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
1196
1163
|
end
|
|
1197
1164
|
# Get or dump neighbour tables
|
|
1198
|
-
class DumpGetneightblRequest < ::Nl::
|
|
1165
|
+
class DumpGetneightblRequest < ::Nl::Message
|
|
1199
1166
|
TYPE = 66
|
|
1200
1167
|
FIXED_HEADER = Structs::Ndtmsg
|
|
1201
1168
|
ATTRIBUTE_SET = AttributeSets::NdtAttrs
|
|
1202
|
-
ATTRIBUTES =
|
|
1169
|
+
ATTRIBUTES = %i[].freeze
|
|
1170
|
+
include ATTRIBUTE_SET::Definitions
|
|
1171
|
+
def initialize(family, attributes = [])
|
|
1172
|
+
@family = family
|
|
1173
|
+
@attributes = attributes
|
|
1174
|
+
end
|
|
1175
|
+
# @private
|
|
1176
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1177
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1178
|
+
new(
|
|
1179
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
1180
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1181
|
+
)
|
|
1182
|
+
end
|
|
1183
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1184
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1185
|
+
def self.decode(decoder)
|
|
1186
|
+
word = decoder.get_u32
|
|
1187
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1188
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
1189
|
+
end
|
|
1190
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1191
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
1192
|
+
encoder.put_string("\x00\x00\x00")
|
|
1193
|
+
encode_attributes(encoder, external_selectors:)
|
|
1194
|
+
end
|
|
1203
1195
|
# @rbs return: ::Integer
|
|
1204
1196
|
# @return [Integer]
|
|
1205
|
-
def family;
|
|
1197
|
+
def family; @family; end
|
|
1206
1198
|
end
|
|
1207
1199
|
# Get or dump neighbour tables
|
|
1208
|
-
class DumpGetneightblReply < ::Nl::
|
|
1200
|
+
class DumpGetneightblReply < ::Nl::Message
|
|
1209
1201
|
TYPE = 64
|
|
1210
1202
|
FIXED_HEADER = Structs::Ndtmsg
|
|
1211
1203
|
ATTRIBUTE_SET = AttributeSets::NdtAttrs
|
|
1212
|
-
ATTRIBUTES =
|
|
1204
|
+
ATTRIBUTES = %i[name thresh1 thresh2 thresh3 config parms stats gc_interval].freeze
|
|
1205
|
+
include ATTRIBUTE_SET::Definitions
|
|
1206
|
+
def initialize(family, attributes = [])
|
|
1207
|
+
@family = family
|
|
1208
|
+
@attributes = attributes
|
|
1209
|
+
end
|
|
1210
|
+
# @private
|
|
1211
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1212
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1213
|
+
new(
|
|
1214
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
1215
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1216
|
+
)
|
|
1217
|
+
end
|
|
1218
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1219
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1220
|
+
def self.decode(decoder)
|
|
1221
|
+
word = decoder.get_u32
|
|
1222
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1223
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
1224
|
+
end
|
|
1225
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1226
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
1227
|
+
encoder.put_string("\x00\x00\x00")
|
|
1228
|
+
encode_attributes(encoder, external_selectors:)
|
|
1229
|
+
end
|
|
1213
1230
|
# @rbs return: ::Integer
|
|
1214
1231
|
# @return [Integer]
|
|
1215
|
-
def family;
|
|
1232
|
+
def family; @family; end
|
|
1216
1233
|
# @rbs return: ::String
|
|
1217
1234
|
# @return [String]
|
|
1218
|
-
|
|
1219
|
-
def name; attributes[:"name"]&.value; end
|
|
1235
|
+
def name; self[:"name"]; end
|
|
1220
1236
|
# @rbs return: ::Integer
|
|
1221
1237
|
# @return [Integer]
|
|
1222
|
-
|
|
1223
|
-
def thresh1; attributes[:"thresh1"]&.value; end
|
|
1238
|
+
def thresh1; self[:"thresh1"]; end
|
|
1224
1239
|
# @rbs return: ::Integer
|
|
1225
1240
|
# @return [Integer]
|
|
1226
|
-
|
|
1227
|
-
def thresh2; attributes[:"thresh2"]&.value; end
|
|
1241
|
+
def thresh2; self[:"thresh2"]; end
|
|
1228
1242
|
# @rbs return: ::Integer
|
|
1229
1243
|
# @return [Integer]
|
|
1230
|
-
|
|
1231
|
-
def thresh3; attributes[:"thresh3"]&.value; end
|
|
1244
|
+
def thresh3; self[:"thresh3"]; end
|
|
1232
1245
|
# @rbs return: Structs::NdtConfig
|
|
1233
1246
|
# @return [Structs::NdtConfig]
|
|
1234
|
-
|
|
1235
|
-
def config; attributes[:"config"]&.value; end
|
|
1247
|
+
def config; self[:"config"]; end
|
|
1236
1248
|
# @rbs return: AttributeSets::NdtpaAttrs
|
|
1237
1249
|
# @return [AttributeSets::NdtpaAttrs]
|
|
1238
|
-
|
|
1239
|
-
def parms; attributes[:"parms"]&.value; end
|
|
1250
|
+
def parms; self[:"parms"]; end
|
|
1240
1251
|
# @rbs return: Structs::NdtStats
|
|
1241
1252
|
# @return [Structs::NdtStats]
|
|
1242
|
-
|
|
1243
|
-
def stats; attributes[:"stats"]&.value; end
|
|
1253
|
+
def stats; self[:"stats"]; end
|
|
1244
1254
|
# @rbs return: ::Integer
|
|
1245
1255
|
# @return [Integer]
|
|
1246
|
-
|
|
1247
|
-
def gc_interval; attributes[:"gc_interval"]&.value; end
|
|
1256
|
+
def gc_interval; self[:"gc_interval"]; end
|
|
1248
1257
|
end
|
|
1249
1258
|
# Set neighbour tables
|
|
1250
|
-
class DoSetneightblRequest < ::Nl::
|
|
1259
|
+
class DoSetneightblRequest < ::Nl::Message
|
|
1251
1260
|
TYPE = 67
|
|
1252
1261
|
FIXED_HEADER = Structs::Ndtmsg
|
|
1253
1262
|
ATTRIBUTE_SET = AttributeSets::NdtAttrs
|
|
1254
|
-
ATTRIBUTES =
|
|
1263
|
+
ATTRIBUTES = %i[name thresh1 thresh2 thresh3 parms gc_interval].freeze
|
|
1264
|
+
include ATTRIBUTE_SET::Definitions
|
|
1265
|
+
def initialize(family, attributes = [])
|
|
1266
|
+
@family = family
|
|
1267
|
+
@attributes = attributes
|
|
1268
|
+
end
|
|
1269
|
+
# @private
|
|
1270
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1271
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1272
|
+
new(
|
|
1273
|
+
FIXED_HEADER::MEMBERS[:"family"].coerce(params.fetch(:"family", 0)),
|
|
1274
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1275
|
+
)
|
|
1276
|
+
end
|
|
1277
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1278
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1279
|
+
def self.decode(decoder)
|
|
1280
|
+
word = decoder.get_u32
|
|
1281
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1282
|
+
new(value_0, decode_attributes(decoder, BY_TYPE, 0))
|
|
1283
|
+
end
|
|
1284
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1285
|
+
FIXED_HEADER::MEMBERS[:"family"].encode(encoder, @family)
|
|
1286
|
+
encoder.put_string("\x00\x00\x00")
|
|
1287
|
+
encode_attributes(encoder, external_selectors:)
|
|
1288
|
+
end
|
|
1255
1289
|
# @rbs return: ::Integer
|
|
1256
1290
|
# @return [Integer]
|
|
1257
|
-
def family;
|
|
1291
|
+
def family; @family; end
|
|
1258
1292
|
# @rbs return: ::String
|
|
1259
1293
|
# @return [String]
|
|
1260
|
-
|
|
1261
|
-
def name; attributes[:"name"]&.value; end
|
|
1294
|
+
def name; self[:"name"]; end
|
|
1262
1295
|
# @rbs return: ::Integer
|
|
1263
1296
|
# @return [Integer]
|
|
1264
|
-
|
|
1265
|
-
def thresh1; attributes[:"thresh1"]&.value; end
|
|
1297
|
+
def thresh1; self[:"thresh1"]; end
|
|
1266
1298
|
# @rbs return: ::Integer
|
|
1267
1299
|
# @return [Integer]
|
|
1268
|
-
|
|
1269
|
-
def thresh2; attributes[:"thresh2"]&.value; end
|
|
1300
|
+
def thresh2; self[:"thresh2"]; end
|
|
1270
1301
|
# @rbs return: ::Integer
|
|
1271
1302
|
# @return [Integer]
|
|
1272
|
-
|
|
1273
|
-
def thresh3; attributes[:"thresh3"]&.value; end
|
|
1303
|
+
def thresh3; self[:"thresh3"]; end
|
|
1274
1304
|
# @rbs return: AttributeSets::NdtpaAttrs
|
|
1275
1305
|
# @return [AttributeSets::NdtpaAttrs]
|
|
1276
|
-
|
|
1277
|
-
def parms; attributes[:"parms"]&.value; end
|
|
1306
|
+
def parms; self[:"parms"]; end
|
|
1278
1307
|
# @rbs return: ::Integer
|
|
1279
1308
|
# @return [Integer]
|
|
1280
|
-
|
|
1281
|
-
def gc_interval; attributes[:"gc_interval"]&.value; end
|
|
1309
|
+
def gc_interval; self[:"gc_interval"]; end
|
|
1282
1310
|
end
|
|
1283
1311
|
end
|
|
1284
1312
|
module Notifications
|
|
1285
1313
|
# Notify a neighbour deletion
|
|
1286
|
-
class DelneighNtf < ::Nl::
|
|
1314
|
+
class DelneighNtf < ::Nl::Message
|
|
1287
1315
|
TYPE = 29
|
|
1288
1316
|
FIXED_HEADER = Structs::Ndmsg
|
|
1289
1317
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1290
|
-
ATTRIBUTES =
|
|
1318
|
+
ATTRIBUTES = %i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext].freeze
|
|
1319
|
+
include ATTRIBUTE_SET::Definitions
|
|
1320
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
1321
|
+
@ndm_family = ndm_family
|
|
1322
|
+
@ndm_ifindex = ndm_ifindex
|
|
1323
|
+
@ndm_state = ndm_state
|
|
1324
|
+
@ndm_flags = ndm_flags
|
|
1325
|
+
@ndm_type = ndm_type
|
|
1326
|
+
@attributes = attributes
|
|
1327
|
+
end
|
|
1328
|
+
# @private
|
|
1329
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1330
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1331
|
+
new(
|
|
1332
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
1333
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
1334
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
1335
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
1336
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
1337
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1338
|
+
)
|
|
1339
|
+
end
|
|
1340
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1341
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1342
|
+
def self.decode(decoder)
|
|
1343
|
+
word = decoder.get_u32
|
|
1344
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1345
|
+
value_2 = decoder.get_host_s32
|
|
1346
|
+
word = decoder.get_u32
|
|
1347
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
1348
|
+
value_4 = ((word >> 16) & 0xff)
|
|
1349
|
+
value_5 = ((word >> 24) & 0xff)
|
|
1350
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
1351
|
+
end
|
|
1352
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1353
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
1354
|
+
encoder.put_string("\x00\x00\x00")
|
|
1355
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
1356
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
1357
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
1358
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
1359
|
+
encode_attributes(encoder, external_selectors:)
|
|
1360
|
+
end
|
|
1291
1361
|
# @rbs return: ::Integer
|
|
1292
1362
|
# @return [Integer]
|
|
1293
|
-
def ndm_family;
|
|
1363
|
+
def ndm_family; @ndm_family; end
|
|
1294
1364
|
# @rbs return: ::Integer
|
|
1295
1365
|
# @return [Integer]
|
|
1296
|
-
def ndm_ifindex;
|
|
1366
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1297
1367
|
# @rbs return: ::Integer
|
|
1298
1368
|
# @return [Integer]
|
|
1299
|
-
def ndm_state;
|
|
1369
|
+
def ndm_state; @ndm_state; end
|
|
1300
1370
|
# @rbs return: ::Integer
|
|
1301
1371
|
# @return [Integer]
|
|
1302
|
-
def ndm_flags;
|
|
1372
|
+
def ndm_flags; @ndm_flags; end
|
|
1303
1373
|
# @rbs return: ::Integer
|
|
1304
1374
|
# @return [Integer]
|
|
1305
|
-
def ndm_type;
|
|
1375
|
+
def ndm_type; @ndm_type; end
|
|
1306
1376
|
# @rbs return: ::String
|
|
1307
1377
|
# @return [String]
|
|
1308
|
-
|
|
1309
|
-
def dst; attributes[:"dst"]&.value; end
|
|
1378
|
+
def dst; self[:"dst"]; end
|
|
1310
1379
|
# @rbs return: ::String
|
|
1311
1380
|
# @return [String]
|
|
1312
|
-
|
|
1313
|
-
def lladdr; attributes[:"lladdr"]&.value; end
|
|
1381
|
+
def lladdr; self[:"lladdr"]; end
|
|
1314
1382
|
# @rbs return: ::Integer
|
|
1315
1383
|
# @return [Integer]
|
|
1316
|
-
|
|
1317
|
-
def probes; attributes[:"probes"]&.value; end
|
|
1384
|
+
def probes; self[:"probes"]; end
|
|
1318
1385
|
# @rbs return: ::Integer
|
|
1319
1386
|
# @return [Integer]
|
|
1320
|
-
|
|
1321
|
-
def vlan; attributes[:"vlan"]&.value; end
|
|
1387
|
+
def vlan; self[:"vlan"]; end
|
|
1322
1388
|
# @rbs return: ::Integer
|
|
1323
1389
|
# @return [Integer]
|
|
1324
|
-
|
|
1325
|
-
def port; attributes[:"port"]&.value; end
|
|
1390
|
+
def port; self[:"port"]; end
|
|
1326
1391
|
# @rbs return: ::Integer
|
|
1327
1392
|
# @return [Integer]
|
|
1328
|
-
|
|
1329
|
-
def vni; attributes[:"vni"]&.value; end
|
|
1393
|
+
def vni; self[:"vni"]; end
|
|
1330
1394
|
# @rbs return: ::Integer
|
|
1331
1395
|
# @return [Integer]
|
|
1332
|
-
|
|
1333
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1396
|
+
def ifindex; self[:"ifindex"]; end
|
|
1334
1397
|
# @rbs return: ::Integer
|
|
1335
1398
|
# @return [Integer]
|
|
1336
|
-
|
|
1337
|
-
def master; attributes[:"master"]&.value; end
|
|
1399
|
+
def master; self[:"master"]; end
|
|
1338
1400
|
# @rbs return: ::Integer
|
|
1339
1401
|
# @return [Integer]
|
|
1340
|
-
|
|
1341
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
1402
|
+
def protocol; self[:"protocol"]; end
|
|
1342
1403
|
# @rbs return: ::Integer
|
|
1343
1404
|
# @return [Integer]
|
|
1344
|
-
|
|
1345
|
-
def nh_id; attributes[:"nh_id"]&.value; end
|
|
1405
|
+
def nh_id; self[:"nh_id"]; end
|
|
1346
1406
|
# @rbs return: ::String
|
|
1347
1407
|
# @return [String]
|
|
1348
|
-
|
|
1349
|
-
def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
|
|
1408
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
1350
1409
|
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
1351
1410
|
# @rbs return: ::Integer
|
|
1352
1411
|
# @return [Integer]
|
|
1353
|
-
|
|
1354
|
-
def flags_ext; attributes[:"flags_ext"]&.value; end
|
|
1412
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
1355
1413
|
end
|
|
1356
1414
|
# Notify a neighbour creation
|
|
1357
|
-
class NewneighNtf < ::Nl::
|
|
1415
|
+
class NewneighNtf < ::Nl::Message
|
|
1358
1416
|
TYPE = 28
|
|
1359
1417
|
FIXED_HEADER = Structs::Ndmsg
|
|
1360
1418
|
ATTRIBUTE_SET = AttributeSets::NeighbourAttrs
|
|
1361
|
-
ATTRIBUTES =
|
|
1419
|
+
ATTRIBUTES = %i[dst lladdr probes vlan port vni ifindex master protocol nh_id fdb_ext_attrs flags_ext].freeze
|
|
1420
|
+
include ATTRIBUTE_SET::Definitions
|
|
1421
|
+
def initialize(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, attributes = [])
|
|
1422
|
+
@ndm_family = ndm_family
|
|
1423
|
+
@ndm_ifindex = ndm_ifindex
|
|
1424
|
+
@ndm_state = ndm_state
|
|
1425
|
+
@ndm_flags = ndm_flags
|
|
1426
|
+
@ndm_type = ndm_type
|
|
1427
|
+
@attributes = attributes
|
|
1428
|
+
end
|
|
1429
|
+
# @private
|
|
1430
|
+
def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1431
|
+
validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
|
|
1432
|
+
new(
|
|
1433
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].coerce(params.fetch(:"ndm_family", 0)),
|
|
1434
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].coerce(params.fetch(:"ndm_ifindex", 0)),
|
|
1435
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].coerce(params.fetch(:"ndm_state", 0)),
|
|
1436
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].coerce(params.fetch(:"ndm_flags", 0)),
|
|
1437
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].coerce(params.fetch(:"ndm_type", 0)),
|
|
1438
|
+
build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
|
|
1439
|
+
)
|
|
1440
|
+
end
|
|
1441
|
+
# Decodes a message payload from the decoder into a new instance.
|
|
1442
|
+
# @rbs (::Nl::Decoder decoder) -> instance
|
|
1443
|
+
def self.decode(decoder)
|
|
1444
|
+
word = decoder.get_u32
|
|
1445
|
+
value_0 = ((word >> 0) & 0xff)
|
|
1446
|
+
value_2 = decoder.get_host_s32
|
|
1447
|
+
word = decoder.get_u32
|
|
1448
|
+
value_3 = (::IO::Buffer::HOST_ENDIAN == ::IO::Buffer::LITTLE_ENDIAN ? ((word >> 0) & 0xffff) : ((((word >> 0) & 0xff) << 8) | ((word >> 8) & 0xff)))
|
|
1449
|
+
value_4 = ((word >> 16) & 0xff)
|
|
1450
|
+
value_5 = ((word >> 24) & 0xff)
|
|
1451
|
+
new(value_0, value_2, value_3, value_4, value_5, decode_attributes(decoder, BY_TYPE, 0))
|
|
1452
|
+
end
|
|
1453
|
+
def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
|
|
1454
|
+
FIXED_HEADER::MEMBERS[:"ndm_family"].encode(encoder, @ndm_family)
|
|
1455
|
+
encoder.put_string("\x00\x00\x00")
|
|
1456
|
+
FIXED_HEADER::MEMBERS[:"ndm_ifindex"].encode(encoder, @ndm_ifindex)
|
|
1457
|
+
FIXED_HEADER::MEMBERS[:"ndm_state"].encode(encoder, @ndm_state)
|
|
1458
|
+
FIXED_HEADER::MEMBERS[:"ndm_flags"].encode(encoder, @ndm_flags)
|
|
1459
|
+
FIXED_HEADER::MEMBERS[:"ndm_type"].encode(encoder, @ndm_type)
|
|
1460
|
+
encode_attributes(encoder, external_selectors:)
|
|
1461
|
+
end
|
|
1362
1462
|
# @rbs return: ::Integer
|
|
1363
1463
|
# @return [Integer]
|
|
1364
|
-
def ndm_family;
|
|
1464
|
+
def ndm_family; @ndm_family; end
|
|
1365
1465
|
# @rbs return: ::Integer
|
|
1366
1466
|
# @return [Integer]
|
|
1367
|
-
def ndm_ifindex;
|
|
1467
|
+
def ndm_ifindex; @ndm_ifindex; end
|
|
1368
1468
|
# @rbs return: ::Integer
|
|
1369
1469
|
# @return [Integer]
|
|
1370
|
-
def ndm_state;
|
|
1470
|
+
def ndm_state; @ndm_state; end
|
|
1371
1471
|
# @rbs return: ::Integer
|
|
1372
1472
|
# @return [Integer]
|
|
1373
|
-
def ndm_flags;
|
|
1473
|
+
def ndm_flags; @ndm_flags; end
|
|
1374
1474
|
# @rbs return: ::Integer
|
|
1375
1475
|
# @return [Integer]
|
|
1376
|
-
def ndm_type;
|
|
1476
|
+
def ndm_type; @ndm_type; end
|
|
1377
1477
|
# @rbs return: ::String
|
|
1378
1478
|
# @return [String]
|
|
1379
|
-
|
|
1380
|
-
def dst; attributes[:"dst"]&.value; end
|
|
1479
|
+
def dst; self[:"dst"]; end
|
|
1381
1480
|
# @rbs return: ::String
|
|
1382
1481
|
# @return [String]
|
|
1383
|
-
|
|
1384
|
-
def lladdr; attributes[:"lladdr"]&.value; end
|
|
1482
|
+
def lladdr; self[:"lladdr"]; end
|
|
1385
1483
|
# @rbs return: ::Integer
|
|
1386
1484
|
# @return [Integer]
|
|
1387
|
-
|
|
1388
|
-
def probes; attributes[:"probes"]&.value; end
|
|
1485
|
+
def probes; self[:"probes"]; end
|
|
1389
1486
|
# @rbs return: ::Integer
|
|
1390
1487
|
# @return [Integer]
|
|
1391
|
-
|
|
1392
|
-
def vlan; attributes[:"vlan"]&.value; end
|
|
1488
|
+
def vlan; self[:"vlan"]; end
|
|
1393
1489
|
# @rbs return: ::Integer
|
|
1394
1490
|
# @return [Integer]
|
|
1395
|
-
|
|
1396
|
-
def port; attributes[:"port"]&.value; end
|
|
1491
|
+
def port; self[:"port"]; end
|
|
1397
1492
|
# @rbs return: ::Integer
|
|
1398
1493
|
# @return [Integer]
|
|
1399
|
-
|
|
1400
|
-
def vni; attributes[:"vni"]&.value; end
|
|
1494
|
+
def vni; self[:"vni"]; end
|
|
1401
1495
|
# @rbs return: ::Integer
|
|
1402
1496
|
# @return [Integer]
|
|
1403
|
-
|
|
1404
|
-
def ifindex; attributes[:"ifindex"]&.value; end
|
|
1497
|
+
def ifindex; self[:"ifindex"]; end
|
|
1405
1498
|
# @rbs return: ::Integer
|
|
1406
1499
|
# @return [Integer]
|
|
1407
|
-
|
|
1408
|
-
def master; attributes[:"master"]&.value; end
|
|
1500
|
+
def master; self[:"master"]; end
|
|
1409
1501
|
# @rbs return: ::Integer
|
|
1410
1502
|
# @return [Integer]
|
|
1411
|
-
|
|
1412
|
-
def protocol; attributes[:"protocol"]&.value; end
|
|
1503
|
+
def protocol; self[:"protocol"]; end
|
|
1413
1504
|
# @rbs return: ::Integer
|
|
1414
1505
|
# @return [Integer]
|
|
1415
|
-
|
|
1416
|
-
def nh_id; attributes[:"nh_id"]&.value; end
|
|
1506
|
+
def nh_id; self[:"nh_id"]; end
|
|
1417
1507
|
# @rbs return: ::String
|
|
1418
1508
|
# @return [String]
|
|
1419
|
-
|
|
1420
|
-
def fdb_ext_attrs; attributes[:"fdb_ext_attrs"]&.value; end
|
|
1509
|
+
def fdb_ext_attrs; self[:"fdb_ext_attrs"]; end
|
|
1421
1510
|
# Known flags are defined in {Flags::NtfExtFlags}.
|
|
1422
1511
|
# @rbs return: ::Integer
|
|
1423
1512
|
# @return [Integer]
|
|
1424
|
-
|
|
1425
|
-
def flags_ext; attributes[:"flags_ext"]&.value; end
|
|
1513
|
+
def flags_ext; self[:"flags_ext"]; end
|
|
1426
1514
|
end
|
|
1427
1515
|
end
|
|
1428
1516
|
# @private
|
|
1429
|
-
NOTIFICATIONS =
|
|
1517
|
+
NOTIFICATIONS = {29 => Notifications::DelneighNtf, 28 => Notifications::NewneighNtf}.freeze #: Hash[::Integer, ::Class]
|
|
1430
1518
|
# Add new neighbour entry
|
|
1431
1519
|
# @rbs (?ndm_family: ::Integer, ?ndm_ifindex: ::Integer, ?ndm_state: ::Integer, ?ndm_flags: ::Integer, ?ndm_type: ::Integer, ?dst: ::String, ?lladdr: ::String, ?probes: ::Integer, ?vlan: ::Integer, ?port: ::Integer, ?vni: ::Integer, ?ifindex: ::Integer, ?master: ::Integer, ?protocol: ::Integer, ?nh_id: ::Integer, ?fdb_ext_attrs: ::String, ?flags_ext: ::Integer) -> void
|
|
1432
1520
|
# @param [Hash] args
|