ns-allinone-2.35/ns-2.35/linkstate/ls.cc
bool LsRouting::isUp(int neighborId) 
{
	if (linkStateListPtr_ == NULL) 
		return false;

	for (LsLinkStateList::iterator itr = linkStateListPtr_->begin();
	     itr!= linkStateListPtr_->end(); itr++)
		if ((*itr).neighborId_ == neighborId)
			return ((*itr).status_ == LS_STATUS_UP) ? true : false;
	return false;
}
/* -- isUp -- */
// a linear search, but not too bad if most nodes will have 
// less than a couple of interfaces
isUp
a linear search, but not too bad if most nodes will have
less than a couple of interfaces
isUp a linear search but not too bad if most nodes will have less than a couple of interfaces
bool LsRouting::isUp(int neighborId) 
{
	if (linkStateListPtr_ == NULL) 
		return false;
	for (LsLinkStateList::iterator itr = linkStateListPtr_->begin();
	     itr!= linkStateListPtr_->end(); itr++)
		if ((*itr).neighborId_ == neighborId)
			return ((*itr).status_ == LS_STATUS_UP) ? true : false;
	return false;
}
bool LsRouting :: isUp ( int neighborId ) { if ( linkStateListPtr_ == NULL ) return false ; for ( LsLinkStateList :: iterator itr = linkStateListPtr_ -> begin ( ) ; itr != linkStateListPtr_ -> end ( ) ; itr ++ ) if ( ( * itr ) . neighborId_ == neighborId ) return ( ( * itr ) . status_ == LS_STATUS_UP ) ? true : false ; return false ; }
isUp 
a linear search, but not too bad if most nodes will have
less than a couple of interfaces
isUp a linear search but not too bad if most nodes will have less than a couple of interfaces