コード例 #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;
}