Skip to main content

Module routing

Module routing 

Source
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§

Ipv4Interface
Information about an IPv4-capable interface.
Ipv4InterfaceAddr
An IPv4 address on an interface.
Ipv4Route
Routing information for an IPv4 destination.

Traits§

Ipv4Router
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.