/* The software in this package is distributed under the GNU General Public License version 2 (with a special exception described below). A copy of GNU General Public License (GPL) is included in this distribution, in the file COPYING.GPL. As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License. This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License. Christian Herdtweck, Intra2net AG 2015 Based on an example in Boost Documentation (by Christopher M. Kohlhoff) and adaptation by Guilherme M. Ferreira */ #ifndef ICMP_TIME_EXCEEDED_DATA_H #define ICMP_TIME_EXCEEDED_DATA_H #include #include #include "icmp/icmpdata_pingfailreply.h" #include using boost::asio::ip::address; /** * Data for a DestinationUnreachableMessage * * has option to interpret data as containing a Ping packet as reason for * DestinationUnreachable reply */ class IcmpTimeExceededData : public IcmpData_PingFailReply { public: IcmpTimeExceededData(const std::size_t size_arg); bool match_time_exceeded(const uint16_t identifier, const uint16_t sequence_number, const address &destination_address) const; void print( const size_t &bytes_received, const boost::posix_time::ptime &time_packet_sent, const std::string &remote_address, const uint32_t ttl) const; std::string to_string() const; }; #endif