User Manual, Developers Guide and API Documentation

UE.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #include <LTE/rlc/UE.hpp>
00029 #include <LTE/controlplane/flowmanagement/IFlowManager.hpp>
00030 
00031 #include <DLL/Layer2.hpp>
00032 
00033 using namespace lte::rlc;
00034 using namespace wns::ldk;
00035 
00036 STATIC_FACTORY_REGISTER_WITH_CREATOR(UERLC, FunctionalUnit, "lte.rlc.UE", FUNConfigCreator);
00037 
00038 UERLC::UERLC(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config) :
00039   wns::ldk::CommandTypeSpecifier<RLCCommand>(fun),
00040   wns::ldk::Processor<UERLC>(),
00041   destination(),
00042   logger(config.get("logger"))
00043 {
00044     friends.flowswitching = NULL;
00045     upperConvergenceReader = NULL;
00046 }
00047 
00048 void
00049 UERLC::onFUNCreated()
00050 {
00051     upperConvergenceReader = getFUN()->getCommandReader("upperConvergence");
00052 
00053     wns::ldk::ControlServiceInterface* csi = getFUN()->getLayer<dll::ILayer2*>()->getControlService<wns::ldk::ControlServiceInterface>("FlowManagerUT");
00054     friends.flowswitching = dynamic_cast<lte::controlplane::flowmanagement::IFlowSwitching*>(csi);
00055     assureNotNull(friends.flowswitching);
00056 
00057     MESSAGE_SINGLE(VERBOSE, logger, "onFUNCreated(): complete");
00058 }
00059 
00060 UERLC::~UERLC()
00061 {
00062 }
00063 
00064 void
00065 UERLC::processOutgoing(const CompoundPtr& compound)
00066 {
00067     assure(upperConvergenceReader, "No reader for upper convergence set!");
00068     dll::UpperCommand* upper = upperConvergenceReader->readCommand<dll::UpperCommand>(compound->getCommandPool());
00069     assure(upper, "Erroneous Upper Convergence Command!");
00070 
00071     RLCCommand* command = activateCommand(compound->getCommandPool());
00072     assure(command, "No RLC-Command set!");
00073 
00074     command->local.direction = PacketDirection::UPLINK();
00075     command->peer.source = getFUN()->getLayer<dll::ILayer2*>()->getDLLAddress();
00076     command->peer.destination = destination;
00077 
00078     command->peer.flowID = upper->local.dllFlowID;
00079     command->rang.flowID = 0;
00080 
00081     wns::service::qos::QoSClass qosClass = friends.flowswitching->getQoSClassForUTFlowID(upper->local.dllFlowID);
00082     command->peer.qosClass = qosClass;
00083 
00084     MESSAGE_SINGLE(NORMAL, logger, "processOutgoing(): FlowID="<<command->peer.flowID<<",QoS="<<lte::helper::QoSClasses::toString(qosClass)<<". Sending to eNB: "<< destination);
00085 
00086 } // processOutgoing
00087 
00088 void
00089 UERLC::processIncoming(const CompoundPtr& compound)
00090 {
00091 }
00092 
00093 CommandPool*
00094 UERLC::createReply(const CommandPool* original) const
00095 {
00096     MESSAGE_BEGIN(NORMAL, logger, m, "createReply");
00097     MESSAGE_END();
00098 
00099     CommandPool* commandPool = getFUN()->createCommandPool();
00100     RLCCommand* inRLCCommand = getCommand(original);
00101     RLCCommand* outRLCCommand = activateCommand(commandPool);
00102 
00103     outRLCCommand->local.direction = PacketDirection::UPLINK();
00104     outRLCCommand->peer.source = inRLCCommand->peer.destination;
00105     outRLCCommand->peer.destination = inRLCCommand->peer.source;
00106     outRLCCommand->peer.flowID = inRLCCommand->peer.flowID;
00107     outRLCCommand->rang.flowID = 0; // ControlPlaneFlowID
00108 
00109     MESSAGE_SINGLE(NORMAL, logger, " inRLCCommand FlowID: "<<inRLCCommand->peer.flowID);
00110 
00111     return commandPool;
00112 } // createReply
00113 
00114 void
00115 UERLC::setDestination(wns::service::dll::UnicastAddress dst)
00116 {
00117     destination = dst;
00118 }
00119 
00120 wns::service::dll::UnicastAddress
00121 UERLC::getDestination()
00122 {
00123     return destination;
00124 }

Generated on Sun May 27 03:32:05 2012 for openWNS by  doxygen 1.5.5