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/ovs_datapath.yaml from Linux v7.2.
3
+ # This file is based on Documentation/netlink/specs/ovs_datapath.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 OvsDatapath < ::Nl::Genl::Family
27
27
  super
28
28
  end
29
29
  # @private
30
- MCAST_GROUPS = Ractor.make_shareable({:"ovs_datapath" => ::Nl::McastGroup.new("ovs_datapath", nil)}) #: Hash[::Symbol, ::Nl::McastGroup]
30
+ MCAST_GROUPS = {:"ovs_datapath" => ::Nl::McastGroup.new("ovs_datapath", nil)}.freeze #: Hash[::Symbol, ::Nl::McastGroup]
31
31
  module Flags
32
32
  module UserFeatures
33
33
  # Allow last Netlink attribute to be unaligned
@@ -48,14 +48,25 @@ class OvsDatapath < ::Nl::Genl::Family
48
48
  # @!attribute [rw] dp_ifindex
49
49
  # @return [Integer]
50
50
  # @private
51
- MEMBERS = Ractor.make_shareable({dp_ifindex: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
51
+ MEMBERS = {dp_ifindex: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
52
+ Ractor.make_shareable(MEMBERS) if defined?(Ractor)
53
+ # @private
54
+ # @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
55
+ def self.from_params(params, context: nil)
56
+ unknown = params.keys - members
57
+ raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
58
+ self.new(
59
+ MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0), context:),
60
+ )
61
+ end
52
62
  # Decodes the struct.
53
63
  # @rbs decoder: ::Nl::Decoder
54
64
  # @rbs return: instance
55
65
  # @param [Nl::Decoder] decoder
56
66
  # @return [self]
57
67
  def self.decode(decoder)
58
- self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
68
+ value_0 = decoder.get_host_u32
69
+ self.new(value_0)
59
70
  end
60
71
  # Encodes the struct.
61
72
  # @rbs encoder: ::Nl::Encoder
@@ -63,7 +74,7 @@ class OvsDatapath < ::Nl::Genl::Family
63
74
  # @param [Nl::Encoder] encoder
64
75
  # @return [void]
65
76
  def encode(encoder)
66
- MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
77
+ MEMBERS[:"dp_ifindex"].encode(encoder, public_send(:"dp_ifindex"))
67
78
  end
68
79
  end
69
80
  OvsDpStats = Struct.new(
@@ -82,14 +93,31 @@ class OvsDatapath < ::Nl::Genl::Family
82
93
  # @!attribute [rw] n_flows
83
94
  # @return [Integer]
84
95
  # @private
85
- MEMBERS = Ractor.make_shareable({n_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_missed: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_lost: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_flows: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
96
+ MEMBERS = {n_hit: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, n_missed: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, n_lost: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, n_flows: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
97
+ Ractor.make_shareable(MEMBERS) if defined?(Ractor)
98
+ # @private
99
+ # @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
100
+ def self.from_params(params, context: nil)
101
+ unknown = params.keys - members
102
+ raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
103
+ self.new(
104
+ MEMBERS[:"n_hit"].coerce(params.fetch(:"n_hit", 0), context:),
105
+ MEMBERS[:"n_missed"].coerce(params.fetch(:"n_missed", 0), context:),
106
+ MEMBERS[:"n_lost"].coerce(params.fetch(:"n_lost", 0), context:),
107
+ MEMBERS[:"n_flows"].coerce(params.fetch(:"n_flows", 0), context:),
108
+ )
109
+ end
86
110
  # Decodes the struct.
87
111
  # @rbs decoder: ::Nl::Decoder
88
112
  # @rbs return: instance
89
113
  # @param [Nl::Decoder] decoder
90
114
  # @return [self]
91
115
  def self.decode(decoder)
92
- self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
116
+ value_0 = decoder.get_host_u64
117
+ value_1 = decoder.get_host_u64
118
+ value_2 = decoder.get_host_u64
119
+ value_3 = decoder.get_host_u64
120
+ self.new(value_0, value_1, value_2, value_3)
93
121
  end
94
122
  # Encodes the struct.
95
123
  # @rbs encoder: ::Nl::Encoder
@@ -97,7 +125,10 @@ class OvsDatapath < ::Nl::Genl::Family
97
125
  # @param [Nl::Encoder] encoder
98
126
  # @return [void]
99
127
  def encode(encoder)
100
- MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
128
+ MEMBERS[:"n_hit"].encode(encoder, public_send(:"n_hit"))
129
+ MEMBERS[:"n_missed"].encode(encoder, public_send(:"n_missed"))
130
+ MEMBERS[:"n_lost"].encode(encoder, public_send(:"n_lost"))
131
+ MEMBERS[:"n_flows"].encode(encoder, public_send(:"n_flows"))
101
132
  end
102
133
  end
103
134
  OvsDpMegaflowStats = Struct.new(
@@ -119,14 +150,33 @@ class OvsDatapath < ::Nl::Genl::Family
119
150
  # @!attribute [rw] pad1
120
151
  # @return [Integer]
121
152
  # @private
122
- MEMBERS = Ractor.make_shareable({n_mask_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), n_masks: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), padding: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), n_cache_hit: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil), pad1: ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)}) #: Hash[::Symbol, ::Nl::_DataType]
153
+ MEMBERS = {n_mask_hit: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, n_masks: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, padding: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, n_cache_hit: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new, pad1: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U64].new}.freeze #: Hash[::Symbol, ::Nl::_DataType]
154
+ Ractor.make_shareable(MEMBERS) if defined?(Ractor)
155
+ # @private
156
+ # @rbs (Hash[Symbol, untyped] params, ?context: untyped) -> instance
157
+ def self.from_params(params, context: nil)
158
+ unknown = params.keys - members
159
+ raise ArgumentError, "unknown struct members: #{unknown.join(', ')}" unless unknown.empty?
160
+ self.new(
161
+ MEMBERS[:"n_mask_hit"].coerce(params.fetch(:"n_mask_hit", 0), context:),
162
+ MEMBERS[:"n_masks"].coerce(params.fetch(:"n_masks", 0), context:),
163
+ MEMBERS[:"padding"].coerce(params.fetch(:"padding", 0), context:),
164
+ MEMBERS[:"n_cache_hit"].coerce(params.fetch(:"n_cache_hit", 0), context:),
165
+ MEMBERS[:"pad1"].coerce(params.fetch(:"pad1", 0), context:),
166
+ )
167
+ end
123
168
  # Decodes the struct.
