Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

MPEGDVBBundle/DTCPPacket.cc

Go to the documentation of this file.
00001 // $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     David Wagner <dw6@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #include "DTCPPacket.hh"
00027 //#include "DTCPPacket.ih"
00028 
00029 // Custom includes
00030 #include <boost/io/ios_state.hpp>
00031 #include <iomanip>
00032 
00033 #define prefix_
00034 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00035 
00036 prefix_ void senf::DTCPHelloPacketType::dump(packet p, std::ostream & os)
00037 {
00038     static char const * COMMANDS[] = { "0", "JOIN", "LEAVE", "3", "4", "5", "6", "7",
00039                                        "8", "9", "10", "11", "12", "13", "14", "15" };
00040     boost::io::ios_all_saver ias(os);
00041     os << "DTCP HELLO Packet:" << std::endl
00042        << senf::fieldName("version")                   << p->versionNumber()                       << "\n"
00043        << senf::fieldName("command")                   << COMMANDS[p->command()]                   << "\n"
00044        << senf::fieldName("interval")                  << unsigned(p->interval())                  << "\n"
00045        << senf::fieldName("sequence number")           << p->sequenceNumber()                      << "\n"
00046        << senf::fieldName("receive capable feed")      << (p->receiveCapableFeed() ? "yes" : "no") << "\n"
00047        << senf::fieldName("ip version")                << p->ipVersion()                           << "\n"
00048        << senf::fieldName("tunnel protocol")           << unsigned(p->tunnelProtocol())            << "\n"
00049        << senf::fieldName("number of BDL ips")         << unsigned(p->fbipCount())                 << "\n"
00050        << "  feed BDL ips:\n";
00051 
00052     switch (p->ipVersion()) {
00053     case 4 : {
00054         typedef DTCPHelloPacket::Parser::v4fbipList_t FBIPList;
00055         FBIPList::container fbips (p->v4fbipList());
00056         FBIPList::container::iterator i (fbips.begin());
00057         FBIPList::container::iterator const i_end (fbips.end());
00058         for (; i != i_end; ++i)
00059             os << "    " << *i << "\n";
00060         break;
00061     }
00062     case 6 : {
00063         typedef DTCPHelloPacket::Parser::v6fbipList_t FBIPList;
00064         FBIPList::container fbips (p->v6fbipList());
00065         FBIPList::container::iterator i (fbips.begin());
00066         FBIPList::container::iterator const i_end (fbips.end());
00067         for (; i != i_end; ++i)
00068             os << "    " << *i << "\n";
00069         break;
00070     }
00071     default:
00072         os << "    unknown ip version\n";
00073     }
00074 }
00075 
00076 #undef prefix_
00077 
00078 
00079 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00080 #undef prefix_
00081 
00082 
00083 // Local Variables:
00084 // mode: c++
00085 // fill-column: 100
00086 // comment-column: 40
00087 // c-file-style: "senf"
00088 // indent-tabs-mode: nil
00089 // ispell-local-dictionary: "american"
00090 // compile-command: "scons -u test"
00091 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research