X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FSocket%2FProtocols%2FINet%2FINet6Address.hh;h=54ea4a12f9b1fb1e98a855fbf69a93b8e53e6279;hb=d0c31526ac12869eed085891e3ae13e8b21072e6;hp=131a46fbd0f4da918d3f41964755ab505fbe60b4;hpb=3fe2ed38b800bcb57afff676698462e763724245;p=senf.git diff --git a/senf/Socket/Protocols/INet/INet6Address.hh b/senf/Socket/Protocols/INet/INet6Address.hh index 131a46f..54ea4a1 100644 --- a/senf/Socket/Protocols/INet/INet6Address.hh +++ b/senf/Socket/Protocols/INet/INet6Address.hh @@ -36,16 +36,15 @@ #include #include #include "INet4Address.hh" -#include -#include -#include //#include "INet6Address.mpp" #include "INet6Address.ih" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { + class EUI64; + class MACAddress; class INet6Network; /** \brief INet6 network address @@ -87,7 +86,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 @@ -132,7 +131,7 @@ namespace senf { public comparable_safe_bool { public: - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// // Types static INet6Address const None; ///< The empty (::0) address @@ -161,9 +160,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, @@ -177,12 +176,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 @@ -207,22 +208,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 @@ -278,14 +279,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 - ///@} + //\} }; @@ -293,7 +294,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 @@ -344,17 +347,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 @@ -395,15 +398,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