124
169
  # @rbs decoder: ::Nl::Decoder
125
170
  # @rbs return: instance
126
171
  # @param [Nl::Decoder] decoder
127
172
  # @return [self]
128
173
  def self.decode(decoder)
129
- self.new(*MEMBERS.map {|name, datatype| datatype.decode(decoder) })
174
+ value_0 = decoder.get_host_u64
175
+ value_1 = decoder.get_host_u32
176
+ value_2 = decoder.get_host_u32
177
+ value_3 = decoder.get_host_u64
178
+ value_4 = decoder.get_host_u64
179
+ self.new(value_0, value_1, value_2, value_3, value_4)
130
180
  end
131
181
  # Encodes the struct.
132
182
  # @rbs encoder: ::Nl::Encoder
@@ -134,287 +184,342 @@ class OvsDatapath < ::Nl::Genl::Family
134
184
  # @param [Nl::Encoder] encoder
135
185
  # @return [void]
136
186
  def encode(encoder)
137
- MEMBERS.each {|name, datatype| datatype.encode(encoder, self.public_send(name)) }
187
+ MEMBERS[:"n_mask_hit"].encode(encoder, public_send(:"n_mask_hit"))
188
+ MEMBERS[:"n_masks"].encode(encoder, public_send(:"n_masks"))
189
+ MEMBERS[:"padding"].encode(encoder, public_send(:"padding"))
190
+ MEMBERS[:"n_cache_hit"].encode(encoder, public_send(:"n_cache_hit"))
191
+ MEMBERS[:"pad1"].encode(encoder, public_send(:"pad1"))
138
192
  end
