nl-linux 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/NLSPEC_VERSION +1 -1
  4. data/generated/nl/linux/binder.rb +103 -187
  5. data/generated/nl/linux/conntrack.rb +1053 -1649
  6. data/generated/nl/linux/dev_energymodel.rb +303 -265
  7. data/generated/nl/linux/devlink.rb +4904 -5576
  8. data/generated/nl/linux/dpll.rb +1097 -1467
  9. data/generated/nl/linux/drm_ras.rb +235 -195
  10. data/generated/nl/linux/ethtool.rb +6652 -7415
  11. data/generated/nl/linux/fou.rb +234 -255
  12. data/generated/nl/linux/handshake.rb +208 -280
  13. data/generated/nl/linux/lockd.rb +99 -73
  14. data/generated/nl/linux/mptcp_pm.rb +589 -687
  15. data/generated/nl/linux/net_shaper.rb +520 -615
  16. data/generated/nl/linux/netdev.rb +1640 -1987
  17. data/generated/nl/linux/nfsd.rb +1341 -1215
  18. data/generated/nl/linux/nftables.rb +5143 -4870
  19. data/generated/nl/linux/nl80211.rb +2542 -6316
  20. data/generated/nl/linux/nlctrl.rb +338 -483
  21. data/generated/nl/linux/ovpn.rb +1006 -1522
  22. data/generated/nl/linux/ovs_datapath.rb +291 -186
  23. data/generated/nl/linux/ovs_flow.rb +1393 -2065
  24. data/generated/nl/linux/ovs_packet.rb +186 -223
  25. data/generated/nl/linux/ovs_vport.rb +328 -285
  26. data/generated/nl/linux/psp.rb +812 -717
  27. data/generated/nl/linux/rt_addr.rb +513 -243
  28. data/generated/nl/linux/rt_link.rb +4504 -7238
  29. data/generated/nl/linux/rt_neigh.rb +935 -847
  30. data/generated/nl/linux/rt_route.rb +1198 -871
  31. data/generated/nl/linux/rt_rule.rb +680 -659
  32. data/generated/nl/linux/sunrpc_cache.rb +323 -321
  33. data/generated/nl/linux/tc.rb +9058 -10454
  34. data/generated/nl/linux/tcp_metrics.rb +258 -367
  35. data/generated/nl/linux/team.rb +327 -345
  36. data/generated/nl/linux/wireguard.rb +270 -434
  37. data/lib/nl/linux/nlctrl_resolver.rb +1 -1
  38. data/lib/nl/linux/version.rb +1 -1
  39. data/linux/conntrack.yaml +18 -3
  40. data/linux/devlink.yaml +26 -4
  41. data/linux/dpll.yaml +19 -0
  42. data/linux/netdev.yaml +21 -0
  43. data/linux/nfsd.yaml +111 -0
  44. data/linux/nl80211.yaml +2 -2
  45. data/linux/rt-addr.yaml +4 -0
  46. data/linux/rt-link.yaml +7 -0
  47. data/linux/rt-neigh.yaml +3 -0
  48. data/linux/rt-route.yaml +83 -2
  49. data/sig/generated/nl/linux/binder.rbs +77 -220
  50. data/sig/generated/nl/linux/conntrack.rbs +770 -1954
  51. data/sig/generated/nl/linux/dev_energymodel.rbs +207 -291
  52. data/sig/generated/nl/linux/devlink.rbs +3318 -6068
  53. data/sig/generated/nl/linux/dpll.rbs +791 -1589
  54. data/sig/generated/nl/linux/drm_ras.rbs +160 -208
  55. data/sig/generated/nl/linux/ethtool.rbs +4205 -7581
  56. data/sig/generated/nl/linux/fou.rbs +139 -254
  57. data/sig/generated/nl/linux/handshake.rbs +144 -319
  58. data/sig/generated/nl/linux/lockd.rbs +64 -74
  59. data/sig/generated/nl/linux/mptcp_pm.rbs +426 -835
  60. data/sig/generated/nl/linux/net_shaper.rbs +351 -644
  61. data/sig/generated/nl/linux/netdev.rbs +1151 -2146
  62. data/sig/generated/nl/linux/nfsd.rbs +1047 -1409
  63. data/sig/generated/nl/linux/nftables.rbs +2907 -5030
  64. data/sig/generated/nl/linux/nl80211.rbs +1807 -7964
  65. data/sig/generated/nl/linux/nlctrl.rbs +220 -544
  66. data/sig/generated/nl/linux/ovpn.rbs +835 -1859
  67. data/sig/generated/nl/linux/ovs_datapath.rbs +141 -181
  68. data/sig/generated/nl/linux/ovs_flow.rbs +817 -2332
  69. data/sig/generated/nl/linux/ovs_packet.rbs +110 -237
  70. data/sig/generated/nl/linux/ovs_vport.rbs +174 -294
  71. data/sig/generated/nl/linux/psp.rbs +550 -741
  72. data/sig/generated/nl/linux/rt_addr.rbs +188 -226
  73. data/sig/generated/nl/linux/rt_link.rbs +2687 -8370
  74. data/sig/generated/nl/linux/rt_neigh.rbs +471 -1005
  75. data/sig/generated/nl/linux/rt_route.rbs +632 -862
  76. data/sig/generated/nl/linux/rt_rule.rbs +217 -639
  77. data/sig/generated/nl/linux/sunrpc_cache.rbs +233 -369
  78. data/sig/generated/nl/linux/tc.rbs +6199 -13391
  79. data/sig/generated/nl/linux/tcp_metrics.rbs +179 -421
  80. data/sig/generated/nl/linux/team.rbs +232 -391
  81. data/sig/generated/nl/linux/wireguard.rbs +197 -502
  82. metadata +6 -6
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
2
  #
