ns-allinone-2.35/ns-2.35/mac/mac-multihop.cc
int MultihopMac::checkInterfaces(int state) 
{
	MultihopMac *p;
	
	if (!(mode_ & state))
		return 0;
	else if (macList_ == 0)
		return 1;
	for (p = (MultihopMac *)macList_; p != this && p != NULL; 
	     p = (MultihopMac *)(p->macList())) {
		if (p->mode() != MAC_IDLE) {
			return 0;
		}
	}
	return 1;
}
/*
 * Returns 1 iff the specified MAC is in the prescribed state, AND all
 * the other MACs are IDLE.
 */
Returns 1 iff the specified MAC is in the prescribed state, AND all
the other MACs are IDLE.
Returns 1 iff the specified MAC is in the prescribed state AND all the other MACs are IDLE .
int MultihopMac::checkInterfaces(int state) 
{
	MultihopMac *p;
	if (!(mode_ & state))
		return 0;
	else if (macList_ == 0)
		return 1;
	for (p = (MultihopMac *)macList_; p != this && p != NULL; 
	     p = (MultihopMac *)(p->macList())) {
		if (p->mode() != MAC_IDLE) {
			return 0;
		}
	}
	return 1;
}
int MultihopMac :: checkInterfaces ( int state ) { MultihopMac * p ; if ( ! ( mode_ & state ) ) return 0 ; else if ( macList_ == 0 ) return 1 ; for ( p = ( MultihopMac * ) macList_ ; p != this && p != NULL ; p = ( MultihopMac * ) ( p -> macList ( ) ) ) { if ( p -> mode ( ) != MAC_IDLE ) { return 0 ; } } return 1 ; }
Returns 1 iff the specified MAC is in the prescribed state, AND all
 the other MACs are IDLE.
Returns 1 iff the specified MAC is in the prescribed state AND all the other MACs are IDLE .