/[cvs]/ccvs/lib/getaddrinfo.h
ViewVC logotype

Diff of /ccvs/lib/getaddrinfo.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dprice, Thu Sep 8 15:58:10 2005 UTC revision 1.3 by dprice, Tue Oct 4 02:34:53 2005 UTC
# Line 19  Line 19 
19  #ifndef GETADDRINFO_H  #ifndef GETADDRINFO_H
20  # define GETADDRINFO_H  # define GETADDRINFO_H
21    
22  /* Get getaddrinfo declarations, if available.  Also get 'socklen_t',  /* Get all getaddrinfo related declarations, if available.  */
23     and 'struct sockaddr' via sys/types.h which are used below. */  # ifdef HAVE_SYS_SOCKET_H
24  # include <sys/types.h>  #  include <sys/socket.h>
25  # include <sys/socket.h>  # endif
26  # include <netdb.h>  # ifdef HAVE_NETDB_H
27    #  include <netdb.h>
28    # endif
29    
30    # ifndef HAVE_STRUCT_ADDRINFO
31    
32  # if !HAVE_GETADDRINFO  /* Get 'socklen_t', and 'struct sockaddr' via sys/types.h which are
33       used below. */
34    #  ifdef HAVE_SYS_TYPES_H
35    #   include <sys/types.h>
36    #  endif
37    
38  /* Structure to contain information about address of a service provider.  */  /* Structure to contain information about address of a service provider.  */
39  struct addrinfo  struct addrinfo
# Line 39  struct addrinfo Line 47  struct addrinfo
47    char *ai_canonname;           /* Canonical name for service location.  */    char *ai_canonname;           /* Canonical name for service location.  */
48    struct addrinfo *ai_next;     /* Pointer to next in list.  */    struct addrinfo *ai_next;     /* Pointer to next in list.  */
49  };  };
50    # endif
51    
52  /* Possible values for `ai_flags' field in `addrinfo' structure.  */  /* Possible values for `ai_flags' field in `addrinfo' structure.  */
53  # define AI_PASSIVE     0x0001  /* Socket address is intended for `bind'.  */  # ifndef AI_PASSIVE
54  # define AI_CANONNAME   0x0002  /* Request for canonical name.  */  #  define AI_PASSIVE    0x0001  /* Socket address is intended for `bind'.  */
55  # define AI_NUMERICHOST 0x0004  /* Don't use name resolution.  */  #  define AI_CANONNAME  0x0002  /* Request for canonical name.  */
56  # define AI_V4MAPPED    0x0008  /* IPv4 mapped addresses are acceptable.  */  #  define AI_NUMERICHOST 0x0004 /* Don't use name resolution.  */
57  # define AI_ALL         0x0010  /* Return IPv4 mapped and IPv6 addresses.  */  #  define AI_V4MAPPED   0x0008  /* IPv4 mapped addresses are acceptable.  */
58  # define AI_ADDRCONFIG  0x0020  /* Use configuration of this host to choose  #  define AI_ALL        0x0010  /* Return IPv4 mapped and IPv6 addresses.  */
59    #  define AI_ADDRCONFIG 0x0020  /* Use configuration of this host to choose
60                                     returned address type..  */                                     returned address type..  */
61    # endif
62    
63  /* Error values for `getaddrinfo' function.  */  /* Error values for `getaddrinfo' function.  */
64  # define EAI_BADFLAGS     -1    /* Invalid value for `ai_flags' field.  */  # ifndef EAI_BADFLAGS
65  # define EAI_NONAME       -2    /* NAME or SERVICE is unknown.  */  #  define EAI_BADFLAGS    -1    /* Invalid value for `ai_flags' field.  */
66  # define EAI_AGAIN        -3    /* Temporary failure in name resolution.  */  #  define EAI_NONAME      -2    /* NAME or SERVICE is unknown.  */
67  # define EAI_FAIL         -4    /* Non-recoverable failure in name res.  */  #  define EAI_AGAIN       -3    /* Temporary failure in name resolution.  */
68  # define EAI_NODATA       -5    /* No address associated with NAME.  */  #  define EAI_FAIL        -4    /* Non-recoverable failure in name res.  */
69  # define EAI_FAMILY       -6    /* `ai_family' not supported.  */  #  define EAI_NODATA      -5    /* No address associated with NAME.  */
70  # define EAI_SOCKTYPE     -7    /* `ai_socktype' not supported.  */  #  define EAI_FAMILY      -6    /* `ai_family' not supported.  */
71  # define EAI_SERVICE      -8    /* SERVICE not supported for `ai_socktype'.  */  #  define EAI_SOCKTYPE    -7    /* `ai_socktype' not supported.  */
72  # define EAI_ADDRFAMILY   -9    /* Address family for NAME not supported.  */  #  define EAI_SERVICE     -8    /* SERVICE not supported for `ai_socktype'.  */
73  # define EAI_MEMORY       -10   /* Memory allocation failure.  */  #  define EAI_ADDRFAMILY  -9    /* Address family for NAME not supported.  */
74  # define EAI_SYSTEM       -11   /* System error returned in `errno'.  */  #  define EAI_MEMORY      -10   /* Memory allocation failure.  */
75  # define EAI_OVERFLOW     -12   /* Argument buffer overflow.  */  #  define EAI_SYSTEM      -11   /* System error returned in `errno'.  */
76    #  define EAI_OVERFLOW    -12   /* Argument buffer overflow.  */
77    # endif
78    
79  # ifdef __USE_GNU  # ifdef __USE_GNU
80  #  define EAI_INPROGRESS  -100  /* Processing request in progress.  */  #  ifndef EAI_INPROGRESS
81  #  define EAI_CANCELED    -101  /* Request canceled.  */  #   define EAI_INPROGRESS       -100    /* Processing request in progress.  */
82  #  define EAI_NOTCANCELED -102  /* Request not canceled.  */  #   define EAI_CANCELED         -101    /* Request canceled.  */
83  #  define EAI_ALLDONE     -103  /* All requests done.  */  #   define EAI_NOTCANCELED      -102    /* Request not canceled.  */
84  #  define EAI_INTR        -104  /* Interrupted by a signal.  */  #   define EAI_ALLDONE          -103    /* All requests done.  */
85  #  define EAI_IDN_ENCODE  -105  /* IDN encoding failed.  */  #   define EAI_INTR             -104    /* Interrupted by a signal.  */
86    #   define EAI_IDN_ENCODE       -105    /* IDN encoding failed.  */
87    #  endif
88  # endif  # endif
89    
90    # ifndef HAVE_DECL_GETADDRINFO
91  /* Translate name of a service location and/or a service name to set of  /* Translate name of a service location and/or a service name to set of
92     socket addresses.     socket addresses.
93     For more details, see the POSIX:2001 specification     For more details, see the POSIX:2001 specification
# Line 79  extern int getaddrinfo (const char *rest Line 96  extern int getaddrinfo (const char *rest
96                          const char *restrict servname,                          const char *restrict servname,
97                          const struct addrinfo *restrict hints,                          const struct addrinfo *restrict hints,
98                          struct addrinfo **restrict res);                          struct addrinfo **restrict res);
99    # endif
100    
101    # ifndef HAVE_DECL_FREEADDRINFO
102  /* Free `addrinfo' structure AI including associated storage.  /* Free `addrinfo' structure AI including associated storage.
103     For more details, see the POSIX:2001 specification     For more details, see the POSIX:2001 specification
104     <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */     <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
105  extern void freeaddrinfo (struct addrinfo *ai);  extern void freeaddrinfo (struct addrinfo *ai);
106    # endif
107    
108    # ifndef HAVE_DECL_GAI_STRERROR
109  /* Convert error return from getaddrinfo() to a string.  /* Convert error return from getaddrinfo() to a string.
110     For more details, see the POSIX:2001 specification     For more details, see the POSIX:2001 specification
111     <http://www.opengroup.org/susv3xsh/gai_strerror.html>.  */     <http://www.opengroup.org/susv3xsh/gai_strerror.html>.  */
112  extern const char *gai_strerror (int ecode);  extern const char *gai_strerror (int ecode);
113    # endif
 # endif /* !HAVE_GETADDRINFO */  
114    
115  #endif /* GETADDRINFO_H */  #endif /* GETADDRINFO_H */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26