3
- # This file is based on Documentation/netlink/specs/team.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/team.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.
@@ -27,7 +27,7 @@ class Team < ::Nl::Genl::Family
27
27
  super
28
28
  end
29
29
  # @private
30
- MCAST_GROUPS = Ractor.make_shareable({}) #: Hash[::Symbol, ::Nl::McastGroup]
30
+ MCAST_GROUPS = {}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
31
31
  module Constants
32
32
  STRING_MAX_LEN = 32
33
33
  GENL_CHANGE_EVENT_MC_GRP_NAME = "change_event"
@@ -50,459 +50,441 @@ class Team < ::Nl::Genl::Family
50
50
  # [TEAM_ATTR_PORT_*], ...
51
51
  # ...
52
52
  class Team < ::Nl::AttributeSet
53
- # Abstract class
54
- class Attribute < ::Nl::AttributeSet::Attribute
53
+ module Definitions
54
+ # @rbs return: ::Integer
55
+ # @return [Integer]
56
+ def team_ifindex; self[:"team_ifindex"]; end
57
+ # @rbs return: AttributeSets::ItemOption
58
+ # @return [AttributeSets::ItemOption]
59
+ def list_option; self[:"list_option"]; end
60
+ # @rbs return: AttributeSets::ItemPort
61
+ # @return [AttributeSets::ItemPort]
62
+ def list_port; self[:"list_port"]; end
55
63
  end
56
- class TeamIfindex < Attribute
57
- TYPE = 1
58
- NAME = :"team_ifindex"
59
- # @private
60
- ORDER = 0
61
- # @private
62
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
63
- end
64
- class ListOption < Attribute
65
- TYPE = 2
66
- NAME = :"list_option"
67
- # @private
68
- ORDER = 1
69
- end
70
- class ListPort < Attribute
71
- TYPE = 3
72
- NAME = :"list_port"
73
- # @private
74
- ORDER = 2
75
- end
76
- # @private
77
- BY_NAME = Ractor.make_shareable({:"team_ifindex" => TeamIfindex, :"list_option" => ListOption, :"list_port" => ListPort}) #: Hash[::Symbol, Attribute]
78
- # @private
79
- BY_TYPE = Ractor.make_shareable({1 => TeamIfindex, 2 => ListOption, 3 => ListPort}) #: Hash[::Integer, Attribute]
80
- # @rbs return: ::Integer
81
- # @return [Integer]
82
- # @see TeamIfindex
83
- def team_ifindex; self[:"team_ifindex"]&.value; end
84
- # @rbs return: AttributeSets::ItemOption
85
- # @return [AttributeSets::ItemOption]
86
- # @see ListOption
87
- def list_option; self[:"list_option"]&.value; end
88
- # @rbs return: AttributeSets::ItemPort
89
- # @return [AttributeSets::ItemPort]
90
- # @see ListPort
91
- def list_port; self[:"list_port"]&.value; end
92
- class << self
93
- # Looks up Attribute class by name.
94
- # @rbs name: Symbol
95
- # @rbs return: Attribute
96
- # @param [Symbol] name
97
- # @return [Attribute]
98
- def by_name(name); BY_NAME.fetch(name); end
99
- # Looks up Attribute class by type value.
100
- # @rbs type: Integer
101
- # @rbs return: Attribute
102
- # @param [Integer] type
103
- # @return [Attribute]
104
- def by_type(type); BY_TYPE.fetch(type); end
64
+ include Definitions
65
+ # Decodes attributes from the decoder into a new attribute set.
66
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
67
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
68
+ super(decoder, BY_TYPE, 0, external_selectors)
105
69
  end
