X-Git-Url: https://unix4lyfe.org/gitweb/darkstat-debian/blobdiff_plain/a1e8056c92203d02860d719abb1d562453896da8..53d9d497ad0dcb0c37efb23a5468762355db6512:/localip.h diff --git a/localip.h b/localip.h index 21231b6..a5b48ea 100644 --- a/localip.h +++ b/localip.h @@ -1,15 +1,29 @@ /* darkstat 3 * copyright (c) 2001-2011 Emil Mikulic. * - * localip.h: determine local IP of our capture interface + * localip.h: determine the local IPs of an interface * * You may use, modify and redistribute this file under the terms of the * GNU General Public License version 2. (see COPYING.GPL) */ +#ifndef __DARKSTAT_LOCALIP_H +#define __DARKSTAT_LOCALIP_H -extern struct addr localip4, localip6; +#include -void localip_init(const char *interface); -void localip_update(void); +struct local_ips { + int is_valid; + long last_update_mono; + int num_addrs; + struct addr *addrs; +}; -/* vim:set ts=3 sw=3 tw=78 expandtab: */ +void localip_init(struct local_ips *ips); +void localip_free(struct local_ips *ips); + +void localip_update(const char *iface, struct local_ips *ips); +int is_localip(const struct addr * const a, + const struct local_ips * const ips); + +#endif +/* vim:set ts=3 sw=3 tw=80 et: */