139
193
  end
140
194
  end
141
195
  module AttributeSets
142
196
  class Datapath < ::Nl::AttributeSet
143
- # Abstract class
144
- class Attribute < ::Nl::AttributeSet::Attribute
145
- end
146
- class Name < Attribute
147
- TYPE = 1
148
- NAME = :"name"
149
- # @private
150
- ORDER = 0
151
- # @private
152
- DATATYPE = ::Nl::DataTypes::String.new(check: nil)
153
- end
154
- # upcall pid
155
- class UpcallPid < Attribute
156
- TYPE = 2
157
- NAME = :"upcall_pid"
158
- # @private
159
- ORDER = 1
160
- # @private
161
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
162
- end
163
- class Stats < Attribute
164
- TYPE = 3
165
- NAME = :"stats"
166
- # @private
167
- ORDER = 2
168
- # @private
169
- DATATYPE = ::Nl::DataTypes::Struct.new(Structs::OvsDpStats, check: nil, consume_remaining: true)
170
- end
171
- class MegaflowStats < Attribute
172
- TYPE = 4
173
- NAME = :"megaflow_stats"
174
- # @private
175
- ORDER = 3
176
- # @private
177
- DATATYPE = ::Nl::DataTypes::Struct.new(Structs::OvsDpMegaflowStats, check: nil, consume_remaining: true)
178
- end
179
- # Known flags are defined in {Flags::UserFeatures}.
180
- class UserFeatures < Attribute
181
- TYPE = 5
182
- NAME = :"user_features"
183
- # @private
184
- ORDER = 4
185
- # @private
186
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
187
- end
188
- class MasksCacheSize < Attribute
189
- TYPE = 7
190
- NAME = :"masks_cache_size"
191
- # @private
192
- ORDER = 5
193
- # @private
194
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
197
+ module Definitions
198
+ # @rbs return: ::String
199
+ # @return [String]
200
+ def name; self[:"name"]; end
201
+ # upcall pid
202
+ # @rbs return: ::Integer
203
+ # @return [Integer]
204
+ def upcall_pid; self[:"upcall_pid"]; end
205
+ # @rbs return: Structs::OvsDpStats
206
+ # @return [Structs::OvsDpStats]
207
+ def stats; self[:"stats"]; end
208
+ # @rbs return: Structs::OvsDpMegaflowStats
209
+ # @return [Structs::OvsDpMegaflowStats]
210
+ def megaflow_stats; self[:"megaflow_stats"]; end
211
+ # Known flags are defined in {Flags::UserFeatures}.
212
+ # @rbs return: ::Integer
213
+ # @return [Integer]
214
+ def user_features; self[:"user_features"]; end
215
+ # @rbs return: ::Integer
216
+ # @return [Integer]
217
+ def masks_cache_size; self[:"masks_cache_size"]; end
218
+ # @rbs return: ::Array[::Integer]
219
+ # @return [Array<Integer>]
220
+ def per_cpu_pids; self[:"per_cpu_pids"]; end
221
+ # @rbs return: ::Integer
222
+ # @return [Integer]
223
+ def ifindex; self[:"ifindex"]; end
195
224
  end