106
70
  end
107
71
  class ItemOption < ::Nl::AttributeSet
108
- # Abstract class
109
- class Attribute < ::Nl::AttributeSet::Attribute
110
- end
111
- class Option < Attribute
112
- TYPE = 1
113
- NAME = :"option"
114
- # @private
115
- ORDER = 0
72
+ module Definitions
73
+ # @rbs return: AttributeSets::AttrOption
74
+ # @return [AttributeSets::AttrOption]
75
+ def option; self[:"option"]; end
116
76
  end
117
- # @private
118
- BY_NAME = Ractor.make_shareable({:"option" => Option}) #: Hash[::Symbol, Attribute]
119
- # @private
120
- BY_TYPE = Ractor.make_shareable({1 => Option}) #: Hash[::Integer, Attribute]
121
- # @rbs return: AttributeSets::AttrOption
122
- # @return [AttributeSets::AttrOption]
123
- # @see Option
124
- def option; self[:"option"]&.value; end
125
- class << self
126
- # Looks up Attribute class by name.
127
- # @rbs name: Symbol
128
- # @rbs return: Attribute
129
- # @param [Symbol] name
130
- # @return [Attribute]
131
- def by_name(name); BY_NAME.fetch(name); end
132
- # Looks up Attribute class by type value.
133
- # @rbs type: Integer
134
- # @rbs return: Attribute
135
- # @param [Integer] type
136
- # @return [Attribute]
137
- def by_type(type); BY_TYPE.fetch(type); end
77
+ include Definitions
78
+ # Decodes attributes from the decoder into a new attribute set.
79
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
80
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
81
+ super(decoder, BY_TYPE, 0, external_selectors)
138
82
  end
139
83
  end
140
84
  class AttrOption < ::Nl::AttributeSet
