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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -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/sunrpc_cache.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/sunrpc_cache.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 Sunrpc < ::Nl::Genl::Family
27
27
  super
28
28
  end
29
29
  # @private
30
- MCAST_GROUPS = Ractor.make_shareable({:"none" => ::Nl::McastGroup.new("none", nil), :"exportd" => ::Nl::McastGroup.new("exportd", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
30
+ MCAST_GROUPS = {:"none" => ::Nl::McastGroup.new("none", nil), :"exportd" => ::Nl::McastGroup.new("exportd", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
31
31
  module Flags
32
32
  module CacheType
33
33
  IpMap = 1
@@ -38,438 +38,440 @@ class Sunrpc < ::Nl::Genl::Family
38
38
  end
39
39
  module AttributeSets
40
40
  class CacheNotify < ::Nl::AttributeSet
41
- # Abstract class
42
- class Attribute < ::Nl::AttributeSet::Attribute
41
+ module Definitions
42
+ # Known flags are defined in {Flags::CacheType}.
43
+ # @rbs return: ::Integer
44
+ # @return [Integer]
45
+ def cache_type; self[:"cache_type"]; end
43
46
  end
44
- # Known flags are defined in {Flags::CacheType}.
45
- class CacheType < Attribute
46
- TYPE = 1
47
- NAME = :"cache_type"
48
- # @private
49
- ORDER = 0
50
- # @private
51
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
52
- end
53
- # @private
54
- BY_NAME = Ractor.make_shareable({:"cache_type" => CacheType}) #: Hash[::Symbol, Attribute]
55
- # @private
56
- BY_TYPE = Ractor.make_shareable({1 => CacheType}) #: Hash[::Integer, Attribute]
57
- # Known flags are defined in {Flags::CacheType}.
58
- # @rbs return: ::Integer
59
- # @return [Integer]
60
- # @see CacheType
61
- def cache_type; self[:"cache_type"]&.value; end
62
- class << self
63
- # Looks up Attribute class by name.
64
- # @rbs name: Symbol
65
- # @rbs return: Attribute
66
- # @param [Symbol] name
67
- # @return [Attribute]
68
- def by_name(name); BY_NAME.fetch(name); end
69
- # Looks up Attribute class by type value.
70
- # @rbs type: Integer
71
- # @rbs return: Attribute
72
- # @param [Integer] type
73
- # @return [Attribute]
74
- def by_type(type); BY_TYPE.fetch(type); end
47
+ include Definitions
48
+ # Decodes attributes from the decoder into a new attribute set.
49
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
50
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
51
+ super(decoder, BY_TYPE, 0, external_selectors)
75
52
  end
76
53
  end
77
54
  class IpMap < ::Nl::AttributeSet
78
- # Abstract class
79
- class Attribute < ::Nl::AttributeSet::Attribute
80
- end
81
- class Seqno < Attribute
82
- TYPE = 1
83
- NAME = :"seqno"
84
- # @private
85
- ORDER = 0
86
- # @private
87
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
55
+ module Definitions
56
+ # @rbs return: ::Integer
57
+ # @return [Integer]
58
+ def seqno; self[:"seqno"]; end
59
+ # @rbs return: ::String
60
+ # @return [String]
61
+ def class; self[:"class"]; end
62
+ # @rbs return: ::String
63
+ # @return [String]
64
+ def addr; self[:"addr"]; end
65
+ # @rbs return: ::String
66
+ # @return [String]
67
+ def domain; self[:"domain"]; end
68
+ # @rbs return: ::Integer
69
+ # @return [Integer]
70
+ def negative; self[:"negative"]; end
71
+ # @rbs return: ::Integer
72
+ # @return [Integer]
73
+ def expiry; self[:"expiry"]; end
88
74
  end
89
- class Class < Attribute
90
- TYPE = 2
91
- NAME = :"class"
92
- # @private
93
- ORDER = 1
94
- # @private
95
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
75
+ include Definitions
76
+ # Decodes attributes from the decoder into a new attribute set.
77
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
78
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
79
+ super(decoder, BY_TYPE, 0, external_selectors)
96
80
  end
97
- class Addr < Attribute
98
- TYPE = 3
99
- NAME = :"addr"
100
- # @private
101
- ORDER = 2
102
- # @private
103
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
104
- end
105
- class Domain < Attribute
106
- TYPE = 4
107
- NAME = :"domain"
108
- # @private
109
- ORDER = 3
110
- # @private
111
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
81
+ end
82
+ class IpMapReqs < ::Nl::AttributeSet
83
+ module Definitions
84
+ # @rbs return: ::Array[AttributeSets::IpMap]
85
+ # @return [Array<AttributeSets::IpMap>]
86
+ def requests; self[:"requests"]; end
112
87
  end
113
- class Negative < Attribute
114
- TYPE = 5
115
- NAME = :"negative"
116
- # @private
117
- ORDER = 4
118
- # @private
119
- DATATYPE = ::Nl::DataTypes::Flag.new
88
+ include Definitions
89
+ # Decodes attributes from the decoder into a new attribute set.
90
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
91
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
92
+ super(decoder, BY_TYPE, 0, external_selectors)
120
93
  end
121
- class Expiry < Attribute
122
- TYPE = 6
123
- NAME = :"expiry"
124
- # @private
125
- ORDER = 5
126
- # @private
127
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
94
+ end
95
+ class UnixGid < ::Nl::AttributeSet
96
+ module Definitions
97
+ # @rbs return: ::Integer
98
+ # @return [Integer]
99
+ def seqno; self[:"seqno"]; end
100
+ # @rbs return: ::Integer
101
+ # @return [Integer]
102
+ def uid; self[:"uid"]; end
103
+ # @rbs return: ::Array[::Integer]
104
+ # @return [Array<Integer>]
105
+ def gids; self[:"gids"]; end
106
+ # @rbs return: ::Integer
107
+ # @return [Integer]
108
+ def negative; self[:"negative"]; end
109
+ # @rbs return: ::Integer
110
+ # @return [Integer]
111
+ def expiry; self[:"expiry"]; end
128
112
  end
129
- # @private
130
- BY_NAME = Ractor.make_shareable({:"seqno" => Seqno, :"class" => Class, :"addr" => Addr, :"domain" => Domain, :"negative" => Negative, :"expiry" => Expiry}) #: Hash[::Symbol, Attribute]
131
- # @private
132
- BY_TYPE = Ractor.make_shareable({1 => Seqno, 2 => Class, 3 => Addr, 4 => Domain, 5 => Negative, 6 => Expiry}) #: Hash[::Integer, Attribute]
133
- # @rbs return: ::Integer
134
- # @return [Integer]
135
- # @see Seqno
136
- def seqno; self[:"seqno"]&.value; end
137
- # @rbs return: ::String
138
- # @return [String]
139
- # @see Class
140
- def class; self[:"class"]&.value; end
141
- # @rbs return: ::String
142
- # @return [String]
143
- # @see Addr
144
- def addr; self[:"addr"]&.value; end
145
- # @rbs return: ::String
146
- # @return [String]
147
- # @see Domain
148
- def domain; self[:"domain"]&.value; end
149
- # @rbs return: ::Integer
150
- # @return [Integer]
151
- # @see Negative
152
- def negative; self[:"negative"]&.value; end
153
- # @rbs return: ::Integer
154
- # @return [Integer]
155
- # @see Expiry
156
- def expiry; self[:"expiry"]&.value; end
157
- class << self
158
- # Looks up Attribute class by name.
159
- # @rbs name: Symbol
160
- # @rbs return: Attribute
161
- # @param [Symbol] name
162
- # @return [Attribute]
163
- def by_name(name); BY_NAME.fetch(name); end
164
- # Looks up Attribute class by type value.
165
- # @rbs type: Integer
166
- # @rbs return: Attribute
167
- # @param [Integer] type
168
- # @return [Attribute]
169
- def by_type(type); BY_TYPE.fetch(type); end
113
+ include Definitions
114
+ # Decodes attributes from the decoder into a new attribute set.
115
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
116
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
117
+ super(decoder, BY_TYPE, 0, external_selectors)
170
118
  end
171
119
  end
172
- class IpMapReqs < ::Nl::AttributeSet
173
- # Abstract class
174
- class Attribute < ::Nl::AttributeSet::Attribute
175
- end
176
- class Requests < Attribute
177
- TYPE = 1
178
- NAME = :"requests"
179
- # @private
180
- MULTI = true
181
- # @private
182
- ORDER = 0
120
+ class UnixGidReqs < ::Nl::AttributeSet
121
+ module Definitions
122
+ # @rbs return: ::Array[AttributeSets::UnixGid]
123
+ # @return [Array<AttributeSets::UnixGid>]
124
+ def requests; self[:"requests"]; end
183
125
  end
184
- # @private
185
- BY_NAME = Ractor.make_shareable({:"requests" => Requests}) #: Hash[::Symbol, Attribute]
186
- # @private
187
- BY_TYPE = Ractor.make_shareable({1 => Requests}) #: Hash[::Integer, Attribute]
188
- # @rbs return: ::Array[AttributeSets::IpMap]
189
- # @return [Array<AttributeSets::IpMap>]
190
- # @see Requests
191
- def requests; self[:"requests"].map(&:value); end
192
- class << self
193
- # Looks up Attribute class by name.
194
- # @rbs name: Symbol
195
- # @rbs return: Attribute
196
- # @param [Symbol] name
197
- # @return [Attribute]
198
- def by_name(name); BY_NAME.fetch(name); end
199
- # Looks up Attribute class by type value.
200
- # @rbs type: Integer
201
- # @rbs return: Attribute
202
- # @param [Integer] type
203
- # @return [Attribute]
204
- def by_type(type); BY_TYPE.fetch(type); end
126
+ include Definitions
127
+ # Decodes attributes from the decoder into a new attribute set.
128
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
129
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
130
+ super(decoder, BY_TYPE, 0, external_selectors)
205
131
  end
206
132
  end
207
- class UnixGid < ::Nl::AttributeSet
208
- # Abstract class
209
- class Attribute < ::Nl::AttributeSet::Attribute
133
+ class CacheFlush < ::Nl::AttributeSet
134
+ module Definitions
135
+ # Known flags are defined in {Flags::CacheType}.
136
+ # @rbs return: ::Integer
137
+ # @return [Integer]
138
+ def mask; self[:"mask"]; end
210
139
  end
211
- class Seqno < Attribute
212
- TYPE = 1
213
- NAME = :"seqno"
214
- # @private
215
- ORDER = 0
216
- # @private
217
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
140
+ include Definitions
141
+ # Decodes attributes from the decoder into a new attribute set.
142
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
143
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
144
+ super(decoder, BY_TYPE, 0, external_selectors)
218
145
  end
219
- class Uid < Attribute
220
- TYPE = 2
221
- NAME = :"uid"
146
+ end
147
+ end
148
+ module AttributeSets
149
+ class CacheNotify
150
+ module Definitions
222
151
  # @private
223
- ORDER = 1
152
+ BY_TYPE = ::Array.new(2).tap do |definitions|
153
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"cache_type", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
154
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
155
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
224
156
  # @private
225
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
157
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
226
158
  end
227
- class Gids < Attribute
228
- TYPE = 3
229
- NAME = :"gids"
230
- # @private
231
- MULTI = true
159
+ end
160
+ class IpMap
161
+ module Definitions
232
162
  # @private
233
- ORDER = 2
163
+ BY_TYPE = ::Array.new(7).tap do |definitions|
164
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"seqno", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 0, selector_slot: nil)
165
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"class", datatype: ::Nl::DataTypes::String.new, multi: false, order: 1, selector_slot: nil)
166
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"addr", datatype: ::Nl::DataTypes::String.new, multi: false, order: 2, selector_slot: nil)
167
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"domain", datatype: ::Nl::DataTypes::String.new, multi: false, order: 3, selector_slot: nil)
168
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"negative", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 4, selector_slot: nil)
169
+ definitions[6] = ::Nl::AttributeSet::Definition.new(id: 6, name: :"expiry", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 5, selector_slot: nil)
170
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
171
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
234
172
  # @private
