// $Id$
//
// Copyright (C) 2007
-// Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
#include <iomanip>
#include <boost/io/ios_state.hpp>
#include "EthernetPacket.hh"
-#include "../../Socket/Protocols/INet/INetAddressing.hh"
//#include "IPv6Packet.mpp"
#define prefix_
senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Packet>
registerIPv6Packet2 (41); // IP6-in-IP(6) encapsulation
-
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::DataPacket>
- registerNoNextHeader (59);
}
prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
- os << "Internet protocol Version 6:\n"
- << " version : " << unsigned(p->version()) << "\n"
- << " traffic class : 0x"
+ os << "Internet protocol Version 6:\n"
+ << " version : " << unsigned(p->version()) << "\n"
+ << " traffic class : 0x"
<< std::hex << std::setw(2) << std::setfill('0') << unsigned(p->trafficClass()) << "\n"
- << " flow label : 0x"
+ << " flow label : 0x"
<< std::hex << std::setw(5) << std::setfill('0') << unsigned(p->flowLabel()) << "\n"
- << " payload length : " << std::dec << unsigned(p->length()) << "\n"
- << " next header : " << unsigned(p->nextHeader()) << "\n"
- << " hop limit : " << unsigned(p->hopLimit()) << "\n"
- << " source : " << p->source() << "\n"
- << " destination : " << p->destination() << "\n";
+ << " payload length : " << std::dec << unsigned(p->length()) << "\n"
+ << " next header : " << unsigned(p->nextHeader()) << "\n"
+ << " hop limit : " << unsigned(p->hopLimit()) << "\n"
+ << " source : " << p->source() << "\n"
+ << " destination : " << p->destination() << "\n";
}
prefix_ void senf::IPv6PacketType::finalize(packet p)
{
p->length() << (p.size() - IPv6PacketParser::fixed_bytes);
- p->nextHeader() << key(p.next());
+ try {
+ p->nextHeader() << key(p.next());
+ }
+ catch (InvalidPacketChainException & ex) {
+ p->nextHeader() << 59; // No next header
+ }
}
///////////////////////////////cc.e////////////////////////////////////////