INET Framework for OMNeT++/OMNEST
CSMAMacLayer.h
Go to the documentation of this file.
00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        CSMAMacLayer.h
00003  *
00004  * author:      Marc Loebbers, Yosia Hadisusanto
00005  *
00006  * copyright:   (C) 2004 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it
00010  *              and/or modify it under the terms of the GNU General Public
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later
00013  *              version.
00014  *              For further information see file COPYING
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  ***************************************************************************/
00019 
00020 
00021 #ifndef CSMAMAC_LAYER_H
00022 #define CSMAMAC_LAYER_H
00023 
00024 #include <list>
00025 #include "WirelessMacBase.h"
00026 #include "NotificationBoard.h"
00027 #include "RadioState.h"
00028 #include "MacPkt_m.h"
00029 
00030 
00031 
00071 class INET_API CSMAMacLayer : public WirelessMacBase, public INotifiable
00072 {
00073   public:
00074     CSMAMacLayer();
00075     virtual ~CSMAMacLayer();
00076 
00077   protected:
00079     virtual void initialize(int);
00080 
00082     virtual void registerInterface();
00083 
00085     virtual void finish();
00086 
00088     virtual void handleLowerMsg(cPacket*);
00089 
00091     virtual void handleCommand(cMessage*);
00092 
00094     virtual void handleUpperMsg(cPacket*);
00095 
00097     virtual void handleSelfMsg(cMessage*);
00098 
00100     virtual MacPkt *encapsMsg(cPacket *netw);
00101 
00103     virtual void receiveChangeNotification(int category, const cPolymorphic *details);
00104 
00105   protected:
00107     MACAddress myMacAddr;
00108 
00110     RadioState::State radioState;
00111 
00114     cQueue macQueue;
00115 
00117     int queueLength;
00118 
00120     cMessage* timer;
00121 
00123     simtime_t sendTime;
00124 };
00125 
00126 #endif
00127