FreeBSD/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
/**
 * Find an entry given its name and location
 */
Find an entry given its name and location
Find an entry given its name and location
static struct device_entry *
device_find_by_dev(const struct devinfo_dev *dev_p)
{
	struct device_map_entry  *map;
	assert(dev_p != NULL);
	STAILQ_FOREACH(map, &device_map, link)
		if (strcmp(map->name_key, dev_p->dd_name) == 0 &&
		    strcmp(map->location_key, dev_p->dd_location) == 0)
		    	return (map->entry_p);
	return (NULL);
}
static struct device_entry * device_find_by_dev ( const struct devinfo_dev * dev_p ) { struct device_map_entry * map ; assert ( dev_p != NULL ) ; STAILQ_FOREACH ( map , & device_map , link ) if ( strcmp ( map -> name_key , dev_p -> dd_name ) == 0 && strcmp ( map -> location_key , dev_p -> dd_location ) == 0 ) return ( map -> entry_p ) ; return ( NULL ) ; }
Find an entry given its name and location
Find an entry given its name and location