// /proc/net/route contains some information about gateway addresses, // and separates the information about by each interface. public GatewayIPAddressInformationCollection GetGatewayAddresses(LinuxNetworkInterface.LinuxNetworkInterfaceSystemProperties systemProperties) { List <GatewayIPAddressInformation> collection = new List <GatewayIPAddressInformation>(); if (systemProperties.IPv4Routes != null) { StringParsingHelpers.ParseIPv4GatewayAddressesFromRouteFile(collection, systemProperties.IPv4Routes, _linuxNetworkInterface.Name); } if (systemProperties.IPv6Routes != null) { StringParsingHelpers.ParseIPv6GatewayAddressesFromRouteFile(collection, systemProperties.IPv6Routes, _linuxNetworkInterface.Name, _linuxNetworkInterface.Index); } return(new GatewayIPAddressInformationCollection(collection)); }
// /proc/net/route contains some information about gateway addresses, // and separates the information about by each interface. public GatewayIPAddressInformationCollection GetGatewayAddresses() { List <GatewayIPAddressInformation> collection = new List <GatewayIPAddressInformation>(); if (File.Exists(NetworkFiles.Ipv4RouteFile)) { StringParsingHelpers.ParseIPv4GatewayAddressesFromRouteFile(collection, NetworkFiles.Ipv4RouteFile, _linuxNetworkInterface.Name); } if (File.Exists(NetworkFiles.Ipv6RouteFile)) { StringParsingHelpers.ParseIPv6GatewayAddressesFromRouteFile(collection, NetworkFiles.Ipv6RouteFile, _linuxNetworkInterface.Name, _linuxNetworkInterface.Index); } return(new GatewayIPAddressInformationCollection(collection)); }