//#include "IpV6Packet.ih"
// Custom includes
+#include <iomanip>
+#include <boost/io/ios_state.hpp>
#include "EthernetPacket.hh"
-#include "Socket/INetAddressing.hh"
+#include "../../Socket/Protocols/INet/INetAddressing.hh"
//#include "IpV6Packet.mpp"
#define prefix_
registerNoNextHeader (59);
}
-prefix_ void senf::IpV6Packet::v_nextInterpreter()
- const
+prefix_ void senf::IpV6PacketType::dump(packet p, std::ostream & os)
{
- registerInterpreter(nextHeader(),begin()+bytes(),end());
+ boost::io::ios_all_saver ias(os);
+ 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"
+ << 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";
}
-prefix_ void senf::IpV6Packet::v_finalize()
-{}
-
-prefix_ void senf::IpV6Packet::v_dump(std::ostream & os)
- const
+prefix_ void senf::IpV6PacketType::finalize(packet p)
{
- os << "Internet protocol Version 6:\n"
- << " version : " << unsigned(version()) << "\n"
- << " traffic class : " << std::hex << unsigned(trafficClass()) << "\n"
- << " flow label : " << std::hex << unsigned(flowLabel()) << "\n"
- << " length : " << std::dec << unsigned(length()) << "\n"
- << " next header : " << unsigned(nextHeader()) << "\n"
- << " hop limit : " << unsigned(hopLimit()) << "\n"
- << " source : " << INet6Address(source().range()) << "\n"
- << " destination : " << INet6Address(destination().range()) << "\n";
+ p->length() << (p.size() - Parse_IpV6::fixed_bytes);
+ p->nextHeader() << key(p.next());
}
///////////////////////////////cc.e////////////////////////////////////////