ns-allinone-2.35/ns-2.35/dccp/dccp.cc
bool DCCPAgent::finishFeatureNegotiation(u_int8_t num, dccp_feature_location location){
	int walker = 0;
	while (walker < feat_list_used_){ //walk through the list
		if (feat_list_num_[walker] == num && feat_list_loc_[walker] == location){
			//we found the feature
			//move the rest of the list one step up
			if (walker + 1 < feat_list_used_){
				for(int i = walker; i < feat_list_used_-1; i++){
					feat_list_num_[i] = feat_list_num_[i+1];
					feat_list_loc_[i] = feat_list_loc_[i+1];
				}
			}
			feat_list_used_--;
			return true;
				
		}
		walker++;
	}
	return false;
}
/* Finish feature negotiation for a feature abd remove it from
 * the list of ongoing feature negotiations.
 * arg: num      - feature number
 *      location - feature location
 * ret: true if the feature is removed
 *      false if it doesn't exist in the list
 */
Finish feature negotiation for a feature abd remove it from
the list of ongoing feature negotiations.
arg: num      - feature number
location - feature location
ret: true if the feature is removed
false if it doesn't exist in the list
Finish feature negotiation for a feature abd remove it from the list of ongoing feature negotiations . arg : num - feature number location - feature location ret : true if the feature is removed false if it doesn ' t exist in the list
bool DCCPAgent::finishFeatureNegotiation(u_int8_t num, dccp_feature_location location){
	int walker = 0;
	while (walker < feat_list_used_){ 
		if (feat_list_num_[walker] == num && feat_list_loc_[walker] == location){
			if (walker + 1 < feat_list_used_){
				for(int i = walker; i < feat_list_used_-1; i++){
					feat_list_num_[i] = feat_list_num_[i+1];
					feat_list_loc_[i] = feat_list_loc_[i+1];
				}
			}
			feat_list_used_--;
			return true;
		}
		walker++;
	}
	return false;
}
bool DCCPAgent :: finishFeatureNegotiation ( u_int8_t num , dccp_feature_location location ) { int walker = 0 ; while ( walker < feat_list_used_ ) { if ( feat_list_num_ [ walker ] == num && feat_list_loc_ [ walker ] == location ) { if ( walker + 1 < feat_list_used_ ) { for ( int i = walker ; i < feat_list_used_ - 1 ; i ++ ) { feat_list_num_ [ i ] = feat_list_num_ [ i + 1 ] ; feat_list_loc_ [ i ] = feat_list_loc_ [ i + 1 ] ; } } feat_list_used_ -- ; return true ; } walker ++ ; } return false ; }
Finish feature negotiation for a feature abd remove it from
 the list of ongoing feature negotiations.
Finish feature negotiation for a feature abd remove it from the list of ongoing feature negotiations .
//walk through the list //we found the feature //move the rest of the list one step up