#include <PingTarget.h>
Public Types | |
| typedef std::vector< PingTarget * >::const_iterator | const_iterator |
| enum | LOG_FILENAME_TYPE { LOG_FILENAME_PLAIN, LOG_FILENAME_DAILY, LOG_FILENAME_HOURLY } |
| Filename pattern used for PrintLogCurrent. More... | |
Public Member Functions | |
| PingTargets () | |
| ~PingTargets () | |
| Destroys all added targets. | |
| PingTarget * | AddTarget (const char *name) |
| Adds target to container if name resolves to valid AF_INET address and maximum number of targets is not exceeded. | |
| bool | AddTargets (std::istream &is) |
| Adds targets in stream. | |
| bool | AddTargets (const char *pszFilename) |
| Adds targets in file. | |
| long | GetMaxTargets () const |
| Returns the maximum number of targets. | |
| PingTarget * | Get (long id) const |
| Returns pointer to target or NULL. | |
| bool | AddResponse (long id, double ms) |
| Adds response to target with id. | |
| void | ClearResponseFlags () |
| Sets all response flags on contained targets to false. | |
| void | AddUnreachableResponses () |
| Adds a unreachable response to alle targets without a response. | |
| long | GetTargetId (USHORT sequence) const |
| Target id is embedded in the sequence parameter of ICMP header as the upper bits defined by mask m_uIdMask. | |
| long | GetSequence (USHORT sequence) const |
| Sequence is embedded in the sequence parameter of ICMP header as the lower bits defined by mask m_uSeqMask. | |
| USHORT | MakeSequence (long lId, long lSequence) const |
| Calculates ICMP sequence based on id and sequence. | |
| long | GetMaxSequence () const |
| Returns the largest sequence number available. | |
| const_iterator | begin () const |
| const_iterator | end () const |
| size_t | size () const |
| void | PrintStatisticsHeader (std::ostream &os, long lConsoleWidth=79) const |
| Prints statistics header to stream. | |
| void | PrintStatistics (std::ostream &os, long lConsoleWidth=79) const |
| Prints statistics to stream. | |
| void | PrintLogHeader (std::ostream &os) const |
| Prints log file header for a single target to stream. | |
| void | PrintLogCurrent (std::ostream &os, const SYSTEMTIME &systemtime) const |
| Prints specified time and current ping values to stream as a single line separated by tab character. | |
| bool | PrintLogCurrent (const char *pszFilename, const SYSTEMTIME &systemtime, LOG_FILENAME_TYPE FilenameType=LOG_FILENAME_PLAIN, bool bNewFile=false) const |
| Prints specified time and current ping values to the specified file as a single line separated by tab character. | |
| long | GetMaxNameWidth () const |
| Return the longest target name width. | |
Protected Types | |
| typedef std::vector< PingTarget * >::iterator | iterator |
Protected Attributes | |
| long | m_lIdBits |
| High order bits used for ICMP id. | |
| long | m_lIdMax |
| Largest id available. | |
| long | m_lSequenceBits |
| Bits used for sequence. | |
| USHORT | m_uIdMask |
| Mask for id bits only on USHORT value. | |
| USHORT | m_uSeqMask |
| Mask for sequence bits only on USHORT value. | |
| long | m_lSequenceMax |
| Largest sequence value. | |
| long | m_lMaxNameWidth |
| Maximum target name width. | |
| std::vector< PingTarget * > | m_targets |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const PingTargets &targets) |
Definition at line 95 of file PingTarget.h.
|
|
Definition at line 149 of file PingTarget.h. |
|
|
Definition at line 211 of file PingTarget.h. |
|
|
Filename pattern used for PrintLogCurrent.
Definition at line 178 of file PingTarget.h. |
|
|
Definition at line 141 of file PingTarget.cpp. References m_lIdBits, m_lIdMax, m_lMaxNameWidth, m_lSequenceBits, m_lSequenceMax, m_uIdMask, and m_uSeqMask. |
|
|
Destroys all added targets.
Definition at line 152 of file PingTarget.cpp. References begin(), end(), and m_targets. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Adds response to target with id. -1 is unreachable or timeout. returns true if id is valid. Definition at line 233 of file PingTarget.cpp. References PingTarget::AddResponseTime(), and Get(). Referenced by main(). Here is the call graph for this function: ![]() |
|
|
Adds target to container if name resolves to valid AF_INET address and maximum number of targets is not exceeded. Returns pointer to new target or NULL. Pointer will only be valid as long as the PingTargets instance. Definition at line 159 of file PingTarget.cpp. References GetMaxTargets(), m_lIdMax, m_lMaxNameWidth, PingTarget::m_sName, and m_targets. Referenced by AddTargets(), and main(). Here is the call graph for this function: ![]() |
|
|
Adds targets in file. One target per line. Returns true if all targets were added succesfully. Definition at line 206 of file PingTarget.cpp. References AddTargets(). Here is the call graph for this function: ![]() |
|
|
Adds targets in stream. One target per line. Returns true if all targets were added succesfully. Definition at line 189 of file PingTarget.cpp. References AddTarget(), and trim_spaces(). Referenced by AddTargets(), and main(). Here is the call graph for this function: ![]() |
|
|
Adds a unreachable response to alle targets without a response.
Definition at line 250 of file PingTarget.cpp. References PingTarget::AddResponseTime(), PingTarget::IsResponseAdded(), and m_targets. Referenced by main(). Here is the call graph for this function: ![]() |
|
|
Definition at line 150 of file PingTarget.h. References m_targets. Referenced by main(), operator<<(), PrintLogCurrent(), PrintLogHeader(), PrintStatistics(), and ~PingTargets(). |
|
|
Sets all response flags on contained targets to false.
Definition at line 244 of file PingTarget.cpp. References m_targets. Referenced by main(). |
|
|
Definition at line 151 of file PingTarget.h. References m_targets. Referenced by main(), operator<<(), PrintLogCurrent(), PrintLogHeader(), PrintStatistics(), and ~PingTargets(). |
|
|
Returns pointer to target or NULL.
Definition at line 225 of file PingTarget.cpp. References m_targets, and size(). Referenced by AddResponse(). Here is the call graph for this function: ![]() |
|
|
Return the longest target name width.
Definition at line 188 of file PingTarget.h. References m_lMaxNameWidth. Referenced by PrintStatistics(), and PrintStatisticsHeader(). |
|
|
Returns the largest sequence number available.
Definition at line 147 of file PingTarget.h. References m_lSequenceMax. Referenced by main(). |
|
|
Returns the maximum number of targets.
Definition at line 220 of file PingTarget.cpp. References m_lIdMax. Referenced by AddTarget(). |
|
|
Sequence is embedded in the sequence parameter of ICMP header as the lower bits defined by mask m_uSeqMask.
Definition at line 265 of file PingTarget.cpp. References m_uSeqMask. Referenced by main(). |
|
|
Target id is embedded in the sequence parameter of ICMP header as the upper bits defined by mask m_uIdMask.
Definition at line 260 of file PingTarget.cpp. References m_lSequenceBits. Referenced by main(). |
|
||||||||||||
|
Calculates ICMP sequence based on id and sequence.
Definition at line 270 of file PingTarget.cpp. References m_lSequenceBits. Referenced by PingTarget::MakeSequence(). |
|
||||||||||||||||||||
|
Prints specified time and current ping values to the specified file as a single line separated by tab character. -1 is unreachable or timeout. If bNewFile is true file is truncated otherwise values are appended to the existing file. Header is added if file is truncated or does not exist. Definition at line 343 of file PingTarget.cpp. References LOG_FILENAME_DAILY, LOG_FILENAME_HOURLY, LOG_FILENAME_PLAIN, PrintLogCurrent(), and PrintLogHeader(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Prints specified time and current ping values to stream as a single line separated by tab character. -1 is unreachable or timeout. Definition at line 330 of file PingTarget.cpp. References begin(), end(), PingTarget::GetCurrent(), and format_system_time::show_seconds. Referenced by main(), and PrintLogCurrent(). Here is the call graph for this function: ![]() |
|
|
Prints log file header for a single target to stream. Header is all target names separated by tab character and a leading tab. Definition at line 319 of file PingTarget.cpp. References begin(), end(), and PingTarget::GetName(). Referenced by PrintLogCurrent(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Prints statistics to stream.
Definition at line 292 of file PingTarget.cpp. References begin(), end(), PingTarget::GetAvg(), PingTarget::GetCurrent(), PingTarget::GetMax(), GetMaxNameWidth(), PingTarget::GetMin(), PingTarget::GetName(), PingTarget::GetSkipped(), PingTarget::GetSkippedPercent(), and PingTarget::GetStdDev(). Referenced by main(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Prints statistics header to stream.
Definition at line 275 of file PingTarget.cpp. References GetMaxNameWidth(). Referenced by main(). Here is the call graph for this function: ![]() |
|
|
Definition at line 152 of file PingTarget.h. References m_targets. |
|
||||||||||||
|
Definition at line 400 of file PingTarget.cpp. |
|
|
High order bits used for ICMP id. Value set in constructor. Should be 2 - 14 bit. Default value is 6 bits or 63 possible targets. Definition at line 197 of file PingTarget.h. Referenced by PingTargets(). |
|
|
Largest id available. Calculated on m_lIdBits. Definition at line 199 of file PingTarget.h. Referenced by AddTarget(), GetMaxTargets(), and PingTargets(). |
|
|
Maximum target name width.
Definition at line 209 of file PingTarget.h. Referenced by AddTarget(), GetMaxNameWidth(), and PingTargets(). |
|
|
Bits used for sequence. Calculated on m_lIdBits. Definition at line 201 of file PingTarget.h. Referenced by GetTargetId(), MakeSequence(), and PingTargets(). |
|
|
Largest sequence value. Calculated on m_uSeqMask. Definition at line 207 of file PingTarget.h. Referenced by GetMaxSequence(), and PingTargets(). |
|
|
Definition at line 212 of file PingTarget.h. Referenced by AddTarget(), AddUnreachableResponses(), begin(), ClearResponseFlags(), end(), Get(), size(), and ~PingTargets(). |
|
|
Mask for id bits only on USHORT value.
Definition at line 203 of file PingTarget.h. Referenced by PingTargets(). |
|
|
Mask for sequence bits only on USHORT value.
Definition at line 205 of file PingTarget.h. Referenced by GetSequence(), and PingTargets(). |
1.4.3