join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::PingStats Class Reference

ICMP echo statistics. More...

#include <ping.hpp>

Public Member Functions

 PingStats ()=default
 create the PingStats instance.
 
 PingStats (const std::string &device, const IpAddress &source, const std::string &host, int size, std::chrono::milliseconds interval, int hop, int df)
 create the PingStats instance for the given sequence settings.
 
 PingStats (const PingStats &other)=default
 create instance by copy.
 
PingStatsoperator= (const PingStats &other)=default
 assign instance by copy.
 
 PingStats (PingStats &&other)=default
 create instance by move.
 
PingStatsoperator= (PingStats &&other)=default
 assign instance by move.
 
 ~PingStats ()=default
 destroy the PingStats instance.
 
const std::string & device () const noexcept
 get the device the echo requests are sent through.
 
const IpAddresssource () const noexcept
 get the source address the echo requests are sent from.
 
const std::string & host () const noexcept
 get the destination as requested by the caller.
 
const IpAddressaddress () const noexcept
 get the resolved destination address.
 
int size () const noexcept
 get the number of data bytes sent in each echo request.
 
std::chrono::milliseconds interval () const noexcept
 get the interval between two echo requests.
 
const IpAddressfrom () const noexcept
 get the address that answered the last echo request.
 
uint16_t sequence () const noexcept
 get the sequence number of the last echo request.
 
int hop () const noexcept
 get the time to live the echo requests are sent with.
 
int df () const noexcept
 get the path MTU discovery setting the echo requests are sent with.
 
int route () const noexcept
 get the MTU the stack knows for the destination.
 
int ttl () const noexcept
 get the time to live of the last answer received.
 
int packetSize () const noexcept
 get the ICMP message size of the last answer received.
 
std::chrono::microseconds rtt () const noexcept
 get the round trip time of the last echo request.
 
bool expired () const noexcept
 check if the last echo request expired before reaching the destination.
 
uint32_t mtu () const noexcept
 get the MTU reported by the last error received.
 
const std::string & error () const noexcept
 get the human readable form of the last error.
 
const std::error_code & code () const noexcept
 get the error code of the last request.
 
uint32_t sent () const noexcept
 get the number of echo requests sent.
 
uint32_t received () const noexcept
 get the number of answers received.
 
double loss () const noexcept
 get the packet loss percentage.
 
std::chrono::microseconds min () const noexcept
 get the minimum round trip time.
 
std::chrono::microseconds max () const noexcept
 get the maximum round trip time.
 
std::chrono::microseconds avg () const noexcept
 get the average round trip time.
 
std::chrono::microseconds mdev () const noexcept
 get the round trip time mean deviation.
 
std::chrono::microseconds total () const noexcept
 get the total elapsed time, request intervals included.
 
void reset () noexcept
 reset the round trip time aggregates and the last request outcome.
 

Friends

class Ping
 friendship with ping.
 

Detailed Description

ICMP echo statistics.

Constructor & Destructor Documentation

◆ PingStats() [1/4]

join::PingStats::PingStats ( )
default

create the PingStats instance.

◆ PingStats() [2/4]

PingStats::PingStats ( const std::string & device,
const IpAddress & source,
const std::string & host,
int size,
std::chrono::milliseconds interval,
int hop,
int df )

create the PingStats instance for the given sequence settings.

Parameters
devicedevice name to bind to.
sourcesource address to bind to.
hostdestination host name or address.
sizenumber of data bytes sent in each echo request.
intervalinterval between two echo requests.
hoptime to live the echo requests are sent with.
dfpath MTU discovery setting the echo requests are sent with.

◆ PingStats() [3/4]

join::PingStats::PingStats ( const PingStats & other)
default

create instance by copy.

Parameters
otherother object to copy.

◆ PingStats() [4/4]

join::PingStats::PingStats ( PingStats && other)
default

create instance by move.

Parameters
otherother object to move.

◆ ~PingStats()

join::PingStats::~PingStats ( )
default

destroy the PingStats instance.

Member Function Documentation

◆ address()

const IpAddress & join::PingStats::address ( ) const
inlinenoexcept

get the resolved destination address.

Returns
destination address.

◆ avg()

std::chrono::microseconds join::PingStats::avg ( ) const
inlinenoexcept

get the average round trip time.

Returns
average round trip time.

◆ code()

const std::error_code & join::PingStats::code ( ) const
inlinenoexcept

