[Autosec-devel] sonar/plugins network_icmp.c,1.43,1.44
Brought to you by:
red0x
From: red0x <re...@us...> - 2004-04-08 21:22:19
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13252/plugins Modified Files: network_icmp.c Log Message: Timing and verbosity fix Index: network_icmp.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/network_icmp.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** network_icmp.c 8 Apr 2004 19:11:02 -0000 1.43 --- network_icmp.c 8 Apr 2004 21:09:07 -0000 1.44 *************** *** 55,59 **** /// Timestamp Time zone static struct timezone tz; ! static unsigned int num_hosts; /// Plugin's plugin_t structure, built by plugin_init --- 55,59 ---- /// Timestamp Time zone static struct timezone tz; ! //static unsigned int num_hosts; /// Plugin's plugin_t structure, built by plugin_init *************** *** 129,133 **** ready = false; ! num_hosts = 0; my_type = ICMP_ECHO; my_code = 0; --- 129,133 ---- ready = false; ! //num_hosts = 0; my_type = ICMP_ECHO; my_code = 0; *************** *** 173,177 **** ready = false; - num_hosts = 0; mthis = NULL; return PLUGIN_UNLOADED; --- 173,176 ---- *************** *** 414,418 **** pthis.ready = true; seq_no = 1 + (int) (70.0 * rand() / (RAND_MAX + 1.0)); - num_hosts = mthis->num_targets; return PLUGIN_OK; } --- 413,416 ---- *************** *** 465,470 **** recd.socket = my_socket; - recd.hosts = num_hosts; - /* this is a broad cast address, not a range */ low_seq = recd.start = clock(); --- 463,466 ---- *************** *** 498,502 **** targets->entry, targets->extra_hosts); #endif ! if(mthis->opts.iVerbose > 0) err_msg("Increasing timeout, netmask detected\n"); } --- 494,498 ---- targets->entry, targets->extra_hosts); #endif ! if(mthis->opts.iVerbose > 1) err_msg("Increasing timeout, netmask detected\n"); } *************** *** 511,515 **** /* sleep after this host (allows more dest unreachables to come back) */ ! if(counter < num_hosts && mthis->opts.iHostDelay > 0) usleep(mthis->opts.iHostDelay * 1000); } --- 507,511 ---- /* sleep after this host (allows more dest unreachables to come back) */ ! if(counter < mthis->num_targets && mthis->opts.iHostDelay > 0) usleep(mthis->opts.iHostDelay * 1000); } *************** *** 810,816 **** rec->responses = 0; ! ! /*while((done == 0 || clock() <= rec->max) && rec->responses < rec->hosts)*/ ! while(done == 0 || ((clock() <= (rec->max * CLOCKS_PER_SEC * rec->hosts) + rec->start)) && rec->responses < rec->hosts) { tr.tv_sec = 0; --- 806,811 ---- rec->responses = 0; ! ! while(done == 0 || ((clock() <= (rec->max * CLOCKS_PER_SEC * rec->hosts) + rec->start) && rec->responses < rec->hosts)) { tr.tv_sec = 0; |