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.

Modules§

fmt
Alternative formatting adapters for network types.

Structs§

BiContiguous
A bi-contiguous IP network.
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.
Ipv4RangeNetworks
An iterator over the minimum set of contiguous IPv4 networks (CIDR blocks) whose union equals the closed address interval [first, last].
Ipv6Network
Represents the network range in which IP addresses are IPv6.
Ipv6NetworkAddrs
Bidirectional iterator over Ipv6Addr in an Ipv6Network.
Ipv6NetworkDiff
Lazy iterator over Ipv6Network parts of a set difference.
Ipv6RangeNetworks
An iterator over the minimum set of contiguous IPv6 networks (CIDR blocks) whose union equals the closed address interval [first, last].
MacAddr
A 48-bit MAC (EUI-48) address.
MacAddrParseError
Error returned when parsing a MAC address string fails.

Enums§

BiContiguousIpNetParseError
An error that occurs when parsing a bi-contiguous IP network.
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_aggregate_contiguous
Aggregates contiguous IPv4 networks in place into their minimal CIDR cover.
ipv4_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.
ipv4_range_to_networks
Returns an iterator over the minimum set of contiguous IPv4 networks covering the closed address interval [first, last].
ipv6_aggregate
Aggregates IPv6 networks in place: removes duplicates, eliminates networks contained in others, and merges adjacent siblings.
ipv6_aggregate_bicontiguous
Aggregates bi-contiguous IPv6 networks in place into a valid, class-closed cover of the same address union.
ipv6_aggregate_contiguous
Aggregates contiguous IPv6 networks in place into their minimal CIDR cover.
ipv6_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.
ipv6_range_to_networks
Returns an iterator over the minimum set of contiguous IPv6 networks covering the closed address interval [first, last].