196
- class PerCpuPids < Attribute
197
- TYPE = 8
198
- NAME = :"per_cpu_pids"
199
- # @private
200
- ORDER = 6
201
- # @private
202
- DATATYPE = ::Nl::DataTypes::PackedArray.new(::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil), check: nil)
225
+ include Definitions
226
+ # Decodes attributes from the decoder into a new attribute set.
227
+ # @rbs (::Nl::Decoder decoder, ?external_selectors: ::Array[untyped]) -> instance
228
+ def self.decode(decoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
229
+ super(decoder, BY_TYPE, 0, external_selectors)
203
230
  end
204
- class Ifindex < Attribute
205
- TYPE = 9
206
- NAME = :"ifindex"
231
+ end
232
+ end
233
+ module AttributeSets
234
+ class Datapath
235
+ module Definitions
207
236
  # @private
208
- ORDER = 7
237
+ BY_TYPE = ::Array.new(10).tap do |definitions|
238
+ definitions[1] = ::Nl::AttributeSet::Definition.new(id: 1, name: :"name", datatype: ::Nl::DataTypes::String.new, multi: false, order: 0, selector_slot: nil)
239
+ definitions[2] = ::Nl::AttributeSet::Definition.new(id: 2, name: :"upcall_pid", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 1, selector_slot: nil)
240
+ definitions[3] = ::Nl::AttributeSet::Definition.new(id: 3, name: :"stats", datatype: ::Nl::DataTypes::Struct.new(Structs::OvsDpStats, consume_remaining: true), multi: false, order: 2, selector_slot: nil)
241
+ definitions[4] = ::Nl::AttributeSet::Definition.new(id: 4, name: :"megaflow_stats", datatype: ::Nl::DataTypes::Struct.new(Structs::OvsDpMegaflowStats, consume_remaining: true), multi: false, order: 3, selector_slot: nil)
242
+ definitions[5] = ::Nl::AttributeSet::Definition.new(id: 5, name: :"user_features", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 4, selector_slot: nil)
243
+ definitions[7] = ::Nl::AttributeSet::Definition.new(id: 7, name: :"masks_cache_size", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 5, selector_slot: nil)
244
+ definitions[8] = ::Nl::AttributeSet::Definition.new(id: 8, name: :"per_cpu_pids", datatype: ::Nl::DataTypes::PackedArray.new(::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new), multi: false, order: 6, selector_slot: nil)
245
+ definitions[9] = ::Nl::AttributeSet::Definition.new(id: 9, name: :"ifindex", datatype: ::Nl::DataTypes::Scalar[::Nl::Endian::Host::U32].new, multi: false, order: 7, selector_slot: nil)
246
+ end.freeze #: Array[::Nl::AttributeSet::Definition?]
247
+ Ractor.make_shareable(BY_TYPE) if defined?(Ractor)
209
248
  # @private
210
- DATATYPE = ::Nl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
211
- end
212
- # @private
213
- BY_NAME = Ractor.make_shareable({:"name" => Name, :"upcall_pid" => UpcallPid, :"stats" => Stats, :"megaflow_stats" => MegaflowStats, :"user_features" => UserFeatures, :"masks_cache_size" => MasksCacheSize, :"per_cpu_pids" => PerCpuPids, :"ifindex" => Ifindex}) #: Hash[::Symbol, Attribute]
214
- # @private
215
- BY_TYPE = Ractor.make_shareable({1 => Name, 2 => UpcallPid, 3 => Stats, 4 => MegaflowStats, 5 => UserFeatures, 7 => MasksCacheSize, 8 => PerCpuPids, 9 => Ifindex}) #: Hash[::Integer, Attribute]
216
- # @rbs return: ::String
217
- # @return [String]
218
- # @see Name
219
- def name; self[:"name"]&.value; end
220
- # upcall pid
221
- # @rbs return: ::Integer
222
- # @return [Integer]
223
- # @see UpcallPid
224
- def upcall_pid; self[:"upcall_pid"]&.value; end
225
- # @rbs return: Structs::OvsDpStats
226
- # @return [Structs::OvsDpStats]
227
- # @see Stats
228
- def stats; self[:"stats"]&.value; end
229
- # @rbs return: Structs::OvsDpMegaflowStats
230
- # @return [Structs::OvsDpMegaflowStats]
231
- # @see MegaflowStats
232
- def megaflow_stats; self[:"megaflow_stats"]&.value; end
233
- # Known flags are defined in {Flags::UserFeatures}.
234
- # @rbs return: ::Integer
235
- # @return [Integer]
236
- # @see UserFeatures
237
- def user_features; self[:"user_features"]&.value; end
238
- # @rbs return: ::Integer
239
- # @return [Integer]
240
- # @see MasksCacheSize
241
- def masks_cache_size; self[:"masks_cache_size"]&.value; end
242
- # @rbs return: ::Array[::Integer]
243
- # @return [Array<Integer>]
244
- # @see PerCpuPids
245
- def per_cpu_pids; self[:"per_cpu_pids"]&.value; end
246
- # @rbs return: ::Integer
247
- # @return [Integer]
248
- # @see Ifindex
249
- def ifindex; self[:"ifindex"]&.value; end
250
- class << self
251
- # Looks up Attribute class by name.
252
- # @rbs name: Symbol
253
- # @rbs return: Attribute
254
- # @param [Symbol] name
255
- # @return [Attribute]
256
- def by_name(name); BY_NAME.fetch(name); end
257
- # Looks up Attribute class by type value.
258
- # @rbs type: Integer
259
- # @rbs return: Attribute
260
- # @param [Integer] type
261
- # @return [Attribute]
262
- def by_type(type); BY_TYPE.fetch(type); end
249
+ BY_NAME = BY_TYPE.compact.to_h { [it.name, it] }.freeze #: Hash[::Symbol, ::Nl::AttributeSet::Definition]
263
250
  end
264
251
  end
265
252
  end
266
253
  module Messages
267
254
  # Get / dump OVS data path configuration and state
268
- class DoGetRequest < ::Nl::Genl::Message
255
+ class DoGetRequest < ::Nl::Message
269
256
  TYPE = 3
270
257
  FIXED_HEADER = Structs::OvsHeader
271
258
  ATTRIBUTE_SET = AttributeSets::Datapath
272
- ATTRIBUTES = Ractor.make_shareable(%i[name])
259
+ ATTRIBUTES = %i[name].freeze
260
+ include ATTRIBUTE_SET::Definitions
261
+ def initialize(dp_ifindex, attributes = [])
262
+ @dp_ifindex = dp_ifindex
263
+ @attributes = attributes
264
+ end
265
+ # @private
266
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
267
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
268
+ new(
269
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
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
+ value_0 = decoder.get_host_u32
277
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
278
+ end
279
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
280
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
281
+ encode_attributes(encoder, external_selectors:)
282
+ end
273
283
  # @rbs return: ::Integer
274
284
  # @return [Integer]
275
- def dp_ifindex; fixed_header.dp_ifindex; end
285
+ def dp_ifindex; @dp_ifindex; end
276
286
  # @rbs return: ::String
277
287
  # @return [String]
278
- # @see AttributeSets::Datapath::Name
279
- def name; attributes[:"name"]&.value; end
288
+ def name; self[:"name"]; end
280
289
  end
281
290
  # Get / dump OVS data path configuration and state
282
- class DoGetReply < ::Nl::Genl::Message
291
+ class DoGetReply < ::Nl::Message
283
292
  TYPE = 3
284
293
  FIXED_HEADER = Structs::OvsHeader
285
294
  ATTRIBUTE_SET = AttributeSets::Datapath
286
- ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
295
+ ATTRIBUTES = %i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids].freeze
296
+ include ATTRIBUTE_SET::Definitions
297
+ def initialize(dp_ifindex, attributes = [])
298
+ @dp_ifindex = dp_ifindex
299
+ @attributes = attributes
300
+ end
301
+ # @private
302
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
303
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
304
+ new(
305
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
306
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
307
+ )
308
+ end
309
+ # Decodes a message payload from the decoder into a new instance.
310
+ # @rbs (::Nl::Decoder decoder) -> instance
311
+ def self.decode(decoder)
312
+ value_0 = decoder.get_host_u32
313
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
314
+ end
315
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
316
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
317
+ encode_attributes(encoder, external_selectors:)
318
+ end
287
319
  # @rbs return: ::Integer
288
320
  # @return [Integer]
289
- def dp_ifindex; fixed_header.dp_ifindex; end
321
+ def dp_ifindex; @dp_ifindex; end
290
322
  # @rbs return: ::String
291
323
  # @return [String]
292
- # @see AttributeSets::Datapath::Name
293
- def name; attributes[:"name"]&.value; end
324
+ def name; self[:"name"]; end
294
325
  # upcall pid
295
326
  # @rbs return: ::Integer
296
327
  # @return [Integer]
297
- # @see AttributeSets::Datapath::UpcallPid
298
- def upcall_pid; attributes[:"upcall_pid"]&.value; end
328
+ def upcall_pid; self[:"upcall_pid"]; end
299
329
  # @rbs return: Structs::OvsDpStats
300
330
  # @return [Structs::OvsDpStats]
301
- # @see AttributeSets::Datapath::Stats
302
- def stats; attributes[:"stats"]&.value; end
331
+ def stats; self[:"stats"]; end
303
332
  # @rbs return: Structs::OvsDpMegaflowStats
304
333
  # @return [Structs::OvsDpMegaflowStats]
305
- # @see AttributeSets::Datapath::MegaflowStats
306
- def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
334
+ def megaflow_stats; self[:"megaflow_stats"]; end
307
335
  # Known flags are defined in {Flags::UserFeatures}.
308
336
  # @rbs return: ::Integer
309
337
  # @return [Integer]
310
- # @see AttributeSets::Datapath::UserFeatures
311
- def user_features; attributes[:"user_features"]&.value; end
338
+ def user_features; self[:"user_features"]; end
312
339
  # @rbs return: ::Integer
313
340
  # @return [Integer]
314
- # @see AttributeSets::Datapath::MasksCacheSize
315
- def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
341
+ def masks_cache_size; self[:"masks_cache_size"]; end
316
342
  # @rbs return: ::Array[::Integer]
317
343
  # @return [Array<Integer>]
318
- # @see AttributeSets::Datapath::PerCpuPids
319
- def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
344
+ def per_cpu_pids; self[:"per_cpu_pids"]; end
320
345
  end
321
346
  # Get / dump OVS data path configuration and state
322
- class DumpGetRequest < ::Nl::Genl::Message
347
+ class DumpGetRequest < ::Nl::Message
323
348
  TYPE = 3
324
349
  FIXED_HEADER = Structs::OvsHeader
325
350
  ATTRIBUTE_SET = AttributeSets::Datapath
326
- ATTRIBUTES = Ractor.make_shareable(%i[name])
351
+ ATTRIBUTES = %i[name].freeze
352
+ include ATTRIBUTE_SET::Definitions
353
+ def initialize(dp_ifindex, attributes = [])
354
+ @dp_ifindex = dp_ifindex
355
+ @attributes = attributes
356
+ end
357
+ # @private
358
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
359
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
360
+ new(
361
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
362
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
363
+ )
364
+ end
365
+ # Decodes a message payload from the decoder into a new instance.
366
+ # @rbs (::Nl::Decoder decoder) -> instance
367
+ def self.decode(decoder)
368
+ value_0 = decoder.get_host_u32
369
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
370
+ end
371
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
372
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
373
+ encode_attributes(encoder, external_selectors:)
374
+ end
327
375
  # @rbs return: ::Integer
328
376
  # @return [Integer]
329
- def dp_ifindex; fixed_header.dp_ifindex; end
377
+ def dp_ifindex; @dp_ifindex; end
330
378
  # @rbs return: ::String
331
379
  # @return [String]
332
- # @see AttributeSets::Datapath::Name
333
- def name; attributes[:"name"]&.value; end
380
+ def name; self[:"name"]; end
334
381
  end
335
382
  # Get / dump OVS data path configuration and state
336
- class DumpGetReply < ::Nl::Genl::Message
383
+ class DumpGetReply < ::Nl::Message
337
384
  TYPE = 3
338
385
  FIXED_HEADER = Structs::OvsHeader
339
386
  ATTRIBUTE_SET = AttributeSets::Datapath
340
- ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids])
387
+ ATTRIBUTES = %i[name upcall_pid stats megaflow_stats user_features masks_cache_size per_cpu_pids].freeze
388
+ include ATTRIBUTE_SET::Definitions
389
+ def initialize(dp_ifindex, attributes = [])
390
+ @dp_ifindex = dp_ifindex
391
+ @attributes = attributes
392
+ end
393
+ # @private
394
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
395
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
396
+ new(
397
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
398
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
399
+ )
400
+ end
401
+ # Decodes a message payload from the decoder into a new instance.
402
+ # @rbs (::Nl::Decoder decoder) -> instance
403
+ def self.decode(decoder)
404
+ value_0 = decoder.get_host_u32
405
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
406
+ end
407
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
408
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
409
+ encode_attributes(encoder, external_selectors:)
410
+ end
341
411
  # @rbs return: ::Integer
