User Manual, Developers Guide and API Documentation

Resolver.hpp

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. 5, 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 IP_RESOLVER_HPP
00029 #define IP_RESOLVER_HPP
00030 
00031 #include <WNS/StaticFactory.hpp>
00032 #include <WNS/service/nl/Address.hpp>
00033 #include <WNS/PyConfigViewCreator.hpp>
00034 
00035 namespace ip { namespace resolver {
00036 
00037     class ResolverInterface
00038     {
00039     public:
00040       virtual
00041       ~ResolverInterface() {};
00042 
00043       virtual void
00044       resolve() = 0;
00045 
00046       virtual wns::service::nl::Address
00047       getAddress() = 0;
00048 
00049       virtual wns::service::nl::Address
00050       getSubnetMask() = 0;
00051     };
00052 
00053     typedef wns::PyConfigViewCreator<ResolverInterface, ResolverInterface> Creator;
00054 
00055     typedef wns::StaticFactory<resolver::Creator> Factory;
00056 
00062     class FixedAddressResolver:
00063         public ResolverInterface
00064     {
00065 
00066     public:
00067       FixedAddressResolver(const wns::pyconfig::View& _pyco);
00068 
00069       virtual void
00070       resolve();
00071 
00072       virtual wns::service::nl::Address
00073       getAddress();
00074 
00075       virtual wns::service::nl::Address
00076       getSubnetMask();
00077 
00078     private:
00079       wns::service::nl::Address address;
00080       wns::service::nl::Address subnetMask;
00081 
00082     };
00083 
00089     class VirtualDHCPResolver:
00090         public ResolverInterface
00091     {
00092 
00093     public:
00094       VirtualDHCPResolver(const wns::pyconfig::View& _pyco);
00095 
00096       virtual void
00097       resolve();
00098 
00099       virtual wns::service::nl::Address
00100       getAddress();
00101 
00102       virtual wns::service::nl::Address
00103       getSubnetMask();
00104 
00105     private:
00106       wns::service::nl::Address address;
00107       wns::service::nl::Address subnetMask;
00108 
00109       std::string zone;
00110     };
00111 
00112 }// resolver
00113 }// ip
00114 #endif // IP_RESOLVER_HPP

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