141
- # Abstract class
142
- class Attribute < ::Nl::AttributeSet::Attribute
143
- end
144
- class Name < Attribute
145
- TYPE = 1
146
- NAME = :"name"
147
- # @private
148
- ORDER = 0
149
- # @private
150
- DATATYPE = ::Nl::DataTypes::String.new(check: -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length #{Constants::STRING_MAX_LEN}" unless it.bytesize <= Constants::STRING_MAX_LEN })
151
- end
152
- class Changed < Attribute
153
- TYPE = 2
154
- NAME = :"changed"
155
- # @private
156
- ORDER = 1
157
- # @private
158
- DATATYPE = ::Nl::DataTypes::Flag.new
159
- end
160
- class Type < Attribute
161
- TYPE = 3
162
- NAME = :"type"
163
- # @private
164
- ORDER = 2
165
- # @private
166
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
167
- end
168
- class Data < Attribute
169
- TYPE = 4
170
- NAME = :"data"
171
- # @private
172
- ORDER = 3
173
- # @private
174
- DATATYPE = ::Nl::DataTypes::Binary.new(check: nil)
175
- end
176
- class Removed < Attribute
177
- TYPE = 5
178
- NAME = :"removed"
179
- # @private
180
- ORDER = 4
181
- # @private
182
- DATATYPE = ::Nl::DataTypes::Flag.new
183
- end
184
- # for per-port options
185
- class PortIfindex < Attribute
186
- TYPE = 6
187
- NAME = :"port_ifindex"
188
- # @private
189
- ORDER = 5
190
- # @private
191
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
192
- end
193
- # for array options
194
- class ArrayIndex < Attribute
195
- TYPE = 7
196
- NAME = :"array_index"
197
- # @private
198
- ORDER = 6
199
- # @private
200
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
85
+ module Definitions
86
+ # @rbs return: ::String
87
+ # @return [String]
88
+ def name; self[:"name"]; end
89
+ # @rbs return: ::Integer
90
+ # @return [Integer]
91
+ def changed; self[:"changed"]; end
92
+ # @rbs return: ::Integer
93
+ # @return [Integer]
94
+ def type; self[:"type"]; end
95
+ # @rbs return: ::String
96
+ # @return [String]
97
+ def data; self[:"data"]; end
98
+ # @rbs return: ::Integer
99
+ # @return [Integer]
100
+ def removed; self[:"removed"]; end
101
+ # for per-port options
102
+ # @rbs return: ::Integer
103
+ # @return [Integer]
104
+ def port_ifindex; self[:"port_ifindex"]; end
105
+ # for array options
106
+ # @rbs return: ::Integer
107
+ # @return [Integer]
108
+ def array_index; self[:"array_index"]; end
201
109
  end
202
- # @private
203
- BY_NAME = Ractor.make_shareable({:"name" => Name, :"changed" => Changed, :"type" => Type, :"data" => Data, :"removed" => Removed, :"port_ifindex" => PortIfindex, :"array_index" => ArrayIndex}) #: Hash[::Symbol, Attribute]
204
- # @private
205
- BY_TYPE = Ractor.make_shareable({1 => Name, 2 => Changed, 3 => Type, 4 => Data, 5 => Removed, 6 => PortIfindex, 7 => ArrayIndex}) #: Hash[::Integer, Attribute]
206
- # @rbs return: ::String
207
- # @return [String]
208
- # @see Name
209
- def name; self[:"name"]&.value; end
210
- # @rbs return: ::Integer
211
- # @return [Integer]
212
- # @see Changed
213
- def changed; self[:"changed"]&.value; end
214
- # @rbs return: ::Integer
215
- # @return [Integer]
216
- # @see Type
217
- def type; self[:"type"]&.value; end
218
- # @rbs return: ::String
219
- # @return [String]
220
- # @see Data
221
- def data; self[:"data"]&.value; end
222
- # @rbs return: ::Integer
223
- # @return [Integer]
224
- # @see Removed
225
- def removed; self[:"removed"]&.value; end
226
- # for per-port options
227
- # @rbs return: ::Integer
228
- # @return [Integer]
229
- # @see PortIfindex
230
- def port_ifindex; self[:"port_ifindex"]&.value; end
231
- # for array options
232
- # @rbs return: ::Integer
233
- # @return [Integer]
234
- # @see ArrayIndex
235
- def array_index; self[:"array_index"]&.value; end
236
- class << self
237
- # Looks up Attribute class by name.
238
- # @rbs name: Symbol
239
- # @rbs return: Attribute
240
- # @param [Symbol] name
241
- # @return [Attribute]
242
- def by_name(name); BY_NAME.fetch(name); end
243
- # Looks up Attribute class by type value.
244
- # @rbs type: Integer
245
- # @rbs return: Attribute
246
- # @param [Integer] type
247
- # @return [Attribute]
248
- def by_type(type); BY_TYPE.fetch(type); end
110
+ include Definitions
111
+ # Decodes attributes from the decoder into a new attribute set.
112
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
113
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
114
+ super(decoder, BY_TYPE, 0, external_selectors)
249
115
  end
250
116
  end
251
117
  class ItemPort < ::Nl::AttributeSet
252
- # Abstract class
253
- class Attribute < ::Nl::AttributeSet::Attribute
118
+ module Definitions
119
+ # @rbs return: AttributeSets::AttrPort
120
+ # @return [AttributeSets::AttrPort]
121
+ def port; self[:"port"]; end
254
122
  end
255
- class Port < Attribute
256
- TYPE = 1
257
- NAME = :"port"
258
- # @private
259
- ORDER = 0
260
- end
261
- # @private
262
- BY_NAME = Ractor.make_shareable({:"port" => Port}) #: Hash[::Symbol, Attribute]
263
- # @private
264
- BY_TYPE = Ractor.make_shareable({1 => Port}) #: Hash[::Integer, Attribute]
265
- # @rbs return: AttributeSets::AttrPort
266
- # @return [AttributeSets::AttrPort]
267
- # @see Port
268
- def port; self[:"port"]&.value; end
269
- class << self
270
- # Looks up Attribute class by name.
271
- # @rbs name: Symbol
272
- # @rbs return: Attribute
273
- # @param [Symbol] name
274
- # @return [Attribute]
275
- def by_name(name); BY_NAME.fetch(name); end
276
- # Looks up Attribute class by type value.
277
- # @rbs type: Integer
278
- # @rbs return: Attribute
279
- # @param [Integer] type
280
- # @return [Attribute]
281
- def by_type(type); BY_TYPE.fetch(type); end
123
+ include Definitions
124
+ # Decodes attributes from the decoder into a new attribute set.
125
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
126
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
127
+ super(decoder, BY_TYPE, 0, external_selectors)
282
128
  end
283
129
  end
284
130
  class AttrPort < ::Nl::AttributeSet
285
- # Abstract class
286
- class Attribute < ::Nl::AttributeSet::Attribute
131
+ module Definitions
132
+ # @rbs return: ::Integer
133
+ # @return [Integer]
134
+ def ifindex; self[:"ifindex"]; end
135
+ # @rbs return: ::Integer
136
+ # @return [Integer]
137
+ def changed; self[:"changed"]; end
138
+ # @rbs return: ::Integer
139
+ # @return [Integer]
140
+ def linkup; self[:"linkup"]; end
141
+ # @rbs return: ::Integer
142
+ # @return [Integer]
143
+ def speed; self[:"speed"]; end
144
+ # @rbs return: ::Integer
145
+ # @return [Integer]
146
+ def duplex; self[:"duplex"]; end
147
+ # @rbs return: ::Integer
148
+ # @return [Integer]
149
+ def removed; self[:"removed"]; end
287
150
  end
288
- class Ifindex < Attribute
289
- TYPE = 1
290
- NAME = :"ifindex"
291
- # @private
292
- ORDER = 0
293
- # @private
294
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
295
- end
296
- class Changed < Attribute
297
- TYPE = 2
298
- NAME = :"changed"
299
- # @private
300
- ORDER = 1
301
- # @private
302
- DATATYPE = ::Nl::DataTypes::Flag.new
151
+ include Definitions
152
+ # Decodes attributes from the decoder into a new attribute set.
153
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
154
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
155
+ super(decoder, BY_TYPE, 0, external_selectors)
303
156
  end
304
- class Linkup < Attribute
305
- TYPE = 3
306
- NAME = :"linkup"
157
+ end
158
+ end
159
+ module AttributeSets
160
+ class Team
161
+ module Definitions
307
162
  # @private
308
- ORDER = 2
163
+ BY_TYPE = ::Array.new(4).tap do |definitions|
164
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"team_ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
165
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"list_option", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemOption, selector_bindings: []), multi: false, order: 1, selector_slot: nil)
166
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"list_port", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemPort, selector_bindings: []), multi: false, order: 2, selector_slot: nil)
167
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
168
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
309
169
  # @private
