iprfc/
rfc3068.rs

1use core::net::{Ipv4Addr, Ipv6Addr};
2
3use ipnet::{IpNet, Ipv4Net, Ipv6Net};
4
5use super::RFC;
6
7const IPV4_1: Ipv4Net = Ipv4Net::new_assert(Ipv4Addr::new(192, 88, 99, 0), 24);
8const IPV6_1: Ipv6Net = Ipv6Net::new_assert(Ipv6Addr::new(8194, 49240, 25345, 0, 0, 0, 0, 0), 120);
9
10/// [RFC 3068] An Anycast Prefix for 6to4 Relay Routers (obsolete by RFC7526)
11///
12/// **Addresses:**
13/// - **IPv4:**
14///   1. `192.88.99.0/24`: § 6to4 Relay anycast address
15///   2. `2002:c058:6301::/120`: §2.5 6to4 IPv6 relay anycast address
16///
17/// [RFC 3068]: https://datatracker.ietf.org/doc/rfc3068/
18pub const RFC3068: RFC = RFC {
19  id: 3068,
20  ip_nets: &[IpNet::V4(IPV4_1), IpNet::V6(IPV6_1)],
21  ipv4_nets: &[IPV4_1],
22  ipv6_nets: &[IPV6_1],
23};
24
25#[test]
26fn t() {
27  let addr: Ipv4Net = "192.88.99.0/24".parse().unwrap();
28  assert_eq!(IPV4_1, addr);
29
30  let addr: Ipv6Net = "2002:c058:6301::/120".parse().unwrap();
31  assert_eq!(IPV6_1, addr);
32}