-
-static monitor_host_t **hosts = NULL;
-static int isVerbose = 0;
-static int keepBanging = 0;
-static unsigned short ident;
-static int send_delay = 1;
-
-
-
-
-
-
-
-
-
-
-
-
-
-int main(int ac, char **av)
-{
- extern char* optarg;
- extern int optind;
- char *cfgfile=NULL;
- int param;
-
- while((param = getopt(ac, av, "rvf:")) != -1)
- switch(param)
- {
- case 'v':
- isVerbose = 1;
- break;
- case 'r':
- keepBanging = 1;
- break;
- case 'f':
- cfgfile=strdup(optarg);
- break;
- default:
- fprintf(stderr,"Usage: icmpmonitor [-v] [-r] [-f cfgfile]\n");
- exit(EXIT_FAILURE);
- }
-
- if (!cfgfile) {
- fprintf(stderr, "ERROR: No config file specified.\n");
- exit(EXIT_FAILURE);
- }
-
- read_hosts(cfgfile);
-
- init_hosts();
-
- ident=getpid() & 0xFFFF;
-
- (void)signal(SIGALRM, pinger);
- alarm(send_delay);
-
- get_response();
-
- exit(EXIT_SUCCESS);
-}
-
+static struct monitor_host ** hosts = NULL;
+static bool verbose = false;
+static int keepBanging = 0;
+static int send_delay = 1;