![]() |
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 CONSTANZE_UDPBINDING_HPP 00029 #define CONSTANZE_UDPBINDING_HPP 00030 00031 #include <CONSTANZE/Binding.hpp> 00032 #include <CONSTANZE/Generator.hpp> 00033 00034 #include <WNS/service/nl/Address.hpp> 00035 #include <WNS/service/tl/Service.hpp> 00036 #include <WNS/service/tl/ConnectionHandler.hpp> 00037 #include <WNS/service/tl/DataHandler.hpp> 00038 #include <WNS/service/tl/PortPool.hpp> 00039 #include <WNS/service/tl/Connection.hpp> 00040 00041 #include <WNS/PyConfigViewCreator.hpp> 00042 #include <WNS/logger/Logger.hpp> 00043 #include <WNS/module/Base.hpp> 00044 00045 00046 namespace constanze 00047 { 00048 class UdpBinding: 00049 public Binding, 00050 public wns::service::tl::ConnectionHandler 00051 { 00052 public: 00053 UdpBinding(const wns::pyconfig::View& _pyco); 00054 virtual ~UdpBinding() {}; 00055 00056 00057 // from Binding 00058 virtual void 00059 registerComponent(wns::node::component::Component* _component); 00060 00061 virtual void 00062 sendData(const wns::osi::PDUPtr& _data); 00063 00064 virtual void 00065 initBinding(constanze::StartTrigger* _startTrigger); 00066 00067 virtual void 00068 releaseBinding(constanze::StopTrigger* _stopTrigger); 00069 00070 virtual void 00071 registerListener(constanze::Listener* _listener); 00072 00073 // from ConnectionHandler 00074 virtual void 00075 onConnectionEstablished(wns::service::nl::Address _sourceIpAddress, wns::service::tl::Connection* _newConnection); 00076 00077 virtual void 00078 onConnectionClosed(wns::service::tl::Connection* _connection); 00079 00080 virtual void 00081 onConnectionClosedByPeer(wns::service::tl::Connection* _connection); 00082 00083 virtual void 00084 onConnectionLost(wns::service::tl::Connection* _connection); 00085 00086 protected: 00087 constanze::StartTrigger* startTrigger; 00088 00089 constanze::StopTrigger* stopTrigger; 00090 00091 wns::service::tl::Service* udpService; 00092 00093 wns::service::tl::ConnectionHandler* connectionHandler; 00094 00095 wns::service::tl::Connection* connection; 00096 00097 wns::node::component::Component* component; 00098 00099 wns::pyconfig::View pyco; 00100 00101 wns::service::nl::FQDN domainName; 00102 00103 wns::service::nl::FQDN destinationDomainName; 00104 00105 wns::service::tl::Port destinationPort; 00106 00107 wns::service::qos::QoSClass qosClass; 00108 00109 virtual std::string printAddress() const; 00110 00114 wns::logger::Logger log; 00115 00116 }; 00117 } //constanze 00118 00119 #endif
1.5.5