dns/hostaddress.cpp
dns/timetolive.cpp
host/hoststatusanalyzer.cpp
+ host/pinger.cpp
host/pinginterval.cpp
host/pingscheduler.cpp
icmp/icmpdestinationunreachablemessage.cpp
icmp/ipv4header.cpp
link/linkstatusanalyzer.cpp
link/statusnotifiercommand.cpp
+ tcp/tcppinger.cpp
main.cpp
)
--- /dev/null
+/*
+ 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.
+ */
+
+#include "host/pinger.h"
+
+//-----------------------------------------------------------------------------
+// Pinger
+//-----------------------------------------------------------------------------
+
+Pinger::Pinger()
+{
+}
+
+Pinger::~Pinger()
+{
+}
--- /dev/null
+/*
+ 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.
+ */
+
+#ifndef PINGER_H
+#define PINGER_H
+
+#include <string>
+
+#include <boost/function.hpp>
+
+//-----------------------------------------------------------------------------
+// Pinger
+//-----------------------------------------------------------------------------
+
+class Pinger
+{
+public:
+ Pinger();
+ virtual ~Pinger();
+
+ virtual void ping(
+ const std::string &destination_ip,
+ boost::function<void(bool)> ping_done_callback
+ ) = 0;
+
+};
+
+#endif /* PINGER_H */
#include <istream>
#include <ostream>
+#include <boost/assert.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
using boost::asio::ip::address;
using boost::asio::ip::icmp;
using boost::date_time::time_resolution_traits_adapted64_impl;
+using boost::function;
using boost::posix_time::microsec_clock;
using boost::posix_time::ptime;
using boost::posix_time::seconds;
--- /dev/null
+/*
+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.
+*/
+#include "tcp/tcppinger.h"
+
+#include <boost/assert.hpp>
+
+using namespace std;
+using boost::function;
+
+//-----------------------------------------------------------------------------
+// TcpPinger
+//-----------------------------------------------------------------------------
+
+TcpPinger::TcpPinger()
+{
+}
+
+TcpPinger::~TcpPinger()
+{
+}
+
+void TcpPinger::ping(
+ const string &destination_ip,
+ function<void(bool)> /*ping_done_callback*/
+)
+{
+ BOOST_ASSERT( !destination_ip.empty() );
+}
--- /dev/null
+/*
+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.
+*/
+#ifndef TCPPINGER_H
+#define TCPPINGER_H
+
+#include <string>
+
+#include <boost/function.hpp>
+
+#include "host/pinger.h"
+
+//-----------------------------------------------------------------------------
+// TcpPinger
+//-----------------------------------------------------------------------------
+
+class TcpPinger : public Pinger
+{
+public:
+ TcpPinger();
+ virtual ~TcpPinger();
+
+ void ping(
+ const std::string &destination_ip,
+ boost::function<void(bool)> ping_done_callback
+ );
+
+};
+
+#endif /* TCPPINGER_H */