|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // Copyright (C) 2006 Andras Varga 00003 // 00004 // This program is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public License 00006 // as published by the Free Software Foundation; either version 2 00007 // of the License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with this program; if not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef IEEE80211_MGMT_BASE_H 00019 #define IEEE80211_MGMT_BASE_H 00020 00021 #include <omnetpp.h> 00022 #include "MACAddress.h" 00023 #include "PassiveQueueBase.h" 00024 #include "NotificationBoard.h" 00025 #include "Ieee80211Frame_m.h" 00026 #include "Ieee80211MgmtFrames_m.h" 00027 00028 00036 class INET_API Ieee80211MgmtBase : public PassiveQueueBase, public INotifiable 00037 { 00038 protected: 00039 // configuration 00040 int frameCapacity; 00041 MACAddress myAddress; 00042 00043 // state 00044 cQueue dataQueue; // queue for data frames 00045 cQueue mgmtQueue; // queue for management frames (higher priority than data frames) 00046 00047 // statistics 00048 long numDataFramesReceived; 00049 long numMgmtFramesReceived; 00050 long numMgmtFramesDropped; 00051 00052 // queue statistics 00053 cOutVector dataQueueLenVec; 00054 cOutVector dataQueueDropVec; 00055 00056 protected: 00057 virtual int numInitStages() const {return 2;} 00058 virtual void initialize(int); 00059 00061 virtual void handleMessage(cMessage *msg); 00062 00064 virtual void handleTimer(cMessage *frame) = 0; 00065 00067 virtual void handleUpperMessage(cPacket *msg) = 0; 00068 00070 virtual void handleCommand(int msgkind, cPolymorphic *ctrl) = 0; 00071 00073 virtual void sendOrEnqueue(cPacket *frame); 00074 00076 virtual bool enqueue(cMessage *msg); 00077 00079 virtual cMessage *dequeue(); 00080 00082 virtual void sendOut(cMessage *msg); 00083 00085 virtual void dropManagementFrame(Ieee80211ManagementFrame *frame); 00086 00088 virtual cPacket *decapsulate(Ieee80211DataFrame *frame); 00089 00091 virtual void sendUp(cMessage *msg); 00092 00094 virtual void processFrame(Ieee80211DataOrMgmtFrame *frame); 00095 00098 virtual void handleDataFrame(Ieee80211DataFrame *frame) = 0; 00099 virtual void handleAuthenticationFrame(Ieee80211AuthenticationFrame *frame) = 0; 00100 virtual void handleDeauthenticationFrame(Ieee80211DeauthenticationFrame *frame) = 0; 00101 virtual void handleAssociationRequestFrame(Ieee80211AssociationRequestFrame *frame) = 0; 00102 virtual void handleAssociationResponseFrame(Ieee80211AssociationResponseFrame *frame) = 0; 00103 virtual void handleReassociationRequestFrame(Ieee80211ReassociationRequestFrame *frame) = 0; 00104 virtual void handleReassociationResponseFrame(Ieee80211ReassociationResponseFrame *frame) = 0; 00105 virtual void handleDisassociationFrame(Ieee80211DisassociationFrame *frame) = 0; 00106 virtual void handleBeaconFrame(Ieee80211BeaconFrame *frame) = 0; 00107 virtual void handleProbeRequestFrame(Ieee80211ProbeRequestFrame *frame) = 0; 00108 virtual void handleProbeResponseFrame(Ieee80211ProbeResponseFrame *frame) = 0; 00110 }; 00111 00112 #endif 00113 00114