예제 #1
0
파일: hpux.c 프로젝트: Generator/wormulon
/*****************************************************************************
 *
 * checkinterface()
 *
 * check if a given interface exists, return 1 if it does and 0 if not (This
 * function is a wrapper function for _countinterfaces && _getifdata.)
 *
 ****************************************************************************/
int checkinterface(void)
{
    /* ==  0 no network interfaces, -1 sth. went wrong */
    if ((ifdata.if_amount =_countinterfaces()) > 0)
        _getifdata();
    return ifdata.if_valid;
}
예제 #2
0
/*****************************************************************************
 *
 * checkinterface()
 *
 * check if a given interface exists, return 1 if it does and 0 if not (This
 * function is a wrapper function for _countinterfaces && _getifdata.)
 *
 ****************************************************************************/
int checkinterface(netdata* data)
{
    /* ==  0 no network interfaces, -1 sth. went wrong */
    if ((data->ifdata.if_amount =_countinterfaces()) > 0)
        _getifdata();
    return data->ifdata.if_valid;
}