/***************************************************************************** * * 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; }
/***************************************************************************** * * 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; }