Packets: added svn:ignore properties
tho [Mon, 28 Sep 2009 09:39:01 +0000 (09:39 +0000)]
Packets: replaced tabs with spaces
Packets: other minor things

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1450 270642c3-0616-0410-b53a-bc976706d245

senf/Packets/80211Bundle/RadiotapPacket.cc
senf/Packets/80211Bundle/RadiotapPacket.hh
senf/Packets/DefaultBundle/ICMPv6TypePacket.cc
senf/Packets/DefaultBundle/IPv6ExtOptionType.cc
senf/Packets/DefaultBundle/IPv6Extensions.test.cc
senf/Packets/DefaultBundle/ListOptionTypeParser.cti
senf/Packets/DefaultBundle/RTPPacket.cc
senf/Packets/DefaultBundle/TCPPacket.cc
senf/Packets/DefaultBundle/TCPPacket.hh
senf/Packets/DefaultBundle/TCPPacket.test.cc
senf/Packets/MPEGDVBBundle/SNDUPacket.cc

index b27bd13..4699d90 100644 (file)
 #include <boost/io/ios_state.hpp>
 
 #define prefix_
+///////////////////////////////cc.p//////////////////////////////////////
 
+namespace {
+    #define DUMP_OPTIONAL_FIELD(name, sign, desc)           \
+        if (p->has_##name())                                \
+            os << senf::fieldName(desc) << sign( p->name()) \
+               << std::endl;
+}
 
 prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream &os)
 {
     boost::io::ios_all_saver ias(os);
     os << "Radiotap:\n"
-       << senf::fieldName("version")                  << unsigned( p->version()) << "\n"
-       << senf::fieldName("length")                   << unsigned( p->length()) << "\n";
-    if (p->has_tsft())
-        os << senf::fieldName("MAC timestamp")                << unsigned( p->tsft()) << "\n";
-    // TODO: flags
-    if (p->has_rate())
-        os << senf::fieldName("rate")                 << unsigned( p->rate()) << "\n";
-    // TODO: channelOptions
-    if (p->has_fhss())
-       os << senf::fieldName("FHSS")                  << unsigned( p->fhss()) << "\n";
-    if (p->has_dbmAntennaSignal())
-        os << senf::fieldName("antenna signal (dBm)")  << signed( p->dbmAntennaSignal()) << "\n";
-    if (p->has_dbmAntennaNoise())
-        os << senf::fieldName("antenna noise (dBm)")   << signed( p->dbmAntennaNoise()) << "\n";
-    if (p->has_lockQuality())
-        os << senf::fieldName("lock quality")         << unsigned( p->lockQuality()) << "\n";
-    if (p->has_txAttenuation())
-        os << senf::fieldName("tx attenuation")        << unsigned( p->txAttenuation()) << "\n";
-    if (p->has_dbTxAttenuation())
-        os << senf::fieldName("tx attenuation (dB)")   << unsigned( p->dbTxAttenuation()) << "\n";
-    if (p->has_dbmTxAttenuation())
-        os << senf::fieldName("tx attenuation (dBm)")  << signed( p->dbmTxAttenuation()) << "\n";
-    if (p->has_antenna())
-        os << senf::fieldName("antenna")              << unsigned( p->antenna()) << "\n";
-    if (p->has_dbAntennaSignal())
-        os << senf::fieldName("antenna signal (dB)")   << unsigned( p->dbAntennaSignal()) << "\n";
-    if (p->has_dbAntennaNoise())
-        os << senf::fieldName("antenna noise (dB)")    << unsigned( p->dbAntennaNoise()) << "\n";
+       << senf::fieldName("version") << unsigned( p->version()) << "\n"
+       << senf::fieldName("length")  << unsigned( p->length()) << "\n";
+    // TODO: flags, channelOptions
+    DUMP_OPTIONAL_FIELD( tsft,              unsigned, "MAC timestamp"        );
+    DUMP_OPTIONAL_FIELD( rate,              unsigned, "rate"                 );
+    DUMP_OPTIONAL_FIELD( fhss,              unsigned, "FHSS"                 );
+    DUMP_OPTIONAL_FIELD( dbmAntennaSignal,  signed,   "antenna signal (dBm)" );
+    DUMP_OPTIONAL_FIELD( dbmAntennaNoise,   signed,   "antenna noise (dBm)"  );
+    DUMP_OPTIONAL_FIELD( lockQuality,       unsigned, "lock quality"         );    
+    DUMP_OPTIONAL_FIELD( txAttenuation,     unsigned, "tx attenuation"       );
+    DUMP_OPTIONAL_FIELD( dbTxAttenuation,   unsigned, "tx attenuation (dB)"  );
+    DUMP_OPTIONAL_FIELD( dbmTxAttenuation,  signed,   "tx attenuation (dBm)" );
+    DUMP_OPTIONAL_FIELD( antenna,           unsigned, "antenna"              );
+    DUMP_OPTIONAL_FIELD( dbAntennaSignal,   unsigned, "antenna signal (dB)"  );
+    DUMP_OPTIONAL_FIELD( dbAntennaNoise,    unsigned, "antenna noise (dB)"   );
     if (p->has_headerFcs())
-        os << senf::fieldName("FCS")                  << unsigned( p->fcs()) << "\n";
+        os << senf::fieldName("FCS")     << unsigned( p->fcs()) << "\n";
 }
 
 prefix_ void senf::RadiotapPacketType::finalize(packet p)
