42 #ifndef _DWMPINGDESTINATION_HH_ 43 #define _DWMPINGDESTINATION_HH_ 92 uint16_t
Port()
const;
97 const std::string &
Hostname()
const;
102 const std::string &
Hostname(
const std::string & hostname);
109 uint16_t identifier)
const;
126 virtual operator std::string ()
const;
131 friend std::ostream &
137 std::string _hostname;
138 mutable bool _primed;
139 mutable uint16_t _sequenceNumber;
141 void GetPacket(std::string & packet,
const Ipv4Address & myAddress,
142 uint16_t identifier)
const;
143 void GetIcmpPacket(std::string & packet,
const Ipv4Address & myAddress,
144 uint16_t identifier)
const;
145 void GetTcpPacket(std::string & packet,
const Ipv4Address & myAddress,
146 uint16_t identifier)
const;
151 #endif // _DWMPINGDESTINATION_HH_ This class abstracts a UNIX socket descriptor.
Definition: DwmSocket.hh:62
This class encapsulates an IPv4 address.
Definition: DwmIpv4Address.hh:62
friend std::ostream & operator<<(std::ostream &os, const PingDestination &pd)
Prints a PingDestination to an ostream in human-readable form.
Dwm::Socket class definition.
Common interface for an IPv4 destination we wish to ping with ICMP or TCP.
Definition: DwmPingDestination.hh:56
const Ipv4Address & Address() const
Returns the destination IP address.
uint16_t Port() const
Returns the port number (0 for ICMP).
Definition: DwmBZ2IO.hh:67
const std::string & Hostname() const
Returns the hostname (an empty string if it was not set).
Dwm::Ipv4Address class definition.
bool SendTo(Socket &socket, const Ipv4Address &myAddress, uint16_t identifier) const
Sends a 'ping' to the destination.
bool operator==(const PingDestination &pd) const
operator ==
PingDestination()
Constructor.
bool operator<(const PingDestination &pd) const
operator <