1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::{io, net::IpAddr};

mod platform_impl;


/// Fetch next-hop gateway for one of the default routes on the system
pub fn default_gateway() -> Result<IpAddr, io::Error> {
    platform_impl::default_gateway()
}

#[cfg(test)]
mod tests {
    use crate::default_gateway;

    #[test]
    fn it_gets_default_gateway() {
        let route = default_gateway().unwrap();
        println!("default route: {}", route);
    }
}