310
- DATATYPE = ::Nl::DataTypes::Flag.new
170
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
311
171
  end
312
- class Speed < Attribute
313
- TYPE = 4
314
- NAME = :"speed"
172
+ end
173
+ class ItemOption
174
+ module Definitions
315
175
  # @private
316
- ORDER = 3
176
+ BY_TYPE = ::Array.new(2).tap do |definitions|
177
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"option", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrOption, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
178
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
179
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
317
180
  # @private
318
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
181
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
319
182
  end
320
- class Duplex < Attribute
321
- TYPE = 5
322
- NAME = :"duplex"
323
- # @private
324
- ORDER = 4
325
- # @private
326
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
183
+ end
184
+ class AttrOption
185
+ module Definitions
186
+ # @private
187
+ BY_TYPE = ::Array.new(8).tap do |definitions|
188
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"name", datatype: ::Nl::DataTypes::Checked.new(::Nl::DataTypes::String.new, check: nil.instance_exec { -> { raise ArgumentError, "Value #{it.inspect} is longer than maximum length #{Constants::STRING_MAX_LEN}" unless it.bytesize <= Constants::STRING_MAX_LEN } }), multi: false, order: 0, selector_slot: nil)
189
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"changed", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 1, selector_slot: nil)
190
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 2, selector_slot: nil)
191
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"data", datatype: ::Nl::DataTypes::Binary.new, multi: false, order: 3, selector_slot: nil)
192
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"removed", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 4, selector_slot: nil)
193
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"port_ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
194
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"array_index", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 6, selector_slot: nil)
195
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
196
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
197
+ # @private
198
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
327
199
  end
328
- class Removed < Attribute
329
- TYPE = 6
330
- NAME = :"removed"
200
+ end
201
+ class ItemPort
202
+ module Definitions
331
203
  # @private
332
- ORDER = 5
204
+ BY_TYPE = ::Array.new(2).tap do |definitions|
205
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"port", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrPort, selector_bindings: []), multi: false, order: 0, selector_slot: nil)
206
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
207
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
333
208
  # @private
334
- DATATYPE = ::Nl::DataTypes::Flag.new
209
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
335
210
  end
