phymac-clmsg.h

Go to the documentation of this file.
00001 /* -*- Mode:C++ -*- */
00002 
00003 /*
00004  * Copyright (c) 2007 Regents of the SIGNET lab, University of Padova.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. Neither the name of the University of Padova (SIGNET lab) nor the 
00016  *    names of its contributors may be used to endorse or promote products 
00017  *    derived from this software without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00020  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
00021  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
00022  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
00023  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00024  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00025  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
00026  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00027  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
00028  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
00029  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  */
00031 
00032 
00044 #ifndef PHYMAC_CLMSG_H
00045 #define PHYMAC_CLMSG_H
00046 
00047 #include<packet.h>
00048 #include<clmessage.h>
00049 
00050 #define CLMSG_PHY2MAC_VERBOSITY 3
00051 #define CLMSG_MAC2PHY_VERBOSITY 3 // ver
00052 
00053 extern ClMessage_t CLMSG_PHY2MAC_ENDTX;
00054 extern ClMessage_t CLMSG_PHY2MAC_STARTRX;
00055 extern ClMessage_t CLMSG_PHY2MAC_CCA;
00056 extern ClMessage_t CLMSG_MAC2PHY_GETTXDURATION;
00057 
00058 class ClSAP;
00059 
00060 
00061 class ClMsgPhy2MacEndTx : public ClMessage
00062 {
00063 public:
00064   ClMsgPhy2MacEndTx(const Packet* p);
00065   ClMessage* copy();    // copy the message
00066   
00067   const Packet* pkt;
00068 };
00069 
00070 
00071 class ClMsgPhy2MacStartRx : public ClMessage 
00072 {
00073 public:
00074   ClMsgPhy2MacStartRx(const Packet* p);
00075   ClMessage* copy();    // copy the message
00076 
00077   const Packet* pkt;
00078 };
00079 
00080 
00081 class ClMsgPhy2MacCCA : public ClMessage 
00082 {
00083 public:
00084   ClMsgPhy2MacCCA(bool new_cca);
00085   ClMessage* copy();    // copy the message
00086 
00087   bool CCA;
00088 };
00089 
00091 
00092 class ClMsgMac2PhyGetTxDuration : public ClMessage
00093 {
00094 
00095 public:
00096 
00097   ClMsgMac2PhyGetTxDuration(Packet* p);
00098   ClMsgMac2PhyGetTxDuration(int moduleId, Packet* p);
00099 
00100   void setDuration(double time);
00101   double getDuration();
00102 
00103   ClMessage* copy();    // copy the message
00104   
00105   Packet* pkt;
00106         
00107 private:
00108 
00109   double duration;
00110 };
00111 
00113 
00114 
00115 
00116 
00117 
00118 #endif /* PHYMAC_CLMSG_H */

Generated on Wed Nov 26 15:47:28 2008 for NS-MIRACLE library by  doxygen 1.5.2