ns-allinone-2.35/dei80211mr-1.1.4/src/mac-802_11mr.cc
void
Mac802_11mr::send_timer()
{
	switch(tx_state_) {
	/*
	 * Sent a RTS, but did not receive a CTS.
	 */
	case MAC_RTS:
		RetransmitRTS();
		break;
	/*
	 * Sent a CTS, but did not receive a DATA packet.
	 */
	case MAC_CTS:
		assert(pktCTRL_);
		Packet::free(pktCTRL_); 
		pktCTRL_ = 0;
		break;
	/*
	 * Sent DATA, but did not receive an ACK packet.
	 */
	case MAC_SEND:
		if(debug_) printf("%f - %i --- send_timer - retransmit data\n",Scheduler::instance().clock(), index_);
		RetransmitDATA();
		break;
	/*
	 * Sent an ACK, and now ready to resume transmission.
	 */
	case MAC_ACK:
		assert(pktCTRL_);
		Packet::free(pktCTRL_); 
		pktCTRL_ = 0;
		break;
	case MAC_IDLE:
		break;
	default:
		assert(0);
	}
	if(debug_) printf("%f - %i --- send_timer - call tx_resume\n",Scheduler::instance().clock(), index_);
	tx_resume();
}
/* ======================================================================
   The "real" Timer Handler Routines
   ====================================================================== */
The "real" Timer Handler Routines
The " real " Timer Handler Routines
void
Mac802_11mr::send_timer()
{
	switch(tx_state_) {
	case MAC_RTS:
		RetransmitRTS();
		break;
	case MAC_CTS:
		assert(pktCTRL_);
		Packet::free(pktCTRL_); 
		pktCTRL_ = 0;
		break;
	case MAC_SEND:
		if(debug_) printf("%f - %i --- send_timer - retransmit data\n",Scheduler::instance().clock(), index_);
		RetransmitDATA();
		break;
	case MAC_ACK:
		assert(pktCTRL_);
		Packet::free(pktCTRL_); 
		pktCTRL_ = 0;
		break;
	case MAC_IDLE:
		break;
	default:
		assert(0);
	}
	if(debug_) printf("%f - %i --- send_timer - call tx_resume\n",Scheduler::instance().clock(), index_);
	tx_resume();
}
void Mac802_11mr :: send_timer ( ) { switch ( tx_state_ ) { case MAC_RTS : RetransmitRTS ( ) ; break ; case MAC_CTS : assert ( pktCTRL_ ) ; Packet :: free ( pktCTRL_ ) ; pktCTRL_ = 0 ; break ; case MAC_SEND : if ( debug_ ) printf ( " \n " , Scheduler :: instance ( ) . clock ( ) , index_ ) ; RetransmitDATA ( ) ; break ; case MAC_ACK : assert ( pktCTRL_ ) ; Packet :: free ( pktCTRL_ ) ; pktCTRL_ = 0 ; break ; case MAC_IDLE : break ; default : assert ( 0 ) ; } if ( debug_ ) printf ( " \n " , Scheduler :: instance ( ) . clock ( ) , index_ ) ; tx_resume ( ) ; }
The "real" Timer Handler Routines
The " real " Timer Handler Routines
/*
	 * Sent a RTS, but did not receive a CTS.
	 */ /*
	 * Sent a CTS, but did not receive a DATA packet.
	 */ /*
	 * Sent DATA, but did not receive an ACK packet.
	 */ /*
	 * Sent an ACK, and now ready to resume transmission.
	 */