PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ifaddr.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * ifaddr.h
4  * IP netmask calculations, and enumerating network interfaces.
5  *
6  * Copyright (c) 2003-2017, PostgreSQL Global Development Group
7  *
8  * src/include/libpq/ifaddr.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef IFADDR_H
13 #define IFADDR_H
14 
15 #include "libpq/pqcomm.h" /* pgrminclude ignore */
16 
17 typedef void (*PgIfAddrCallback) (struct sockaddr *addr,
18  struct sockaddr *netmask,
19  void *cb_data);
20 
21 extern int pg_range_sockaddr(const struct sockaddr_storage *addr,
22  const struct sockaddr_storage *netaddr,
23  const struct sockaddr_storage *netmask);
24 
25 extern int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask,
26  char *numbits, int family);
27 
28 extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data);
29 
30 #endif /* IFADDR_H */
int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data)
Definition: ifaddr.c:559
void(* PgIfAddrCallback)(struct sockaddr *addr, struct sockaddr *netmask, void *cb_data)
Definition: ifaddr.h:17
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:48
int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family)
Definition: ifaddr.c:115
int pg_range_sockaddr(const struct sockaddr_storage *addr, const struct sockaddr_storage *netaddr, const struct sockaddr_storage *netmask)
Definition: ifaddr.c:53