tcp/tcpipv6segment.cpp
tcp/tcpsegment.cpp
tcp/tcpsegmentfactory.cpp
+ boost_assert_handler.cpp
main.cpp
)
--- /dev/null
+// Boost assertion handler
+//
+// Defines boost::assertion_failed which is declared in <boost/assert.hpp> but
+// not defined to be overwritten by user
+//
+// created 2014 by Christian Herdtweck, Intra2net AG
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <stdexcept>
+#include <sstream>
+#include "boost_assert_handler.h"
+
+namespace boost
+{
+ void assertion_failed(char const * expr, char const * function,
+ char const * file, long line)
+ {
+ std::stringstream msg;
+ msg << "BOOST_ASSERT( " << expr << " ) failed for function "
+ << function << " (line " << line << ")!";
+ throw std::runtime_error( msg.str() );
+ }
+}
--- /dev/null
+// Boost assertion handler
+//
+// created 2014 by Christian Herdtweck, Intra2net AG
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_ASSERT_HANDLER_H
+#define BOOST_ASSERT_HANDLER_H
+
+#define BOOST_ENABLE_ASSERT_HANDLER
+#include <boost/assert.hpp>
+
+#endif
#include <set>
#include <ctime> // for seeding random number generator
-#include <boost/assert.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/foreach.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using I2n::Logger::LogLevel;
using I2n::Logger::GlobalLogger;
#include "config/configurationcommandline.h"
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "config/configurationoptions.h"
#include "config/option/hostnameoption.h"
#include <fstream>
#include <iostream>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "config/configurationoptions.h"
using namespace std;
#include <iostream>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "config/option/configfileoption.h"
#include "config/option/daemonoption.h"
#include "config/option/hostsdownlimitoption.h"
*/
#include "config/configurationreader.h"
-#include <boost/assert.hpp>
-
+#include "boost_assert_handler.h"
#include "config/configurationcommandline.h"
#include "config/configurationfile.h"
*/
#include "config/host.h"
-#include <limits>
+#include "boost_assert_handler.h"
-#include <boost/assert.hpp>
+#include <limits>
using namespace std;
#include <limits>
#include <string>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "config/option/hostpingintervaloption.h"
#include "config/option/hostpingprotocoloption.h"
#include "config/option/hostportoption.h"
#include <string>
#include <vector>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::program_options::value;
using boost::program_options::variables_map;
#include <string>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::program_options::value;
using boost::program_options::variables_map;
#include <sstream>
#include <string>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::program_options::value;
using boost::program_options::variables_map;
#include <string>
#include <vector>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::program_options::value;
using boost::program_options::variables_map;
#include <string>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::program_options::value;
using boost::program_options::variables_map;
#include <algorithm>
#include <iostream>
-#include <boost/assert.hpp>
#include <boost/asio.hpp>
#include <boost/foreach.hpp>
#include <boost/net/resolve.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "dns/hostaddress.h"
using namespace std;
#include <boost/net/dns.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::net::dns::type_t;
*/
#include "dns/hostaddress.h"
-#include <boost/assert.hpp>
#include <boost/version.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address;
*/
#include "dns/timetolive.h"
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
using boost::date_time::time_resolution_traits_adapted64_impl;
using boost::posix_time::microsec_clock;
#include <iostream>
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
using namespace std;
#include <algorithm>
#include <map>
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
using namespace std;
using I2n::Logger::LogLevel;
#include <algorithm>
#include <map>
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
using namespace std;
// Copyright (c) 2003-2010 Christopher M. Kohlhoff
// Modifications (c) 2011 by Guilherme Maciel Ferreira / Intra2net AG
+// and (c) 2014 by Christian Herdtweck / Intra2net AG
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
#include <algorithm>
#include <limits>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using I2n::Logger::GlobalLogger;
#include <string>
-#include <boost/assert.hpp>
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/basic_raw_socket.hpp>
#include <boost/asio/ip/address.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "host/networkinterfacelist.h"
typedef const struct sockaddr* const_sockaddr_ptr_t;
#include <stddef.h>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using I2n::Logger::GlobalLogger;
#include <boost/asio/ip/tcp_raw_protocol.hpp>
#include <boost/system/system_error.hpp>
+#include "boost_assert_handler.h"
#include "icmp/icmppinger.h"
#include "tcp/tcppinger.h"
*/
#include "host/pinginterval.h"
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
//-----------------------------------------------------------------------------
// PingInterval
#include <algorithm>
#include <map>
-#include <boost/assert.hpp>
+#include "boost_assert_handler.h"
using namespace std;
#include "host/pingrotate.h"
-#include <boost/assert.hpp>
#include <boost/bind.hpp>
+#include "boost_assert_handler.h"
#include "dns/dnsresolverfactory.h"
#include "host/pingerfactory.h"
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "dns/dnsresolver.h"
#include "host/pingerfactory.h"
#include "icmp/icmppinger.h"
#include "icmp/icmppacketfactory.h"
-#include <boost/assert.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "icmp/icmpchecksum.h"
#include "icmp/icmpdata.h"
#include "icmp/icmptype.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>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "icmp/icmppacketfactory.h"
using namespace std;
// http://www.boost.org/LICENSE_1_0.txt)
#include "icmp/icmpv4header.h"
+#include "boost_assert_handler.h"
#include "icmp/icmpdestinationunreachablemessage.h"
#include "icmp/icmpechoreplymessage.h"
#include "icmp/icmpechorequestmessage.h"
#include <iostream>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address;
using boost::date_time::time_resolution_traits_adapted64_impl;
// http://www.boost.org/LICENSE_1_0.txt)
#include "icmp/icmpv6header.h"
+#include "boost_assert_handler.h"
#include "icmp/icmpdestinationunreachablemessage.h"
#include "icmp/icmpechoreplymessage.h"
#include "icmp/icmpechorequestmessage.h"
#include <iostream>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address;
using boost::date_time::time_resolution_traits_adapted64_impl;
// http://www.boost.org/LICENSE_1_0.txt)
#include "ip/ipv6header.h"
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <boost/scoped_array.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address_v6;
using boost::scoped_array;
#include <iostream>
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::lock_guard;
using boost::mutex;
#include <iostream>
-#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <logfunc.hpp>
#include <stringfunc.hxx>
+#include "boost_assert_handler.h"
+
using namespace std;
using I2n::Logger::GlobalLogger;
#include <daemonfunc.hpp>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "config/configurationreader.h"
#include "config/host.h"
#include "link/linkstatus.h"
#include "host/pingprotocol.h"
#include "host/pingscheduler.h"
+
using namespace std;
using boost::asio::io_service;
using boost::shared_ptr;
#include <algorithm>
-#include <boost/assert.hpp>
-
+#include "boost_assert_handler.h"
#include "ip/pseudoipv4header.h"
#include "ip/pseudoipv6header.h"
#include "tcp/tcpipv4segment.h"
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address;
using boost::date_time::time_resolution_traits_adapted64_impl;
#include "tcp/tcpipv6segment.h"
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
+
using namespace std;
using boost::asio::ip::address;
using boost::date_time::time_resolution_traits_adapted64_impl;
#include <ostream>
#include <limits>
-#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>
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "tcp/tcpsegmentfactory.h"
using namespace std;
#include "tcp/tcpsegmentfactory.h"
-#include <boost/assert.hpp>
-
#include <logfunc.hpp>
+#include "boost_assert_handler.h"
#include "tcp/tcpheader.h"
#include "tcp/tcpipv4segment.h"
#include "tcp/tcpipv6segment.h"
# compiler: creates the binaries
add_executable(test_configurationcommandline
test_configurationcommandline.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationcommandline.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationinterface.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationoptions.cpp
# compiler: creates the binaries
add_executable(test_configurationfile
test_configurationfile.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationfile.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationinterface.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationoptions.cpp
# compiler: creates the binaries
add_executable(test_configurationoptions
test_configurationoptions.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/config/configurationoptions.cpp
${CMAKE_SOURCE_DIR}/src/config/configuration.cpp
${CMAKE_SOURCE_DIR}/src/config/host.cpp
# compiler: creates the binaries
add_executable(test_hoststatus
test_hoststatus.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/host/hoststatus.cpp
)
# compiler: creates the binaries
add_executable(test_icmpv4header
test_icmpv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpv4header.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpmessage.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachablemessage.cpp
# compiler: creates the binaries
add_executable(test_icmpv6header
test_icmpv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpv6header.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpmessage.cpp
${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachablemessage.cpp
# compiler: creates the binaries
add_executable(test_ipv4header
test_ipv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/ip/ipv4header.cpp
${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
)
# compiler: creates the binaries
add_executable(test_ipv6header
test_ipv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/ip/ipv6header.cpp
${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
)
# compiler: creates the binaries
add_executable(test_linkstatus
test_linkstatus
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/link/linkstatus.cpp
)
# compiler: creates the binaries
add_executable(test_loglevel
test_loglevel.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/host/loglevel.cpp
)
# compiler: creates the binaries
add_executable(test_logoutput
test_logoutput.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/host/logoutput.cpp
)
# compiler: creates the binaries
add_executable(test_messagepayload
test_messagepayload.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
)
# compiler: creates the binaries
add_executable(test_pingprotocol
test_pingprotocol.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/host/pingprotocol.cpp
)
# compiler: creates the binaries
add_executable(test_tcpheader
test_tcpheader.cpp
+ ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp
${CMAKE_SOURCE_DIR}/src/tcp/tcpheader.cpp
${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
)