235
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
173
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
236
174
  end
237
- class Negative < Attribute
238
- TYPE = 4
239
- NAME = :"negative"
175
+ end
176
+ class IpMapReqs
177
+ module Definitions
240
178
  # @private
241
- ORDER = 3
179
+ BY_TYPE = ::Array.new(2).tap do |definitions|
180
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"requests", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::IpMap, selector_bindings: []), multi: true, order: 0, selector_slot: nil)
181
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
182
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
242
183
  # @private
243
- DATATYPE = ::Nl::DataTypes::Flag.new
184
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
244
185
  end
245
- class Expiry < Attribute
246
- TYPE = 5
247
- NAME = :"expiry"
186
+ end
187
+ class UnixGid
188
+ module Definitions
248
189
  # @private
249
- ORDER = 4
190
+ BY_TYPE = ::Array.new(6).tap do |definitions|
191
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"seqno", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 0, selector_slot: nil)
192
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"uid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
193
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"gids", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: true, order: 2, selector_slot: nil)
194
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"negative", datatype: ::Nl::DataTypes::Flag.new, multi: false, order: 3, selector_slot: nil)
195
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"expiry", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, multi: false, order: 4, selector_slot: nil)
196
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
197
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
250
198
  # @private
251
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
252
- end
253
- # @private
254
- BY_NAME = Ractor.make_shareable({:"seqno" => Seqno, :"uid" => Uid, :"gids" => Gids, :"negative" => Negative, :"expiry" => Expiry}) #: Hash[::Symbol, Attribute]
255
- # @private
256
- BY_TYPE = Ractor.make_shareable({1 => Seqno, 2 => Uid, 3 => Gids, 4 => Negative, 5 => Expiry}) #: Hash[::Integer, Attribute]
257
- # @rbs return: ::Integer
258
- # @return [Integer]
259
- # @see Seqno
260
- def seqno; self[:"seqno"]&.value; end
261
- # @rbs return: ::Integer
262
- # @return [Integer]
263
- # @see Uid
264
- def uid; self[:"uid"]&.value; end
265
- # @rbs return: ::Array[::Integer]
266
- # @return [Array<Integer>]
267
- # @see Gids
268
- def gids; self[:"gids"].map(&:value); end
269
- # @rbs return: ::Integer
270
- # @return [Integer]
271
- # @see Negative
272
- def negative; self[:"negative"]&.value; end
273
- # @rbs return: ::Integer
274
- # @return [Integer]
275
- # @see Expiry
276
- def expiry; self[:"expiry"]&.value; end
277
- class << self
278
- # Looks up Attribute class by name.
279
- # @rbs name: Symbol
280
- # @rbs return: Attribute
281
- # @param [Symbol] name
282
- # @return [Attribute]
283
- def by_name(name); BY_NAME.fetch(name); end
284
- # Looks up Attribute class by type value.
285
- # @rbs type: Integer
286
- # @rbs return: Attribute
287
- # @param [Integer] type
288
- # @return [Attribute]
289
- def by_type(type); BY_TYPE.fetch(type); end
199
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
290
200
  end
