Merge tag 'upstream/3.0.717'
[darkstat-debian] / localip.h
index 21231b6..a5b48ea 100644 (file)
--- 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 <time.h>
 
-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: */