4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief EUI64 public header */
26 #ifndef HH_SENF_Socket_Protocols_Raw_EUI64_
27 #define HH_SENF_Socket_Protocols_Raw_EUI64_ 1
31 #include <boost/cstdint.hpp>
32 #include <boost/array.hpp>
33 #include "../../../Utils/Tags.hh"
34 #include "../../../Utils/safe_bool.hh"
36 //#include "EUI64.mpp"
37 ///////////////////////////////hh.p////////////////////////////////////////
43 /** \brief EUI-64 data type
45 An EUI-64 is a 64 bit (8 octet) id.
48 : public boost::array<boost::uint8_t,8>,
49 public senf::comparable_safe_bool<EUI64>
52 ///////////////////////////////////////////////////////////////////////////
53 ///\name Structors and default members
56 // default copy constructor
57 // default copy assignment
59 // no conversion constructors
61 explicit EUI64(boost::uint64_t v=0u);
62 explicit EUI64(senf::NoInit_t);
64 static EUI64 from_mac(MACAddress const & mac);
65 static EUI64 from_string(std::string const & s);
66 template <class InputIterator>
67 static EUI64 from_data(InputIterator i);
70 ///////////////////////////////////////////////////////////////////////////
72 bool isMACCompatible() const;
73 bool boolean_test() const;
74 boost::uint64_t uint64() const;
77 std::ostream & operator<<(std::ostream & os, EUI64 const & v);
78 std::istream & operator>>(std::istream & is, EUI64 & v);
82 ///////////////////////////////hh.e////////////////////////////////////////
93 // c-file-style: "senf"
94 // indent-tabs-mode: nil
95 // ispell-local-dictionary: "american"
96 // compile-command: "scons -u test"