342
412
  # @return [Integer]
343
- def dp_ifindex; fixed_header.dp_ifindex; end
413
+ def dp_ifindex; @dp_ifindex; end
344
414
  # @rbs return: ::String
345
415
  # @return [String]
346
- # @see AttributeSets::Datapath::Name
347
- def name; attributes[:"name"]&.value; end
416
+ def name; self[:"name"]; end
348
417
  # upcall pid
349
418
  # @rbs return: ::Integer
350
419
  # @return [Integer]
351
- # @see AttributeSets::Datapath::UpcallPid
352
- def upcall_pid; attributes[:"upcall_pid"]&.value; end
420
+ def upcall_pid; self[:"upcall_pid"]; end
353
421
  # @rbs return: Structs::OvsDpStats
354
422
  # @return [Structs::OvsDpStats]
355
- # @see AttributeSets::Datapath::Stats
356
- def stats; attributes[:"stats"]&.value; end
423
+ def stats; self[:"stats"]; end
357
424
  # @rbs return: Structs::OvsDpMegaflowStats
358
425
  # @return [Structs::OvsDpMegaflowStats]
359
- # @see AttributeSets::Datapath::MegaflowStats
360
- def megaflow_stats; attributes[:"megaflow_stats"]&.value; end
426
+ def megaflow_stats; self[:"megaflow_stats"]; end
361
427
  # Known flags are defined in {Flags::UserFeatures}.