336
- # @private
337
- BY_NAME = Ractor.make_shareable({:"ifindex" => Ifindex, :"changed" => Changed, :"linkup" => Linkup, :"speed" => Speed, :"duplex" => Duplex, :"removed" => Removed}) #: Hash[::Symbol, Attribute]
338
- # @private
339
- BY_TYPE = Ractor.make_shareable({1 => Ifindex, 2 => Changed, 3 => Linkup, 4 => Speed, 5 => Duplex, 6 => Removed}) #: Hash[::Integer, Attribute]
340
- # @rbs return: ::Integer
341
- # @return [Integer]
342
- # @see Ifindex
343
- def ifindex; self[:"ifindex"]&.value; end
344
- # @rbs return: ::Integer
345
- # @return [Integer]
346
- # @see Changed
347
- def changed; self[:"changed"]&.value; end
348
- # @rbs return: ::Integer
349
- # @return [Integer]
350
- # @see Linkup
351
- def linkup; self[:"linkup"]&.value; end
352
- # @rbs return: ::Integer
353
- # @return [Integer]
354
- # @see Speed
355
- def speed; self[:"speed"]&.value; end
356
- # @rbs return: ::Integer
357
- # @return [Integer]
358
- # @see Duplex
359
- def duplex; self[:"duplex"]&.value; end
360
- # @rbs return: ::Integer
361
- # @return [Integer]
362
- # @see Removed
363
- def removed; self[:"removed"]&.value; end
364
- class << self
365
- # Looks up Attribute class by name.
366
- # @rbs name: Symbol
367
- # @rbs return: Attribute
368
- # @param [Symbol] name
369
- # @return [Attribute]
370
- def by_name(name); BY_NAME.fetch(name); end
371
- # Looks up Attribute class by type value.
372
- # @rbs type: Integer
373
- # @rbs return: Attribute
374
- # @param [Integer] type
375
- # @return [Attribute]
376
- def by_type(type); BY_TYPE.fetch(type); end
211
+ end
212
+ class AttrPort
213
+ module Definitions
214
+ # @private
215
+ BY_TYPE = ::Array.new(7).tap do |definitions|
216
+ 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)
217
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"changed", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 1, selector_slot: nil)
218
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"linkup", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 2, selector_slot: nil)
219
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"speed", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 3, selector_slot: nil)
220
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"duplex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U8].new, multi: false, order: 4, selector_slot: nil)
221
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"removed", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 5, selector_slot: nil)
222
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
223
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
224
+ # @private
225
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
377
226
  end
378
227
  end
379
- # @private
380
- Team::ListOption::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemOption, selector_bindings: Ractor.make_shareable([]))
381
- # @private
382
- Team::ListPort::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::ItemPort, selector_bindings: Ractor.make_shareable([]))
383
- # @private
384
- ItemOption::Option::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrOption, selector_bindings: Ractor.make_shareable([]))
385
- # @private
386
- ItemPort::Port::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::AttrPort, selector_bindings: Ractor.make_shareable([]))
387
228
  end
388
229
  module Messages
389
230
  # No operation
390
- class DoNoopRequest < ::Nl::Genl::Message
231
+ class DoNoopRequest < ::Nl::Message
391
232
  TYPE = 0
392
233
  FIXED_HEADER = nil
393
234
  ATTRIBUTE_SET = AttributeSets::Team
394
- ATTRIBUTES = Ractor.make_shareable(%i[])
235
+ ATTRIBUTES = %i[].freeze
236
+ include ATTRIBUTE_SET::Definitions
237
+ def initialize(attributes = [])
238
+ @attributes = attributes
239
+ end
240
+ # @private
241
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
242
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
243
+ new(
244
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
245
+ )
246
+ end
247
+ # Decodes a message payload from the decoder into a new instance.
248
+ # @rbs (::Nl::Decoder decoder) -> instance
249
+ def self.decode(decoder)
250
+ new(decode_attributes(decoder, BY_TYPE, 0))
251
+ end
252
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
253
+ encode_attributes(encoder, external_selectors:)
254
+ end
395
255
  end
396
256
  # No operation
397
- class DoNoopReply < ::Nl::Genl::Message
257
+ class DoNoopReply < ::Nl::Message
398
258
  TYPE = 0
399
259
  FIXED_HEADER = nil
400
260
  ATTRIBUTE_SET = AttributeSets::Team
401
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
261
+ ATTRIBUTES = %i[team_ifindex].freeze
262
+ include ATTRIBUTE_SET::Definitions
263
+ def initialize(attributes = [])
264
+ @attributes = attributes
265
+ end
266
+ # @private
267
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
268
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
269
+ new(
270
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
271
+ )
272
+ end
273
+ # Decodes a message payload from the decoder into a new instance.
274
+ # @rbs (::Nl::Decoder decoder) -> instance
275
+ def self.decode(decoder)
276
+ new(decode_attributes(decoder, BY_TYPE, 0))
277
+ end
278
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
279
+ encode_attributes(encoder, external_selectors:)
280
+ end
402
281
  # @rbs return: ::Integer
403
282
  # @return [Integer]
404
- # @see AttributeSets::Team::TeamIfindex
405
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
283
+ def team_ifindex; self[:"team_ifindex"]; end
406
284
  end
407
285
  # Set team options
408
286
  #
409
287
  # Requires CAP_NET_ADMIN in the initial user namespace.
410
- class DoOptionsSetRequest < ::Nl::Genl::Message
288
+ class DoOptionsSetRequest < ::Nl::Message
411
289
  TYPE = 1
