#include <boost/asio/ip/tcp_raw_protocol.hpp>
#include <boost/system/system_error.hpp>
+#include "host/pingrotate.h"
#include "icmp/icmppinger.h"
#include "tcp/tcppinger.h"
return PingerItem(); //lint !e527
}
+
+/**
+ * @brief Create a Pinger object suitable to the given list of protocols.
+ *
+ * @param protocol_list A list of the available ping protocols.
+ * @param io_serv The @c io_service object.
+ * @param network_interface The network interface name from where the ping
+ * packet will be sent.
+ * @return a Pinger object to able to ping using the given list of protocols.
+ */
+PingerItem PingerFactory::createPinger(
+ const PingProtocolList &protocol_list,
+ io_service &io_serv,
+ const string &network_interface
+)
+{
+ BOOST_ASSERT( 0 < protocol_list.size() );
+ BOOST_ASSERT( !network_interface.empty() );
+
+ return PingerItem(
+ new PingRotate( io_serv, network_interface, protocol_list )
+ );
+}
const std::string &network_interface
);
+ static PingerItem createPinger(
+ const PingProtocolList &protocol_list,
+ boost::asio::io_service &io_serv,
+ const std::string &network_interface
+ );
+
private:
PingerFactory();
~PingerFactory();