FreeBSD/contrib/ntp/lib/isc/win32/interfaceiter.c
/*
 * Step the iterator to the next interface.  Unlike
 * isc_interfaceiter_next(), this may leave the iterator
 * positioned on an interface that will ultimately
 * be ignored.  Return ISC_R_NOMORE if there are no more
 * interfaces, otherwise ISC_R_SUCCESS.
 */
Step the iterator to the next interface.  Unlike
isc_interfaceiter_next(), this may leave the iterator
positioned on an interface that will ultimately
be ignored.  Return ISC_R_NOMORE if there are no more
interfaces, otherwise ISC_R_SUCCESS.
Step the iterator to the next interface . Unlike isc_interfaceiter_next () this may leave the iterator positioned on an interface that will ultimately be ignored . Return ISC_R_NOMORE if there are no more interfaces otherwise ISC_R_SUCCESS .
static isc_result_t
internal_next(isc_interfaceiter_t *iter) {
	if (iter->numIF >= iter->v4IF)
		return (ISC_R_NOMORE);
	if (iter->numIF == 0)
		iter->pos4 = (INTERFACE_INFO *)(iter->buf4 + (iter->v4IF));
	iter->pos4--;
	if (&(iter->pos4) < &(iter->buf4))
		return (ISC_R_NOMORE);
	memset(&(iter->IFData), 0, sizeof(INTERFACE_INFO));
	memcpy(&(iter->IFData), iter->pos4, sizeof(INTERFACE_INFO));
	iter->numIF++;
	return (ISC_R_SUCCESS);
}
static isc_result_t internal_next ( isc_interfaceiter_t * iter ) { if ( iter -> numIF >= iter -> v4IF ) return ( ISC_R_NOMORE ) ; if ( iter -> numIF == 0 ) iter -> pos4 = ( INTERFACE_INFO * ) ( iter -> buf4 + ( iter -> v4IF ) ) ; iter -> pos4 -- ; if ( & ( iter -> pos4 ) < & ( iter -> buf4 ) ) return ( ISC_R_NOMORE ) ; memset ( & ( iter -> IFData ) , 0 , sizeof ( INTERFACE_INFO ) ) ; memcpy ( & ( iter -> IFData ) , iter -> pos4 , sizeof ( INTERFACE_INFO ) ) ; iter -> numIF ++ ; return ( ISC_R_SUCCESS ) ; }
Step the iterator to the next interface.
Step the iterator to the next interface .
/*
	 * The first one needs to be set up to point to the last
	 * Element of the array.  Go to the end and back up
	 * Microsoft's implementation is peculiar for returning
	 * the list in reverse order
	 */