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 {
8787 msg : format ! ( "Invalid number. Expected {expected} bytes, received {received} bytes" ) ,
8888 }
8989 }
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+ }
90108}
91109
92110#[ derive( Debug , PartialEq , Eq , Clone ) ]
Original file line number Diff line number Diff line change @@ -267,3 +267,6 @@ pub use self::message::*;
267267
268268pub mod constants;
269269pub use self :: constants:: * ;
270+
271+ pub mod nla;
272+ pub use self :: nla:: * ;
You can’t perform that action at this time.
0 commit comments