![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WiFiMac * 00003 * This file is part of openWNS (open Wireless Network Simulator) 00004 * _____________________________________________________________________________ 00005 * 00006 * Copyright (C) 2004-2007 00007 * Chair of Communication Networks (ComNets) 00008 * Kopernikusstr. 16, D-52074 Aachen, Germany 00009 * phone: ++49-241-80-27910, 00010 * fax: ++49-241-80-22242 00011 * email: info@openwns.org 00012 * www: http://www.openwns.org 00013 * _____________________________________________________________________________ 00014 * 00015 * openWNS is free software; you can redistribute it and/or modify it under the 00016 * terms of the GNU Lesser General Public License version 2 as published by the 00017 * Free Software Foundation; 00018 * 00019 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00020 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00021 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00022 * details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public License 00025 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00026 * 00027 ******************************************************************************/ 00028 00029 #ifndef WIFIMAC_PATHSELECTION_MESHFORWARDING_HPP 00030 #define WIFIMAC_PATHSELECTION_MESHFORWARDING_HPP 00031 00032 #include <WIFIMAC/Layer2.hpp> 00033 #include <WIFIMAC/pathselection/ForwardingCommand.hpp> 00034 #include <WIFIMAC/pathselection/IPathSelection.hpp> 00035 00036 #include <WNS/ldk/ManagementServiceInterface.hpp> 00037 #include <WNS/logger/Logger.hpp> 00038 00039 #include <WNS/ldk/Command.hpp> 00040 #include <WNS/ldk/fu/Plain.hpp> 00041 00042 #include <WNS/service/dll/Address.hpp> 00043 00044 #include <DLL/UpperConvergence.hpp> 00045 00046 00047 namespace wifimac { namespace pathselection { 00048 00052 class MeshForwarding : 00053 public wns::ldk::fu::Plain<MeshForwarding, ForwardingCommand> 00054 { 00055 public: 00056 00057 MeshForwarding(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00058 00059 virtual 00060 ~MeshForwarding(); 00061 00062 private: 00063 // FunctionalUnit / CompoundHandlerInterface 00064 virtual bool doIsAccepting(const wns::ldk::CompoundPtr& _compound) const; 00065 virtual void doSendData(const wns::ldk::CompoundPtr& _compound); 00066 virtual void doWakeup(); 00067 virtual void doOnData(const wns::ldk::CompoundPtr& _compound); 00068 virtual void doOnDataAP(const wns::ldk::CompoundPtr& compound, ForwardingCommand*& fc, dll::UpperCommand*& uc); 00069 virtual bool doOnDataFRS(const wns::ldk::CompoundPtr& compound, ForwardingCommand*& fc, dll::UpperCommand*& uc); 00070 00071 virtual void onFUNCreated(); 00072 00074 void printForwardingInformation(ForwardingCommand* fc, dll::UpperCommand* uc) const; 00075 00076 const wns::pyconfig::View config; 00077 wns::logger::Logger logger; 00078 00080 std::string ucName; 00081 00082 wifimac::Layer2* layer2; 00083 wifimac::pathselection::IPathSelection* ps; 00084 00086 const int dot11MeshTTL; 00087 00092 void sendFrameToOwnBSS(const wns::ldk::CompoundPtr& compound, 00093 ForwardingCommand*& fc, 00094 dll::UpperCommand*& uc, 00095 wns::service::dll::UnicastAddress src, 00096 wns::service::dll::UnicastAddress dst); 00097 00102 bool sendFrameToMP(const wns::ldk::CompoundPtr& compound, 00103 ForwardingCommand*& fc, 00104 dll::UpperCommand*& uc, 00105 wns::service::dll::UnicastAddress src, 00106 wns::service::dll::UnicastAddress mpDst); 00107 00108 00113 bool sendFrameToOtherBSS(const wns::ldk::CompoundPtr& compound, 00114 ForwardingCommand*& fc, 00115 dll::UpperCommand*& uc, 00116 wns::service::dll::UnicastAddress src, 00117 wns::service::dll::UnicastAddress meshSrc, 00118 wns::service::dll::UnicastAddress dst); 00119 00120 00125 wns::ldk::CompoundPtr 00126 createForwardingCopy(const wns::ldk::CompoundPtr& compound, 00127 ForwardingCommand* originalFC, 00128 ForwardingCommand*& copyFC, 00129 dll::UpperCommand*& copyUC); 00130 }; 00131 } // mac 00132 } // wifimac 00133 00134 #endif // WIFIMAC_PATHSELECTION_MESHFORWARDING_HPP
1.5.5