362
428
  # @rbs return: ::Integer
363
429
  # @return [Integer]
364
- # @see AttributeSets::Datapath::UserFeatures
365
- def user_features; attributes[:"user_features"]&.value; end
430
+ def user_features; self[:"user_features"]; end
366
431
  # @rbs return: ::Integer
367
432
  # @return [Integer]
368
- # @see AttributeSets::Datapath::MasksCacheSize
369
- def masks_cache_size; attributes[:"masks_cache_size"]&.value; end
433
+ def masks_cache_size; self[:"masks_cache_size"]; end
370
434
  # @rbs return: ::Array[::Integer]
371
435
  # @return [Array<Integer>]
372
- # @see AttributeSets::Datapath::PerCpuPids
373
- def per_cpu_pids; attributes[:"per_cpu_pids"]&.value; end
436
+ def per_cpu_pids; self[:"per_cpu_pids"]; end
374
437
  end
375
438
  # Create new OVS data path
376
- class DoNewRequest < ::Nl::Genl::Message
439
+ class DoNewRequest < ::Nl::Message
377
440
  TYPE = 1
378
441
  FIXED_HEADER = Structs::OvsHeader
379
442
  ATTRIBUTE_SET = AttributeSets::Datapath
380
- ATTRIBUTES = Ractor.make_shareable(%i[name upcall_pid user_features])
443
+ ATTRIBUTES = %i[name upcall_pid user_features].freeze
444
+ include ATTRIBUTE_SET::Definitions
445
+ def initialize(dp_ifindex, attributes = [])
446
+ @dp_ifindex = dp_ifindex
447
+ @attributes = attributes
448
+ end
449
+ # @private
450
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
451
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
452
+ new(
453
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
454
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
455
+ )
456
+ end
457
+ # Decodes a message payload from the decoder into a new instance.
458
+ # @rbs (::Nl::Decoder decoder) -> instance
459
+ def self.decode(decoder)
460
+ value_0 = decoder.get_host_u32
461
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
462
+ end
463
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
464
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
465
+ encode_attributes(encoder, external_selectors:)
466
+ end
381
467
  # @rbs return: ::Integer
