6 int main (int argc, char **argv)
15 printf ("Usage: %s <host> [host [host [...]]]\n", argv[0]);
19 if ((ping = ping_construct ()) == NULL)
21 fprintf (stderr, "ping_construct failed\n");
25 for (i = 1; i < argc; i++)
27 printf ("Adding host `%s'..\n", argv[i]);
29 if (ping_host_add (ping, argv[i]) > 0)
31 fprintf (stderr, "ping_host_add (verplant.org) failed\n");
38 if (ping_send (ping) < 0)
40 fprintf (stderr, "ping_send failed\n");
44 for (iter = ping_iterator_get (ping); iter != NULL; iter = ping_iterator_next (iter))
49 host = ping_iterator_get_host (iter);
50 latency = ping_iterator_get_latency (iter);
52 printf ("host = %s, latency = %f\n", host, latency);