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.
Ipv6Network
Represents the network range in which IP addresses are IPv6.
Ipv6NetworkAddrs
Bidirectional iterator over Ipv6Addr in an Ipv6Network.
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_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.
ipv6_binary_split
Finds the shortest common network for the given slice of networks that covers at least half of slice.