void BoostPinger::ping( const Host &host )
{
- std::string destination = host.get_ip();
+ std::string destination = host.get_address();
// TODO what if it is an DNS?
// TODO what about ping multiple hosts?
#include "host.h"
Host::Host( std::string address ) :
- ip( "" ),
- dns( address ),
+ address( address ),
port( 0 ),
interval( 0 ),
options()
{
}
-std::string Host::get_dns() const
+std::string Host::get_address() const
{
- return dns;
+ return address;
}
-void Host::set_dns( std::string dns )
+void Host::set_address( std::string address )
{
- this->dns = dns;
+ this->address = address;
}
-uint32_t Host::get_interval() const
+uint16_t Host::get_port() const
{
- return interval;
+ return port;
}
-void Host::set_interval( uint32_t interval )
+void Host::set_port( uint16_t port )
{
- this->interval = interval;
+ this->port = port;
}
-std::string Host::get_ip() const
+uint32_t Host::get_interval() const
{
- return ip;
+ return interval;
}
-void Host::set_ip( std::string ip )
+void Host::set_interval( uint32_t interval )
{
- this->ip = ip;
+ this->interval = interval;
}
+
std::vector<std::string> Host::get_options() const
{
return options;
{
this->options = options;
}
-
-uint16_t Host::get_port() const
-{
- return port;
-}
-
-void Host::set_port( uint16_t port )
-{
- this->port = port;
-}
Host( std::string address );
virtual ~Host();
- std::string get_dns() const;
- void set_dns( std::string dns );
+ std::string get_address() const;
+ void set_address( std::string address );
+
+ uint16_t get_port() const;
+ void set_port( uint16_t port );
uint32_t get_interval() const;
void set_interval( uint32_t interval );
- std::string get_ip() const;
- void set_ip( std::string ip );
-
std::vector<std::string> get_options() const;
void set_options( std::vector<std::string> options );
- uint16_t get_port() const;
- void set_port( uint16_t port );
-
private:
- std::string ip;
- std::string dns;
+ std::string address;
uint16_t port;
uint32_t interval;
std::vector<std::string> options;