4 * $Header: /cvsroot/pgpool/pgpool-II/pool_ip.h,v 1.2 2008/01/29 01:56:36 y-asaba Exp $
6 * This file was imported from PostgreSQL 8.0.8 source code.
7 * See below for the copyright and description.
9 * pgpool: a language independent connection pool server for PostgreSQL
10 * written by Tatsuo Ishii
12 * Portions Copyright (c) 2003-2008 PgPool Global Development Group
13 * Portions Copyright (c) 2003-2005, PostgreSQL Global Development Group
15 * Permission to use, copy, modify, and distribute this software and
16 * its documentation for any purpose and without fee is hereby
17 * granted, provided that the above copyright notice appear in all
18 * copies and that both that copyright notice and this permission
19 * notice appear in supporting documentation, and that the name of the
20 * author not be used in advertising or publicity pertaining to
21 * distribution of the software without specific, written prior
22 * permission. The author makes no representations about the
23 * suitability of this software for any purpose. It is provided "as
24 * is" without express or implied warranty.
26 * pool_ip.h.: Definitions for IPv6-aware network access.
33 #include "pool_type.h"
35 extern int getaddrinfo_all(const char *hostname, const char *servname,
36 const struct addrinfo * hintp,
37 struct addrinfo ** result);
38 extern void freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai);
40 extern int getnameinfo_all(const struct sockaddr_storage * addr, int salen,
41 char *node, int nodelen,
42 char *service, int servicelen,
45 extern int rangeSockAddr(const struct sockaddr_storage * addr,
46 const struct sockaddr_storage * netaddr,
47 const struct sockaddr_storage * netmask);
49 extern int SockAddr_cidr_mask(struct sockaddr_storage * mask,
50 char *numbits, int family);
52 /* imported from PostgreSQL getaddrinfo.c */
53 #ifndef HAVE_GAI_STRERROR
54 extern const char * gai_strerror(int errcode);
55 #endif /* HAVE_GAI_STRERROR */
58 extern void promote_v4_to_v6_addr(struct sockaddr_storage * addr);
59 extern void promote_v4_to_v6_mask(struct sockaddr_storage * addr);
62 #define IS_AF_INET(fam) ((fam) == AF_INET)
63 #define IS_AF_UNIX(fam) ((fam) == AF_UNIX)