agent/eni/networkutils/utils_linux.go
func IsValidNetworkDevice(devicePath string) bool {
	/*
	* DevicePath Samples:
	* eth1 -> /devices/pci0000:00/0000:00:05.0/net/eth1
	* eth0 -> ../../devices/pci0000:00/0000:00:03.0/net/eth0
	* lo   -> ../../devices/virtual/net/lo
	 */
	splitDevLink := strings.SplitN(devicePath, "devices/", 2)
	if len(splitDevLink) != 2 {
		seelog.Warnf("Cannot determine device validity: %s", devicePath)
		return false
	}
	/*
	* CoreOS typically employs the vif style for physical net interfaces
	* Amazon Linux, Ubuntu, RHEL, Fedora, Suse use the traditional pci convention
	 */
	if strings.HasPrefix(splitDevLink[1], pciDevicePrefix) || strings.HasPrefix(splitDevLink[1], vifDevicePrefix) {
		return true
	}
	if strings.HasPrefix(splitDevLink[1], virtualDevicePrefix) {
		return false
	}
	// NOTE: Should never reach here
	seelog.Criticalf("Failed to validate device path: %s", devicePath)
	return false
}
func IsValidNetworkDevice(devicePath string) bool {
	/*
	* DevicePath Samples:
	* eth1 -> /devices/pci0000:00/0000:00:05.0/net/eth1
	* eth0 -> ../../devices/pci0000:00/0000:00:03.0/net/eth0
	* lo   -> ../../devices/virtual/net/lo
	 */
	splitDevLink := strings.SplitN(devicePath, "devices/", 2)
	if len(splitDevLink) != 2 {
		seelog.Warnf("Cannot determine device validity: %s", devicePath)
		return false
	}
	/*
	* CoreOS typically employs the vif style for physical net interfaces
	* Amazon Linux, Ubuntu, RHEL, Fedora, Suse use the traditional pci convention
	 */
	if strings.HasPrefix(splitDevLink[1], pciDevicePrefix) || strings.HasPrefix(splitDevLink[1], vifDevicePrefix) {
		return true
	}
	if strings.HasPrefix(splitDevLink[1], virtualDevicePrefix) {
		return false
	}
	// NOTE: Should never reach here
	seelog.Criticalf("Failed to validate device path: %s", devicePath)
	return false
}
// IsValidNetworkDevice is used to differentiate virtual and physical devices
// Returns true only for pci or vif interfaces