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
//! RIPng — RIP for IPv6 (RFC 2080) wire constants.
//!
//! Values come from RFC 2080 (RIPng for IPv6). These are kept separate from the
//! IPv4 `rip/constants.rs` because RIPng runs over a different UDP port, uses an
//! IPv6 multicast group, and carries a single-octet metric. Each constant cites
//! its defining RFC source in a line comment.
use Ipv6Addr;
// ---------------------------------------------------------------------------
// Fixed protocol constants (RFC 2080 §2)
// ---------------------------------------------------------------------------
/// RIPng UDP port. RFC 2080 §2.
pub const RIPNG_UDP_PORT: u16 = 521;
/// RIPng message header length (command, version, 2-octet reserved), in octets.
/// RFC 2080 §2.
pub const RIPNG_HEADER_LEN: usize = 4;
/// RIPng Route Table Entry (RTE) length, in octets. RFC 2080 §2.1.
pub const RIPNG_RTE_LEN: usize = 20;
/// Metric value denoting an unreachable destination (infinity). RFC 2080 §2.1.
pub const RIPNG_METRIC_INFINITY: u8 = 16;
/// Metric value marking a next-hop RTE. RFC 2080 §2.1.1.
pub const RIPNG_NEXT_HOP_METRIC: u8 = 0xFF;
// ---------------------------------------------------------------------------
// Version number (RFC 2080 §2)
// ---------------------------------------------------------------------------
/// RIPng version 1. RFC 2080 §2.
pub const RIPNG_VERSION_1: u8 = 1;
// ---------------------------------------------------------------------------
// Command codes (RFC 2080 §2.1)
// ---------------------------------------------------------------------------
/// Request command: ask a router for all or part of its routing table.
/// RFC 2080 §2.1.
pub const RIPNG_COMMAND_REQUEST: u8 = 1;
/// Response command: a routing table message, solicited or unsolicited.
/// RFC 2080 §2.1.
pub const RIPNG_COMMAND_RESPONSE: u8 = 2;
// ---------------------------------------------------------------------------
// Multicast group (RFC 2080 §2)
// ---------------------------------------------------------------------------
/// RIPng all-RIP-routers link-local multicast group (`ff02::9`). RFC 2080 §2.
pub const RIPNG_MULTICAST: Ipv6Addr = new;