Encapsulates a 'pinger', which can 'ping' one or more hosts using TCP or ICMP.
More...
#include <DwmHostPinger.hh>
|
|
| HostPinger (uint16_t identifier, const std::string &device="lo0") |
| | Construct with the given identifier (normally getpid() & 0xFFFF).
|
| |
|
bool | AddDestination (const PingDestination &destination) |
| | Adds a destination. Returns true on success.
|
| |
| uint16_t | PacketRate () const |
| | Returns the packet rate. More...
|
| |
| uint16_t | PacketRate (uint16_t pps) |
| | Sets and returns the packet rate in packets/sec. More...
|
| |
|
uint32_t | PacketsSent (const PingDestination &destination) const |
| | Returns the number of packets sent to the given destination.
|
| |
| uint32_t | PacketsReceived (const PingDestination &destination) const |
| | Returns the number of packets received from the given destination. More...
|
| |
|
float | PacketLoss (const PingDestination &destination) const |
| | Returns the percent packet loss for the given destination.
|
| |
|
bool | Start (int count=0) |
| | Starts the pinger. Returns true on success.
|
| |
|
bool | Stop () |
| | Stops the pinger. Returns true on success.
|
| |
| bool | Outstanding () const |
| | Returns true if we have not yet received replies for some of the packets we sent. More...
|
| |
|
|
bool | StopWatcher () |
| |
|
bool | StopSender () |
| |
|
void | GetTcpPacket (const PingDestination &destination, uint16_t seq, std::string &s) |
| |
|
void | RunWatcher () |
| |
|
void | RunSender () |
| |
|
|
static void | PcapCallback (uint8_t *user, const struct pcap_pkthdr *pchdr, const uint8_t *pkt) |
| |
|
|
std::string | _device |
| |
|
Ipv4Address | _myAddress |
| |
|
std::thread | _watcherThread |
| |
|
std::thread | _senderThread |
| |
|
std::mutex | _watcherReadyMutex |
| |
|
std::unique_lock< std::mutex > | _watcherReadyLock |
| |
|
std::condition_variable | _watcherReady |
| |
|
bool | _runSender |
| |
|
bool | _runWatcher |
| |
|
uint16_t | _identifier |
| |
|
Socket | _socket |
| |
|
uint16_t | _packetRate |
| |
|
Pcap | _pcap |
| |
|
int | _count |
| |
|
bool | _forever |
| |
|
DestinationMap | _destinations |
| |
Encapsulates a 'pinger', which can 'ping' one or more hosts using TCP or ICMP.
◆ Outstanding()
| bool Dwm::HostPinger::Outstanding |
( |
| ) |
const |
Returns true if we have not yet received replies for some of the packets we sent.
◆ PacketRate() [1/2]
| uint16_t Dwm::HostPinger::PacketRate |
( |
| ) |
const |
Returns the packet rate.
This is divided across all destinations; if the packet rate is 10 and there are 5 destinations, each destination will get 10/5 == 2 packets/sec.
◆ PacketRate() [2/2]
| uint16_t Dwm::HostPinger::PacketRate |
( |
uint16_t |
pps | ) |
|
Sets and returns the packet rate in packets/sec.
This is divided across all destinations; if the packet rate is 10 and there are 5 destinations, each destination will get 10/5 == 2 packets/sec.
◆ PacketsReceived()
| uint32_t Dwm::HostPinger::PacketsReceived |
( |
const PingDestination & |
destination | ) |
const |
Returns the number of packets received from the given destination.
The documentation for this class was generated from the following file: