FreeBSD/sbin/atm/atmconfig/diag.c
/*
 * Make sure the interface exists and has a phy
 */
Make sure the interface exists and has a phy
Make sure the interface exists and has a phy
static struct diagif *
diagif_get_phy(const char *arg)
{
	struct diagif *aif;
	diagif_fetch();
	TAILQ_FOREACH(aif, &diagif_list, link)
		if (strcmp(aif->ifname, arg) == 0)
			break;
	if (aif == NULL)
		errx(1, "no such interface: %s", arg);
	if (!aif->phy_present)
		errx(1, "interface %s has no phy", arg);
	return (aif);
}
static struct diagif * diagif_get_phy ( const char * arg ) { struct diagif * aif ; diagif_fetch ( ) ; TAILQ_FOREACH ( aif , & diagif_list , link ) if ( strcmp ( aif -> ifname , arg ) == 0 ) break ; if ( aif == NULL ) errx ( 1 , " " , arg ) ; if ( ! aif -> phy_present ) errx ( 1 , " " , arg ) ; return ( aif ) ; }
Make sure the interface exists and has a phy
Make sure the interface exists and has a phy