Expand description
IPv4 routing utilities.
Provides routing table lookup and interface selection for IPv4 packets. This is used to determine which interface to send packets on and what the next-hop address should be.
Structs§
- Ipv4
Interface - Information about an IPv4-capable interface.
- Ipv4
Interface Addr - An IPv4 address on an interface.
- Ipv4
Route - Routing information for an IPv4 destination.
Traits§
- Ipv4
Router - A router that can look up routes for destinations.
Functions§
- broadcast_
address - Calculate the broadcast address for a network.
- get_
default_ route - Get the default route (gateway).
- get_
interface_ for_ dst - Get the interface name for a destination.
- get_
ipv4_ interfaces - Get all available IPv4 interfaces.
- get_
route - Get routing information for a destination address.
- get_
source_ for_ dst - Get the source IP address for a destination.
- ip_
in_ network - Check if an IP address matches a network/prefix.
- is_
local_ destination - Check if a destination is on the local network.
- mask_
to_ prefix - Convert a subnet mask to a prefix length.
- network_
host_ count - Calculate the number of hosts in a network.
- prefix_
to_ mask - Convert a prefix length to a subnet mask.