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
//! IEEE 802.1ad Provider Bridges (QinQ) dual VLAN wire frame builder.
//!
//! Synthesizes IEEE 802.1ad double-tagged Ethernet frames carrying an outer 32-bit Service
//! VLAN tag (S-Tag, `TPID = 0x88A8` followed by 16-bit TCI containing `outer_vid`) and an
//! inner 32-bit Customer VLAN tag (C-Tag, `TPID = 0x8100` followed by 16-bit TCI containing
//! `inner_vid`), ahead of the encapsulated inner EtherType (`0x0800`) and payload bytes.
//!
//! Canonical `.fasm` syntax:
//! `a -> b QINQ <outer_vid> [INNER_VLAN <inner_vid>] [PAYLOAD "<str>" | HEXPAYLOAD "<hex>"]`
use crate*;
use crateWireContext;
use crateCompilerError;
use cratebuild_ethernet_and_l2;
use Vec;
/// Builds a standalone IEEE 802.1ad QinQ wire frame.
///
/// # Errors
/// Returns `CompilerError::BackendError` if construction fails.