@@ -91,4 +85,16 @@ senf::RadiotapPacketType::nextPacketRange(packet p)
         : optional_range( range(p.data().begin() + h, p.data().end() - t) );
 }
 
+///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
+
+\f
+// Local Variables:
+// mode: c++
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
+// End:
index a9dc79b..5987c0e 100644 (file)
@@ -197,7 +197,6 @@ namespace senf
         SENF_PARSER_SKIP_BITS( 4 );
         SENF_PARSER_BITFIELD_RO ( frameType, 2, unsigned );
         SENF_PARSER_SKIP_BITS( 2 );
-            
     };
 
     /** \brief Radiotap packet
index e75612e..c7f18c0 100644 (file)
 #include "ICMPv6TypePacket.hh"
 
 #define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
+
 namespace {
-//Implementing the ICMPv6 Type registry
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6ErrDestUnreachable>
-        registerICMPv6ErrDestUnreachable (1);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6ErrTooBig>
-        registerICMPv6ErrTooBig (2);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6ErrTimeExceeded>
-        registerICMPv6ErrTimeExceeded (3);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6ErrParamProblem>
-        registerICMPv6ErrParamProblem (4);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6EchoRequest>
-        registerICMPv6EchoRequest (128);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::ICMPv6EchoReply>
-        registerICMPv6EchoReply (129);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::MLDv2ListenerQuery>
-        registerMLDv2ListenerQuery (130);
-    senf::PacketRegistry<senf::ICMPTypes>::RegistrationProxy<senf::MLDv2ListenerReport>
-        registerMLDv2ListenerReport (143);
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 1,   senf::ICMPv6ErrDestUnreachable );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 2,   senf::ICMPv6ErrTooBig          );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 3,   senf::ICMPv6ErrTimeExceeded    );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 4,   senf::ICMPv6ErrParamProblem    );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 128, senf::ICMPv6EchoRequest        );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 129, senf::ICMPv6EchoReply          );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 130, senf::MLDv2ListenerQuery       );
+    SENF_PACKET_REGISTRY_REGISTER( senf::ICMPTypes, 143, senf::MLDv2ListenerReport      );
 }
 
 prefix_ void senf::ICMPv6EchoRequestType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Echo Request:\n"
-       << senf::fieldName("Identifier")               << unsigned(p->identifier()) << "\n"
-       << senf::fieldName("SequenceNumber")           << unsigned(p->seqNr() ) << "\n";
+       << senf::fieldName("Identifier")         << unsigned(p->identifier()) << "\n"
+       << senf::fieldName("SequenceNumber")     << unsigned(p->seqNr() ) << "\n";
 }
 
 prefix_ void senf::ICMPv6EchoReplyType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Echo Reply:\n"
-       << senf::fieldName("Identifier")               << unsigned(p->identifier()) << "\n"
-       << senf::fieldName("SequenceNumber")           << unsigned(p->seqNr()) << "\n";
+       << senf::fieldName("Identifier")         << unsigned(p->identifier()) << "\n"
+       << senf::fieldName("SequenceNumber")     << unsigned(p->seqNr()) << "\n";
 }
 
 prefix_ void senf::ICMPv6ErrDestUnreachableType::dump(packet p, std::ostream & os)
@@ -70,28 +63,28 @@ prefix_ void senf::ICMPv6ErrDestUnreachableType::dump(packet p, std::ostream & o
 prefix_ void senf::ICMPv6ErrTooBigType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Error Packet Too Big:\n"
-       << senf::fieldName("MTU")                      << unsigned(p->mtu() ) << "\n";    
+       << senf::fieldName("MTU")            << unsigned(p->mtu() ) << "\n";    
 }
 
 prefix_ void senf::ICMPv6ErrTimeExceededType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Error Time Exceeded:\n"
-       << senf::fieldName("Unused(32Bit)")            << unsigned(p->unused() ) << "\n";    
+       << senf::fieldName("Unused(32Bit)")  << unsigned(p->unused() ) << "\n";    
 }
 
 prefix_ void senf::ICMPv6ErrParamProblemType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Error Parameter Problem:\n"
-       << senf::fieldName("Pointer")                  << unsigned(p->pointer() ) << "\n";    
+       << senf::fieldName("Pointer")        << unsigned(p->pointer() ) << "\n";    
 }
 
 prefix_ void senf::MLDv2ListenerQueryType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Multicast Listener Query:\n"
-       << senf::fieldName("Max. ResponseCode")                << unsigned(p->maxResponseCode()) << "\n"
-       << senf::fieldName("Reserved(16Bit)")          << unsigned(p->reserved()) << "\n"
-       << senf::fieldName("Multicast Address")                << p->mcAddress() << "\n"
-       << senf::fieldName("Reserver(4Bit)")           << unsigned(p->resv()) << "\n"
+       << senf::fieldName("Max. ResponseCode")         << unsigned(p->maxResponseCode()) << "\n"
+       << senf::fieldName("Reserved(16Bit)")           << unsigned(p->reserved()) << "\n"
+       << senf::fieldName("Multicast Address")         << p->mcAddress() << "\n"
+       << senf::fieldName("Reserver(4Bit)")            << unsigned(p->resv()) << "\n"
        << senf::fieldName("Suppress Router-Side Processing") << unsigned(p->sFlag()) << "\n"
        << senf::fieldName("Querier's Robustness Variable") << unsigned(p->qrv()) << "\n"
        << senf::fieldName("Querier's Query Interval Code") << unsigned(p->qqic()) << "\n"
@@ -99,22 +92,22 @@ prefix_ void senf::MLDv2ListenerQueryType::dump(packet p, std::ostream & os)
     senf::MLDv2ListenerQuery::Parser::srcAddresses_t::container c (p->srcAddresses());
     senf::MLDv2ListenerQuery::Parser::srcAddresses_t::container::iterator i (c.begin());
     for (unsigned int nr =1; i != c.end(); ++i, ++nr)
-       os << "    " << nr << ".) " << *i << "\n";    
+        os << "    " << nr << ".) " << *i << "\n";    
     os << "\n";    
 }
 
 prefix_ void senf::MLDv2ListenerReportType::dump(packet p, std::ostream & os)
 {
     os << "ICMPv6 Multicast Listener Report Message:\n"
-       << senf::fieldName("Reserved")                 << unsigned(p->reserved() ) 
+       << senf::fieldName("Reserved")              << unsigned(p->reserved() ) 
        <<"\n  Multicast Address Records:\n";
     
     senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container cAddrR (p->mcastAddrRecords() );
     senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator iAddrR (cAddrR.begin() );
     for (; iAddrR != cAddrR.end(); ++iAddrR) {
-        os << senf::fieldName("  Record Type")                << unsigned(iAddrR->recordType()) << "\n"
-          << senf::fieldName("  Multicast Address")   << iAddrR->mcAddress() << "\n"
-          << "    Source Addresses\n:";
+        os << senf::fieldName("  Record Type")         << unsigned(iAddrR->recordType()) << "\n"
+           << senf::fieldName("  Multicast Address")   << iAddrR->mcAddress() << "\n"
+           << "    Source Addresses\n:";
         senf::MLDv2AddressRecordParser::srcAddresses_t::container cSrcAddr (iAddrR->srcAddresses());
         senf::MLDv2AddressRecordParser::srcAddresses_t::container::iterator iSrcAddr (cSrcAddr.begin());
         for (;iSrcAddr != cSrcAddr.end();++iSrcAddr)
@@ -127,4 +120,5 @@ prefix_ void senf::MLDv2ListenerReportType::dump(packet p, std::ostream & os)
     }
 }
 
+///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
index 96e10e4..7507aab 100644 (file)
@@ -20,6 +20,8 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+/** \file
+    \brief IPv6Extension-Options non-inline non-template implementation */
 
 #include "IPv6ExtOptionType.hh"
 // Custom includes
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-prefix_  senf::PacketInterpreterBase::range senf::IPv6GenericOptionTLVParser::value() const {
+prefix_  senf::PacketInterpreterBase::range senf::IPv6GenericOptionTLVParser::value() 
+    const 
+{
     senf::PacketData::iterator begin (boost::next(i(), 2 ));
     return PacketInterpreterBase::range(begin, boost::next( begin, optionLength()) );
 }
 
+///////////////////////////////cc.e////////////////////////////////////////
+#undef prefix_
+
 
 // Local Variables:
 // mode: c++
index 1b81b00..404ebc6 100644 (file)
@@ -224,9 +224,9 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_parse)
     BOOST_CHECK_EQUAL( pICMPv6->checksum(), 0x50cc);
 }
 
-BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_create)                                                                                                      
+BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_create)
 {
-    std::ostringstream oss (std::ostringstream::out);                                                                                                   
+    std::ostringstream oss (std::ostringstream::out);
     unsigned char HopByHop_packetData[] = {
         //Ethernet
         0x33 ,0x33 ,0x00 ,0x00 ,0x00 ,0x16 ,    //destination MAC
index c01fb88..7c0e324 100644 (file)
@@ -127,7 +127,7 @@ prefix_ void
 senf::detail::ListOptionTypeParser_Policy<ElementParser,AuxPolicy>::container_policy::
 destruct(container_type & c)
 {
-    // data_iterator i (AuxPolicy::adjust(parser_type::get(p).i(), parser_type::get(p).state()));
+    //data_iterator i (AuxPolicy::adjust(parser_type::get(p).i(), parser_type::get(p).state()));
     safe_data_iterator i (c.data(), c.i()) ;
     safe_data_iterator e = i + realAux_;
     unsigned int padBytes = 0;
index b02e814..afe5cd5 100644 (file)
@@ -65,15 +65,16 @@ prefix_ void senf::RTPPacketType::dump(packet p, std::ostream &os)
 {
     boost::io::ios_all_saver ias(os);
     os << "Real Time Protocol:\n"
-       << senf::fieldName("version")                  << p->version() << "\n"
-       << senf::fieldName("padding")                  << p->padding() << "\n"
-       << senf::fieldName("extension")                        << p->extension() << "\n"
+       << senf::fieldName("version")               << p->version() << "\n"
+       << senf::fieldName("padding")               << p->padding() << "\n"
+       << senf::fieldName("extension")             << p->extension() << "\n"
        << senf::fieldName("contributing source cnt")   << p->csrcCount() << "\n"
-       << senf::fieldName("marker")                   << p->marker() << "\n"
-       << senf::fieldName("payload type")             << p->payloadType() << " "<< ptName(p->payloadType() ) <<"\n"
-       << senf::fieldName("sequence number")          << p->seqNumber() << "\n"
-       << senf::fieldName("timestamp")                        << p->timeStamp() << "\n"
-       << senf::fieldName("sync source id")           << p->synSourceId() << "\n";
+       << senf::fieldName("marker")                << p->marker() << "\n"
+       << senf::fieldName("payload type")          << p->payloadType() << " " 
+           << ptName(p->payloadType() ) <<"\n"
+       << senf::fieldName("sequence number")       << p->seqNumber() << "\n"
+       << senf::fieldName("timestamp")             << p->timeStamp() << "\n"
+       << senf::fieldName("sync source id")        << p->synSourceId() << "\n";
 }
 
 #undef prefix_
index 2fc62f1..41fabce 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
-//        Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
+//     Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
index f2f9038..57f9cde 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
-//        Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
+//     Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -46,14 +46,14 @@ namespace senf {
     {
 #       include SENF_PARSER()
 
-       SENF_PARSER_FIELD( source,                              UInt16Parser );
-       SENF_PARSER_FIELD( destination,                 UInt16Parser );
-       SENF_PARSER_FIELD( sequencenumber,              UInt32Parser );
-       SENF_PARSER_FIELD( acknowledgmentnumber,        UInt32Parser );
+        SENF_PARSER_FIELD( source,                  UInt16Parser );
+        SENF_PARSER_FIELD( destination,             UInt16Parser );
+        SENF_PARSER_FIELD( sequencenumber,          UInt32Parser );
+        SENF_PARSER_FIELD( acknowledgmentnumber,    UInt32Parser );
 
-       SENF_PARSER_BITFIELD        ( dataoffset, 4, unsigned );
-       SENF_PARSER_PRIVATE_BITFIELD( reserved,   6, unsigned );
-       SENF_PARSER_BITFIELD        ( urgf,       1, bool     );
+        SENF_PARSER_BITFIELD        ( dataoffset, 4, unsigned );
+        SENF_PARSER_PRIVATE_BITFIELD( reserved,   6, unsigned );
+        SENF_PARSER_BITFIELD        ( urgf,       1, bool     );
         SENF_PARSER_BITFIELD        ( ackf,       1, bool     );
         SENF_PARSER_BITFIELD        ( pshf,       1, bool     );
         SENF_PARSER_BITFIELD        ( rstf,       1, bool     );
index b37fef6..99cc2bb 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
-//        Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
+//     Dennis Goslar <dennis.goslar@inf.hochschule-bonn-rhein-sieg.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
index c56d5a1..c9e40ab 100644 (file)
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-//namespace {
-//    senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::EthVLanPacketType>
-//        registerEthVLanPacket(0x8100);
-//}
-
-
 prefix_ boost::uint32_t senf::SNDUPacketParser::calcCrc()
     const
 {