~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/include/libpq/ip.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * ip.h
 
4
 *        Definitions for IPv6-aware network access.
 
5
 *
 
6
 * These definitions are used by both frontend and backend code.  Be careful
 
7
 * what you include here!
 
8
 *
 
9
 * Copyright (c) 2003-2009, PostgreSQL Global Development Group
 
10
 *
 
11
 * $PostgreSQL$
 
12
 *
 
13
 *-------------------------------------------------------------------------
 
14
 */
 
15
#ifndef IP_H
 
16
#define IP_H
 
17
 
 
18
#include "getaddrinfo.h"
 
19
#include "libpq/pqcomm.h"
 
20
 
 
21
 
 
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);
 
26
 
 
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);
 
31
 
 
32
extern int pg_range_sockaddr(const struct sockaddr_storage * addr,
 
33
                                  const struct sockaddr_storage * netaddr,
 
34
                                  const struct sockaddr_storage * netmask);
 
35
 
 
36
extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask,
 
37
                                          char *numbits, int family);
 
38
 
 
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
 
43
 
 
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
 
49
 
 
50
#endif   /* IP_H */