User Manual, Developers Guide and API Documentation

OneWayHandshake.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 <TCP/OneWayHandshake.hpp>
00029 #include <TCP/Service.hpp>
00030 #include <TCP/UpperConvergence.hpp>
00031 #include <TCP/Component.hpp>
00032 #include <TCP/HandshakeStrategyHandlerInterface.hpp>
00033 
00034 #include <WNS/module/Base.hpp>
00035 
00036 using namespace tcp;
00037 
00038 
00039 STATIC_FACTORY_REGISTER_WITH_CREATOR(
00040     OneWayHandshake,
00041     wns::ldk::FunctionalUnit,
00042     "udp.OneWayHandshake",
00043     wns::ldk::FUNConfigCreator
00044     );
00045 
00046 OneWayHandshake::OneWayHandshake(wns::ldk::fun::FUN* _fun, const wns::pyconfig::View& _config) :
00047     wns::ldk::CommandTypeSpecifier<>(_fun),
00048     wns::ldk::HasReceptor<>(),
00049     wns::ldk::HasConnector<>(),
00050     wns::ldk::HasDeliverer<>(),
00051     wns::Cloneable<OneWayHandshake>(),
00052     logger(_config.get("logger")),
00053     strategyHandler(NULL),
00054     config(_config),
00055     fun(_fun)
00056 {
00057     MESSAGE_SINGLE(NORMAL, logger, "FU for 1-way-handshake created!");
00058 }
00059 
00060 OneWayHandshake::~OneWayHandshake()
00061 {
00062 }
00063 
00064 void
00065 OneWayHandshake::onFUNCreated()
00066 {
00067 }
00068 
00069 void
00070 OneWayHandshake::doOnData(const wns::ldk::CompoundPtr&)
00071 {
00072 }
00073 
00074 void
00075 OneWayHandshake::doSendData(const wns::ldk::CompoundPtr&)
00076 {
00077 }
00078 
00079 bool
00080 OneWayHandshake::doIsAccepting(const wns::ldk::CompoundPtr&)
00081 {
00082     return true;
00083 }
00084 
00085 void
00086 OneWayHandshake::doWakeup()
00087 {
00088 }
00089 
00090 bool
00091 OneWayHandshake::doIsAccepting(const wns::ldk::CompoundPtr&) const
00092 {
00093     return true;
00094 }
00095 
00096 void
00097 OneWayHandshake::activeOpen(const wns::service::tl::FlowID& _flowID)
00098 {
00099     MESSAGE_SINGLE(NORMAL, logger, "OneWayHandshake::activeOpen() called for flowID " << _flowID);
00100 
00101     strategyHandler->connectionEstablished(_flowID);
00102 }
00103 
00104 void
00105 OneWayHandshake::passiveOpen(const wns::service::tl::FlowID& _flowID)
00106 {
00107     MESSAGE_SINGLE(NORMAL, logger, "OneWayHandshake::passiveOpen() called for flowID " << _flowID);
00108 
00109     strategyHandler->connectionEstablished(_flowID);
00110 }
00111 
00112 void
00113 OneWayHandshake::registerStrategyHandler(HandshakeStrategyHandlerInterface* _strategyHandler)
00114 {
00115     strategyHandler = _strategyHandler;
00116 }
00117 
00118 void
00119 OneWayHandshake::closeConnection(const wns::service::tl::FlowID& _flowID)
00120 {
00121     strategyHandler->connectionClosed(_flowID);
00122 }

Generated on Fri May 25 03:32:20 2012 for openWNS by  doxygen 1.5.5