412
290
  FIXED_HEADER = nil
413
291
  ATTRIBUTE_SET = AttributeSets::Team
414
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
292
+ ATTRIBUTES = %i[team_ifindex list_option].freeze
293
+ include ATTRIBUTE_SET::Definitions
294
+ def initialize(attributes = [])
295
+ @attributes = attributes
296
+ end
297
+ # @private
298
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
299
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
300
+ new(
301
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
302
+ )
303
+ end
304
+ # Decodes a message payload from the decoder into a new instance.
305
+ # @rbs (::Nl::Decoder decoder) -> instance
306
+ def self.decode(decoder)
307
+ new(decode_attributes(decoder, BY_TYPE, 0))
308
+ end
309
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
310
+ encode_attributes(encoder, external_selectors:)
311
+ end
415
312
  # @rbs return: ::Integer
416
313
  # @return [Integer]
417
- # @see AttributeSets::Team::TeamIfindex
418
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
314
+ def team_ifindex; self[:"team_ifindex"]; end
419
315
  # @rbs return: AttributeSets::ItemOption
420
316
  # @return [AttributeSets::ItemOption]
421
- # @see AttributeSets::Team::ListOption
422
- def list_option; attributes[:"list_option"]&.value; end
317
+ def list_option; self[:"list_option"]; end
423
318
  end
424
319
  # Set team options
425
320
  #
426
321
  # Requires CAP_NET_ADMIN in the initial user namespace.
427
- class DoOptionsSetReply < ::Nl::Genl::Message
322
+ class DoOptionsSetReply < ::Nl::Message
428
323
  TYPE = 1
429
324
  FIXED_HEADER = nil
430
325
  ATTRIBUTE_SET = AttributeSets::Team
431
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
326
+ ATTRIBUTES = %i[team_ifindex list_option].freeze
327
+ include ATTRIBUTE_SET::Definitions
328
+ def initialize(attributes = [])
329
+ @attributes = attributes
330
+ end
331
+ # @private
332
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
333
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
334
+ new(
335
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
336
+ )
337
+ end
338
+ # Decodes a message payload from the decoder into a new instance.
339
+ # @rbs (::Nl::Decoder decoder) -> instance
340
+ def self.decode(decoder)
341
+ new(decode_attributes(decoder, BY_TYPE, 0))
342
+ end
343
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
344
+ encode_attributes(encoder, external_selectors:)
345
+ end
432
346
  # @rbs return: ::Integer
433
347
  # @return [Integer]
434
- # @see AttributeSets::Team::TeamIfindex
435
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
348
+ def team_ifindex; self[:"team_ifindex"]; end
436
349
  # @rbs return: AttributeSets::ItemOption
437
350
  # @return [AttributeSets::ItemOption]
438
- # @see AttributeSets::Team::ListOption
439
- def list_option; attributes[:"list_option"]&.value; end
351
+ def list_option; self[:"list_option"]; end
440
352
  end
441
353
  # Get team options info
442
354
  #
443
355
  # Requires CAP_NET_ADMIN in the initial user namespace.
444
- class DoOptionsGetRequest < ::Nl::Genl::Message
356
+ class DoOptionsGetRequest < ::Nl::Message
445
357
  TYPE = 2
446
358
  FIXED_HEADER = nil
447
359
  ATTRIBUTE_SET = AttributeSets::Team
448
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
360
+ ATTRIBUTES = %i[team_ifindex].freeze
361
+ include ATTRIBUTE_SET::Definitions
362
+ def initialize(attributes = [])
363
+ @attributes = attributes
364
+ end
365
+ # @private
366
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
367
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
368
+ new(
369
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
370
+ )
371
+ end
372
+ # Decodes a message payload from the decoder into a new instance.
373
+ # @rbs (::Nl::Decoder decoder) -> instance
374
+ def self.decode(decoder)
375
+ new(decode_attributes(decoder, BY_TYPE, 0))
376
+ end
377
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
378
+ encode_attributes(encoder, external_selectors:)
379
+ end
449
380
  # @rbs return: ::Integer
450
381
  # @return [Integer]
451
- # @see AttributeSets::Team::TeamIfindex
452
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
382
+ def team_ifindex; self[:"team_ifindex"]; end
453
383
  end
454
384
  # Get team options info
455
385
  #
456
386
  # Requires CAP_NET_ADMIN in the initial user namespace.
457
- class DoOptionsGetReply < ::Nl::Genl::Message
387
+ class DoOptionsGetReply < ::Nl::Message
458
388
  TYPE = 2
459
389
  FIXED_HEADER = nil
