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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! IEEE 802.1AB Link Layer Discovery Protocol (LLDP) wire frame builder.
//!
//! Synthesizes IEEE 802.1AB LLDP Data Units (LLDPDUs) over Ethernet II (`EtherType = 0x88CC`)
//! addressed to the nearest-bridge multicast MAC `01:80:C2:00:00:0E`. Each TLV header packs a
//! 7-bit TLV Type (`bits 15..9`) and a 9-bit TLV Information String Length (`bits 8..0`) in
//! big-endian byte order, emitting mandatory Chassis ID (`Type = 1`), Port ID (`Type = 2`),
//! and TTL (`Type = 3`) TLVs, optional System Name (`Type = 5`) and System Description (`Type = 6`)
//! TLVs, and the mandatory End Of LLDPDU (`Type = 0, Length = 0`) marker.
//!
//! Canonical `.fasm` syntax:
//! `a -> b LLDP [CHASSIS_ID "<str>"] [PORT_ID "<str>"] [TTL <u16>] [SYSNAME "<str>"] [SYSDESC "<str>"]`
use crate*;
use crateWireContext;
use crateCompilerError;
use cratebuild_ethernet_and_l2;
use Vec;
/// Builds an IEEE 802.1AB LLDP wire frame.
///
/// # Errors
/// Returns `CompilerError::BackendError` if construction fails.