FreeBSD/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
/**
 * Get the status of a device
 */
Get the status of a device
Get the status of a device
static enum DeviceStatus
device_get_status(struct devinfo_dev *dev)
{
	assert(dev != NULL);
	switch (dev->dd_state) {
	case DS_ALIVE:			
	case DS_NOTPRESENT:		
		return (DS_DOWN);
	case DS_ATTACHED:		
	case DS_BUSY:			
		return (DS_RUNNING);
	default:
		return (DS_UNKNOWN);
	}
}
static enum DeviceStatus device_get_status ( struct devinfo_dev * dev ) { assert ( dev != NULL ) ; switch ( dev -> dd_state ) { case DS_ALIVE : case DS_NOTPRESENT : return ( DS_DOWN ) ; case DS_ATTACHED : case DS_BUSY : return ( DS_RUNNING ) ; default : return ( DS_UNKNOWN ) ; } }
Get the status of a device
Get the status of a device
/* probe succeeded */ /* not probed or probe failed */ /* attach method called */ /* device is open */