ns-allinone-2.35/ns-2.35/dccp/dccp_ackv.cc
int DCCPAckVector::getAckVector(u_char* vect, u_int16_t *size){
	if (size_ == 0)
		return DCCP_ACKV_EMPTY;
	else if (size_ > *size){
		*size = size_;
		return DCCP_ACKV_ERR_SIZE;
	}

	int walker = head_;

	for (int i = 0; i < size_; i++){
		vect[i] = vector_[walker];
		walker = (walker + 1) % max_size_;
	}
	*size = size_;
	
	return size_;
}
/* Return the ack vector
 * arg: vect - array to store ack vector in
 *      size - size of vect
 * ret: The size of returned ack vector (also in size) if successful
 *      DCCP_ACKV_EMPTY if its empty
 *      DCCP_ACKV_ERR_SIZE if size is too small
 *	(will set size to the size needed)
 */
Return the ack vector
arg: vect - array to store ack vector in
size - size of vect
ret: The size of returned ack vector (also in size) if successful
DCCP_ACKV_EMPTY if its empty
DCCP_ACKV_ERR_SIZE if size is too small
(will set size to the size needed)
Return the ack vector arg : vect - array to store ack vector in size - size of vect ret : The size of returned ack vector ( also in size ) if successful DCCP_ACKV_EMPTY if its empty DCCP_ACKV_ERR_SIZE if size is too small ( will set size to the size needed )
int DCCPAckVector::getAckVector(u_char* vect, u_int16_t *size){
	if (size_ == 0)
		return DCCP_ACKV_EMPTY;
	else if (size_ > *size){
		*size = size_;
		return DCCP_ACKV_ERR_SIZE;
	}
	int walker = head_;
	for (int i = 0; i < size_; i++){
		vect[i] = vector_[walker];
		walker = (walker + 1) % max_size_;
	}
	*size = size_;
	return size_;
}
int DCCPAckVector :: getAckVector ( u_char * vect , u_int16_t * size ) { if ( size_ == 0 ) return DCCP_ACKV_EMPTY ; else if ( size_ > * size ) { * size = size_ ; return DCCP_ACKV_ERR_SIZE ; } int walker = head_ ; for ( int i = 0 ; i < size_ ; i ++ ) { vect [ i ] = vector_ [ walker ] ; walker = ( walker + 1 ) % max_size_ ; } * size = size_ ; return size_ ; }
Return the ack vector
 arg: vect - array to store ack vector in
      size - size of vect
 ret: The size of returned ack vector (also in size) if successful
      DCCP_ACKV_EMPTY if its empty
      DCCP_ACKV_ERR_SIZE if size is too small
      (will set size to the size needed)
Return the ack vector arg : vect - array to store ack vector in size - size of vect ret : The size of returned ack vector ( also in size ) if successful DCCP_ACKV_EMPTY if its empty DCCP_ACKV_ERR_SIZE if size is too small ( will set size to the size needed )