#include <boost/cstdint.hpp>
#include <boost/array.hpp>
#include <boost/operators.hpp>
-#include "../../../Utils/safe_bool.hh"
-#include "../../../Utils/Tags.hh"
+#include <senf/Utils/safe_bool.hh>
+#include <senf/Utils/Tags.hh>
#include "INet4Address.hh"
-#include "../AddressExceptions.hh"
-#include "../Raw/MACAddress.hh"
-#include "../Raw/EUI64.hh"
//#include "INet6Address.mpp"
#include "INet6Address.ih"
-///////////////////////////////hh.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
namespace senf {
+ class EUI64;
+ class MACAddress;
class INet6Network;
/** \brief INet6 network address
<tr><td><tt>ff00::/8</tt></td> <td>Multicast</td> <td>RFC4291</td> <td></td></tr>
<tr><td><tt>ff00::/12</tt></td> <td>Globally allocated multicast</td> <td>RFC4291</td> <td></td></tr>
<tr><td><tt>ff10::/12</tt></td> <td>Locally allocated multicast</td> <td>RFC4291</td> <td></td></tr>
- <tr><td><tt>ff30::/12</tt></td> <td>Unicast prefic based multicast</td> <td>RFC3306</td> <td></td></tr>
+ <tr><td><tt>ff30::/12</tt></td> <td>Unicast prefix based multicast</td> <td>RFC3306</td> <td></td></tr>
<tr><td><tt>ff70::/12</tt></td> <td>Multicast address with embedded RP</td> <td>RFC3956</td> <td></td></tr>
</table>
\endhtmlonly
public comparable_safe_bool<INet6Address>
{
public:
- ///////////////////////////////////////////////////////////////////////////
+ //-////////////////////////////////////////////////////////////////////////
// Types
static INet6Address const None; ///< The empty (::0) address
, 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,
///< 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
\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
<tt>fe80::xxxx:xxff:fexx:xxxx</tt>. */
- 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
<tt>fe80::xxxx:xxxx:xxxx:xxxx</tt>. */
-
- 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 <tt>/64</tt> Network of this address
bool hasEUI64() const; ///< \c true, if address is based on an EUID-64
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
- ///@}
+ //\}
};
\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
public comparable_safe_bool<INet6Network>
{
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
\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"