diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/common/ip.h (renamed from src/include/libpq/ip.h) | 18 | ||||
| -rw-r--r-- | src/include/common/md5.h (renamed from src/include/libpq/md5.h) | 2 | ||||
| -rw-r--r-- | src/include/libpq/ifaddr.h | 30 |
3 files changed, 33 insertions, 17 deletions
diff --git a/src/include/libpq/ip.h b/src/include/common/ip.h index ce9bc6e2253..36e05113241 100644 --- a/src/include/libpq/ip.h +++ b/src/include/common/ip.h @@ -3,12 +3,11 @@ * ip.h * Definitions for IPv6-aware network access. * - * These definitions are used by both frontend and backend code. Be careful - * what you include here! + * These definitions are used by both frontend and backend code. * * Copyright (c) 2003-2016, PostgreSQL Global Development Group * - * src/include/libpq/ip.h + * src/include/common/ip.h * *------------------------------------------------------------------------- */ @@ -25,10 +24,6 @@ #define IS_AF_UNIX(fam) (0) #endif -typedef void (*PgIfAddrCallback) (struct sockaddr * addr, - struct sockaddr * netmask, - void *cb_data); - extern int pg_getaddrinfo_all(const char *hostname, const char *servname, const struct addrinfo * hintp, struct addrinfo ** result); @@ -39,13 +34,4 @@ extern int pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen, char *service, int servicelen, int flags); -extern int pg_range_sockaddr(const struct sockaddr_storage * addr, - const struct sockaddr_storage * netaddr, - const struct sockaddr_storage * netmask); - -extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, - char *numbits, int family); - -extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data); - #endif /* IP_H */ diff --git a/src/include/libpq/md5.h b/src/include/common/md5.h index f3eec8b4f4f..4a0432076a0 100644 --- a/src/include/libpq/md5.h +++ b/src/include/common/md5.h @@ -9,7 +9,7 @@ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * src/include/libpq/md5.h + * src/include/common/md5.h * *------------------------------------------------------------------------- */ diff --git a/src/include/libpq/ifaddr.h b/src/include/libpq/ifaddr.h new file mode 100644 index 00000000000..40094a612a4 --- /dev/null +++ b/src/include/libpq/ifaddr.h @@ -0,0 +1,30 @@ +/*------------------------------------------------------------------------- + * + * ifaddr.h + * IP netmask calculations, and enumerating network interfaces. + * + * Copyright (c) 2003-2016, PostgreSQL Global Development Group + * + * src/include/libpq/ifaddr.h + * + *------------------------------------------------------------------------- + */ +#ifndef IFADDR_H +#define IFADDR_H + +#include "libpq/pqcomm.h" /* pgrminclude ignore */ + +typedef void (*PgIfAddrCallback) (struct sockaddr * addr, + struct sockaddr * netmask, + void *cb_data); + +extern int pg_range_sockaddr(const struct sockaddr_storage * addr, + const struct sockaddr_storage * netaddr, + const struct sockaddr_storage * netmask); + +extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, + char *numbits, int family); + +extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data); + +#endif /* IFADDR_H */ |
