Expand description
A crate for parsing, representing, and manipulating network addresses.
netaddr2
arose from a need to mask and subnet IP space logically similar
to the way that routers and network interface cards (NICs) do. This enables
the user to ask questions like:
-
Does this
IpAddr
belong to thisNetAddr
? (That is, does this specific address happen to lie within the network/netmask given by thisNetAddr
?) -
Does this network contain this other network?
The API is strikingly similar to that of the std::net::Ip.*Addr
structs,
and users who have used that set of structs will hopefully find this API
quite naturally similar.
Structs§
- Netv4
Addr - A structure representing an IPv4 network.
- Netv6
Addr - A structure representing an IPv6 network.
Enums§
- Error
- The error type for operations relating to the
NetAddr
type - NetAddr
- A structure representing an IP network.
Traits§
- Broadcast
- Compute the “broadcast” address for supported networks.
- Contains
- Check containment of one object within another
- Mask
- Masking one object with another
- Merge
- Merge two items together
Type Aliases§
- Result
- A type definition with
netaddr2::Error
as its type.