]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - pool_ip.h
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / pool_ip.h
1 /* -*-pgsql-c-*- */
2 /*
3  *
4  * $Header: /cvsroot/pgpool/pgpool-II/pool_ip.h,v 1.2 2008/01/29 01:56:36 y-asaba Exp $
5  *
6  * This file was imported from PostgreSQL 8.0.8 source code.
7  * See below for the copyright and description.
8  *
9  * pgpool: a language independent connection pool server for PostgreSQL 
10  * written by Tatsuo Ishii
11  *
12  * Portions Copyright (c) 2003-2008     PgPool Global Development Group
13  * Portions Copyright (c) 2003-2005, PostgreSQL Global Development Group
14  *
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.
25  *
26  * pool_ip.h.: Definitions for IPv6-aware network access.
27  *
28  */
29
30 #ifndef POOL_IP_H
31 #define POOL_IP_H
32
33 #include "pool_type.h"
34
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);
39
40 extern int getnameinfo_all(const struct sockaddr_storage * addr, int salen,
41                                 char *node, int nodelen,
42                                 char *service, int servicelen,
43                                 int flags);
44
45 extern int rangeSockAddr(const struct sockaddr_storage * addr,
46                           const struct sockaddr_storage * netaddr,
47                           const struct sockaddr_storage * netmask);
48
49 extern int SockAddr_cidr_mask(struct sockaddr_storage * mask,
50                                    char *numbits, int family);
51
52 /* imported from PostgreSQL getaddrinfo.c */
53 #ifndef HAVE_GAI_STRERROR
54 extern const char * gai_strerror(int errcode);
55 #endif /* HAVE_GAI_STRERROR */
56
57 #ifdef HAVE_IPV6
58 extern void promote_v4_to_v6_addr(struct sockaddr_storage * addr);
59 extern void promote_v4_to_v6_mask(struct sockaddr_storage * addr);
60 #endif
61
62 #define IS_AF_INET(fam) ((fam) == AF_INET)
63 #define IS_AF_UNIX(fam) ((fam) == AF_UNIX)
64
65 #endif   /* IP_H */