kubernetes/vendor/go.etcd.io/etcd/pkg/v3/netutil/routes_linux.go

var errNoDefaultRoute

var errNoDefaultHost

var errNoDefaultInterface

// GetDefaultHost obtains the first IP address of machine from the routing table and returns the IP address as string.
// An IPv4 address is preferred to an IPv6 address for backward compatibility.
func GetDefaultHost() (string, error) {}

func chooseHost(family uint8, rmsg *syscall.NetlinkMessage) (string, error) {}

func getDefaultRoutes() (map[uint8]*syscall.NetlinkMessage, error) {}

// Used to get an address of interface.
func getIfaceAddr(idx uint32, family uint8) (*syscall.NetlinkMessage, error) {}

// Used to get a name of interface.
func getIfaceLink(idx uint32) (*syscall.NetlinkMessage, error) {}

// GetDefaultInterfaces gets names of interfaces and returns a map[interface]families.
func GetDefaultInterfaces() (map[string]uint8, error) {}

// parsePREFSRC returns preferred source address and output interface index (RTA_OIF).
func parsePREFSRC(m *syscall.NetlinkMessage) (host string, oif uint32, err error) {}