X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FSocket%2FProtocols%2FINet%2FINet6Address.hh;h=cf43b8deb95a22311c5d9bf6adaec9d6ea30bd64;hb=51b24c3227717ce5ad8111a99c2d7eea5fa0bd8d;hp=f5f700ae2dc25d71ef48e09729a32de9fae5c085;hpb=9cb871b939efe93e35dd96808d25089399acfc46;p=senf.git diff --git a/senf/Socket/Protocols/INet/INet6Address.hh b/senf/Socket/Protocols/INet/INet6Address.hh index f5f700a..cf43b8d 100644 --- a/senf/Socket/Protocols/INet/INet6Address.hh +++ b/senf/Socket/Protocols/INet/INet6Address.hh @@ -2,23 +2,28 @@ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund // -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// http://senf.berlios.de/license.html // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// All Rights Reserved. +// +// Contributor(s): +// Stefan Bund /** \file \brief INet6Address public header */ @@ -36,15 +41,15 @@ #include #include #include "INet4Address.hh" -#include -#include //#include "INet6Address.mpp" #include "INet6Address.ih" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { + class EUI64; + class MACAddress; class INet6Network; /** \brief INet6 network address @@ -86,7 +91,7 @@ namespace senf { ff00::/8 Multicast RFC4291 ff00::/12 Globally allocated multicast RFC4291 ff10::/12 Locally allocated multicast RFC4291 - ff30::/12 Unicast prefic based multicast RFC3306 + ff30::/12 Unicast prefix based multicast RFC3306 ff70::/12 Multicast address with embedded RP RFC3956 \endhtmlonly @@ -131,7 +136,7 @@ namespace senf { public comparable_safe_bool { public: - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// // Types static INet6Address const None; ///< The empty (::0) address @@ -160,9 +165,9 @@ namespace senf { , UnassignedScope = 6 /**< Unassigned scope, may be defined locally */ }; - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// ///\name Structors and default members - ///@{ + //\{ explicit INet6Address(senf::NoInit_t); ///< Construct uninitialized (!) address explicit INet6Address(boost::uint16_t a0=0u, boost::uint16_t a1=0u, boost::uint16_t a2=0u, @@ -176,12 +181,14 @@ namespace senf { ///< Convert string to address /**< This member will try to convert the given string into an IP address. from_string() supports all standard IP - literal representations as well es hostnames. + literal representations as well as hostnames. \attention This call may block if \a s represents a hostname which must be looked up via some network protocol like DNS or NIS \throws AddressSyntaxException if the address cannot be converted for some reason + \throws UnknownHostnameException if the hostname cannot + be resolved \param[in] s Address literal or hostname \param[in] resolve If this is set to \c ResolveINet4, the call will additionally try to interpret \a s as @@ -206,22 +213,22 @@ namespace senf { \par INet4 compatible INet6 addresses are not directly supported, they are deprecated in the RFC. */ - static INet6Address from_mac(senf::MACAddress const & mac); + static INet6Address from_mac(MACAddress const & mac); ///< Construct a link-local INet6 address /**< This will construct a link local address of the form fe80::xxxx:xxff:fexx:xxxx. */ - static INet6Address from_eui64(senf::EUI64 const & eui); + static INet6Address from_eui64(EUI64 const & eui); ///< Construct link-local INet6 address /**< This will construct a link local address of the form fe80::xxxx:xxxx:xxxx:xxxx. */ - in6_addr toin6_addr() const; ///< get the linux in6_addr struct (convinience only) + in6_addr toin6_addr() const; ///< get the linux in6_addr struct (convenience only) - ///@} - /////////////////////////////////////////////////////////////////////////// + //\} + //-//////////////////////////////////////////////////////////////////////// ///\name Accessors - ///@{ + //\{ INet6Network network() const; ///< Return /64 Network of this address bool hasEUI64() const; ///< \c true, if address is based on an EUID-64 @@ -277,14 +284,14 @@ namespace senf { bool boolean_test() const; ///< \c true, if address != '::' (None) - ///@} + //\} ///\name Mutators - ///@{ + //\{ void network(boost::uint64_t net); ///< Set network part of address void id(boost::uint64_t id); ///< Set interface id part of address - ///@} + //\} }; @@ -292,7 +299,9 @@ namespace senf { \related INet6Address */ std::ostream & operator<<(std::ostream & os, INet6Address const & addr); + /** \brief Try to initialize INet6Address instance from a string representation + sets std::ios::failbit on the stream if an error occurred \see INet6Address from_string() \related INet6Address @@ -343,17 +352,17 @@ namespace senf { public comparable_safe_bool { public: - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// ///\name Structors and default members - ///@{ + //\{ INet6Network(); ///< Construct empty (::/0) network INet6Network(INet6Address const & address, unsigned prefix_len); ///< Construct network from given address and prefix length explicit INet6Network(std::string const & s); ///< Construct network from CIDR notation - ///@} - /////////////////////////////////////////////////////////////////////////// + //\} + //-//////////////////////////////////////////////////////////////////////// INet6Address const & address() const; ///< Get the network address unsigned prefix_len() const; ///< Get the network prefix length @@ -394,15 +403,22 @@ namespace senf { \related INet6Network */ std::ostream & operator<<(std::ostream & os, INet6Network const & addr); + + /** \brief Try to initialize INet6Network instance from a string representation + + sets std::ios::failbit on the stream if an error occurred + \related INet6Network + */ + std::istream & operator>>(std::istream & is, INet6Network & addr); } -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #include "INet6Address.cci" #include "INet6Address.ct" #include "INet6Address.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100