get the error code of the last request.

Returns
error code.

◆ device()

const std::string & join::PingStats::device ( ) const
inlinenoexcept

get the device the echo requests are sent through.

Returns
device name, empty if not bound to a device.

◆ df()

int join::PingStats::df ( ) const
inlinenoexcept

get the path MTU discovery setting the echo requests are sent with.

Returns
path MTU discovery setting.

◆ error()

const std::string & join::PingStats::error ( ) const
inlinenoexcept

get the human readable form of the last error.

Returns
error message, empty if the last request succeeded.

◆ expired()

bool join::PingStats::expired ( ) const
inlinenoexcept

check if the last echo request expired before reaching the destination.

Returns
true if a time exceeded message was received.

◆ from()

const IpAddress & join::PingStats::from ( ) const
inlinenoexcept

get the address that answered the last echo request.

Returns
answering address, wildcard if none answered.

◆ hop()

int join::PingStats::hop ( ) const
inlinenoexcept

get the time to live the echo requests are sent with.

Returns
time to live.

◆ host()

const std::string & join::PingStats::host ( ) const
inlinenoexcept

get the destination as requested by the caller.

Returns
destination host name or address.

◆ interval()

std::chrono::milliseconds join::PingStats::interval ( ) const
inlinenoexcept

get the interval between two echo requests.

Returns
interval between two echo requests.

◆ loss()

double join::PingStats::loss ( ) const
inlinenoexcept

get the packet loss percentage.

Returns
packet loss percentage.

◆ max()

std::chrono::microseconds join::PingStats::max ( ) const
inlinenoexcept

get the maximum round trip time.

Returns
maximum round trip time.

◆ mdev()

std::chrono::microseconds PingStats::mdev ( ) const
noexcept

get the round trip time mean deviation.

Returns
round trip time mean deviation.

◆ min()

std::chrono::microseconds join::PingStats::min ( ) const
inlinenoexcept

get the minimum round trip time.

Returns
minimum round trip time.

◆ mtu()

uint32_t join::PingStats::mtu ( ) const
inlinenoexcept

get the MTU reported by the last error received.

Returns
reported MTU, zero if none was reported.

◆ operator=() [1/2]

PingStats & join::PingStats::operator= ( const PingStats & other)
default

assign instance by copy.

Parameters
otherother object to copy.
Returns
a reference of the current object.

◆ operator=() [2/2]

PingStats & join::PingStats::operator= ( PingStats && other)
default

assign instance by move.

Parameters
otherother object to move.
Returns
a reference of the current object.

◆ packetSize()

int join::PingStats::packetSize ( ) const
inlinenoexcept

get the ICMP message size of the last answer received.

Returns
ICMP message size.

◆ received()

uint32_t join::PingStats::received ( ) const
inlinenoexcept

get the number of answers received.

Returns
number of answers received.

◆ reset()

void PingStats::reset ( )
noexcept

reset the round trip time aggregates and the last request outcome.

◆ route()

int join::PingStats::route ( ) const
inlinenoexcept

get the MTU the stack knows for the destination.

Returns
route MTU, zero if unknown.

◆ rtt()

std::chrono::microseconds join::PingStats::rtt ( ) const
inlinenoexcept

get the round trip time of the last echo request.

Returns
round trip time, zero if not measurable.

◆ sent()

uint32_t join::PingStats::sent ( ) const
inlinenoexcept

get the number of echo requests sent.

Returns
number of echo requests sent.

◆ sequence()

uint16_t join::PingStats::sequence ( ) const
inlinenoexcept

get the sequence number of the last echo request.

Returns
sequence number.

◆ size()

int join::PingStats::size ( ) const
inlinenoexcept

get the number of data bytes sent in each echo request.

Returns
number of data bytes.

◆ source()

const IpAddress & join::PingStats::source ( ) const
inlinenoexcept

get the source address the echo requests are sent from.

Returns
source address.

◆ total()

std::chrono::microseconds join::PingStats::total ( ) const
inlinenoexcept

get the total elapsed time, request intervals included.

Returns
total elapsed time.

◆ ttl()

int join::PingStats::ttl ( ) const
inlinenoexcept

get the time to live of the last answer received.

Returns
time to live.

Friends And Related Symbol Documentation

◆ Ping

friend class Ping
friend

friendship with ping.


The documentation for this class was generated from the following files: