4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
7 // Philipp Batroff <philipp.batroff@fokus.fraunhofer.de>
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the
21 // Free Software Foundation, Inc.,
22 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 \brief IPv6Extensions non-inline non-template implementation */
27 #include "IPv6Extensions.hh"
28 //#include "IPv6Extensions.ih"
29 #include <senf/Utils/hexdump.hh>
32 //#include "IPv6Extensions.mpp"
34 ///////////////////////////////cc.p////////////////////////////////////////
37 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6FragmentPacket>
38 registerIPv6FragmentPacketType (44);
39 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6RoutingPacket>
40 registerIPv6RoutingPacketType (43);
41 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6HopByHopOptionsPacket>
42 registerIPv6HopByHopOptionsPacketType (0u);
43 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6DestinationOptionsPacket>
44 registerIPv6DestinationOptionsPacketType (60u);
47 prefix_ void senf::IPv6FragmentPacketType::dump(packet p, std::ostream & os)
49 os << "Internet protocol Version 6 fragment extension:\n"
50 << " next header : " << unsigned(p->nextHeader()) << "\n"
51 << " fragment offset : " << std::hex << unsigned(p->fragmentOffset()) << "\n"
52 << " more fragments : " << (p->moreFragments()?"yes":"no") << "\n"
53 << " id : " << std::hex << unsigned(p->id()) << "\n";
56 prefix_ void senf::IPv6RoutingPacketType::dump(packet p, std::ostream & os)
58 os << "Internet protocol Version 6 routing extension:\n"
59 << " next header : " << unsigned (p->nextHeader()) << "\n"
60 << " header length : " << unsigned (p->headerLength()) << "\n"
61 << " routing type : " << unsigned (p->routingType()) << "\n"
62 << " segments left : " << unsigned (p->segmentsLeft()) << "\n"
63 << " further Hop Addresses : \n";
64 typedef IPv6RoutingPacket::Parser::hopAddresses_t::container addrContainer_t;
65 addrContainer_t hopAddresses (p->hopAddresses());
66 if ( p->segmentsLeft() != 0 )
67 for (addrContainer_t::iterator i (hopAddresses.begin()); i != hopAddresses.end(); ++i)
71 prefix_ void senf::IPv6HopByHopOptionsPacketType::dump(packet p, std::ostream & os)
73 os << "Internet protocol Version 6 Hop-By-Hop extension:\n"
74 << " next header : " << unsigned (p->nextHeader()) << "\n"
75 << " header length : " << unsigned (p->headerLength()) << "\n";
76 os << " OptionTypes:\n";
77 typedef IPv6HopByHopOptionsPacket::Parser::options_t::container optContainer_t;
78 optContainer_t options (p->options());
79 optContainer_t::iterator optIter(options.begin());
80 for(; optIter != options.end(); ++optIter) {
81 os << " AltAction : " << (unsigned) optIter->altAction()
82 << "\n ChangeFlag : " << (unsigned) optIter->changeFlag()
83 << "\n Option Type : " << (unsigned) optIter->optionType()
84 << "\n OptionLength : " << (unsigned) optIter->optionLength() <<"\n";
85 senf::hexdump(boost::begin(optIter->value()) , boost::end(optIter->value()), os );
89 prefix_ void senf::IPv6DestinationOptionsPacketType::dump(packet p, std::ostream & os)
91 os << "Internet protocol Version 6 Destination Options extension:\n"
92 << " next header : " << unsigned (p->nextHeader()) << "\n"
93 << " header length : " << unsigned (p->headerLength()) << "\n";
96 ///////////////////////////////cc.e////////////////////////////////////////
98 //#include "IPv6Extensions.mpp"
104 // c-file-style: "senf"
105 // indent-tabs-mode: nil
106 // ispell-local-dictionary: "american"
107 // compile-command: "scons -u test"
108 // comment-column: 40