1 // $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // David Wagner <dw6@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief DTCPPacket non-inline non-template implementation */
26 //#include "DTCPPacket.hh"
27 //#include "DTCPPacket.ih"
30 #include "DTCPPacket.hh"
31 #include <boost/io/ios_state.hpp>
35 ///////////////////////////////cc.p////////////////////////////////////////
37 prefix_ void senf::DTCPHelloPacketType::dump(packet p, std::ostream & os)
39 static char const * COMMANDS[] = { "0", "JOIN", "LEAVE", "3", "4", "5", "6", "7",
40 "8", "9", "10", "11", "12", "13", "14", "15" };
41 boost::io::ios_all_saver ias(os);
42 os << "DTCP HELLO Packet:" << std::endl
43 << " version : " << p->versionNumber() << std::endl
44 << " command : " << COMMANDS[p->command()] << std::endl
45 << " interval : " << unsigned(p->interval()) << std::endl
46 << " sequence number : " << p->sequenceNumber() << std::endl
47 << " receive capable feed : " << (p->receiveCapableFeed() ? "yes" : "no") << std::endl
48 << " ip version : " << p->ipVersion() << std::endl
49 << " tunnel protocol : " << unsigned(p->tunnelProtocol()) << std::endl
50 << " number of BDL ips : " << unsigned(p->fbipCount()) << std::endl
51 << " feed BDL ips : ";
53 switch (p->ipVersion()) {
55 typedef DTCPHelloPacket::Parser::v4fbipList_t FBIPList;
56 FBIPList::container fbips (p->v4fbipList());
57 FBIPList::container::iterator i (fbips.begin());
58 FBIPList::container::iterator const i_end (fbips.end());
59 for (; i != i_end; ++i)
64 typedef DTCPHelloPacket::Parser::v6fbipList_t FBIPList;
65 FBIPList::container fbips (p->v6fbipList());
66 FBIPList::container::iterator i (fbips.begin());
67 FBIPList::container::iterator const i_end (fbips.end());
68 for (; i != i_end; ++i)
73 os << "unknown ip version";
82 ///////////////////////////////cc.e////////////////////////////////////////
90 // c-file-style: "senf"
91 // indent-tabs-mode: nil
92 // ispell-local-dictionary: "american"
93 // compile-command: "scons -u test"