ns-allinone-2.35/ns-2.35/mac/mac-multihop.cc
void
PollAckHandler::handle(Event *e)
{
	PollEvent *pe = (PollEvent *) e;
	Scheduler& s = Scheduler::instance();

	if (mac_->checkInterfaces(MAC_POLLING | MAC_IDLE)) {
		mac_->backoffTime(mac_->backoffBase());
		mac_->mode(MAC_SND);
		mac_->peer(pe->peerMac());
		s.cancel(mac_->pendingPE()); /* cancel pending timeout */
		free(mac_->pendingPE());  // and free the event
		mac_->pendingPE(NULL);
		mac_->send(mac_->pkt()); /* send saved packet */
	}
}
/*
 * Handle a POLLACK from a peer node's MAC.
 */
Handle a POLLACK from a peer node's MAC.
Handle a POLLACK from a peer node ' s MAC .
void
PollAckHandler::handle(Event *e)
{
	PollEvent *pe = (PollEvent *) e;
	Scheduler& s = Scheduler::instance();
	if (mac_->checkInterfaces(MAC_POLLING | MAC_IDLE)) {
		mac_->backoffTime(mac_->backoffBase());
		mac_->mode(MAC_SND);
		mac_->peer(pe->peerMac());
		s.cancel(mac_->pendingPE()); 
		free(mac_->pendingPE());  
		mac_->pendingPE(NULL);
		mac_->send(mac_->pkt()); 
	}
}
void PollAckHandler :: handle ( Event * e ) { PollEvent * pe = ( PollEvent * ) e ; Scheduler & s = Scheduler :: instance ( ) ; if ( mac_ -> checkInterfaces ( MAC_POLLING | MAC_IDLE ) ) { mac_ -> backoffTime ( mac_ -> backoffBase ( ) ) ; mac_ -> mode ( MAC_SND ) ; mac_ -> peer ( pe -> peerMac ( ) ) ; s . cancel ( mac_ -> pendingPE ( ) ) ; free ( mac_ -> pendingPE ( ) ) ; mac_ -> pendingPE ( NULL ) ; mac_ -> send ( mac_ -> pkt ( ) ) ; } }
Handle a POLLACK from a peer node's MAC.
Handle a POLLACK from a peer node ' s MAC .
/* cancel pending timeout */ // and free the event /* send saved packet */