ENUt
|
00001 /* 00002 00003 This file is a part of ENUt, a library containing network 00004 programming utilities. 00005 00006 Copyright (C) 2006-2008 Hasselt University - Expertise Centre for 00007 Digital Media (EDM) (http://www.edm.uhasselt.be) 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00022 USA 00023 00024 */ 00025 00030 #ifndef NUT_NETWORKLAYERADDRESS_H 00031 00032 #define NUT_NETWORKLAYERADDRESS_H 00033 00034 #include "nutconfig.h" 00035 #include <string> 00036 00038 namespace nut 00039 { 00040 00042 enum NetworkLayerProtocol 00043 { 00045 IPv4, 00046 00048 IPv6 00049 }; 00050 00052 class ENUT_IMPORTEXPORT NetworkLayerAddress 00053 { 00054 protected: 00055 NetworkLayerAddress(NetworkLayerProtocol p) { m_protocol = p; } 00056 public: 00057 virtual ~NetworkLayerAddress() { } 00058 00060 NetworkLayerProtocol getProtocol() const { return m_protocol; } 00061 00063 virtual NetworkLayerAddress *createCopy() const = 0; 00064 00066 virtual bool isSameAddress(const NetworkLayerAddress &address) const = 0; 00067 00069 virtual std::string getAddressString() const = 0; 00070 private: 00071 NetworkLayerProtocol m_protocol; 00072 }; 00073 00074 } 00075 00076 #endif // NUT_NETWORKLAYERADDRESS_H 00077