382
468
  # @return [Integer]
383
- def dp_ifindex; fixed_header.dp_ifindex; end
469
+ def dp_ifindex; @dp_ifindex; end
384
470
  # @rbs return: ::String
385
471
  # @return [String]
386
- # @see AttributeSets::Datapath::Name
387
- def name; attributes[:"name"]&.value; end
472
+ def name; self[:"name"]; end
388
473
  # upcall pid
389
474
  # @rbs return: ::Integer
390
475
  # @return [Integer]
391
- # @see AttributeSets::Datapath::UpcallPid
392
- def upcall_pid; attributes[:"upcall_pid"]&.value; end
476
+ def upcall_pid; self[:"upcall_pid"]; end
393
477
  # Known flags are defined in {Flags::UserFeatures}.
394
478
  # @rbs return: ::Integer
395
479
  # @return [Integer]
396
- # @see AttributeSets::Datapath::UserFeatures
397
- def user_features; attributes[:"user_features"]&.value; end
480
+ def user_features; self[:"user_features"]; end
398
481
  end
399
482
  # Delete existing OVS data path
400
- class DoDelRequest < ::Nl::Genl::Message
483
+ class DoDelRequest < ::Nl::Message
401
484
  TYPE = 2
402
485
  FIXED_HEADER = Structs::OvsHeader
