![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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 #ifndef TCP_THREEWAYHANDSHAKE_HPP 00029 #define TCP_THREEWAYHANDSHAKE_HPP 00030 00031 #include <TCP/HandshakeStrategyInterface.hpp> 00032 #include <TCP/TCPHeader.hpp> 00033 00034 #include <WNS/logger/Logger.hpp> 00035 00036 #include <WNS/service/nl/Service.hpp> 00037 00038 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00039 #include <WNS/ldk/HasConnector.hpp> 00040 #include <WNS/ldk/HasReceptor.hpp> 00041 #include <WNS/ldk/HasDeliverer.hpp> 00042 #include <WNS/ldk/FunctionalUnit.hpp> 00043 #include <WNS/ldk/Command.hpp> 00044 00045 00046 namespace tcp { 00047 00048 class Service; 00049 class UpperCommand; 00050 class FiniteStateMachine; 00051 class HandshakeStrategyHandlerInterface; 00052 00057 class ThreeWayHandshake : 00058 public virtual HandshakeStrategyInterface, 00059 public virtual wns::ldk::FunctionalUnit, 00060 public wns::ldk::CommandTypeSpecifier<>, 00061 public wns::ldk::HasReceptor<>, 00062 public wns::ldk::HasConnector<>, 00063 public wns::ldk::HasDeliverer<>, 00064 public wns::Cloneable<ThreeWayHandshake> 00065 { 00066 public: 00067 ThreeWayHandshake(wns::ldk::fun::FUN* _fun, const wns::pyconfig::View& _pyco); 00068 00072 virtual 00073 ~ThreeWayHandshake(); 00074 00075 00079 virtual bool 00080 doIsAccepting(const wns::ldk::CompoundPtr& _compound) const; 00081 00086 virtual void 00087 onFUNCreated(); 00088 00092 virtual void 00093 doOnData(const wns::ldk::CompoundPtr& _compound); 00094 00098 virtual void 00099 doSendData(const wns::ldk::CompoundPtr& _compound); 00100 00104 virtual void 00105 activeOpen(const wns::service::tl::FlowID& _flowID); 00106 00110 virtual void 00111 passiveOpen(const wns::service::tl::FlowID& _flowID); 00112 00116 virtual void 00117 closeConnection(const wns::service::tl::FlowID& _flowID); 00118 00122 virtual void 00123 registerStrategyHandler(HandshakeStrategyHandlerInterface* _strategyHandler); 00124 00129 void 00130 tcpFlagsToUpperCommand(wns::ldk::CompoundPtr& _compound); 00131 00132 private: 00133 bool 00134 doIsAccepting(const wns::ldk::CompoundPtr& _compound); 00135 00136 void 00137 doWakeup(); 00138 00142 wns::logger::Logger logger; 00143 00147 HandshakeStrategyHandlerInterface* strategyHandler; 00148 00152 wns::service::tl::FlowID flowID; 00153 00157 wns::pyconfig::View pyco; 00158 00162 FiniteStateMachine* fsm; 00163 00164 TCPHeader* tcpHeaderFU; 00165 00166 wns::ldk::CommandReaderInterface* tcpHeaderReader; 00167 }; 00168 } // namespace tcp 00169 00170 #endif // NOT defined TCP_THREEWAYHANDSHAKE_HPP
1.5.5