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
//! Border Gateway Protocol Version 4 (BGP-4, RFC 4271 / RFC 4760) AST definitions.
//!
//! Defines inter-domain Autonomous System routing messages specified in RFC 4271 and carried over TCP
//! port `179`. Every BGP-4 PDU begins with a 19-byte fixed header comprising a 16-byte all-ones
//! synchronization `Marker` (`0xFF..0xFF`), a 16-bit total `Length` (`19..=4096`), and an 8-bit `Type`
//! code (`1` `OPEN`, `2` `UPDATE`, `3` `NOTIFICATION`, `4` `KEEPALIVE`). `OPEN` messages negotiate the
//! protocol version (`4`), 16-bit My Autonomous System (`ASN`), 16-bit `Hold Time` (`HOLDTIME`), and
//! 32-bit IPv4 `BGP Identifier` (`BGPID`), while `UPDATE` messages advertise Network Layer Reachability
//! Information (`PREFIX`) and `NEXT_HOP` (`NEXTHOP`) path attributes.
//!
//! Canonical `.fasm` syntax:
//! `a -> b BGP [OPEN | UPDATE | NOTIFICATION | KEEPALIVE] [ASN <u32>] [HOLDTIME <u16>] [BGPID <ipv4>] [PREFIX "<cidr>"] [NEXTHOP <ip>]`
use IpAddr;
/// RFC 4271 BGP-4 message type code.
/// Border Gateway Protocol v4 (RFC 4271) specification over TCP port `179`.
///
/// Syntax mapping: `BGP [OPEN | UPDATE | NOTIFICATION | KEEPALIVE] [ASN <u32>] [HOLDTIME <u16>] [BGPID <ipv4>] [PREFIX "<cidr>"] [NEXTHOP <ip>]`