ns-allinone-2.35/ns-2.35/dccp/dccp_sb.cc
bool DCCPSendBuffer::add(int packet_size){
	if (empty_) {
		buf_[head_] = packet_size;
		empty_ = false;
	} else if ( (tail_+1) % size_ == head_)  //buffer is full
		return false;
	else {
		tail_ = (tail_ + 1) % size_;
		buf_[tail_] = packet_size;
	}
	return true;
}
/* Add an element to the buffer
 * arg: size - size of element
 * ret: true if successful, false if full
 */
Add an element to the buffer
arg: size - size of element
ret: true if successful, false if full
Add an element to the buffer arg : size - size of element ret : true if successful false if full
bool DCCPSendBuffer::add(int packet_size){
	if (empty_) {
		buf_[head_] = packet_size;
		empty_ = false;
	} else if ( (tail_+1) % size_ == head_)  
		return false;
	else {
		tail_ = (tail_ + 1) % size_;
		buf_[tail_] = packet_size;
	}
	return true;
}
bool DCCPSendBuffer :: add ( int packet_size ) { if ( empty_ ) { buf_ [ head_ ] = packet_size ; empty_ = false ; } else if ( ( tail_ + 1 ) % size_ == head_ ) return false ; else { tail_ = ( tail_ + 1 ) % size_ ; buf_ [ tail_ ] = packet_size ; } return true ; }
Add an element to the buffer
 arg: size - size of element
 ret: true if successful, false if full
Add an element to the buffer arg : size - size of element ret : true if successful false if full
//buffer is full