ns-allinone-2.35/ns-2.35/mac/mac-802_3.cc
void Mac802_3::resume() {
	PRNT_MAC_FUNCS(this);
	assert(!mhRecv_.busy());
	assert(!mhSend_.busy());
	assert(!mhIFS_.busy());

	state_= MAC_IDLE;

	if (mhRetx_.packet()) {
		if (!mhRetx_.busy()) {
			// we're not backing off and not sensing carrier right now: send
			transmit(mhRetx_.packet());
		}
	} else {
		if (callback_ && !mhRetx_.busy()) {
			//WARNING: calling callback_->handle may change the value of callback_
			Handler* h= callback_; 
			callback_= 0;
			h->handle(0);
		}
	}
}
/* we call resume() in these cases:
   - successful transmission
   - whole packet's received
   - collision and backoffLimit's exceeded
   - collision while receiving */
we call resume() in these cases:
successful transmission
whole packet's received
collision and backoffLimit's exceeded
collision while receiving
we call resume () in these cases : successful transmission whole packet ' s received collision and backoffLimit ' s exceeded collision while receiving
void Mac802_3::resume() {
	PRNT_MAC_FUNCS(this);
	assert(!mhRecv_.busy());
	assert(!mhSend_.busy());
	assert(!mhIFS_.busy());
	state_= MAC_IDLE;
	if (mhRetx_.packet()) {
		if (!mhRetx_.busy()) {
			transmit(mhRetx_.packet());
		}
	} else {
		if (callback_ && !mhRetx_.busy()) {
			Handler* h= callback_; 
			callback_= 0;
			h->handle(0);
		}
	}
}
void Mac802_3 :: resume ( ) { PRNT_MAC_FUNCS ( this ) ; assert ( ! mhRecv_ . busy ( ) ) ; assert ( ! mhSend_ . busy ( ) ) ; assert ( ! mhIFS_ . busy ( ) ) ; state_ = MAC_IDLE ; if ( mhRetx_ . packet ( ) ) { if ( ! mhRetx_ . busy ( ) ) { transmit ( mhRetx_ . packet ( ) ) ; } } else { if ( callback_ && ! mhRetx_ . busy ( ) ) { Handler * h = callback_ ; callback_ = 0 ; h -> handle ( 0 ) ; } } }
we call resume() in these cases:
 successful transmission
 whole packet's received
 collision and backoffLimit's exceeded
 collision while receiving
we call resume () in these cases : successful transmission whole packet ' s received collision and backoffLimit ' s exceeded collision while receiving
// we're not backing off and not sensing carrier right now: send //WARNING: calling callback_->handle may change the value of callback_