2 * Object oriented C module to send ICMP and ICMPv6 `echo's.
3 * Copyright (C) 2006 Florian octo Forster <octo at verplant.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #define AI_ADDRCONFIG 0
28 #include <sys/types.h>
37 #include <sys/types.h>
38 #include <sys/socket.h>
40 #include <netinet/ip_icmp.h>
41 #include <netinet/icmp6.h>
50 typedef struct pinghost
53 struct sockaddr_storage *addr;
59 struct timeval *timer;
61 struct pinghost *next;
70 typedef pinghost_t pingobj_iter_t;
75 pingobj_t *ping_construct (int flags);
76 void ping_destroy (pingobj_t *obj);
78 int ping_send (pingobj_t *obj);
80 int ping_host_add (pingobj_t *obj, const char *host);
81 int ping_host_remove (pingobj_t *obj, const char *host);
83 pingobj_iter_t *ping_iterator_get (pingobj_t *obj);
84 pingobj_iter_t *ping_iterator_next (pingobj_iter_t *iter);
86 const char *ping_iterator_get_host (pingobj_iter_t *iter);
87 double ping_iterator_get_latency (pingobj_iter_t *iter);
89 #endif /* OCTO_PING_H */