nl 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/lib/nl/async/dispatcher.rb +2 -2
- data/lib/nl/attribute_set.rb +19 -153
- data/lib/nl/attributes.rb +193 -0
- data/lib/nl/blocking_transport.rb +5 -5
- data/lib/nl/datagram.rb +4 -4
- data/lib/nl/datatypes/checked.rb +66 -0
- data/lib/nl/datatypes/defaults.rb +13 -0
- data/lib/nl/datatypes/scalar.rb +28 -0
- data/lib/nl/datatypes.rb +97 -125
- data/lib/nl/decoder.rb +79 -25
- data/lib/nl/encoder.rb +4 -6
- data/lib/nl/endian.rb +5 -3
- data/lib/nl/exchange.rb +18 -17
- data/lib/nl/genl/protocol.rb +16 -3
- data/lib/nl/genl/wire.rb +9 -3
- data/lib/nl/genl.rb +0 -18
- data/lib/nl/message.rb +21 -0
- data/lib/nl/notification_router.rb +2 -5
- data/lib/nl/raw/protocol.rb +27 -21
- data/lib/nl/raw/wire.rb +20 -50
- data/lib/nl/raw.rb +1 -51
- data/lib/nl/{sub_message.rb → selector.rb} +13 -23
- data/lib/nl/version.rb +1 -1
- data/lib/nl.rb +2 -2
- data/sig/generated/nl/attribute_set.rbs +21 -29
- data/sig/generated/nl/attributes.rbs +51 -0
- data/sig/generated/nl/datagram.rbs +4 -4
- data/sig/generated/nl/datatypes/checked.rbs +31 -0
- data/sig/generated/nl/datatypes/defaults.rbs +11 -0
- data/sig/generated/nl/datatypes/scalar.rbs +11 -0
- data/sig/generated/nl/datatypes.rbs +38 -34
- data/sig/generated/nl/decoder.rbs +12 -4
- data/sig/generated/nl/encoder.rbs +1 -1
- data/sig/generated/nl/exchange.rbs +2 -2
- data/sig/generated/nl/genl/protocol.rbs +3 -1
- data/sig/generated/nl/genl.rbs +0 -15
- data/sig/generated/nl/message.rbs +14 -0
- data/sig/generated/nl/raw/protocol.rbs +29 -43
- data/sig/generated/nl/raw/wire.rbs +0 -36
- data/sig/generated/nl/raw.rbs +0 -35
- data/sig/generated/nl/{sub_message.rbs → selector.rbs} +8 -19
- metadata +14 -6
- data/lib/nl/structured_payload.rb +0 -61
- data/sig/generated/nl/structured_payload.rbs +0 -25
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Generated from lib/nl/datatypes/checked.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module DataTypes
|
|
5
|
+
# Validation applies to the decoded value, or the value being encoded.
|
|
6
|
+
class Checked
|
|
7
|
+
def initialize: (untyped datatype, check: untyped) -> untyped
|
|
8
|
+
|
|
9
|
+
def nlattr_type_flags: (?untyped value, ?context: untyped) -> untyped
|
|
10
|
+
|
|
11
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
12
|
+
|
|
13
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
14
|
+
|
|
15
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Structured binary and packed arrays validate their encoded bytes.
|
|
19
|
+
class CheckedPayload
|
|
20
|
+
def initialize: (untyped datatype, check: untyped) -> untyped
|
|
21
|
+
|
|
22
|
+
def nlattr_type_flags: (?untyped value, ?context: untyped) -> untyped
|
|
23
|
+
|
|
24
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
25
|
+
|
|
26
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
27
|
+
|
|
28
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated from lib/nl/datatypes/defaults.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module DataTypes
|
|
5
|
+
module Defaults
|
|
6
|
+
def nlattr_type_flags: (?untyped _value, ?context: untyped) -> untyped
|
|
7
|
+
|
|
8
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -12,25 +12,9 @@ module Nl
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
module DataTypes
|
|
15
|
-
class
|
|
16
|
-
|
|
15
|
+
class VariableInteger
|
|
16
|
+
include Defaults
|
|
17
17
|
|
|
18
|
-
def nlattr_type_flags: (?untyped _value, ?context: untyped) -> untyped
|
|
19
|
-
|
|
20
|
-
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
21
|
-
|
|
22
|
-
private def checked: (untyped value) -> untyped
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
class Scalar < Base
|
|
26
|
-
def initialize: (untyped type, check: untyped) -> untyped
|
|
27
|
-
|
|
28
|
-
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
29
|
-
|
|
30
|
-
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
class VariableInteger < Base
|
|
34
18
|
UINT32_RANGE: untyped
|
|
35
19
|
|
|
36
20
|
UINT64_RANGE: untyped
|
|
@@ -39,23 +23,25 @@ module Nl
|
|
|
39
23
|
|
|
40
24
|
SINT64_RANGE: untyped
|
|
41
25
|
|
|
42
|
-
def initialize: (untyped byte_order, signed: untyped
|
|
26
|
+
def initialize: (untyped byte_order, signed: untyped) -> untyped
|
|
43
27
|
|
|
44
28
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
45
29
|
|
|
46
30
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
47
31
|
end
|
|
48
32
|
|
|
49
|
-
class String
|
|
50
|
-
|
|
33
|
+
class String
|
|
34
|
+
include Defaults
|
|
51
35
|
|
|
52
36
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
53
37
|
|
|
54
38
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
55
39
|
end
|
|
56
40
|
|
|
57
|
-
class Binary
|
|
58
|
-
|
|
41
|
+
class Binary
|
|
42
|
+
include Defaults
|
|
43
|
+
|
|
44
|
+
def initialize: (?length: untyped) -> untyped
|
|
59
45
|
|
|
60
46
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
61
47
|
|
|
@@ -64,8 +50,10 @@ module Nl
|
|
|
64
50
|
|
|
65
51
|
# An array whose elements are packed consecutively without per-element
|
|
66
52
|
# headers or alignment padding.
|
|
67
|
-
class PackedArray
|
|
68
|
-
|
|
53
|
+
class PackedArray
|
|
54
|
+
include Defaults
|
|
55
|
+
|
|
56
|
+
def initialize: (untyped sub_type) -> untyped
|
|
69
57
|
|
|
70
58
|
def encode: (untyped encoder, untyped values, ?context: untyped) -> untyped
|
|
71
59
|
|
|
@@ -74,8 +62,10 @@ module Nl
|
|
|
74
62
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
75
63
|
end
|
|
76
64
|
|
|
77
|
-
class Struct
|
|
78
|
-
|
|
65
|
+
class Struct
|
|
66
|
+
include Defaults
|
|
67
|
+
|
|
68
|
+
def initialize: (untyped type, ?consume_remaining: untyped) -> untyped
|
|
79
69
|
|
|
80
70
|
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
81
71
|
|
|
@@ -84,19 +74,25 @@ module Nl
|
|
|
84
74
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
85
75
|
end
|
|
86
76
|
|
|
87
|
-
class Flag
|
|
77
|
+
class Flag
|
|
78
|
+
include Defaults
|
|
79
|
+
|
|
88
80
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
89
81
|
|
|
90
82
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
91
83
|
end
|
|
92
84
|
|
|
93
|
-
class Bitfield32
|
|
85
|
+
class Bitfield32
|
|
86
|
+
include Defaults
|
|
87
|
+
|
|
94
88
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
95
89
|
|
|
96
90
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
97
91
|
end
|
|
98
92
|
|
|
99
|
-
class Pad
|
|
93
|
+
class Pad
|
|
94
|
+
include Defaults
|
|
95
|
+
|
|
100
96
|
def initialize: (?untyped length) -> untyped
|
|
101
97
|
|
|
102
98
|
def encode: (untyped encoder, untyped _value, ?context: untyped) -> untyped
|
|
@@ -104,7 +100,9 @@ module Nl
|
|
|
104
100
|
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
105
101
|
end
|
|
106
102
|
|
|
107
|
-
class NestedAttributes
|
|
103
|
+
class NestedAttributes
|
|
104
|
+
include Defaults
|
|
105
|
+
|
|
108
106
|
def initialize: (untyped attribute_set, ?selector_bindings: untyped) -> untyped
|
|
109
107
|
|
|
110
108
|
def nlattr_type_flags: (?untyped _value, ?context: untyped) -> untyped
|
|
@@ -118,7 +116,9 @@ module Nl
|
|
|
118
116
|
private def selectors: (untyped context) -> untyped
|
|
119
117
|
end
|
|
120
118
|
|
|
121
|
-
class SubMessage
|
|
119
|
+
class SubMessage
|
|
120
|
+
include Defaults
|
|
121
|
+
|
|
122
122
|
class Format < Data
|
|
123
123
|
attr_reader type(): untyped
|
|
124
124
|
|
|
@@ -150,7 +150,9 @@ module Nl
|
|
|
150
150
|
# Nested attributes whose type numbers are keys rather than members of
|
|
151
151
|
# an attribute set. Each level is returned as an Integer-keyed Hash;
|
|
152
152
|
# values at the innermost level are decoded as @attribute_set.
|
|
153
|
-
class NestTypeValue
|
|
153
|
+
class NestTypeValue
|
|
154
|
+
include Defaults
|
|
155
|
+
|
|
154
156
|
def initialize: (untyped attribute_set, untyped levels, ?selector_bindings: untyped) -> untyped
|
|
155
157
|
|
|
156
158
|
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
@@ -168,7 +170,9 @@ module Nl
|
|
|
168
170
|
private def selectors: (untyped context) -> untyped
|
|
169
171
|
end
|
|
170
172
|
|
|
171
|
-
class IndexedArray
|
|
173
|
+
class IndexedArray
|
|
174
|
+
include Defaults
|
|
175
|
+
|
|
172
176
|
def initialize: (untyped sub_type) -> untyped
|
|
173
177
|
|
|
174
178
|
def encode: (untyped encoder, untyped values, ?context: untyped) -> untyped
|
|
@@ -13,6 +13,14 @@ module Nl
|
|
|
13
13
|
def initialize: (?untyped message) -> untyped
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
VALUE_READERS: untyped
|
|
17
|
+
|
|
18
|
+
alias get_host_int get_host_sint
|
|
19
|
+
|
|
20
|
+
alias get_host_long get_host_slong
|
|
21
|
+
|
|
22
|
+
alias get_host_llong get_host_sllong
|
|
23
|
+
|
|
16
24
|
def initialize: (untyped buffer, ?untyped offset, ?untyped length) -> untyped
|
|
17
25
|
|
|
18
26
|
def available?: (?untyped size) -> untyped
|
|
@@ -21,18 +29,18 @@ module Nl
|
|
|
21
29
|
|
|
22
30
|
def limit: (untyped size) -> untyped
|
|
23
31
|
|
|
32
|
+
def lookahead: () -> untyped
|
|
33
|
+
|
|
24
34
|
def skip: (?untyped length) -> untyped
|
|
25
35
|
|
|
26
36
|
def get_string: (?untyped length) -> untyped
|
|
27
37
|
|
|
28
|
-
def
|
|
38
|
+
def slice: (?untyped length) -> untyped
|
|
29
39
|
|
|
30
40
|
def get_zstring: (?unterminated_ok: untyped) -> untyped
|
|
31
41
|
|
|
32
|
-
def get_value: (untyped type) -> untyped
|
|
33
|
-
|
|
34
42
|
def get_values: (untyped types) -> untyped
|
|
35
43
|
|
|
36
|
-
def
|
|
44
|
+
def align_to_4: () -> untyped
|
|
37
45
|
end
|
|
38
46
|
end
|
|
@@ -54,7 +54,7 @@ module Nl
|
|
|
54
54
|
# @rbs (mode: :dump | :no_reply | :reply) -> void
|
|
55
55
|
def initialize: (mode: :dump | :no_reply | :reply) -> void
|
|
56
56
|
|
|
57
|
-
def accept: (untyped
|
|
57
|
+
def accept: (untyped header, untyped message) -> untyped
|
|
58
58
|
|
|
59
59
|
def cancel: () -> untyped
|
|
60
60
|
|
|
@@ -66,7 +66,7 @@ module Nl
|
|
|
66
66
|
|
|
67
67
|
private def accept_ack: () -> untyped
|
|
68
68
|
|
|
69
|
-
private def accept_reply: (untyped
|
|
69
|
+
private def accept_reply: (untyped header, untyped message) -> untyped
|
|
70
70
|
|
|
71
71
|
private def complete: (untyped value) -> untyped
|
|
72
72
|
|
|
@@ -21,6 +21,8 @@ module Nl
|
|
|
21
21
|
class Protocol < Raw::Protocol
|
|
22
22
|
def initialize: () -> untyped
|
|
23
23
|
|
|
24
|
+
private def decode_message: (untyped endpoint, untyped header, untyped decoder, untyped message_class) -> untyped
|
|
25
|
+
|
|
24
26
|
def encode_message: (untyped encoder, untyped endpoint, untyped request, seq: untyped, pid: untyped) -> untyped
|
|
25
27
|
|
|
26
28
|
def notification_channel_key: (untyped endpoint) -> untyped
|
|
@@ -31,7 +33,7 @@ module Nl
|
|
|
31
33
|
|
|
32
34
|
def notification_frame?: (untyped endpoint, untyped header, untyped _payload) -> untyped
|
|
33
35
|
|
|
34
|
-
def
|
|
36
|
+
def decode_notification: (untyped endpoint, untyped header, untyped payload, untyped classes) -> untyped
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
end
|
data/sig/generated/nl/genl.rbs
CHANGED
|
@@ -31,20 +31,5 @@ module Nl
|
|
|
31
31
|
def self.open: (resolver: ^(Client, ::String) -> FamilyInfo, ?executor: executor?, ?notification_capacity: Integer?) -> (Nl::Family::Session & instance)
|
|
32
32
|
| [R] (resolver: ^(Client, ::String) -> FamilyInfo, ?executor: executor?, ?notification_capacity: Integer?) { (instance) -> R } -> R
|
|
33
33
|
end
|
|
34
|
-
|
|
35
|
-
# Base class for Generic Netlink messages.
|
|
36
|
-
#
|
|
37
|
-
# A Generic Netlink message payload begins with a {GenlMsgHdr}, followed by
|
|
38
|
-
# the optional fixed header and attributes handled by {Raw::Message}.
|
|
39
|
-
class Message < Raw::Message
|
|
40
|
-
# Decodes a Generic Netlink message payload.
|
|
41
|
-
#
|
|
42
|
-
# @param [Decoder] decoder the source decoder
|
|
43
|
-
# @param [Integer] type the family ID from the Netlink message header
|
|
44
|
-
# @return [Message] the decoded message
|
|
45
|
-
# @raise [RuntimeError] if the command does not match the message class's type
|
|
46
|
-
# @rbs (Decoder decoder, type: Integer) -> instance
|
|
47
|
-
def self.decode: (Decoder decoder, type: Integer) -> instance
|
|
48
|
-
end
|
|
49
34
|
end
|
|
50
35
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Generated from lib/nl/message.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
# Family payload with fixed-header fields and attribute values stored inline.
|
|
5
|
+
class Message
|
|
6
|
+
include Attributes
|
|
7
|
+
|
|
8
|
+
EMPTY_FIELD_NAMES: untyped
|
|
9
|
+
|
|
10
|
+
def self.from_params: (?untyped params) -> untyped
|
|
11
|
+
|
|
12
|
+
private def self.validate_params: (untyped params, untyped header_names, untyped attribute_names) -> untyped
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -2,66 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
module Nl
|
|
4
4
|
module Raw
|
|
5
|
-
class
|
|
6
|
-
|
|
5
|
+
class Ack < Data
|
|
6
|
+
def self.new: () -> instance
|
|
7
|
+
| () -> instance
|
|
7
8
|
|
|
8
|
-
def self.
|
|
9
|
-
| (header: untyped) -> instance
|
|
9
|
+
def self.members: () -> [ ]
|
|
10
10
|
|
|
11
|
-
def
|
|
12
|
-
|
|
13
|
-
def members: () -> [ :header ]
|
|
11
|
+
def members: () -> [ ]
|
|
14
12
|
end
|
|
15
13
|
|
|
16
|
-
class
|
|
17
|
-
attr_reader header(): untyped
|
|
18
|
-
|
|
14
|
+
class Error < Data
|
|
19
15
|
attr_reader errno(): untyped
|
|
20
16
|
|
|
21
|
-
def self.new: (untyped
|
|
22
|
-
| (
|
|
17
|
+
def self.new: (untyped errno) -> instance
|
|
18
|
+
| (errno: untyped) -> instance
|
|
23
19
|
|
|
24
|
-
def self.members: () -> [ :
|
|
20
|
+
def self.members: () -> [ :errno ]
|
|
25
21
|
|
|
26
|
-
def members: () -> [ :
|
|
22
|
+
def members: () -> [ :errno ]
|
|
27
23
|
end
|
|
28
24
|
|
|
29
|
-
class
|
|
30
|
-
attr_reader header(): untyped
|
|
31
|
-
|
|
25
|
+
class Done < Data
|
|
32
26
|
attr_reader errno(): untyped
|
|
33
27
|
|
|
34
|
-
def self.new: (untyped
|
|
35
|
-
| (
|
|
28
|
+
def self.new: (untyped errno) -> instance
|
|
29
|
+
| (errno: untyped) -> instance
|
|
36
30
|
|
|
37
|
-
def self.members: () -> [ :
|
|
31
|
+
def self.members: () -> [ :errno ]
|
|
38
32
|
|
|
39
|
-
def members: () -> [ :
|
|
33
|
+
def members: () -> [ :errno ]
|
|
40
34
|
end
|
|
41
35
|
|
|
42
|
-
class
|
|
43
|
-
|
|
36
|
+
class Unknown < Data
|
|
37
|
+
def self.new: () -> instance
|
|
38
|
+
| () -> instance
|
|
44
39
|
|
|
45
|
-
def self.
|
|
46
|
-
| (header: untyped) -> instance
|
|
40
|
+
def self.members: () -> [ ]
|
|
47
41
|
|
|
48
|
-
def
|
|
49
|
-
|
|
50
|
-
def members: () -> [ :header ]
|
|
42
|
+
def members: () -> [ ]
|
|
51
43
|
end
|
|
52
44
|
|
|
53
|
-
|
|
54
|
-
attr_reader header(): untyped
|
|
55
|
-
|
|
56
|
-
attr_reader message(): untyped
|
|
57
|
-
|
|
58
|
-
def self.new: (untyped header, untyped message) -> instance
|
|
59
|
-
| (header: untyped, message: untyped) -> instance
|
|
45
|
+
ACK: untyped
|
|
60
46
|
|
|
61
|
-
|
|
47
|
+
DONE: untyped
|
|
62
48
|
|
|
63
|
-
|
|
64
|
-
end
|
|
49
|
+
UNKNOWN: untyped
|
|
65
50
|
|
|
66
51
|
class Request < Data
|
|
67
52
|
attr_reader type(): untyped
|
|
@@ -99,8 +84,11 @@ module Nl
|
|
|
99
84
|
|
|
100
85
|
def encode_message: (untyped encoder, untyped _endpoint, untyped request, seq: untyped, pid: untyped) -> untyped
|
|
101
86
|
|
|
102
|
-
#
|
|
103
|
-
|
|
87
|
+
# Returns a decoded reply or control result for one Netlink frame.
|
|
88
|
+
# @rbs (Endpoint endpoint, NlMsgHdr header, Decoder decoder, Class? message_class) -> (Message | Ack | Done | Error | Unknown)
|
|
89
|
+
def decode_frame: (Endpoint endpoint, NlMsgHdr header, Decoder decoder, Class? message_class) -> (Message | Ack | Done | Error | Unknown)
|
|
90
|
+
|
|
91
|
+
private def decode_message: (untyped _endpoint, untyped header, untyped decoder, untyped message_class) -> untyped
|
|
104
92
|
|
|
105
93
|
def send_message: (untyped socket, untyped endpoint, untyped request, seq: untyped, pid: untyped) -> untyped
|
|
106
94
|
|
|
@@ -114,9 +102,7 @@ module Nl
|
|
|
114
102
|
|
|
115
103
|
def notification_frame?: (untyped _endpoint, untyped header, untyped _payload) -> untyped
|
|
116
104
|
|
|
117
|
-
def
|
|
118
|
-
|
|
119
|
-
def decode_notification: (untyped endpoint, untyped header, untyped payload, untyped message_class) -> untyped
|
|
105
|
+
def decode_notification: (untyped _endpoint, untyped header, untyped payload, untyped classes) -> untyped
|
|
120
106
|
end
|
|
121
107
|
end
|
|
122
108
|
end
|
|
@@ -111,41 +111,5 @@ module Nl
|
|
|
111
111
|
# @rbs (Encoder encoder) -> void
|
|
112
112
|
def encode: (Encoder encoder) -> void
|
|
113
113
|
end
|
|
114
|
-
|
|
115
|
-
# Fixed-format header prepended to every Netlink attribute.
|
|
116
|
-
#
|
|
117
|
-
# This corresponds to Linux's +struct nlattr+.
|
|
118
|
-
#
|
|
119
|
-
# @!attribute [rw] len
|
|
120
|
-
# @return [Integer] attribute length in bytes, including this header but
|
|
121
|
-
# excluding trailing alignment padding
|
|
122
|
-
# @!attribute [rw] type
|
|
123
|
-
# @return [Integer] attribute type combined with optional +NLA_F_+ flags
|
|
124
|
-
class NlAttr < Struct[Integer]
|
|
125
|
-
attr_accessor len(): Integer
|
|
126
|
-
|
|
127
|
-
attr_accessor type(): Integer
|
|
128
|
-
|
|
129
|
-
def self.new: (?Integer len, ?Integer type) -> instance
|
|
130
|
-
| (?len: Integer, ?type: Integer) -> instance
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
class NlAttr
|
|
134
|
-
FORMAT: untyped
|
|
135
|
-
|
|
136
|
-
# Decodes an attribute header from the decoder's current position.
|
|
137
|
-
#
|
|
138
|
-
# @param [Decoder] decoder the source decoder
|
|
139
|
-
# @return [NlAttr] the decoded header
|
|
140
|
-
# @rbs (Decoder decoder) -> instance
|
|
141
|
-
def self.decode: (Decoder decoder) -> instance
|
|
142
|
-
|
|
143
|
-
# Encodes this attribute header at the encoder's current position.
|
|
144
|
-
#
|
|
145
|
-
# @param [Encoder] encoder the destination encoder
|
|
146
|
-
# @return [void]
|
|
147
|
-
# @rbs (Encoder encoder) -> void
|
|
148
|
-
def encode: (Encoder encoder) -> void
|
|
149
|
-
end
|
|
150
114
|
end
|
|
151
115
|
end
|
data/sig/generated/nl/raw.rbs
CHANGED
|
@@ -31,40 +31,5 @@ module Nl
|
|
|
31
31
|
# @rbs (executor: executor?, notification_capacity: Integer) -> (Nl::Family::Session & instance)
|
|
32
32
|
private def self.build_session: (executor: executor?, notification_capacity: Integer) -> (Nl::Family::Session & instance)
|
|
33
33
|
end
|
|
34
|
-
|
|
35
|
-
# Base class for raw Netlink messages.
|
|
36
|
-
#
|
|
37
|
-
# A message may contain a fixed header followed by a set of Netlink
|
|
38
|
-
# attributes.
|
|
39
|
-
class Message
|
|
40
|
-
include Nl::StructuredPayload
|
|
41
|
-
|
|
42
|
-
# @param [Object, nil] fixed_header the family-specific fixed header
|
|
43
|
-
# @param [AttributeSet, nil] attributes the message's attributes
|
|
44
|
-
# @rbs (?untyped fixed_header, ?AttributeSet? attributes) -> void
|
|
45
|
-
def initialize: (?untyped fixed_header, ?AttributeSet? attributes) -> void
|
|
46
|
-
|
|
47
|
-
# Appends an attribute to the message.
|
|
48
|
-
#
|
|
49
|
-
# @param [AttributeSet::Attribute] attribute the attribute to append
|
|
50
|
-
# @return [void]
|
|
51
|
-
# @rbs (AttributeSet::Attribute attribute) -> void
|
|
52
|
-
def append_attribute: (AttributeSet::Attribute attribute) -> void
|
|
53
|
-
|
|
54
|
-
# Decodes a raw Netlink message payload.
|
|
55
|
-
#
|
|
56
|
-
# @param [Decoder] decoder the source decoder
|
|
57
|
-
# @param [Integer] type the message type from its Netlink header
|
|
58
|
-
# @return [Message] the decoded message
|
|
59
|
-
# @raise [RuntimeError] if +type+ does not match the message class's type
|
|
60
|
-
# @rbs (Decoder decoder, type: Integer) -> instance
|
|
61
|
-
def self.decode: (Decoder decoder, type: Integer) -> instance
|
|
62
|
-
|
|
63
|
-
# Returns the attribute names accepted by this message.
|
|
64
|
-
#
|
|
65
|
-
# @return [Array<Symbol>] the attribute names
|
|
66
|
-
# @rbs () -> Array[Symbol]
|
|
67
|
-
private def self.attribute_names: () -> Array[Symbol]
|
|
68
|
-
end
|
|
69
34
|
end
|
|
70
35
|
end
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
# Generated from lib/nl/
|
|
1
|
+
# Generated from lib/nl/selector.rb with RBS::Inline
|
|
2
2
|
|
|
3
3
|
module Nl
|
|
4
4
|
module Selector
|
|
5
|
+
EMPTY_VALUES: untyped
|
|
6
|
+
|
|
5
7
|
class MissingSelectorValueError < StandardError
|
|
6
8
|
attr_reader scope: untyped
|
|
7
9
|
|
|
@@ -43,7 +45,9 @@ module Nl
|
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
class State
|
|
46
|
-
def
|
|
48
|
+
def self.for: (untyped local_selector_count, untyped external) -> untyped
|
|
49
|
+
|
|
50
|
+
def initialize: (untyped local_selector_count, untyped external) -> untyped
|
|
47
51
|
|
|
48
52
|
def set_local: (untyped index, untyped value) -> untyped
|
|
49
53
|
|
|
@@ -52,23 +56,8 @@ module Nl
|
|
|
52
56
|
def fetch_external: (untyped index) -> untyped
|
|
53
57
|
|
|
54
58
|
def fetch: (untyped values, untyped key) -> untyped
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# A selector-specific payload containing an optional fixed header followed by
|
|
59
|
-
# an optional set of Netlink attributes.
|
|
60
|
-
class SubMessage
|
|
61
|
-
include StructuredPayload
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# An unrecognized selector-specific payload retained without interpretation.
|
|
65
|
-
class RawSubMessage < SubMessage
|
|
66
|
-
attr_reader payload: untyped
|
|
67
|
-
|
|
68
|
-
attr_reader nlattr_type_flags: untyped
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def encode: (untyped encoder, ?external_selectors: untyped) -> untyped
|
|
60
|
+
EMPTY: untyped
|
|
61
|
+
end
|
|
73
62
|
end
|
|
74
63
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kasumi Hanazuki
|
|
@@ -29,11 +29,15 @@ files:
|
|
|
29
29
|
- lib/nl/async/mailbox.rb
|
|
30
30
|
- lib/nl/async/operation.rb
|
|
31
31
|
- lib/nl/attribute_set.rb
|
|
32
|
+
- lib/nl/attributes.rb
|
|
32
33
|
- lib/nl/bitfield32.rb
|
|
33
34
|
- lib/nl/blocking_transport.rb
|
|
34
35
|
- lib/nl/connection.rb
|
|
35
36
|
- lib/nl/datagram.rb
|
|
36
37
|
- lib/nl/datatypes.rb
|
|
38
|
+
- lib/nl/datatypes/checked.rb
|
|
39
|
+
- lib/nl/datatypes/defaults.rb
|
|
40
|
+
- lib/nl/datatypes/scalar.rb
|
|
37
41
|
- lib/nl/decoder.rb
|
|
38
42
|
- lib/nl/encoder.rb
|
|
39
43
|
- lib/nl/endian.rb
|
|
@@ -44,16 +48,16 @@ files:
|
|
|
44
48
|
- lib/nl/genl/client.rb
|
|
45
49
|
- lib/nl/genl/protocol.rb
|
|
46
50
|
- lib/nl/genl/wire.rb
|
|
51
|
+
- lib/nl/message.rb
|
|
47
52
|
- lib/nl/notification.rb
|
|
48
53
|
- lib/nl/notification_router.rb
|
|
49
54
|
- lib/nl/raw.rb
|
|
50
55
|
- lib/nl/raw/client.rb
|
|
51
56
|
- lib/nl/raw/protocol.rb
|
|
52
57
|
- lib/nl/raw/wire.rb
|
|
58
|
+
- lib/nl/selector.rb
|
|
53
59
|
- lib/nl/sequence_allocator.rb
|
|
54
60
|
- lib/nl/socket.rb
|
|
55
|
-
- lib/nl/structured_payload.rb
|
|
56
|
-
- lib/nl/sub_message.rb
|
|
57
61
|
- lib/nl/version.rb
|
|
58
62
|
- sig/generated/nl.rbs
|
|
59
63
|
- sig/generated/nl/async.rbs
|
|
@@ -62,11 +66,15 @@ files:
|
|
|
62
66
|
- sig/generated/nl/async/mailbox.rbs
|
|
63
67
|
- sig/generated/nl/async/operation.rbs
|
|
64
68
|
- sig/generated/nl/attribute_set.rbs
|
|
69
|
+
- sig/generated/nl/attributes.rbs
|
|
65
70
|
- sig/generated/nl/bitfield32.rbs
|
|
66
71
|
- sig/generated/nl/blocking_transport.rbs
|
|
67
72
|
- sig/generated/nl/connection.rbs
|
|
68
73
|
- sig/generated/nl/datagram.rbs
|
|
69
74
|
- sig/generated/nl/datatypes.rbs
|
|
75
|
+
- sig/generated/nl/datatypes/checked.rbs
|
|
76
|
+
- sig/generated/nl/datatypes/defaults.rbs
|
|
77
|
+
- sig/generated/nl/datatypes/scalar.rbs
|
|
70
78
|
- sig/generated/nl/decoder.rbs
|
|
71
79
|
- sig/generated/nl/encoder.rbs
|
|
72
80
|
- sig/generated/nl/endian.rbs
|
|
@@ -77,23 +85,23 @@ files:
|
|
|
77
85
|
- sig/generated/nl/genl/client.rbs
|
|
78
86
|
- sig/generated/nl/genl/protocol.rbs
|
|
79
87
|
- sig/generated/nl/genl/wire.rbs
|
|
88
|
+
- sig/generated/nl/message.rbs
|
|
80
89
|
- sig/generated/nl/notification.rbs
|
|
81
90
|
- sig/generated/nl/notification_router.rbs
|
|
82
91
|
- sig/generated/nl/raw.rbs
|
|
83
92
|
- sig/generated/nl/raw/client.rbs
|
|
84
93
|
- sig/generated/nl/raw/protocol.rbs
|
|
85
94
|
- sig/generated/nl/raw/wire.rbs
|
|
95
|
+
- sig/generated/nl/selector.rbs
|
|
86
96
|
- sig/generated/nl/sequence_allocator.rbs
|
|
87
97
|
- sig/generated/nl/socket.rbs
|
|
88
|
-
- sig/generated/nl/structured_payload.rbs
|
|
89
|
-
- sig/generated/nl/sub_message.rbs
|
|
90
98
|
- sig/generated/nl/version.rbs
|
|
91
99
|
homepage: https://github.com/hanazuki/nl
|
|
92
100
|
licenses:
|
|
93
101
|
- MIT
|
|
94
102
|
metadata:
|
|
95
103
|
homepage_uri: https://github.com/hanazuki/nl
|
|
96
|
-
source_code_uri: https://github.com/hanazuki/nl/tree/v0.
|
|
104
|
+
source_code_uri: https://github.com/hanazuki/nl/tree/v0.5.0
|
|
97
105
|
changelog_uri: https://github.com/hanazuki/nl/blob/master/CHANGELOG.md
|
|
98
106
|
rdoc_options: []
|
|
99
107
|
require_paths:
|