Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / libpq / ip.h
blob19349574f8da9f3af21759bc334e761cf31c2855
1 /*-------------------------------------------------------------------------
3 * ip.h
4 * Definitions for IPv6-aware network access.
6 * These definitions are used by both frontend and backend code. Be careful
7 * what you include here!
9 * Copyright (c) 2003-2009, PostgreSQL Global Development Group
11 * $PostgreSQL$
13 *-------------------------------------------------------------------------
15 #ifndef IP_H
16 #define IP_H
18 #include "getaddrinfo.h"
19 #include "libpq/pqcomm.h"
22 extern int pg_getaddrinfo_all(const char *hostname, const char *servname,
23 const struct addrinfo * hintp,
24 struct addrinfo ** result);
25 extern void pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai);
27 extern int pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen,
28 char *node, int nodelen,
29 char *service, int servicelen,
30 int flags);
32 extern int pg_range_sockaddr(const struct sockaddr_storage * addr,
33 const struct sockaddr_storage * netaddr,
34 const struct sockaddr_storage * netmask);
36 extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask,
37 char *numbits, int family);
39 #ifdef HAVE_IPV6
40 extern void pg_promote_v4_to_v6_addr(struct sockaddr_storage * addr);
41 extern void pg_promote_v4_to_v6_mask(struct sockaddr_storage * addr);
42 #endif
44 #ifdef HAVE_UNIX_SOCKETS
45 #define IS_AF_UNIX(fam) ((fam) == AF_UNIX)
46 #else
47 #define IS_AF_UNIX(fam) (0)
48 #endif
50 #endif /* IP_H */