File tree Expand file tree Collapse file tree 3 files changed +400
-0
lines changed Expand file tree Collapse file tree 3 files changed +400
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,24 @@ impl DecodeError {
87
87
msg : format ! ( "Invalid number. Expected {expected} bytes, received {received} bytes" ) ,
88
88
}
89
89
}
90
+
91
+ pub fn nla_buffer_too_small ( buffer_len : usize , nla_len : usize ) -> Self {
92
+ Self {
93
+ msg : format ! ( "buffer has length {buffer_len}, but an NLA header is {nla_len} bytes" ) ,
94
+ }
95
+ }
96
+
97
+ pub fn nla_length_mismatch ( buffer_len : usize , nla_len : usize ) -> Self {
98
+ Self {
99
+ msg : format ! ( "buffer has length: {buffer_len}, but the NLA is {nla_len} bytes" ) ,
100
+ }
101
+ }
102
+
103
+ pub fn nla_invalid_length ( buffer_len : usize , nla_len : usize ) -> Self {
104
+ Self {
105
+ msg : format ! ( "NLA has invalid length: {nla_len} (should be at least {buffer_len} bytes)" ) ,
106
+ }
107
+ }
90
108
}
91
109
92
110
#[ derive( Debug , PartialEq , Eq , Clone ) ]
Original file line number Diff line number Diff line change @@ -271,5 +271,8 @@ pub use self::constants::*;
271
271
pub mod parsers;
272
272
pub use self :: parsers:: * ;
273
273
274
+ pub mod nla;
275
+ pub use self :: nla:: * ;
276
+
274
277
#[ macro_use]
275
278
mod macros;
You can’t perform that action at this time.
0 commit comments