File: localip.h

package info (click to toggle)
darkstat 3.0.722-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 868 kB
  • sloc: ansic: 7,585; sh: 660; javascript: 213; makefile: 174; php: 15
file content (29 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* darkstat 3
 * copyright (c) 2001-2014 Emil Mikulic.
 *
 * 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

#include <time.h>

struct local_ips {
   int is_valid;
   time_t last_update_mono;
   int num_addrs;
   struct addr *addrs;
};

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: */