403
486
  ATTRIBUTE_SET = AttributeSets::Datapath
404
- ATTRIBUTES = Ractor.make_shareable(%i[name])
487
+ ATTRIBUTES = %i[name].freeze
488
+ include ATTRIBUTE_SET::Definitions
489
+ def initialize(dp_ifindex, attributes = [])
490
+ @dp_ifindex = dp_ifindex
491
+ @attributes = attributes
492
+ end
493
+ # @private
494
+ def self.build_instance(params, external_selectors: ::Nl::Selector::EMPTY_VALUES)
495
+ validate_params(params, FIXED_HEADER.members, ATTRIBUTES)
496
+ new(
497
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].coerce(params.fetch(:"dp_ifindex", 0)),
498
+ build_attributes(params.slice(*ATTRIBUTES), external_selectors:),
499
+ )
500
+ end
501
+ # Decodes a message payload from the decoder into a new instance.
502
+ # @rbs (::Nl::Decoder decoder) -> instance
503
+ def self.decode(decoder)
504
+ value_0 = decoder.get_host_u32
505
+ new(value_0, decode_attributes(decoder, BY_TYPE, 0))
506
+ end
507
+ def encode(encoder, external_selectors: ::Nl::Selector::EMPTY_VALUES)
508
+ FIXED_HEADER::MEMBERS[:"dp_ifindex"].encode(encoder, @dp_ifindex)
509
+ encode_attributes(encoder, external_selectors:)
510
+ end
405
511
  # @rbs return: ::Integer
406
512
  # @return [Integer]
407
- def dp_ifindex; fixed_header.dp_ifindex; end
513
+ def dp_ifindex; @dp_ifindex; end
408
514
  # @rbs return: ::String
409
515
  # @return [String]
410
- # @see AttributeSets::Datapath::Name
411
- def name; attributes[:"name"]&.value; end
516
+ def name; self[:"name"]; end
412
517
  end
413
518
  end
414
519
  module Notifications
415
520
  end
416
521
  # @private
417
- NOTIFICATIONS = Ractor.make_shareable({}) #: Hash[::Integer, ::Class]
522
+ NOTIFICATIONS = {}.freeze #: Hash[::Integer, ::Class]
418
523
  # Get / dump OVS data path configuration and state
419
524
  # @rbs (?dp_ifindex: ::Integer, ?name: ::String) -> Messages::DoGetReply
420
525
  # @param [Hash] args