#include <netinet/ip_icmp.h>
#endif
-#if defined (FREE_BSD) || defined (FREE_BSD5)
+#if defined (FREE_BSD) || defined (FREE_BSD5) || defined(DARWIN)
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
class STG_PINGER
{
public:
- STG_PINGER(time_t delay = 15);
+ typedef std::multimap<uint32_t, time_t> PingIPs;
+ typedef PingIPs::size_type SizeType;
+
+ explicit STG_PINGER(time_t delay = 15);
~STG_PINGER();
int Start();
int Stop();
void AddIP(uint32_t ip);
void DelIP(uint32_t ip);
- int GetPingIPNum() const;
+ SizeType GetPingIPNum() const { return pingIP.size(); }
void PrintAllIP();
int GetIPTime(uint32_t ip, time_t * t) const;
void SetDelayTime(time_t d) { delay = d; }
static void * RunSendPing(void * d);
static void * RunRecvPing(void * d);
- int delay;
+ time_t delay;
bool nonstop;
bool isRunningRecver;
bool isRunningSender;