File: pool_ip.h

package info (click to toggle)
pgpool2 3.3.4-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 9,196 kB
  • sloc: ansic: 59,850; sh: 12,893; yacc: 10,787; lex: 4,637; sql: 743; makefile: 481; java: 469; php: 125; ruby: 98; asm: 5
file content (65 lines) | stat: -rw-r--r-- 2,207 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* -*-pgsql-c-*- */
/*
 *
 * $Header$
 *
 * This file was imported from PostgreSQL 8.0.8 source code.
 * See below for the copyright and description.
 *
 * pgpool: a language independent connection pool server for PostgreSQL 
 * written by Tatsuo Ishii
 *
 * Portions Copyright (c) 2003-2008	PgPool Global Development Group
 * Portions Copyright (c) 2003-2005, PostgreSQL Global Development Group
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose and without fee is hereby
 * granted, provided that the above copyright notice appear in all
 * copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of the
 * author not be used in advertising or publicity pertaining to
 * distribution of the software without specific, written prior
 * permission. The author makes no representations about the
 * suitability of this software for any purpose.  It is provided "as
 * is" without express or implied warranty.
 *
 * pool_ip.h.: Definitions for IPv6-aware network access.
 *
 */

#ifndef POOL_IP_H
#define POOL_IP_H

#include "pool_type.h"

extern int getaddrinfo_all(const char *hostname, const char *servname,
				const struct addrinfo * hintp,
				struct addrinfo ** result);
extern void freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai);

extern int getnameinfo_all(const struct sockaddr_storage * addr, int salen,
				char *node, int nodelen,
				char *service, int servicelen,
				int flags);

extern int rangeSockAddr(const struct sockaddr_storage * addr,
			  const struct sockaddr_storage * netaddr,
			  const struct sockaddr_storage * netmask);

extern int SockAddr_cidr_mask(struct sockaddr_storage * mask,
				   char *numbits, int family);

/* imported from PostgreSQL getaddrinfo.c */
#ifndef HAVE_GAI_STRERROR
extern const char * gai_strerror(int errcode);
#endif /* HAVE_GAI_STRERROR */

#ifdef HAVE_IPV6
extern void promote_v4_to_v6_addr(struct sockaddr_storage * addr);
extern void promote_v4_to_v6_mask(struct sockaddr_storage * addr);
#endif

#define IS_AF_INET(fam) ((fam) == AF_INET)
#define IS_AF_UNIX(fam) ((fam) == AF_UNIX)

#endif   /* IP_H */