INET Framework for OMNeT++/OMNEST
Ieee80211MgmtAPSimplified.cc
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 
00019 #include "Ieee80211MgmtAPSimplified.h"
00020 #include "Ieee802Ctrl_m.h"
00021 #include "EtherFrame_m.h"
00022 
00023 Define_Module(Ieee80211MgmtAPSimplified);
00024 
00025 
00026 // FIXME add sequence number handling
00027 
00028 void Ieee80211MgmtAPSimplified::initialize(int stage)
00029 {
00030     Ieee80211MgmtAPBase::initialize(stage);
00031 }
00032 
00033 void Ieee80211MgmtAPSimplified::handleTimer(cMessage *msg)
00034 {
00035     ASSERT(false);
00036 }
00037 
00038 void Ieee80211MgmtAPSimplified::handleUpperMessage(cPacket *msg)
00039 {
00040     // convert Ethernet frames arriving from MACRelayUnit (i.e. from
00041     // the AP's other Ethernet or wireless interfaces)
00042     Ieee80211DataFrame *frame = convertFromEtherFrame(check_and_cast<EtherFrame *>(msg));
00043     sendOrEnqueue(frame);
00044 }
00045 
00046 void Ieee80211MgmtAPSimplified::handleCommand(int msgkind, cPolymorphic *ctrl)
00047 {
00048     error("handleCommand(): no commands supported");
00049 }
00050 
00051 void Ieee80211MgmtAPSimplified::receiveChangeNotification(int category, const cPolymorphic *details)
00052 {
00053     Enter_Method_Silent();
00054     printNotificationBanner(category, details);
00055 }
00056 
00057 void Ieee80211MgmtAPSimplified::handleDataFrame(Ieee80211DataFrame *frame)
00058 {
00059     // check toDS bit
00060     if (!frame->getToDS())
00061     {
00062         // looks like this is not for us - discard
00063         delete frame;
00064         return;
00065     }
00066 
00067     if (hasRelayUnit)
00068     {
00069         // LAN bridging: if we have a relayUnit, send up the frame to it.
00070         // We don't need to call distributeReceivedDataFrame() here, because
00071         // if the frame needs to be distributed onto the wireless LAN too,
00072         // then relayUnit will send a copy back to us.
00073         send(convertToEtherFrame(frame), "uppergateOut");
00074     }
00075     else
00076     {
00077         // send it out to the destination STA
00078         distributeReceivedDataFrame(frame);
00079     }
00080 }
00081 
00082 void Ieee80211MgmtAPSimplified::handleAuthenticationFrame(Ieee80211AuthenticationFrame *frame)
00083 {
00084     dropManagementFrame(frame);
00085 }
00086 
00087 void Ieee80211MgmtAPSimplified::handleDeauthenticationFrame(Ieee80211DeauthenticationFrame *frame)
00088 {
00089     dropManagementFrame(frame);
00090 }
00091 
00092 void Ieee80211MgmtAPSimplified::handleAssociationRequestFrame(Ieee80211AssociationRequestFrame *frame)
00093 {
00094     dropManagementFrame(frame);
00095 }
00096 
00097 void Ieee80211MgmtAPSimplified::handleAssociationResponseFrame(Ieee80211AssociationResponseFrame *frame)
00098 {
00099     dropManagementFrame(frame);
00100 }
00101 
00102 void Ieee80211MgmtAPSimplified::handleReassociationRequestFrame(Ieee80211ReassociationRequestFrame *frame)
00103 {
00104     dropManagementFrame(frame);
00105 }
00106 
00107 void Ieee80211MgmtAPSimplified::handleReassociationResponseFrame(Ieee80211ReassociationResponseFrame *frame)
00108 {
00109     dropManagementFrame(frame);
00110 }
00111 
00112 void Ieee80211MgmtAPSimplified::handleDisassociationFrame(Ieee80211DisassociationFrame *frame)
00113 {
00114     dropManagementFrame(frame);
00115 }
00116 
00117 void Ieee80211MgmtAPSimplified::handleBeaconFrame(Ieee80211BeaconFrame *frame)
00118 {
00119     dropManagementFrame(frame);
00120 }
00121 
00122 void Ieee80211MgmtAPSimplified::handleProbeRequestFrame(Ieee80211ProbeRequestFrame *frame)
00123 {
00124     dropManagementFrame(frame);
00125 }
00126 
00127 void Ieee80211MgmtAPSimplified::handleProbeResponseFrame(Ieee80211ProbeResponseFrame *frame)
00128 {
00129     dropManagementFrame(frame);
00130 }
00131 
00132