continue implementation; first tests with recursion returned IPs but then added cance...
[pingcheck] / src / dns / timetolive.h
CommitLineData
91fcc471
TJ
1/*
2The software in this package is distributed under the GNU General
3Public License version 2 (with a special exception described below).
4
5A copy of GNU General Public License (GPL) is included in this distribution,
6in the file COPYING.GPL.
7
8As a special exception, if other files instantiate templates or use macros
9or inline functions from this file, or you compile this file and link it
10with other works to produce a work based on this file, this file
11does not by itself cause the resulting work to be covered
12by the GNU General Public License.
13
14However the source code for this file must still be made available
15in accordance with section (3) of the GNU General Public License.
16
17This exception does not invalidate any other reasons why a work based
18on this file might be covered by the GNU General Public License.
19*/
a9c88e1c
GMF
20#ifndef TIME_TO_LIVE_H
21#define TIME_TO_LIVE_H
101be5ce 22
b0a693a0
GMF
23#include <stdint.h>
24
101be5ce 25#include <boost/asio.hpp>
e18c1337
CH
26//#include "dns/hostaddress.h"
27
28// forward declaration
29class HostAddress;
101be5ce
GMF
30
31//-----------------------------------------------------------------------------
32// TimeToLive
33//-----------------------------------------------------------------------------
34
35class TimeToLive
36{
37public:
b0a693a0 38 TimeToLive( uint32_t ttl = 0 );
101be5ce
GMF
39 ~TimeToLive();
40
b0a693a0
GMF
41 uint32_t get_value() const;
42 void set_value( const uint32_t ttl );
101be5ce 43
b0a693a0 44 uint32_t get_updated_value() const;
101be5ce
GMF
45
46private:
e18c1337
CH
47 // required for saving and loading TtlSetTime to original value
48 friend class HostAddress;
49 //template<class Archive>
50 //friend void HostAddress::load(Archive & ar, const unsigned int version);
51 //template<class Archive>
52 //friend void HostAddress::save(Archive & ar, const unsigned int version)
53 // const;
54
d3e8a9f9 55 /// the numeric time-to-live
b0a693a0 56 uint32_t Ttl;
d3e8a9f9
GMF
57 /// the time when the time-to-live was set, so it is possible to know the
58 /// elapsed time
101be5ce
GMF
59 boost::posix_time::ptime TtlSetTime;
60};
61
a9c88e1c 62#endif // TIME_TO_LIVE_H