291
201
  end
292
- class UnixGidReqs < ::Nl::AttributeSet
293
- # Abstract class
294
- class Attribute < ::Nl::AttributeSet::Attribute
295
- end
296
- class Requests < Attribute
297
- TYPE = 1
298
- NAME = :"requests"
202
+ class UnixGidReqs
203
+ module Definitions
299
204
  # @private
300
- MULTI = true
205
+ BY_TYPE = ::Array.new(2).tap do |definitions|
206
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"requests", datatype: ::Nl::DataTypes::NestedAttributes.new(AttributeSets::UnixGid, selector_bindings: []), multi: true, order: 0, selector_slot: nil)
207
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
208
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
301
209
  # @private
302
- ORDER = 0
303
- end
304
- # @private
305
- BY_NAME = Ractor.make_shareable({:"requests" => Requests}) #: Hash[::Symbol, Attribute]
306
- # @private
307
- BY_TYPE = Ractor.make_shareable({1 => Requests}) #: Hash[::Integer, Attribute]
308
- # @rbs return: ::Array[AttributeSets::UnixGid]
309
- # @return [Array<AttributeSets::UnixGid>]
310
- # @see Requests
311
- def requests; self[:"requests"].map(&:value); end
312
- class << self
313
- # Looks up Attribute class by name.
314
- # @rbs name: Symbol
315
- # @rbs return: Attribute
316
- # @param [Symbol] name
317
- # @return [Attribute]
318
- def by_name(name); BY_NAME.fetch(name); end
319
- # Looks up Attribute class by type value.
320
- # @rbs type: Integer
321
- # @rbs return: Attribute
322
- # @param [Integer] type
323
- # @return [Attribute]
324
- def by_type(type); BY_TYPE.fetch(type); end
210
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
325
211
  end
