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
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Transmission Control Protocol (TCP, RFC 9293 / RFC 7323) AST definitions.
//!
//! Defines the control flags and header options for RFC 9293 Transmission Control Protocol
//! segments encapsulated over IPv4 or IPv6 using IP Protocol number `6`. The 20-byte base TCP
//! header contains 16-bit Source and Destination Ports, 32-bit Sequence Number (`SEQ`), 32-bit
//! Acknowledgment Number (`ACKNUM`), 4-bit Data Offset, 8-bit Control Flags (`CWR`, `ECE`,
//! `URG`, `ACK`, `PSH`, `RST`, `SYN`, `FIN`), 16-bit Window Size (`WIN`), 16-bit Checksum,
//! and 16-bit Urgent Pointer (`URGENT`), followed by 32-bit padded TLV options (`MSS`, `WSCALE`,
//! `SACK_PERM`, `TSVAL`, `TSECR`).
//!
//! Canonical `.fasm` syntax:
//! `a -> b TCP [SYN] [ACK] [FIN] [RST] [PSH] [URG] [ECE] [CWR] [SRCPORT <u16>] [DSTPORT <u16>] [SEQ <u32>] [ACKNUM <u32>] [WIN <u16>] [MSS <u16>] [WSCALE <u8>] [SACK_PERM] [TSVAL <u32>] [TSECR <u32>]`
/// TCP 8-bit control flags in byte 13 of the RFC 9293 TCP header (`CWR`, `ECE`, `URG`, `ACK`, `PSH`, `RST`, `SYN`, `FIN`).
///
/// Syntax mapping: `TCP [SYN] [ACK] [FIN] [RST] [PSH] [URG] [ECE] [CWR]`
///
/// # Examples
/// ```rust
/// use frameassembly::ast::TcpFlag;
/// let flag = TcpFlag::Syn;
/// ```
/// RFC 9293 / RFC 7323 / RFC 2018 TCP header options specification.
///
/// Syntax mapping: `TCP [SYN] [ACK] [FIN] [RST] [PSH] [URG] [ECE] [CWR] [SRCPORT <u16>] [DSTPORT <u16>] [SEQ <u32>] [ACKNUM <u32>] [WIN <u16>] [URGENT <u16>] [MSS <u16>] [WSCALE <u8>] [SACK_PERM] [TSVAL <u32>] [TSECR <u32>]`
/// Type alias for Transmission Control Protocol (RFC 9293 / RFC 7323) specification ([`TcpOptions`]).
///
/// Syntax mapping: `TCP [SYN] [ACK] [FIN] [RST] [PSH] [URG] [ECE] [CWR] [SRCPORT <u16>] [DSTPORT <u16>] [SEQ <u32>] [ACKNUM <u32>] [WIN <u16>] [URGENT <u16>] [MSS <u16>] [WSCALE <u8>] [SACK_PERM] [TSVAL <u32>] [TSECR <u32>]`
pub type TcpSpec = TcpOptions;