X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FEthernetPacket.hh;h=8603c856acfb9ddfcef7cbd46b4d348d0b08014a;hb=9a988902090d28007578e93bffd809f6bd913155;hp=ae4fdb280373ec284a99eb5898bad3436983ed3e;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Packets/EthernetPacket.hh b/Packets/EthernetPacket.hh index ae4fdb2..8603c85 100644 --- a/Packets/EthernetPacket.hh +++ b/Packets/EthernetPacket.hh @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund @@ -32,9 +32,9 @@ //#include "EthernetPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { - +namespace senf { + + template struct Parse_Ethernet : public ParserBase { @@ -46,24 +46,25 @@ namespace pkf { Parse_Ethernet(Iterator const & i) : ParserBase(i) {} static unsigned bytes() { return 14; } - + /////////////////////////////////////////////////////////////////////////// typedef Parse_Array < 6, Parse_UInt8<>, Iterator > Parse_MAC; typedef Parse_UInt16 < Iterator > Parse_Type; - + Parse_MAC destination() const { return Parse_MAC (this->i() ); } Parse_MAC source() const { return Parse_MAC (this->i() + Parse_MAC::size() ); } Parse_Type type() const { return Parse_Type (this->i() + 2*Parse_MAC::size() ); } }; struct EtherTypes { + // See http://www.iana.org/assignments/ethernet-numbers typedef boost::uint16_t key_t; }; class EthernetPacket - : public Packet, - public Parse_Ethernet, + : public Packet, + public Parse_Ethernet, public PacketRegistryMixin { using PacketRegistryMixin::registerInterpreter; @@ -97,9 +98,9 @@ namespace pkf { Parse_EthVLan(Iterator const & i) : ParserBase(i) {} static unsigned bytes() { return 4; } - + /////////////////////////////////////////////////////////////////////////// - + typedef Parse_UIntField < 0, 3, Iterator > Parse_Priority; typedef Parse_Flag < 3, Iterator > Parse_CFI; typedef Parse_UIntField < 4, 16, Iterator > Parse_VLanId; @@ -136,7 +137,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -148,5 +149,8 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" // End: