Skip to main content

Crate netip

Crate netip 

Source
Expand description

IPv4/IPv6 network primitives.

This library provides types for IP networks by extending the standard library.

Unlike most open-source libraries, this library is designed to support non-contiguous masks.

Structs§

Contiguous
A contiguous IP network.
Ipv4Network
Represents the network range in which IP addresses are IPv4.
Ipv4NetworkAddrs
Bidirectional iterator over Ipv4Addr in an Ipv4Network.
Ipv4NetworkDiff
Lazy iterator over Ipv4Network parts of a set difference.
Ipv6Network
Represents the network range in which IP addresses are IPv6.
Ipv6NetworkAddrs
Bidirectional iterator over Ipv6Addr in an Ipv6Network.
Ipv6NetworkDiff
Yields between 0 and 128 pairwise-disjoint networks whose union equals S(A) \ S(B).
MacAddr
A 48-bit MAC (EUI-48) address.
MacAddrParseError
Error returned when parsing a MAC address string fails.

Enums§

ContiguousIpNetParseError
An error that occurs when parsing a contiguous IP network.
IpNetParseError
An error that is returned during IP network parsing.
IpNetwork
An IP network, either IPv4 or IPv6.

Functions§

ipv4_aggregate
Aggregates IPv4 networks in place: removes duplicates, eliminates networks contained in others, and merges adjacent siblings.
ipv4_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.
ipv6_aggregate
Aggregates IPv6 networks in place: removes duplicates, eliminates networks contained in others, and merges adjacent siblings.
ipv6_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.