ns-allinone-2.35/rap/rap.cc
void RapAgent::SendAck(int seqNum)
{
	type_ = PT_RAP_ACK;
	Packet* pkt = allocpkt();	// Create a new packet
	hdr_rap* hdr = hdr_rap::access(pkt);   // Access header

	hdr->seqno() = seqNum;
	hdr->flags() = RH_ACK;

	hdr->lastRecv = lastRecv_;
	hdr->lastMiss = lastMiss_;
	hdr->prevRecv = prevRecv_;

	hdr_cmn *ch = hdr_cmn::access(pkt);
	ch->size() = rap_base_hdr_size_;

	send(pkt, 0);
	Debug(debugEnable_, logfile_, 
	      "- ack sent %u [%u %u %u]\n", 
	      seqNum, lastRecv_, lastMiss_, prevRecv_);
}
//----------------------------------------------------------------------
// RapAgent::SendAck
//      Create an ack packet, set fields, send the packet out.
//
//      "seqNum" is the sequence number of the packet being acked.
//----------------------------------------------------------------------
:SendAck
Create an ack packet, set fields, send the packet out.

"seqNum" is the sequence number of the packet being acked.
: SendAck Create an ack packet set fields send the packet out . " seqNum " is the sequence number of the packet being acked .
void RapAgent::SendAck(int seqNum)
{
	type_ = PT_RAP_ACK;
	Packet* pkt = allocpkt();	
	hdr_rap* hdr = hdr_rap::access(pkt);   
	hdr->seqno() = seqNum;
	hdr->flags() = RH_ACK;
	hdr->lastRecv = lastRecv_;
	hdr->lastMiss = lastMiss_;
	hdr->prevRecv = prevRecv_;
	hdr_cmn *ch = hdr_cmn::access(pkt);
	ch->size() = rap_base_hdr_size_;
	send(pkt, 0);
	Debug(debugEnable_, logfile_, 
	      "- ack sent %u [%u %u %u]\n", 
	      seqNum, lastRecv_, lastMiss_, prevRecv_);
}
void RapAgent :: SendAck ( int seqNum ) { type_ = PT_RAP_ACK ; Packet * pkt = allocpkt ( ) ; hdr_rap * hdr = hdr_rap :: access ( pkt ) ; hdr -> seqno ( ) = seqNum ; hdr -> flags ( ) = RH_ACK ; hdr -> lastRecv = lastRecv_ ; hdr -> lastMiss = lastMiss_ ; hdr -> prevRecv = prevRecv_ ; hdr_cmn * ch = hdr_cmn :: access ( pkt ) ; ch -> size ( ) = rap_base_hdr_size_ ; send ( pkt , 0 ) ; Debug ( debugEnable_ , logfile_ , " \n " , seqNum , lastRecv_ , lastMiss_ , prevRecv_ ) ; }
RapAgent::SendAck
Create an ack packet, set fields, send the packet out.
RapAgent :: SendAck Create an ack packet set fields send the packet out .
// Create a new packet // Access header