ns-allinone-2.35/ns-2.35/mac/mac-802_11Ext.cc
void Mac802_11Ext::recv(Packet *p, Handler *h) {
	struct hdr_cmn *hdr = HDR_CMN(p);
	/*
	 * Sanity Check
	 */
	assert(initialized());

	if (hdr->direction() == hdr_cmn::DOWN) {
		if (MAC_DBG)
			log("FROM_IFQ", "");
		//			send(p, h); replaced by txc
		callback_=h;
		txc.handleMsgFromUp(p);
		return;
	} else {
		//the reception of a packet is moved to handleRXStart/EndIndication
		cout<<"logic error at recv, event sendUP"<<endl;
	}
}
// this function is used to handle the packets from the upper layer
this function is used to handle the packets from the upper layer
this function is used to handle the packets from the upper layer
void Mac802_11Ext::recv(Packet *p, Handler *h) {
	struct hdr_cmn *hdr = HDR_CMN(p);
	assert(initialized());
	if (hdr->direction() == hdr_cmn::DOWN) {
		if (MAC_DBG)
			log("FROM_IFQ", "");
		callback_=h;
		txc.handleMsgFromUp(p);
		return;
	} else {
		cout<<"logic error at recv, event sendUP"<<endl;
	}
}
void Mac802_11Ext :: recv ( Packet * p , Handler * h ) { struct hdr_cmn * hdr = HDR_CMN ( p ) ; assert ( initialized ( ) ) ; if ( hdr -> direction ( ) == hdr_cmn :: DOWN ) { if ( MAC_DBG ) log ( " " , " " ) ; callback_ = h ; txc . handleMsgFromUp ( p ) ; return ; } else { cout << " " << endl ; } }
this function is used to handle the packets from the upper layer
this function is used to handle the packets from the upper layer
/*
	 * Sanity Check
	 */ //			send(p, h); replaced by txc //the reception of a packet is moved to handleRXStart/EndIndication