X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FRaw%2FEUI64.hh;h=aa70d01007d0bc785a9f631091a40f11259b4912;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=f1fc8446eaf3e2b4b8c470ee6c9d704ee024dd49;hpb=b8ca4a544cce3e6023bb56b712a03d6362f2bb79;p=senf.git diff --git a/Socket/Protocols/Raw/EUI64.hh b/Socket/Protocols/Raw/EUI64.hh index f1fc844..aa70d01 100644 --- a/Socket/Protocols/Raw/EUI64.hh +++ b/Socket/Protocols/Raw/EUI64.hh @@ -52,7 +52,7 @@ namespace senf { std::string senf::EUI64::from_string("1a:2b:3c:4d-5f:60:71:82")
senf::str(eui64) - raw data + raw data
    (8 bytes) senf::EUI64::from_data(iterator)
eui64.begin() senf::MACAddress
    (aka EUI-48) @@ -60,7 +60,16 @@ namespace senf { senf::MACAddress::from_eui64(eui64) - Additionally, a senf::MACAddress can be converted into an EUI64 and vice versa. + Since senf::EUI64 is based on \c boost::array, you can access the raw data bytes of the + address using \c begin(), \c end() or \c operator[]: + \code + senf::EUI64 eui64 (...); + std::vector data; + data.resize(8); + std::copy(eui64.begin(), eui64.end(), data.begin()); // Copy 8 bytes + \endcode + + \see RFC 4291 \ingroup addr_group */ @@ -86,7 +95,8 @@ namespace senf { static EUI64 from_string(std::string const & s); ///< Construct EUI-64 from string representation /**< The string representation consists of 8 octets in - hexadecimal notation spearated by ':' or '-' */ + hexadecimal notation spearated by ':' or '-' + \throws senf::AddressSyntaxException */ template static EUI64 from_data(InputIterator i); ///< Construct EUI-64 from 8 data octets @@ -99,6 +109,13 @@ namespace senf { bool isMACCompatible() const; ///< \c true, if EUI64 is MAC compatible, \c false otherwise /**< An EUI64 is MAC compatible if bytes 4th and 5th byte (in network byte order) are 0xfffe. */ + bool local() const; ///< \c true if the \e local bit is set, \c false otherwise + /**< The \e local bit is the second least significant bit of + the first octet (bit 6 in standard RFC bit numbering). + */ + bool group() const; ///< \c true if the \e group bit is set, \c false otherwise + /**< The \e group bit is the least significant bit of the + first octed (bit 7 in standard RFC bit numbering). */ bool boolean_test() const; ///< \c true, if EUI64 is != 0, \c false otherwise boost::uint64_t uint64() const; ///< Return EUI64 as integer number };