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
//! IP constants and utilities
use ;
pub use IntoCanonicalIpAddr;
/// Re-export of the [`ipnet`] crate: IPv4/IPv6 network (CIDR) types, exposed so
/// you can name them (e.g. for the typed `MmdbBuilder::insert`) without adding
/// an `ipnet` dependency of your own.
///
/// [`ipnet`]: https://docs.rs/ipnet
pub use ;
/// An IPv4 address with the address pointing to localhost: `127.0.0.1`
pub const IPV4_LOCALHOST: IpAddr = V4;
/// An IPv4 address representing an unspecified address: `0.0.0.0`
///
/// This corresponds to the constant `INADDR_ANY` in other languages.
pub const IPV4_UNSPECIFIED: IpAddr = V4;
/// An IPv4 address representing the broadcast address: `255.255.255.255`.
pub const IPV4_BROADCAST: IpAddr = V4;
/// An IPv6 address representing localhost: `::1`.
///
/// This corresponds to constant `IN6ADDR_LOOPBACK_INIT` or `in6addr_loopback` in other
/// languages.
pub const IPV6_LOCALHOST: IpAddr = V6;
/// An IPv6 address representing the unspecified address: `::`.
///
/// This corresponds to constant `IN6ADDR_ANY_INIT` or `in6addr_any` in other languages.
pub const IPV6_UNSPECIFIED: IpAddr = V6;
/// The IPv6 All Nodes multicast address in link-local scope, as defined in
/// [RFC 4291 Section 2.7.1].
///
/// [RFC 4291 Section 2.7.1]: https://tools.ietf.org/html/rfc4291#section-2.7.1
pub const IPV6_ALL_NODES_LINK_LOCAL: IpAddr =
V6;
/// The IPv6 All Routers multicast address in link-local scope, as defined
/// in [RFC 4291 Section 2.7.1].
///
/// [RFC 4291 Section 2.7.1]: https://tools.ietf.org/html/rfc4291#section-2.7.1
pub const IPV6_ALL_ROUTERS_LINK_LOCAL: IpAddr =
V6;