326
212
  end
327
- class CacheFlush < ::Nl::AttributeSet
328
- # Abstract class
329
- class Attribute < ::Nl::AttributeSet::Attribute
330
- end
331
- # Known flags are defined in {Flags::CacheType}.
332
- class Mask < Attribute
333
- TYPE = 1
334
- NAME = :"mask"
213
+ class CacheFlush
214
+ module Definitions
335
215
  # @private
336
- ORDER = 0
216
+ BY_TYPE = ::Array.new(2).tap do |definitions|
217
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"mask", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 0, selector_slot: nil)
218
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
219
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
337
220
  # @private
338
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
339
- end
340
- # @private
341
- BY_NAME = Ractor.make_shareable({:"mask" => Mask}) #: Hash[::Symbol, Attribute]
342
- # @private
343
- BY_TYPE = Ractor.make_shareable({1 => Mask}) #: Hash[::Integer, Attribute]
344
- # Known flags are defined in {Flags::CacheType}.
345
- # @rbs return: ::Integer
346
- # @return [Integer]
347
- # @see Mask
348
- def mask; self[:"mask"]&.value; end
349
- class << self
350
- # Looks up Attribute class by name.
351
- # @rbs name: Symbol
352
- # @rbs return: Attribute
353
- # @param [Symbol] name
354
- # @return [Attribute]
355
- def by_name(name); BY_NAME.fetch(name); end
356
- # Looks up Attribute class by type value.
357
- # @rbs type: Integer
358
- # @rbs return: Attribute
359
- # @param [Integer] type
360
- # @return [Attribute]
361
- def by_type(type); BY_TYPE.fetch(type); end
221
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
362
222
  end
