// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+/** \file
+ \brief EthernetPacket public header */
+
#ifndef HH_EthernetPacket_
#define HH_EthernetPacket_ 1
// Custom includes
#include <algorithm>
-#include <boost/array.hpp>
-#include "Packets/Packets.hh"
+#include "../../Socket/Protocols/Raw/MACAddress.hh"
+#include "../../Packets/Packets.hh"
//#include "EthernetPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
- /** \brief Ethernet MAC address
-
- The Ethernet MAC is modelled as a fixed-size container/sequence of 6 bytes.
-
- \todo Move to someplace else when implementing the addressing classes
- */
- struct MACAddress
- : boost::array<PacketParserBase::byte,6>
- {
- MACAddress(std::string addr);
- template <class InputIterator>
- MACAddress(InputIterator i);
-
- struct SyntaxException : public std::exception
- { virtual char const * what() const throw() { return "invalid mac address syntax"; } };
- };
-
/** \brief Parse an Ethernet MAC address
The ethernet MAC is returned by value as a 6-byte sequence
typedef MACAddress value_type;
static const size_type fixed_bytes = 6u;
- value_type value() const { return MACAddress(i()); }
+ value_type value() const { return MACAddress::from_data(i()); }
void value(value_type const & v) { std::copy(v.begin(), v.end(), i()); }
operator value_type () { return value(); }
byte & operator[](size_type index) { return *boost::next(i(),index); }
#endif
#ifndef SENF_PACKETS_DECL_ONLY
//#include "EthernetPacket.cci"
-#include "EthernetPacket.ct"
+//#include "EthernetPacket.ct"
//#include "EthernetPacket.cti"
#endif