nl-linux 0.2.0 → 0.2.2

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Rakefile +31 -5
  4. data/generated/nl/linux/binder.rb +96 -0
  5. data/generated/nl/linux/conntrack.rb +1227 -0
  6. data/generated/nl/linux/dev_energymodel.rb +235 -0
  7. data/generated/nl/linux/devlink.rb +5177 -0
  8. data/generated/nl/linux/dpll.rb +944 -0
  9. data/generated/nl/linux/ethtool.rb +7121 -0
  10. data/generated/nl/linux/fou.rb +332 -0
  11. data/generated/nl/linux/handshake.rb +238 -0
  12. data/generated/nl/linux/lockd.rb +99 -0
  13. data/generated/nl/linux/mptcp_pm.rb +607 -0
  14. data/generated/nl/linux/net_shaper.rb +731 -0
  15. data/generated/nl/linux/netdev.rb +1450 -0
  16. data/generated/nl/linux/nfsd.rb +500 -0
  17. data/generated/nl/linux/nftables.rb +2924 -0
  18. data/generated/nl/linux/nl80211.rb +3393 -0
  19. data/generated/nl/linux/nlctrl.rb +397 -0
  20. data/generated/nl/linux/ovpn.rb +964 -0
  21. data/generated/nl/linux/ovs_datapath.rb +321 -0
  22. data/generated/nl/linux/ovs_flow.rb +1447 -0
  23. data/generated/nl/linux/ovs_vport.rb +391 -0
  24. data/generated/nl/linux/psp.rb +463 -0
  25. data/generated/nl/linux/rt_addr.rb +448 -0
  26. data/generated/nl/linux/rt_link.rb +4613 -0
  27. data/generated/nl/linux/rt_neigh.rb +897 -0
  28. data/generated/nl/linux/rt_route.rb +1126 -0
  29. data/generated/nl/linux/rt_rule.rb +708 -0
  30. data/generated/nl/linux/tc.rb +7066 -0
  31. data/generated/nl/linux/tcp_metrics.rb +317 -0
  32. data/generated/nl/linux/team.rb +339 -0
  33. data/generated/nl/linux/wireguard.rb +430 -0
  34. data/generated/nl/linux.rb +35 -0
  35. data/lib/nl/linux/version.rb +1 -1
  36. data/lib/nl-linux.rb +1 -1
  37. metadata +37 -7
  38. data/lib/nl/linux.rb +0 -3
