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
//! Routing Information Protocol (RIPv2 RFC 2453 / RIPng RFC 2080) AST definitions.
//!
//! Defines distance-vector Interior Gateway Protocol route table request and advertisement messages
//! specified in RFC 2453 (RIPv2 over UDP port `520` to multicast `224.0.0.9`) and RFC 2080 (RIPng
//! for IPv6 over UDP port `521` to multicast `ff02::9`). A 24-byte RIPv2 packet consists of a 4-byte
//! header (`Command`: `1` `REQUEST` or `2` `RESPONSE`, `Version`: `2`, 16-bit `Must Be Zero`) followed
//! by one or more 20-byte Route Table Entries (RTEs) encoding `Address Family Identifier` (`2`), 16-bit
//! `Route Tag` (`TAG`), 32-bit `IP Address` (`PREFIX`), 32-bit `Subnet Mask` (`255.255.255.0`), 32-bit
//! `Next Hop` (`NEXTHOP`), and 32-bit hop-count `Metric` (`METRIC`, `1..=16` where `16` = infinity).
//!
//! Canonical `.fasm` syntax:
//! `a -> b RIP [REQUEST | RESPONSE] [PREFIX <ip>] [METRIC <1..16>] [NEXTHOP <ip>] [TAG <u16>]`
use PhantomData;
use IpAddr;
/// RFC 2453 / RFC 2080 RIP message command code.
/// Routing Information Protocol (RFC 2453 RIPv2 / RFC 2080 RIPng) specification over UDP `520` / `521`.
///
/// Syntax mapping: `RIP [REQUEST | RESPONSE] [PREFIX <ip>] [METRIC <1..16>] [NEXTHOP <ip>] [TAG <u16>]`