INET Framework for OMNeT++/OMNEST
Ieee80211AgentSTA.h
Go to the documentation of this file.
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_AGENT_STA_H
00019 #define IEEE80211_AGENT_STA_H
00020 
00021 #include <vector>
00022 #include <omnetpp.h>
00023 #include "Ieee80211Primitives_m.h"
00024 #include "NotificationBoard.h"
00025 
00026 
00036 class INET_API Ieee80211AgentSTA : public cSimpleModule, public INotifiable
00037 {
00038   protected:
00039     bool activeScan;
00040     std::vector<int> channelsToScan;
00041     simtime_t probeDelay;
00042     simtime_t minChannelTime;
00043     simtime_t maxChannelTime;
00044     simtime_t authenticationTimeout;
00045     simtime_t associationTimeout;
00046 
00047   protected:
00048     virtual int numInitStages() const {return 2;}
00049     virtual void initialize(int);
00050 
00052     virtual void handleMessage(cMessage *msg);
00053 
00055     virtual void handleTimer(cMessage *msg);
00056 
00058     virtual void handleResponse(cMessage *msg);
00059 
00061     virtual void receiveChangeNotification(int category, const cPolymorphic *details);
00062 
00063     // utility method: attaches object to a message as controlInfo, and sends it to mgmt
00064     virtual void sendRequest(Ieee80211PrimRequest *req);
00065 
00068     virtual void sendScanRequest();
00069     virtual void sendAuthenticateRequest(const MACAddress& address);
00070     virtual void sendDeauthenticateRequest(const MACAddress& address, int reasonCode);
00071     virtual void sendAssociateRequest(const MACAddress& address);
00072     virtual void sendReassociateRequest(const MACAddress& address);
00073     virtual void sendDisassociateRequest(const MACAddress& address, int reasonCode);
00075 
00078     virtual void processScanConfirm(Ieee80211Prim_ScanConfirm *resp);
00079     virtual void processAuthenticateConfirm(Ieee80211Prim_AuthenticateConfirm *resp);
00080     virtual void processAssociateConfirm(Ieee80211Prim_AssociateConfirm *resp);
00081     virtual void processReassociateConfirm(Ieee80211Prim_ReassociateConfirm *resp);
00083 
00085     virtual int chooseBSS(Ieee80211Prim_ScanConfirm *resp);
00086 
00087     // utility method, for debugging
00088     virtual void dumpAPList(Ieee80211Prim_ScanConfirm *resp);
00089 };
00090 
00091 #endif
00092 
00093