From 503498839b43a3983f0bb2cbbd98da1a42e46044 Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Sun, 22 Sep 2019 03:17:45 -0700 Subject: [PATCH] Misc minor updates. --- icmpmonitor.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/icmpmonitor.c b/icmpmonitor.c index 164bf5e..8b176b9 100644 --- a/icmpmonitor.c +++ b/icmpmonitor.c @@ -1,10 +1,13 @@ /* - * Monitor hosts using ICMP "echo" and notify when down. - * TODO: Write a better description. + * ICMPmonitor + * + * Monitors hosts using ICMP 'echo', executing a user-specified command + * whenever hosts change state between responsive and unresponsive. * * © 2019 Aaron Taylor * © 1999 Vadim Zaliva * © 1989 The Regents of the University of California & Mike Muuss + * * See LICENSE file for copyright and license details. */ @@ -24,6 +27,7 @@ #include #include #include + #include "iniparser/iniparser.h" #define VERSION 2 @@ -123,7 +127,7 @@ tv_sub(register struct timeval * out, register struct timeval * in) static void pinger(int ignore) { - int cc, i; + int i; struct icmp * icp; struct monitor_host * p; u_char outpack[MAXPACKETSIZE]; @@ -164,7 +168,7 @@ pinger(int ignore) gettimeofday((struct timeval *) &outpack[8], (struct timezone *) NULL); - cc = DEFAULTDATALEN + 8; /* skips ICMP portion */ + int cc = DEFAULTDATALEN + 8; /* skips ICMP portion */ /* compute ICMP checksum */ icp->icmp_cksum = in_cksum((unsigned short *) icp, cc); -- 2.20.1