ns-allinone-2.35/ns-2.35/dccp/dccp_ackv.cc
bool DCCPAckVector::findSeqNum(u_int32_t seqnum, u_int16_t *where, u_int32_t *seq_start, u_int32_t *seq_end){
	if (size_ == 0 || seqnum > seq_head_ || seqnum < seq_tail_ )
		return false;
	
	*where = head_;
	*seq_start = seq_head_;
	*seq_end = 0;
	int stop = (tail_ + 1) % max_size_;
	
	do{
		*seq_end = *seq_start - (vector_[*where] & DCCP_RUN_LENGTH_MASK);
		
		if (*seq_end <= seqnum && *seq_start >= seqnum){
			return true;
		}
		
		*where = (*where + 1) % max_size_;
		*seq_start = *seq_end - 1;
	} while(*where != stop);
	
	//should never get here!!
	return false;
}
/* Find where in the vector a info about a seqnum exists
 * arg: seqnum    - sequence number to find
 *      where     - resulting position in the vector
 *      seq_start - starting sequence number corresponding to where
 *      seq_end   - ending sequence number corresponding to where
 * ret: true if found
 *      false otherwise (where, seq_start, seq_end invalid)
 */
Find where in the vector a info about a seqnum exists
arg: seqnum    - sequence number to find
where     - resulting position in the vector
seq_start - starting sequence number corresponding to where
seq_end   - ending sequence number corresponding to where
ret: true if found
false otherwise (where, seq_start, seq_end invalid)
Find where in the vector a info about a seqnum exists arg : seqnum - sequence number to find where - resulting position in the vector seq_start - starting sequence number corresponding to where seq_end - ending sequence number corresponding to where ret : true if found false otherwise ( where seq_start seq_end invalid )
bool DCCPAckVector::findSeqNum(u_int32_t seqnum, u_int16_t *where, u_int32_t *seq_start, u_int32_t *seq_end){
	if (size_ == 0 || seqnum > seq_head_ || seqnum < seq_tail_ )
		return false;
	*where = head_;
	*seq_start = seq_head_;
	*seq_end = 0;
	int stop = (tail_ + 1) % max_size_;
	do{
		*seq_end = *seq_start - (vector_[*where] & DCCP_RUN_LENGTH_MASK);
		if (*seq_end <= seqnum && *seq_start >= seqnum){
			return true;
		}
		*where = (*where + 1) % max_size_;
		*seq_start = *seq_end - 1;
	} while(*where != stop);
	return false;
}
bool DCCPAckVector :: findSeqNum ( u_int32_t seqnum , u_int16_t * where , u_int32_t * seq_start , u_int32_t * seq_end ) { if ( size_ == 0 || seqnum > seq_head_ || seqnum < seq_tail_ ) return false ; * where = head_ ; * seq_start = seq_head_ ; * seq_end = 0 ; int stop = ( tail_ + 1 ) % max_size_ ; do { * seq_end = * seq_start - ( vector_ [ * where ] & DCCP_RUN_LENGTH_MASK ) ; if ( * seq_end <= seqnum && * seq_start >= seqnum ) { return true ; } * where = ( * where + 1 ) % max_size_ ; * seq_start = * seq_end - 1 ; } while ( * where != stop ) ; return false ; }
Find where in the vector a info about a seqnum exists
 arg: seqnum    - sequence number to find
      where     - resulting position in the vector
      seq_start - starting sequence number corresponding to where
      seq_end   - ending sequence number corresponding to where
 ret: true if found
      false otherwise (where, seq_start, seq_end invalid)
Find where in the vector a info about a seqnum exists arg : seqnum - sequence number to find where - resulting position in the vector seq_start - starting sequence number corresponding to where seq_end - ending sequence number corresponding to where ret : true if found false otherwise ( where seq_start seq_end invalid )
//should never get here!!