remove the footer saying that vim is the best editor -- anyone knows anyway
[pingcheck] / src / icmp / icmpdestinationunreachabledata.h
CommitLineData
c120ad42
CH
1/*
2 The software in this package is distributed under the GNU General
3 Public License version 2 (with a special exception described below).
4
5 A copy of GNU General Public License (GPL) is included in this distribution,
6 in the file COPYING.GPL.
7
8 As a special exception, if other files instantiate templates or use macros
9 or inline functions from this file, or you compile this file and link it
10 with other works to produce a work based on this file, this file
11 does not by itself cause the resulting work to be covered
12 by the GNU General Public License.
13
14 However the source code for this file must still be made available
15 in accordance with section (3) of the GNU General Public License.
16
17 This exception does not invalidate any other reasons why a work based
18 on this file might be covered by the GNU General Public License.
19
20 Christian Herdtweck, Intra2net AG 2015
057e6cc9
CH
21 Based on an example in Boost Documentation (by Christopher M. Kohlhoff)
22 and adaptation by Guilherme M. Ferreira
c120ad42
CH
23 */
24
25
26#ifndef ICMP_DEST_11_H
27#define ICMP_DEST_11_H
28
29#include <stdint.h>
30#include <boost/date_time/posix_time/ptime.hpp>
15023b99 31#include "icmp/icmpdata_pingfailreply.h"
c120ad42 32
81c26517
CH
33#include <boost/asio/ip/address.hpp>
34using boost::asio::ip::address;
c120ad42
CH
35
36/**
15023b99
CH
37 * Data for a DestinationUnreachableMessage
38 *
39 * has option to interpret data as containing a Ping packet as reason for
40 * DestinationUnreachable reply
c120ad42 41 */
15023b99 42class IcmpDestinationUnreachableData : public IcmpData_PingFailReply
c120ad42
CH
43{
44public:
0ba8adc0 45 IcmpDestinationUnreachableData(const std::size_t size_arg);
c120ad42 46
c120ad42 47 bool match_destination_unreachable(const uint16_t identifier,
81c26517
CH
48 const uint16_t sequence_number,
49 const address &destination_address) const;
0ba8adc0 50
c120ad42
CH
51 /**
52 * @brief Prints the destination unreachable messages.
53 *
54 * @return void
55 */
56 void print( const size_t &bytes_received,
57 const boost::posix_time::ptime &time_packet_sent,
58 const std::string &remote_address,
0ba8adc0 59 const uint32_t ttl) const;
c120ad42 60
e7cdd99c
CH
61 std::string to_string() const;
62
c120ad42
CH
63};
64
65#endif
66