460
390
  ATTRIBUTE_SET = AttributeSets::Team
461
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_option])
391
+ ATTRIBUTES = %i[team_ifindex list_option].freeze
392
+ include ATTRIBUTE_SET::Definitions
393
+ def initialize(attributes = [])
394
+ @attributes = attributes
395
+ end
396
+ # @private
397
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
398
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
399
+ new(
400
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
401
+ )
402
+ end
403
+ # Decodes a message payload from the decoder into a new instance.
404
+ # @rbs (::Nl::Decoder decoder) -> instance
405
+ def self.decode(decoder)
406
+ new(decode_attributes(decoder, BY_TYPE, 0))
407
+ end
408
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
409
+ encode_attributes(encoder, external_selectors:)
410
+ end
462
411
  # @rbs return: ::Integer
463
412
  # @return [Integer]
464
- # @see AttributeSets::Team::TeamIfindex
465
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
413
+ def team_ifindex; self[:"team_ifindex"]; end
466
414
  # @rbs return: AttributeSets::ItemOption
467
415
  # @return [AttributeSets::ItemOption]
468
- # @see AttributeSets::Team::ListOption
469
- def list_option; attributes[:"list_option"]&.value; end
416
+ def list_option; self[:"list_option"]; end
470
417
  end
471
418
  # Get team ports info
472
419
  #
473
420
  # Requires CAP_NET_ADMIN in the initial user namespace.
474
- class DoPortListGetRequest < ::Nl::Genl::Message
421
+ class DoPortListGetRequest < ::Nl::Message
475
422
  TYPE = 3
476
423
  FIXED_HEADER = nil
477
424
  ATTRIBUTE_SET = AttributeSets::Team
478
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex])
425
+ ATTRIBUTES = %i[team_ifindex].freeze
426
+ include ATTRIBUTE_SET::Definitions
427
+ def initialize(attributes = [])
428
+ @attributes = attributes
429
+ end
430
+ # @private
431
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
432
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
433
+ new(
434
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
435
+ )
436
+ end
437
+ # Decodes a message payload from the decoder into a new instance.
438
+ # @rbs (::Nl::Decoder decoder) -> instance
439
+ def self.decode(decoder)
440
+ new(decode_attributes(decoder, BY_TYPE, 0))
441
+ end
442
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
443
+ encode_attributes(encoder, external_selectors:)
444
+ end
479
445
  # @rbs return: ::Integer
480
446
  # @return [Integer]
481
- # @see AttributeSets::Team::TeamIfindex
482
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
447
+ def team_ifindex; self[:"team_ifindex"]; end
483
448
  end
484
449
  # Get team ports info
485
450
  #
486
451
  # Requires CAP_NET_ADMIN in the initial user namespace.
487
- class DoPortListGetReply < ::Nl::Genl::Message
452
+ class DoPortListGetReply < ::Nl::Message
488
453
  TYPE = 3
489
454
  FIXED_HEADER = nil
490
455
  ATTRIBUTE_SET = AttributeSets::Team
491
- ATTRIBUTES = Ractor.make_shareable(%i[team_ifindex list_port])
456
+ ATTRIBUTES = %i[team_ifindex list_port].freeze
457
+ include ATTRIBUTE_SET::Definitions
458
+ def initialize(attributes = [])
459
+ @attributes = attributes
460
+ end
461
+ # @private
462
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
463
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
464
+ new(
465
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
466
+ )
467
+ end
468
+ # Decodes a message payload from the decoder into a new instance.
469
+ # @rbs (::Nl::Decoder decoder) -> instance
470
+ def self.decode(decoder)
471
+ new(decode_attributes(decoder, BY_TYPE, 0))
472
+ end
473
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
474
+ encode_attributes(encoder, external_selectors:)
475
+ end
492
476
  # @rbs return: ::Integer
493
477
  # @return [Integer]
494
- # @see AttributeSets::Team::TeamIfindex
495
- def team_ifindex; attributes[:"team_ifindex"]&.value; end
478
+ def team_ifindex; self[:"team_ifindex"]; end
496
479
  # @rbs return: AttributeSets::ItemPort
497
480
  # @return [AttributeSets::ItemPort]
498
- # @see AttributeSets::Team::ListPort
499
- def list_port; attributes[:"list_port"]&.value; end
481
+ def list_port; self[:"list_port"]; end
500
482
  end
501
483
  end
502
484
  module Notifications
503
485
  end
504
486
  # @private
505
- NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
487
+ NOTIFICATIONS = {}.freeze #: Hash[::Integer, ::Class]
506
488
  # No operation
507
489
  # @rbs () -> Messages::DoNoopReply
508
490
  # @param [Hash] args