|
@@ -106,6 +106,24 @@ impl<'a> Routes<'a> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// Remove the default ipv4 gateway
|
|
|
|
+ ///
|
|
|
|
+ /// On success, returns the previous default route, if any.
|
|
|
|
+ #[cfg(feature = "proto-ipv4")]
|
|
|
|
+ pub fn remove_default_ipv4_route(&mut self) -> Option<Route> {
|
|
|
|
+ let cidr = IpCidr::new(IpAddress::v4(0, 0, 0, 0), 0);
|
|
|
|
+ self.storage.remove(&cidr)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// Remove the default ipv6 gateway
|
|
|
|
+ ///
|
|
|
|
+ /// On success, returns the previous default route, if any.
|
|
|
|
+ #[cfg(feature = "proto-ipv6")]
|
|
|
|
+ pub fn remove_default_ipv6_route(&mut self) -> Option<Route> {
|
|
|
|
+ let cidr = IpCidr::new(IpAddress::v6(0, 0, 0, 0, 0, 0, 0, 0), 0);
|
|
|
|
+ self.storage.remove(&cidr)
|
|
|
|
+ }
|
|
|
|
+
|
|
pub(crate) fn lookup(&self, addr: &IpAddress, timestamp: Instant) ->
|
|
pub(crate) fn lookup(&self, addr: &IpAddress, timestamp: Instant) ->
|
|
Option<IpAddress> {
|
|
Option<IpAddress> {
|
|
assert!(addr.is_unicast());
|
|
assert!(addr.is_unicast());
|