1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Decoder for lldpd's internal "marshal" payload encoding (`src/marshal.c`
//! upstream).
//!
//! Each message payload is a tree of chunks. A chunk is:
//!
//! ```text
//! [padding to align(pointer width)] [orig: usize] [size: usize] [size bytes of body]
//! ```
//!
//! `body` is either the flat, `#[repr(C)]`-compatible raw bytes of a C struct
//! (see [`raw`]), or a string. A struct's *own* pointer-shaped fields (a
//! `char *`, a `TAILQ_HEAD`/`TAILQ_ENTRY` link) are, in that raw body, either
//! zero (the field was absent) or a small "dummy" reference id - and if
//! non-zero, are followed immediately by one more chunk holding whatever that
//! pointer referred to, *in the exact field declaration order of the C
//! struct*. Lists (`TAILQ`) are just chains of such pointers - there's no
//! explicit length prefix, you follow pointers until you hit zero.
//!
//! This is not a designed wire format: it is `lldpd`'s internal C structures,
//! `memcpy`'d. See the crate-level docs for what that implies.
pub
pub use ;
/// Encodes the payload for a `GET_INTERFACE` request: a single chunk holding
/// the interface name as a null-terminated string (mirrors
/// `marshal_serialize(string, name, buffer)` on the client side upstream).
pub