Function iocage_provision::netstat_gateway_addr[][src]

pub fn netstat_gateway_addr() -> Result<IpAddr, GatewayError>
Expand description

Determines and returns a default gateway IP address by querying the netstat command.

Errors

Returns an Err if:

  • The netstat command cannot be found
  • The output of the command cannot be parsed as UTF-8
  • No line of output starting with "default" can be found
  • The default line cannot be successfully split
  • The IP address string cannot be parsed as an IP address