2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
4 // Stefan Bund <g0dil@berlios.de>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 \brief IPv6Packet non-inline non-template implementation */
24 #include "IPv6Packet.hh"
25 //#include "IPv6Packet.ih"
29 #include <boost/io/ios_state.hpp>
30 #include "EthernetPacket.hh"
31 #include "../../Socket/Protocols/INet/INetAddressing.hh"
33 //#include "IPv6Packet.mpp"
35 ///////////////////////////////cc.p////////////////////////////////////////
38 senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::IPv6Packet>
39 registerIPv6Packet (0x86dd);
41 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Packet>
42 registerIPv6Packet2 (41); // IP6-in-IP(6) encapsulation
44 senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::DataPacket>
45 registerNoNextHeader (59);
48 prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os)
50 boost::io::ios_all_saver ias(os);
51 os << "Internet protocol Version 6:\n"
52 << " version : " << unsigned(p->version()) << "\n"
53 << " traffic class : 0x"
54 << std::hex << std::setw(2) << std::setfill('0') << unsigned(p->trafficClass()) << "\n"
56 << std::hex << std::setw(5) << std::setfill('0') << unsigned(p->flowLabel()) << "\n"
57 << " payload length : " << std::dec << unsigned(p->length()) << "\n"
58 << " next header : " << unsigned(p->nextHeader()) << "\n"
59 << " hop limit : " << unsigned(p->hopLimit()) << "\n"
60 << " source : " << p->source() << "\n"
61 << " destination : " << p->destination() << "\n";
64 prefix_ void senf::IPv6PacketType::finalize(packet p)
66 p->length() << (p.size() - Parse_IPv6::fixed_bytes);
67 p->nextHeader() << key(p.next());
70 ///////////////////////////////cc.e////////////////////////////////////////
72 //#include "IPv6Packet.mpp"
78 // c-file-style: "senf"
79 // indent-tabs-mode: nil
80 // ispell-local-dictionary: "american"
81 // compile-command: "scons -u test"