X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FDefaultBundle%2FEthernetPacket.cc;h=04a87af9f35c29caf94211975bdd75eba94ba120;hb=6c0332484574ed1cb571bbc0dc9f0a37d6653282;hp=b3ba75b5a3127dc715c587003cd424d21d14ae45;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Packets/DefaultBundle/EthernetPacket.cc b/senf/Packets/DefaultBundle/EthernetPacket.cc index b3ba75b..04a87af 100644 --- a/senf/Packets/DefaultBundle/EthernetPacket.cc +++ b/senf/Packets/DefaultBundle/EthernetPacket.cc @@ -30,13 +30,13 @@ #include "LlcSnapPacket.hh" #include #include +#include #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - senf::PacketRegistry::RegistrationProxy - registerEthVLanPacket(0x8100); + SENF_PACKET_REGISTRY_REGISTER( senf::EtherTypes, 0x8100, senf::EthVLanPacket); } /////////////////////////////////////////////////////////////////////////// @@ -52,10 +52,9 @@ prefix_ void senf::EthernetPacketType::dump(packet p, std::ostream & os) else os << "Ethernet 802.3 (bad ethertype >1500 and <1536)"; os << ": \n" - << " destination : " << p->destination() << "\n" - << " source : " << p->source() << "\n" - << " type/length : 0x" - << std::hex << std::setw(4) << std::setfill('0') << p->type_length() << "\n"; + << senf::fieldName("destination") << p->destination() << "\n" + << senf::fieldName("source") << p->source() << "\n" + << senf::fieldName("type/length") << senf::format::dumpint(p->type_length().value()) << "\n"; } prefix_ senf::PacketInterpreterBase::factory_t senf::EthernetPacketType::nextPacketType(packet p) @@ -81,12 +80,12 @@ prefix_ void senf::EthernetPacketType::finalize(packet p) prefix_ void senf::EthVLanPacketType::dump(packet p, std::ostream & os) { boost::io::ios_all_saver ias(os); - os << "Ethernet 802.1q (VLAN):\n" - << " priority : " << p->priority() << "\n" - << " cfi : " << p->cfi() << "\n" - << " vlan-ID : " << p->vlanId() << "\n" - << " ethertype : 0x" - << std::hex << std::setw(4) << std::setfill('0') << p->type() << "\n"; + os << "Ethernet 802.1q (VLAN):\n" + << senf::fieldName("priority") << p->priority() << "\n" + << senf::fieldName("cfi") << p->cfi() << "\n" + << senf::fieldName("vlan-ID") << p->vlanId() << "\n" + << senf::fieldName("ethertype") + << " 0x" << std::hex << std::setw(4) << std::setfill('0') << p->type() << "\n"; } prefix_ void senf::EthVLanPacketType::finalize(packet p)