363
223
  end
364
- # @private
365
- IpMapReqs::Requests::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::IpMap, selector_bindings: Ractor.make_shareable([]))
366
- # @private
367
- UnixGidReqs::Requests::DATATYPE = ::Nl::DataTypes::NestedAttributes.new(AttributeSets::UnixGid, selector_bindings: Ractor.make_shareable([]))
368
224
  end
369
225
  module Messages
370
226
  # Dump all pending ip_map requests
371
227
  #
372
228
  # Requires CAP_NET_ADMIN in the initial user namespace.
373
- class DumpIpMapGetReqsRequest < ::Nl::Genl::Message
229
+ class DumpIpMapGetReqsRequest < ::Nl::Message
374
230
  TYPE = 2
375
231
  FIXED_HEADER = nil
376
232
  ATTRIBUTE_SET = AttributeSets::IpMapReqs
377
- ATTRIBUTES = Ractor.make_shareable(%i[])
233
+ ATTRIBUTES = %i[].freeze
234
+ include ATTRIBUTE_SET::Definitions
235
+ def initialize(attributes = [])
236
+ @attributes = attributes
237
+ end
238
+ # @private
239
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
240
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
241
+ new(
242
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
243
+ )
244
+ end
245
+ # Decodes a message payload from the decoder into a new instance.
246
+ # @rbs (::Nl::Decoder decoder) -> instance
247
+ def self.decode(decoder)
248
+ new(decode_attributes(decoder, BY_TYPE, 0))
249
+ end
250
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
251
+ encode_attributes(encoder, external_selectors:)
252
+ end
378
253
  end
379
254
  # Dump all pending ip_map requests
380
255
  #
381
256
  # Requires CAP_NET_ADMIN in the initial user namespace.
382
- class DumpIpMapGetReqsReply < ::Nl::Genl::Message
257
+ class DumpIpMapGetReqsReply < ::Nl::Message
383
258
  TYPE = 2
384
259
  FIXED_HEADER = nil
385
260
  ATTRIBUTE_SET = AttributeSets::IpMapReqs
386
- ATTRIBUTES = Ractor.make_shareable(%i[requests])
261
+ ATTRIBUTES = %i[requests].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
387
281
  # @rbs return: ::Array[AttributeSets::IpMap]
388
282
  # @return [Array<AttributeSets::IpMap>]
389
- # @see AttributeSets::IpMapReqs::Requests
390
- def requests; attributes[:"requests"].map(&:value); end
283
+ def requests; self[:"requests"]; end
391
284
  end
392
285
  # Respond to one or more ip_map requests
393
286
  #
394
287
  # Requires CAP_NET_ADMIN in the initial user namespace.
