Use a monotonic clock where appropriate.
[darkstat] / localip.h
1 /* darkstat 3
2 * copyright (c) 2001-2011 Emil Mikulic.
3 *
4 * localip.h: determine the local IPs of an interface
5 *
6 * You may use, modify and redistribute this file under the terms of the
7 * GNU General Public License version 2. (see COPYING.GPL)
8 */
9 #ifndef __DARKSTAT_LOCALIP_H
10 #define __DARKSTAT_LOCALIP_H
11
12 #include <time.h>
13
14 struct local_ips {
15 int is_valid;
16 long last_update_mono;
17 int num_addrs;
18 struct addr *addrs;
19 };
20
21 extern struct local_ips *local_ips;
22
23 struct local_ips *localip_make(void);
24 void localip_free(struct local_ips *ips);
25
26 void localip_update(const char *iface, struct local_ips *ips);
27 int is_localip(const struct addr * const a,
28 const struct local_ips * const ips);
29
30 #endif
31 /* vim:set ts=3 sw=3 tw=80 et: */