X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FEthernetPacket.hh;h=9615565a2a6e228aa8a816d1dbb4cc777973181b;hb=aa8de2975f5365cd4f29f6f337f93ad328f6685c;hp=ebb07ae5a8d03762078a41f12c18bc24cee91fc0;hpb=a4e052fb8832499ef5e3ae4e563ea01b834010c2;p=senf.git diff --git a/Packets/DefaultBundle/EthernetPacket.hh b/Packets/DefaultBundle/EthernetPacket.hh index ebb07ae..9615565 100644 --- a/Packets/DefaultBundle/EthernetPacket.hh +++ b/Packets/DefaultBundle/EthernetPacket.hh @@ -20,12 +20,15 @@ // 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 -#include +#include "Socket/Protocols/Raw/MACAddress.hh" #include "Packets/Packets.hh" //#include "EthernetPacket.mpp" @@ -33,23 +36,6 @@ 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 - { - MACAddress(std::string addr); - template - 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 @@ -66,7 +52,7 @@ namespace senf { 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); } @@ -106,8 +92,8 @@ namespace senf { This registry registers packet types with their EtherType number. - \see Ethernet numbers - \ref PacketRegistry + \see Ethernet numbers \n + \ref PacketRegistry */ struct EtherTypes { // See @@ -227,7 +213,7 @@ namespace senf { #endif #ifndef SENF_PACKETS_DECL_ONLY //#include "EthernetPacket.cci" -#include "EthernetPacket.ct" +//#include "EthernetPacket.ct" //#include "EthernetPacket.cti" #endif