ns-allinone-2.35/ns-2.35/mac/mac-multihop.cc
void MultihopMac::poll(Packet *p)
{
	Scheduler& s = Scheduler::instance();
	MultihopMac *pm = (MultihopMac*) getPeerMac(p);
	PollEvent *pe = new PollEvent(pm, this);

	pendingPollEvent_ = new PollEvent(pm, this);
	pkt_ = p->copy();	/* local copy for poll retries */
	double timeout = max(pm->rx_tx(), tx_rx_) + 4*pollTxtime(MAC_POLLSIZE);
	s.schedule(&bh_, pendingPollEvent_, timeout);

	/*  If the other interfaces are idle, then go ahead, else not. */
	if (checkInterfaces(MAC_IDLE)) { 
		mode_ = MAC_POLLING;
		peer_ = pm;
		s.schedule(pm->ph(), (Event *)pe, pollTxtime(MAC_POLLSIZE));
	}
}
/*
 * Poll a peer node prior to a send.  There can be at most one POLL 
 * outstanding from a node at any point in time.  This is achieved implicitly
 * because there can be at most one packet down from LL (thru IFQ) to this MAC.
 */
Poll a peer node prior to a send.  There can be at most one POLL
outstanding from a node at any point in time.  This is achieved implicitly
because there can be at most one packet down from LL (thru IFQ) to this MAC.
Poll a peer node prior to a send . There can be at most one POLL outstanding from a node at any point in time . This is achieved implicitly because there can be at most one packet down from LL ( thru IFQ ) to this MAC .
void MultihopMac::poll(Packet *p)
{
	Scheduler& s = Scheduler::instance();
	MultihopMac *pm = (MultihopMac*) getPeerMac(p);
	PollEvent *pe = new PollEvent(pm, this);
	pendingPollEvent_ = new PollEvent(pm, this);
	pkt_ = p->copy();	
	double timeout = max(pm->rx_tx(), tx_rx_) + 4*pollTxtime(MAC_POLLSIZE);
	s.schedule(&bh_, pendingPollEvent_, timeout);
	if (checkInterfaces(MAC_IDLE)) { 
		mode_ = MAC_POLLING;
		peer_ = pm;
		s.schedule(pm->ph(), (Event *)pe, pollTxtime(MAC_POLLSIZE));
	}
}
void MultihopMac :: poll ( Packet * p ) { Scheduler & s = Scheduler :: instance ( ) ; MultihopMac * pm = ( MultihopMac * ) getPeerMac ( p ) ; PollEvent * pe = new PollEvent ( pm , this ) ; pendingPollEvent_ = new PollEvent ( pm , this ) ; pkt_ = p -> copy ( ) ; double timeout = max ( pm -> rx_tx ( ) , tx_rx_ ) + 4 * pollTxtime ( MAC_POLLSIZE ) ; s . schedule ( & bh_ , pendingPollEvent_ , timeout ) ; if ( checkInterfaces ( MAC_IDLE ) ) { mode_ = MAC_POLLING ; peer_ = pm ; s . schedule ( pm -> ph ( ) , ( Event * ) pe , pollTxtime ( MAC_POLLSIZE ) ) ; } }
Poll a peer node prior to a send.
Poll a peer node prior to a send .
/* local copy for poll retries */ /*  If the other interfaces are idle, then go ahead, else not. */