@@ -0,0 +1,332 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ module Nl; module Linux
8
+ # Foo-over-UDP.
9
+ class Fou < ::Nl::Family
10
+ NAME = "fou"
11
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("fou"))
12
+ module Structs
13
+ end
14
+ module AttributeSets
15
+ class Fou < ::Nl::Protocols::Genl::AttributeSet
16
+ # Abstract class
17
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
18
+ end
19
+ class Port < Attribute
20
+ TYPE = 1
21
+ NAME = :"port"
22
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
23
+ end
24
+ class Af < Attribute
25
+ TYPE = 2
26
+ NAME = :"af"
27
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
28
+ end
29
+ class Ipproto < Attribute
30
+ TYPE = 3
31
+ NAME = :"ipproto"
32
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: -> { raise ArgumentError, "Value #{it.inspect} is less than minimum 1" unless it >= 1 })
33
+ end
34
+ class Type < Attribute
35
+ TYPE = 4
36
+ NAME = :"type"
37
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U8, check: nil)
38
+ end
39
+ class RemcsumNopartial < Attribute
40
+ TYPE = 5
41
+ NAME = :"remcsum_nopartial"
42
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Flag.new
43
+ end
44
+ class LocalV4 < Attribute
45
+ TYPE = 6
46
+ NAME = :"local_v4"
47
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
48
+ end
49
+ class LocalV6 < Attribute
50
+ TYPE = 7
51
+ NAME = :"local_v6"
52
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
53
+ end
54
+ class PeerV4 < Attribute
55
+ TYPE = 8
56
+ NAME = :"peer_v4"
57
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
58
+ end
59
+ class PeerV6 < Attribute
60
+ TYPE = 9
61
+ NAME = :"peer_v6"
62
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Binary.new(check: -> { raise ArgumentError, "Value #{it.inspect} is not equal to length 16" unless it.bytesize == 16 })
63
+ end
64
+ class PeerPort < Attribute
65
+ TYPE = 10
66
+ NAME = :"peer_port"
67
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Big::U16, check: nil)
68
+ end
69
+ class Ifindex < Attribute
70
+ TYPE = 11
71
+ NAME = :"ifindex"
72
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
73
+ end
74
+ # :nodoc:
75
+ BY_NAME = Ractor.make_shareable({:"port" => Port, :"af" => Af, :"ipproto" => Ipproto, :"type" => Type, :"remcsum_nopartial" => RemcsumNopartial, :"local_v4" => LocalV4, :"local_v6" => LocalV6, :"peer_v4" => PeerV4, :"peer_v6" => PeerV6, :"peer_port" => PeerPort, :"ifindex" => Ifindex}) #: Hash[::Symbol, Attribute]
76
+ # :nodoc:
77
+ BY_TYPE = Ractor.make_shareable({1 => Port, 2 => Af, 3 => Ipproto, 4 => Type, 5 => RemcsumNopartial, 6 => LocalV4, 7 => LocalV6, 8 => PeerV4, 9 => PeerV6, 10 => PeerPort, 11 => Ifindex}) #: Hash[::Integer, Attribute]
78
+ class << self
79
+ # Looks up Attribute class by name.
80
+ #--
81
+ # @rbs name: Symbol
82
+ # @rbs return: Attribute
83
+ def by_name(name); BY_NAME.fetch(name); end
84
+ # Looks up Attribute class by type value.
85
+ #--
86
+ # @rbs type: Integer
87
+ # @rbs return: Attribute
88
+ def by_type(type); BY_TYPE.fetch(type); end
89
+ end
90
+ end
91
+ end
92
+ module Messages
93
+ # Add port.
94
+ class DoAddRequest < ::Nl::Protocols::Genl::Message
95
+ TYPE = 1
96
+ FIXED_HEADER = nil
97
+ ATTRIBUTE_SET = AttributeSets::Fou
98
+ ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
99
+ # Gets the value of `port` attribute in the message.
100
+ #--
101
+ # @rbs return: ::Integer
102
+ def port; attributes[:"port"]&.value; end
103
+ # Gets the value of `ipproto` attribute in the message.
104
+ #--
105
+ # @rbs return: ::Integer
106
+ def ipproto; attributes[:"ipproto"]&.value; end
107
+ # Gets the value of `type` attribute in the message.
108
+ #--
109
+ # @rbs return: ::Integer
110
+ def type; attributes[:"type"]&.value; end
111
+ # Gets the value of `remcsum-nopartial` attribute in the message.
112
+ #--
113
+ # @rbs return: ::Integer
114
+ def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
115
+ # Gets the value of `local-v4` attribute in the message.
116
+ #--
117
+ # @rbs return: ::Integer
118
+ def local_v4; attributes[:"local_v4"]&.value; end
119
+ # Gets the value of `local-v6` attribute in the message.
120
+ #--
121
+ # @rbs return: untyped
122
+ def local_v6; attributes[:"local_v6"]&.value; end
123
+ # Gets the value of `peer-v4` attribute in the message.
124
+ #--
125
+ # @rbs return: ::Integer
126
+ def peer_v4; attributes[:"peer_v4"]&.value; end
127
+ # Gets the value of `peer-v6` attribute in the message.
128
+ #--
129
+ # @rbs return: untyped
130
+ def peer_v6; attributes[:"peer_v6"]&.value; end
131
+ # Gets the value of `peer-port` attribute in the message.
132
+ #--
133
+ # @rbs return: ::Integer
134
+ def peer_port; attributes[:"peer_port"]&.value; end
135
+ # Gets the value of `ifindex` attribute in the message.
136
+ #--
137
+ # @rbs return: ::Integer
138
+ def ifindex; attributes[:"ifindex"]&.value; end
139
+ end
140
+ # Delete port.
141
+ class DoDelRequest < ::Nl::Protocols::Genl::Message
142
+ TYPE = 2
143
+ FIXED_HEADER = nil
144
+ ATTRIBUTE_SET = AttributeSets::Fou
145
+ ATTRIBUTES = Ractor.make_shareable(%i[port af local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
146
+ # Gets the value of `port` attribute in the message.
147
+ #--
148
+ # @rbs return: ::Integer
149
+ def port; attributes[:"port"]&.value; end
150
+ # Gets the value of `af` attribute in the message.
151
+ #--
152
+ # @rbs return: ::Integer
153
+ def af; attributes[:"af"]&.value; end
154
+ # Gets the value of `local-v4` attribute in the message.
155
+ #--
156
+ # @rbs return: ::Integer
157
+ def local_v4; attributes[:"local_v4"]&.value; end
158
+ # Gets the value of `local-v6` attribute in the message.
159
+ #--
160
+ # @rbs return: untyped
161
+ def local_v6; attributes[:"local_v6"]&.value; end
162
+ # Gets the value of `peer-v4` attribute in the message.
163
+ #--
164
+ # @rbs return: ::Integer
165
+ def peer_v4; attributes[:"peer_v4"]&.value; end
166
+ # Gets the value of `peer-v6` attribute in the message.
167
+ #--
168
+ # @rbs return: untyped
169
+ def peer_v6; attributes[:"peer_v6"]&.value; end
170
+ # Gets the value of `peer-port` attribute in the message.
171
+ #--
172
+ # @rbs return: ::Integer
173
+ def peer_port; attributes[:"peer_port"]&.value; end
174
+ # Gets the value of `ifindex` attribute in the message.
175
+ #--
176
+ # @rbs return: ::Integer
177
+ def ifindex; attributes[:"ifindex"]&.value; end
178
+ end
179
+ # Get tunnel info.
180
+ class DoGetRequest < ::Nl::Protocols::Genl::Message
181
+ TYPE = 3
182
+ FIXED_HEADER = nil
183
+ ATTRIBUTE_SET = AttributeSets::Fou
184
+ ATTRIBUTES = Ractor.make_shareable(%i[port af local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
185
+ # Gets the value of `port` attribute in the message.
186
+ #--
187
+ # @rbs return: ::Integer
188
+ def port; attributes[:"port"]&.value; end
189
+ # Gets the value of `af` attribute in the message.
190
+ #--
191
+ # @rbs return: ::Integer
192
+ def af; attributes[:"af"]&.value; end
193
+ # Gets the value of `local-v4` attribute in the message.
194
+ #--
195
+ # @rbs return: ::Integer
196
+ def local_v4; attributes[:"local_v4"]&.value; end
197
+ # Gets the value of `local-v6` attribute in the message.
198
+ #--
199
+ # @rbs return: untyped
200
+ def local_v6; attributes[:"local_v6"]&.value; end
201
+ # Gets the value of `peer-v4` attribute in the message.
202
+ #--
203
+ # @rbs return: ::Integer
204
+ def peer_v4; attributes[:"peer_v4"]&.value; end
205
+ # Gets the value of `peer-v6` attribute in the message.
206
+ #--
207
+ # @rbs return: untyped
208
+ def peer_v6; attributes[:"peer_v6"]&.value; end
209
+ # Gets the value of `peer-port` attribute in the message.
210
+ #--
211
+ # @rbs return: ::Integer
212
+ def peer_port; attributes[:"peer_port"]&.value; end
213
+ # Gets the value of `ifindex` attribute in the message.
214
+ #--
215
+ # @rbs return: ::Integer
216
+ def ifindex; attributes[:"ifindex"]&.value; end
217
+ end
218
+ # Get tunnel info.
219
+ class DoGetReply < ::Nl::Protocols::Genl::Message
220
+ TYPE = 3
221
+ FIXED_HEADER = nil
222
+ ATTRIBUTE_SET = AttributeSets::Fou
223
+ ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
224
+ # Gets the value of `port` attribute in the message.
225
+ #--
226
+ # @rbs return: ::Integer
227
+ def port; attributes[:"port"]&.value; end
228
+ # Gets the value of `ipproto` attribute in the message.
229
+ #--
230
+ # @rbs return: ::Integer
231
+ def ipproto; attributes[:"ipproto"]&.value; end
232
+ # Gets the value of `type` attribute in the message.
233
+ #--
234
+ # @rbs return: ::Integer
235
+ def type; attributes[:"type"]&.value; end
236
+ # Gets the value of `remcsum-nopartial` attribute in the message.
237
+ #--
238
+ # @rbs return: ::Integer
239
+ def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
240
+ # Gets the value of `local-v4` attribute in the message.
241
+ #--
242
+ # @rbs return: ::Integer
243
+ def local_v4; attributes[:"local_v4"]&.value; end
244
+ # Gets the value of `local-v6` attribute in the message.
245
+ #--
246
+ # @rbs return: untyped
247
+ def local_v6; attributes[:"local_v6"]&.value; end
248
+ # Gets the value of `peer-v4` attribute in the message.
249
+ #--
250
+ # @rbs return: ::Integer
251
+ def peer_v4; attributes[:"peer_v4"]&.value; end
252
+ # Gets the value of `peer-v6` attribute in the message.
253
+ #--
254
+ # @rbs return: untyped
255
+ def peer_v6; attributes[:"peer_v6"]&.value; end
256
+ # Gets the value of `peer-port` attribute in the message.
257
+ #--
258
+ # @rbs return: ::Integer
259
+ def peer_port; attributes[:"peer_port"]&.value; end
260
+ # Gets the value of `ifindex` attribute in the message.
261
+ #--
262
+ # @rbs return: ::Integer
263
+ def ifindex; attributes[:"ifindex"]&.value; end
264
+ end
265
+ # Get tunnel info.
266
+ class DumpGetReply < ::Nl::Protocols::Genl::Message
267
+ TYPE = 3
268
+ FIXED_HEADER = nil
269
+ ATTRIBUTE_SET = AttributeSets::Fou
270
+ ATTRIBUTES = Ractor.make_shareable(%i[port ipproto type remcsum_nopartial local_v4 local_v6 peer_v4 peer_v6 peer_port ifindex])
271
+ # Gets the value of `port` attribute in the message.
272
+ #--
273
+ # @rbs return: ::Integer
274
+ def port; attributes[:"port"]&.value; end
275
+ # Gets the value of `ipproto` attribute in the message.
276
+ #--
277
+ # @rbs return: ::Integer
278
+ def ipproto; attributes[:"ipproto"]&.value; end
279
+ # Gets the value of `type` attribute in the message.
280
+ #--
281
+ # @rbs return: ::Integer
282
+ def type; attributes[:"type"]&.value; end
283
+ # Gets the value of `remcsum-nopartial` attribute in the message.
284
+ #--
285
+ # @rbs return: ::Integer
286
+ def remcsum_nopartial; attributes[:"remcsum_nopartial"]&.value; end
287
+ # Gets the value of `local-v4` attribute in the message.
288
+ #--
289
+ # @rbs return: ::Integer
290
+ def local_v4; attributes[:"local_v4"]&.value; end
291
+ # Gets the value of `local-v6` attribute in the message.
292
+ #--
293
+ # @rbs return: untyped
294
+ def local_v6; attributes[:"local_v6"]&.value; end
295
+ # Gets the value of `peer-v4` attribute in the message.
296
+ #--
297
+ # @rbs return: ::Integer
298
+ def peer_v4; attributes[:"peer_v4"]&.value; end
299
+ # Gets the value of `peer-v6` attribute in the message.
300
+ #--
301
+ # @rbs return: untyped
302
+ def peer_v6; attributes[:"peer_v6"]&.value; end
303
+ # Gets the value of `peer-port` attribute in the message.
304
+ #--
305
+ # @rbs return: ::Integer
306
+ def peer_port; attributes[:"peer_port"]&.value; end
307
+ # Gets the value of `ifindex` attribute in the message.
308
+ #--
309
+ # @rbs return: ::Integer
310
+ def ifindex; attributes[:"ifindex"]&.value; end
311
+ end
312
+ end
313
+ # Add port.
314
+ #--
315
+ # @rbs (?port: ::Integer, ?ipproto: ::Integer, ?type: ::Integer, ?remcsum_nopartial: ::Integer, ?local_v4: ::Integer, ?local_v6: untyped, ?peer_v4: ::Integer, ?peer_v6: untyped, ?peer_port: ::Integer, ?ifindex: ::Integer) -> void
316
+ def do_add(**args)
317
+ exchange_message(:"do", Messages::DoAddRequest, nil, args)
318
+ end
319
+ # Delete port.
320
+ #--
321
+ # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: untyped, ?peer_v4: ::Integer, ?peer_v6: untyped, ?peer_port: ::Integer, ?ifindex: ::Integer) -> void
322
+ def do_del(**args)
323
+ exchange_message(:"do", Messages::DoDelRequest, nil, args)
324
+ end
325
+ # Get tunnel info.
326
+ #--
327
+ # @rbs (?port: ::Integer, ?af: ::Integer, ?local_v4: ::Integer, ?local_v6: untyped, ?peer_v4: ::Integer, ?peer_v6: untyped, ?peer_port: ::Integer, ?ifindex: ::Integer) -> Messages::DoGetReply
328
+ def do_get(**args)
329
+ exchange_message(:"do", Messages::DoGetRequest, Messages::DoGetReply, args)
330
+ end
331
+ end
332
+ end; end
@@ -0,0 +1,238 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # Author: Chuck Lever <chuck.lever@oracle.com>
4
+ #
5
+ # Copyright (c) 2023, Oracle and/or its affiliates.
6
+ #
7
+ #--
8
+ # frozen_string_literal: true
9
+ # rbs_inline: enabled
10
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
11
+ require 'nl'
12
+ module Nl; module Linux
13
+ # Netlink protocol to request a transport layer security handshake.
14
+ class Handshake < ::Nl::Family
15
+ NAME = "handshake"
16
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("handshake"))
17
+ module Structs
18
+ end
19
+ module AttributeSets
20
+ class X509 < ::Nl::Protocols::Genl::AttributeSet
21
+ # Abstract class
22
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
23
+ end
24
+ class Cert < Attribute
25
+ TYPE = 1
26
+ NAME = :"cert"
27
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
28
+ end
29
+ class Privkey < Attribute
30
+ TYPE = 2
31
+ NAME = :"privkey"
32
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
33
+ end
34
+ # :nodoc:
35
+ BY_NAME = Ractor.make_shareable({:"cert" => Cert, :"privkey" => Privkey}) #: Hash[::Symbol, Attribute]
36
+ # :nodoc:
37
+ BY_TYPE = Ractor.make_shareable({1 => Cert, 2 => Privkey}) #: Hash[::Integer, Attribute]
38
+ class << self
39
+ # Looks up Attribute class by name.
40
+ #--
41
+ # @rbs name: Symbol
42
+ # @rbs return: Attribute
43
+ def by_name(name); BY_NAME.fetch(name); end
44
+ # Looks up Attribute class by type value.
45
+ #--
46
+ # @rbs type: Integer
47
+ # @rbs return: Attribute
48
+ def by_type(type); BY_TYPE.fetch(type); end
49
+ end
50
+ end
51
+ class Accept < ::Nl::Protocols::Genl::AttributeSet
52
+ # Abstract class
53
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
54
+ end
55
+ class Sockfd < Attribute
56
+ TYPE = 1
57
+ NAME = :"sockfd"
58
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
59
+ end
60
+ class HandlerClass < Attribute
61
+ TYPE = 2
62
+ NAME = :"handler_class"
63
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
64
+ end
65
+ class MessageType < Attribute
66
+ TYPE = 3
67
+ NAME = :"message_type"
68
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
69
+ end
70
+ class Timeout < Attribute
71
+ TYPE = 4
72
+ NAME = :"timeout"
73
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
74
+ end
75
+ class AuthMode < Attribute
76
+ TYPE = 5
77
+ NAME = :"auth_mode"
78
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
79
+ end
80
+ class PeerIdentity < Attribute
81
+ TYPE = 6
82
+ NAME = :"peer_identity"
83
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
84
+ end
85
+ class Certificate < Attribute
86
+ TYPE = 7
87
+ NAME = :"certificate"
88
+ end
89
+ class Peername < Attribute
90
+ TYPE = 8
91
+ NAME = :"peername"
92
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::String.new(check: nil)
93
+ end
94
+ class Keyring < Attribute
95
+ TYPE = 9
96
+ NAME = :"keyring"
97
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
98
+ end
99
+ # :nodoc:
100
+ BY_NAME = Ractor.make_shareable({:"sockfd" => Sockfd, :"handler_class" => HandlerClass, :"message_type" => MessageType, :"timeout" => Timeout, :"auth_mode" => AuthMode, :"peer_identity" => PeerIdentity, :"certificate" => Certificate, :"peername" => Peername, :"keyring" => Keyring}) #: Hash[::Symbol, Attribute]
101
+ # :nodoc:
102
+ BY_TYPE = Ractor.make_shareable({1 => Sockfd, 2 => HandlerClass, 3 => MessageType, 4 => Timeout, 5 => AuthMode, 6 => PeerIdentity, 7 => Certificate, 8 => Peername, 9 => Keyring}) #: Hash[::Integer, Attribute]
103
+ class << self
104
+ # Looks up Attribute class by name.
105
+ #--
106
+ # @rbs name: Symbol
107
+ # @rbs return: Attribute
108
+ def by_name(name); BY_NAME.fetch(name); end
109
+ # Looks up Attribute class by type value.
110
+ #--
111
+ # @rbs type: Integer
112
+ # @rbs return: Attribute
113
+ def by_type(type); BY_TYPE.fetch(type); end
114
+ end
115
+ end
116
+ class Done < ::Nl::Protocols::Genl::AttributeSet
117
+ # Abstract class
118
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
119
+ end
120
+ class Status < Attribute
121
+ TYPE = 1
122
+ NAME = :"status"
123
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
124
+ end
125
+ class Sockfd < Attribute
126
+ TYPE = 2
127
+ NAME = :"sockfd"
128
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::S32, check: nil)
129
+ end
130
+ class RemoteAuth < Attribute
131
+ TYPE = 3
132
+ NAME = :"remote_auth"
133
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
134
+ end
135
+ # :nodoc:
136
+ BY_NAME = Ractor.make_shareable({:"status" => Status, :"sockfd" => Sockfd, :"remote_auth" => RemoteAuth}) #: Hash[::Symbol, Attribute]
137
+ # :nodoc:
138
+ BY_TYPE = Ractor.make_shareable({1 => Status, 2 => Sockfd, 3 => RemoteAuth}) #: Hash[::Integer, Attribute]
139
+ class << self
140
+ # Looks up Attribute class by name.
141
+ #--
142
+ # @rbs name: Symbol
143
+ # @rbs return: Attribute
144
+ def by_name(name); BY_NAME.fetch(name); end
145
+ # Looks up Attribute class by type value.
146
+ #--
147
+ # @rbs type: Integer
148
+ # @rbs return: Attribute
149
+ def by_type(type); BY_TYPE.fetch(type); end
150
+ end
151
+ end
152
+ Accept::Certificate::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(X509)
153
+ end
154
+ module Messages
155
+ # Handler retrieves next queued handshake request
156
+ class DoAcceptRequest < ::Nl::Protocols::Genl::Message
157
+ TYPE = 2
158
+ FIXED_HEADER = nil
159
+ ATTRIBUTE_SET = AttributeSets::Accept
160
+ ATTRIBUTES = Ractor.make_shareable(%i[handler_class])
161
+ # Gets the value of `handler-class` attribute in the message.
162
+ #--
163
+ # @rbs return: ::Integer
164
+ def handler_class; attributes[:"handler_class"]&.value; end
165
+ end
166
+ # Handler retrieves next queued handshake request
167
+ class DoAcceptReply < ::Nl::Protocols::Genl::Message
168
+ TYPE = 2
169
+ FIXED_HEADER = nil
170
+ ATTRIBUTE_SET = AttributeSets::Accept
171
+ ATTRIBUTES = Ractor.make_shareable(%i[sockfd message_type timeout auth_mode peer_identity certificate peername keyring])
172
+ # Gets the value of `sockfd` attribute in the message.
173
+ #--
174
+ # @rbs return: ::Integer
175
+ def sockfd; attributes[:"sockfd"]&.value; end
176
+ # Gets the value of `message-type` attribute in the message.
177
+ #--
178
+ # @rbs return: ::Integer
179
+ def message_type; attributes[:"message_type"]&.value; end
180
+ # Gets the value of `timeout` attribute in the message.
181
+ #--
182
+ # @rbs return: ::Integer
183
+ def timeout; attributes[:"timeout"]&.value; end
184
+ # Gets the value of `auth-mode` attribute in the message.
185
+ #--
186
+ # @rbs return: ::Integer
187
+ def auth_mode; attributes[:"auth_mode"]&.value; end
188
+ # Gets the value of `peer-identity` attribute in the message.
189
+ #--
190
+ # @rbs return: ::Integer
191
+ def peer_identity; attributes[:"peer_identity"]&.value; end
192
+ # Gets the value of `certificate` attribute in the message.
193
+ #--
194
+ # @rbs return: AttributeSets::X509
195
+ def certificate; attributes[:"certificate"]&.value; end
196
+ # Gets the value of `peername` attribute in the message.
197
+ #--
198
+ # @rbs return: ::String
199
+ def peername; attributes[:"peername"]&.value; end
200
+ # Gets the value of `keyring` attribute in the message.
201
+ #--
202
+ # @rbs return: ::Integer
203
+ def keyring; attributes[:"keyring"]&.value; end
204
+ end
205
+ # Handler reports handshake completion
206
+ class DoDoneRequest < ::Nl::Protocols::Genl::Message
207
+ TYPE = 3
208
+ FIXED_HEADER = nil
209
+ ATTRIBUTE_SET = AttributeSets::Done
210
+ ATTRIBUTES = Ractor.make_shareable(%i[status sockfd remote_auth])
211
+ # Gets the value of `status` attribute in the message.
212
+ #--
213
+ # @rbs return: ::Integer
214
+ def status; attributes[:"status"]&.value; end
215
+ # Gets the value of `sockfd` attribute in the message.
216
+ #--
217
+ # @rbs return: ::Integer
218
+ def sockfd; attributes[:"sockfd"]&.value; end
219
+ # Gets the value of `remote-auth` attribute in the message.
220
+ #--
221
+ # @rbs return: ::Integer
222
+ def remote_auth; attributes[:"remote_auth"]&.value; end
223
+ end
224
+ end
225
+ # Handler retrieves next queued handshake request
226
+ #--
227
+ # @rbs (?handler_class: ::Integer) -> Messages::DoAcceptReply
228
+ def do_accept(**args)
229
+ exchange_message(:"do", Messages::DoAcceptRequest, Messages::DoAcceptReply, args)
230
+ end
231
+ # Handler reports handshake completion
232
+ #--
233
+ # @rbs (?status: ::Integer, ?sockfd: ::Integer, ?remote_auth: ::Integer) -> void
234
+ def do_done(**args)
235
+ exchange_message(:"do", Messages::DoDoneRequest, nil, args)
236
+ end
237
+ end
238
+ end; end
@@ -0,0 +1,99 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #--
3
+ # frozen_string_literal: true
4
+ # rbs_inline: enabled
5
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
6
+ require 'nl'
7
+ module Nl; module Linux
8
+ # lockd configuration over generic netlink
9
+ class Lockd < ::Nl::Family
10
+ NAME = "lockd"
11
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("lockd"))
12
+ module Structs
13
+ end
14
+ module AttributeSets
15
+ class Server < ::Nl::Protocols::Genl::AttributeSet
16
+ # Abstract class
17
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
18
+ end
19
+ class Gracetime < Attribute
20
+ TYPE = 1
21
+ NAME = :"gracetime"
22
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
23
+ end
24
+ class TcpPort < Attribute
25
+ TYPE = 2
26
+ NAME = :"tcp_port"
27
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
28
+ end
29
+ class UdpPort < Attribute
30
+ TYPE = 3
31
+ NAME = :"udp_port"
32
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U16, check: nil)
33
+ end
34
+ # :nodoc:
35
+ BY_NAME = Ractor.make_shareable({:"gracetime" => Gracetime, :"tcp_port" => TcpPort, :"udp_port" => UdpPort}) #: Hash[::Symbol, Attribute]
36
+ # :nodoc:
37
+ BY_TYPE = Ractor.make_shareable({1 => Gracetime, 2 => TcpPort, 3 => UdpPort}) #: Hash[::Integer, Attribute]
38
+ class << self
39
+ # Looks up Attribute class by name.
40
+ #--
41
+ # @rbs name: Symbol
42
+ # @rbs return: Attribute
43
+ def by_name(name); BY_NAME.fetch(name); end
44
+ # Looks up Attribute class by type value.
45
+ #--
46
+ # @rbs type: Integer
47
+ # @rbs return: Attribute
48
+ def by_type(type); BY_TYPE.fetch(type); end
49
+ end
50
+ end
51
+ end
52
+ module Messages
53
+ # set the lockd server parameters
54
+ class DoServerSetRequest < ::Nl::Protocols::Genl::Message
55
+ TYPE = 1
56
+ FIXED_HEADER = nil
57
+ ATTRIBUTE_SET = AttributeSets::Server
58
+ ATTRIBUTES = Ractor.make_shareable(%i[gracetime tcp_port udp_port])
59
+ # Gets the value of `gracetime` attribute in the message.
60
+ #--
61
+ # @rbs return: ::Integer
62
+ def gracetime; attributes[:"gracetime"]&.value; end
63
+ # Gets the value of `tcp-port` attribute in the message.
64
+ #--
65
+ # @rbs return: ::Integer
66
+ def tcp_port; attributes[:"tcp_port"]&.value; end
67
+ # Gets the value of `udp-port` attribute in the message.
68
+ #--
69
+ # @rbs return: ::Integer
70
+ def udp_port; attributes[:"udp_port"]&.value; end
71
+ end
72
+ # get the lockd server parameters
73
+ class DoServerGetReply < ::Nl::Protocols::Genl::Message
74
+ TYPE = 2
75
+ FIXED_HEADER = nil
76
+ ATTRIBUTE_SET = AttributeSets::Server
77
+ ATTRIBUTES = Ractor.make_shareable(%i[gracetime tcp_port udp_port])
78
+ # Gets the value of `gracetime` attribute in the message.
79
+ #--
80
+ # @rbs return: ::Integer
81
+ def gracetime; attributes[:"gracetime"]&.value; end
82
+ # Gets the value of `tcp-port` attribute in the message.
83
+ #--
84
+ # @rbs return: ::Integer
85
+ def tcp_port; attributes[:"tcp_port"]&.value; end
86
+ # Gets the value of `udp-port` attribute in the message.
87
+ #--
88
+ # @rbs return: ::Integer
89
+ def udp_port; attributes[:"udp_port"]&.value; end
90
+ end
91
+ end
92
+ # set the lockd server parameters
93
+ #--
94
+ # @rbs (?gracetime: ::Integer, ?tcp_port: ::Integer, ?udp_port: ::Integer) -> void
95
+ def do_server_set(**args)
96
+ exchange_message(:"do", Messages::DoServerSetRequest, nil, args)
97
+ end
98
+ end
99
+ end; end