#include <stdint.h>
+#include <iostream>
#include <string>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/shared_ptr.hpp>
//-----------------------------------------------------------------------------
// IcmpPacket
) const = 0;
virtual void print_destination_unreachable() const = 0;
+ virtual bool read( std::istream &is ) = 0;
+ virtual void write( std::ostream &os ) const = 0;
+
};
+//-----------------------------------------------------------------------------
+// IcmpPacketItem
+//-----------------------------------------------------------------------------
+
+typedef boost::shared_ptr<IcmpPacket> IcmpPacketItem;
+
#endif // ICMP_PACKET_H
<< " Destination Net Unreachable" << endl;
}
+bool Icmpv4Packet::read( istream &is )
+{
+ is >> *this;
+
+ return is.fail();
+}
+
+void Icmpv4Packet::write( ostream &os ) const
+{
+ os << *this;
+}
+
istream& operator>>(
istream &is,
Icmpv4Packet &packet
) const;
void print_destination_unreachable() const;
+ bool read( std::istream &is );
+ void write( std::ostream &os ) const;
+
friend std::istream& operator>>(
std::istream &is,
Icmpv4Packet &packet
<< " Destination Net Unreachable" << endl;
}
+bool Icmpv6Packet::read( istream &is )
+{
+ is >> *this;
+
+ return is.fail();
+}
+
+void Icmpv6Packet::write( ostream &os ) const
+{
+ os << *this;
+}
+
istream& operator>>(
istream &is,
Icmpv6Packet &packet
) const;
void print_destination_unreachable() const;
+ bool read( std::istream &is );
+ void write( std::ostream &os ) const;
+
friend std::istream& operator>>(
std::istream &is,
Icmpv6Packet &packet