395
- class DoIpMapSetReqsRequest < ::Nl::Genl::Message
288
+ class DoIpMapSetReqsRequest < ::Nl::Message
396
289
  TYPE = 3
397
290
  FIXED_HEADER = nil
398
291
  ATTRIBUTE_SET = AttributeSets::IpMapReqs
399
- ATTRIBUTES = Ractor.make_shareable(%i[requests])
292
+ ATTRIBUTES = %i[requests].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
400
312
  # @rbs return: ::Array[AttributeSets::IpMap]
401
313
  # @return [Array<AttributeSets::IpMap>]
402
- # @see AttributeSets::IpMapReqs::Requests
403
- def requests; attributes[:"requests"].map(&:value); end
314
+ def requests; self[:"requests"]; end
404
315
  end
405
316
  # Dump all pending unix_gid requests
406
317
  #
407
318
  # Requires CAP_NET_ADMIN in the initial user namespace.
408
- class DumpUnixGidGetReqsRequest < ::Nl::Genl::Message
319
+ class DumpUnixGidGetReqsRequest < ::Nl::Message
409
320
  TYPE = 4
410
321
  FIXED_HEADER = nil
411
322
  ATTRIBUTE_SET = AttributeSets::UnixGidReqs
412
- ATTRIBUTES = Ractor.make_shareable(%i[])
323
+ ATTRIBUTES = %i[].freeze
324
+ include ATTRIBUTE_SET::Definitions
325
+ def initialize(attributes = [])
326
+ @attributes = attributes
327
+ end
328
+ # @private
329
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
330
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
331
+ new(
332
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
333
+ )
334
+ end
335
+ # Decodes a message payload from the decoder into a new instance.
336
+ # @rbs (::Nl::Decoder decoder) -> instance
337
+ def self.decode(decoder)
338
+ new(decode_attributes(decoder, BY_TYPE, 0))
339
+ end
340
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
341
+ encode_attributes(encoder, external_selectors:)
342
+ end
413
343
  end
414
344
  # Dump all pending unix_gid requests
415
345
  #
416
346
  # Requires CAP_NET_ADMIN in the initial user namespace.
417
- class DumpUnixGidGetReqsReply < ::Nl::Genl::Message
347
+ class DumpUnixGidGetReqsReply < ::Nl::Message
418
348
  TYPE = 4
419
349
  FIXED_HEADER = nil
420
350
  ATTRIBUTE_SET = AttributeSets::UnixGidReqs
421
- ATTRIBUTES = Ractor.make_shareable(%i[requests])
351
+ ATTRIBUTES = %i[requests].freeze
352
+ include ATTRIBUTE_SET::Definitions
353
+ def initialize(attributes = [])
354
+ @attributes = attributes
355
+ end
356
+ # @private
357
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
358
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
359
+ new(
360
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
361
+ )
362
+ end
363
+ # Decodes a message payload from the decoder into a new instance.
364
+ # @rbs (::Nl::Decoder decoder) -> instance
365
+ def self.decode(decoder)
366
+ new(decode_attributes(decoder, BY_TYPE, 0))
367
+ end
368
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
369
+ encode_attributes(encoder, external_selectors:)
370
+ end
422
371
  # @rbs return: ::Array[AttributeSets::UnixGid]
423
372
  # @return [Array<AttributeSets::UnixGid>]
424
- # @see AttributeSets::UnixGidReqs::Requests
425
- def requests; attributes[:"requests"].map(&:value); end
373
+ def requests; self[:"requests"]; end
426
374
  end
427
375
  # Respond to one or more unix_gid requests
428
376
  #
429
377
  # Requires CAP_NET_ADMIN in the initial user namespace.
430
- class DoUnixGidSetReqsRequest < ::Nl::Genl::Message
378
+ class DoUnixGidSetReqsRequest < ::Nl::Message
431
379
  TYPE = 5
432
380
  FIXED_HEADER = nil
433
381
  ATTRIBUTE_SET = AttributeSets::UnixGidReqs
434
- ATTRIBUTES = Ractor.make_shareable(%i[requests])
382
+ ATTRIBUTES = %i[requests].freeze
383
+ include ATTRIBUTE_SET::Definitions
384
+ def initialize(attributes = [])
385
+ @attributes = attributes
386
+ end
387
+ # @private
388
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
389
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
390
+ new(
391
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
392
+ )
393
+ end
394
+ # Decodes a message payload from the decoder into a new instance.
395
+ # @rbs (::Nl::Decoder decoder) -> instance
396
+ def self.decode(decoder)
397
+ new(decode_attributes(decoder, BY_TYPE, 0))
398
+ end
399
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
400
+ encode_attributes(encoder, external_selectors:)
401
+ end
435
402
  # @rbs return: ::Array[AttributeSets::UnixGid]
436
403
  # @return [Array<AttributeSets::UnixGid>]
437
- # @see AttributeSets::UnixGidReqs::Requests
438
- def requests; attributes[:"requests"].map(&:value); end
404
+ def requests; self[:"requests"]; end
439
405
  end
440
406
  # Flush sunrpc caches (ip_map and/or unix_gid)
441
407
  #
442
408
  # Requires CAP_NET_ADMIN in the initial user namespace.
443
- class DoCacheFlushRequest < ::Nl::Genl::Message
409
+ class DoCacheFlushRequest < ::Nl::Message
444
410
  TYPE = 6
445
411
  FIXED_HEADER = nil
446
412
  ATTRIBUTE_SET = AttributeSets::CacheFlush
447
- ATTRIBUTES = Ractor.make_shareable(%i[mask])
413
+ ATTRIBUTES = %i[mask].freeze
414
+ include ATTRIBUTE_SET::Definitions
415
+ def initialize(attributes = [])
416
+ @attributes = attributes
417
+ end
418
+ # @private
419
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
420
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
421
+ new(
422
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
423
+ )
424
+ end
425
+ # Decodes a message payload from the decoder into a new instance.
426
+ # @rbs (::Nl::Decoder decoder) -> instance
427
+ def self.decode(decoder)
428
+ new(decode_attributes(decoder, BY_TYPE, 0))
429
+ end
430
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
431
+ encode_attributes(encoder, external_selectors:)
432
+ end
448
433
  # Known flags are defined in {Flags::CacheType}.
449
434
  # @rbs return: ::Integer
450
435
  # @return [Integer]
451
- # @see AttributeSets::CacheFlush::Mask
452
- def mask; attributes[:"mask"]&.value; end
436
+ def mask; self[:"mask"]; end
453
437
  end
454
438
  end
455
439
  module Notifications
456
440
  # Notification that there are cache requests that need servicing
457
441
  #
458
442
  # Multicast group: `exportd`.
459
- class CacheNotify < ::Nl::Genl::Message
443
+ class CacheNotify < ::Nl::Message
460
444
  TYPE = 1
461
445
  FIXED_HEADER = nil
462
446
  ATTRIBUTE_SET = AttributeSets::CacheNotify
463
- ATTRIBUTES = Ractor.make_shareable(%i[cache_type])
447
+ ATTRIBUTES = %i[cache_type].freeze
448
+ include ATTRIBUTE_SET::Definitions
449
+ def initialize(attributes = [])
450
+ @attributes = attributes
451
+ end
452
+ # @private
453
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
454
+ validate_params(params, ::Nl::Message::EMPTY_FIELD_NAMES, ATTRIBUTES)
455
+ new(
456
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
457
+ )
458
+ end
459
+ # Decodes a message payload from the decoder into a new instance.
460
+ # @rbs (::Nl::Decoder decoder) -> instance
461
+ def self.decode(decoder)
462
+ new(decode_attributes(decoder, BY_TYPE, 0))
463
+ end
464
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
465
+ encode_attributes(encoder, external_selectors:)
466
+ end
464
467
  # Known flags are defined in {Flags::CacheType}.
465
468
  # @rbs return: ::Integer
466
469
  # @return [Integer]
467
- # @see AttributeSets::CacheNotify::CacheType
468
- def cache_type; attributes[:"cache_type"]&.value; end
470
+ def cache_type; self[:"cache_type"]; end
469
471
  end
470
472
  end
471
473
  # @private
472
- NOTIFICATIONS = Ractor.make_shareable({1 => Notifications::CacheNotify}) #: Hash[::Integer, ::Class]
474
+ NOTIFICATIONS = {1 => Notifications::CacheNotify}.freeze #: Hash[::Integer, ::Class]
473
475
  # Dump all pending ip_map requests
474
476
  #
475
477
  # Requires CAP_NET_ADMIN in the initial user namespace.