ares_private.h: use curl_memdebug.h instead of memdebug.h
[platform/upstream/c-ares.git] / ares_getnameinfo.3
index 55918ff..7e4990c 100644 (file)
-.\" $Id$\r
-.\"\r
-.\" Copyright 2005 by Dominick Meglio.\r
-.\"\r
-.\" Permission to use, copy, modify, and distribute this\r
-.\" software and its documentation for any purpose and without\r
-.\" fee is hereby granted, provided that the above copyright\r
-.\" notice appear in all copies and that both that copyright\r
-.\" notice and this permission notice appear in supporting\r
-.\" documentation, and that the name of M.I.T. not be used in\r
-.\" advertising or publicity pertaining to distribution of the\r
-.\" software without specific, written prior permission.\r
-.\" M.I.T. makes no representations about the suitability of\r
-.\" this software for any purpose.  It is provided "as is"\r
-.\" without express or implied warranty.\r
-.\"\r
-.TH ARES_GETNAMEINFO 3 "16 May 2005"\r
-.SH NAME\r
-ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner\r
-.SH SYNOPSIS\r
-.nf\r
-.B #include <ares.h>\r
-.PP\r
-.B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,\r
-.B     int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)\r
-.PP\r
-.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,\r
-.B     socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,\r
-.B     void *\fIarg\fP)\r
-.fi\r
-.SH DESCRIPTION\r
-The\r
-.B ares_getnameinfo\r
-function is defined for protocol-independent address translation. The function\r
-is a combination of \fIares_gethostbyaddr(3)\fP and \fIgetservbyport(3)\fP. The function will\r
-translate the address either by executing a host query on the name service channel\r
-identified by\r
-.IR channel \r
-or it will attempt to resolve it locally if possible.\r
-The parameters\r
-.I sa\r
-and\r
-.I len\r
-give the address as a sockaddr structure, and\r
-.I flags\r
-gives the options that the function will use.  Valid flags are listed below:\r
-.TP 19\r
-.B ARES_NI_NOFQDN\r
-Only the nodename portion of the FQDN is returned for local hosts.\r
-.TP 19\r
-.B ARES_NI_NUMERICHOST\r
-The numeric form of the hostname is returned rather than the name.\r
-.TP 19\r
-.B ARES_NI_NAMEREQD\r
-An error is returned if the hostname cannot be found in the DNS.\r
-.TP 19\r
-.B ARES_NI_NUMERICSERV\r
-The numeric form of the service is returned rather than the name.\r
-.TP 19\r
-.B ARES_NI_TCP\r
-The service name is to be looked up for the TCP protocol.\r
-.TP 19\r
-.B ARES_NI_UDP\r
-The service name is to be looked up for the UDP protocol.\r
-.TP 19\r
-.B ARES_NI_SCTP\r
-The service name is to be looked up for the SCTP protocol.\r
-.TP 19\r
-.B ARES_NI_DCCP\r
-The service name is to be looked up for the DCCP protocol.\r
-.TP 19\r
-.B ARES_NI_NUMERICSCOPE\r
-The numeric form of the scope ID is returned rather than the name.\r
-.TP 19\r
-.B ARES_NI_LOOKUPHOST\r
-A hostname lookup is being requested.\r
-.TP 19\r
-.B ARES_NI_LOOKUPSERVICE\r
-A service name lookup is being requested.\r
-.PP\r
-When the query\r
-is complete or has \r
-failed, the ares library will invoke \fIcallback\fP.  Completion or failure of \r
-the query may happen immediately, or may happen during a later call to\r
-\fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP.\r
-.PP\r
-The callback argument\r
-.I arg\r
-is copied from the\r
-.B ares_getnameinfo\r
-argument\r
-.IR arg .\r
-The callback argument\r
-.I status\r
-indicates whether the query succeeded and, if not, how it failed.  It\r
-may have any of the following values:\r
-.TP 19\r
-.B ARES_SUCCESS\r
-The host lookup completed successfully.\r
-.TP 19\r
-.B ARES_ENOTIMP\r
-The ares library does not know how to look up addresses of type\r
-.IR family .\r
-.TP 19\r
-.B ARES_ENOTFOUND\r
-The address\r
-.I addr\r
-was not found.\r
-.TP 19\r
-.B ARES_ENOMEM\r
-Memory was exhausted.\r
-.TP 19\r
-.B ARES_EDESTRUCTION\r
-The name service channel\r
-.I channel\r
-is being destroyed; the query will not be completed.\r
-.TP 19\r
-.B ARES_EBADFLAGS\r
-The\r
-.I flags\r
-parameter contains an illegal value.\r
-.PP\r
-The callback argument\r
-.I timeouts\r
-reports how many times a query timed out during the execution of the\r
-given request.\r
-.PP\r
-On successful completion of the query, the callback argument\r
-.I node\r
-contains a string representing the hostname (assuming \r
-.B ARES_NI_LOOKUPHOST\r
-was specified). Additionally, \r
-.I service\r
-contains a string representing the service name (assuming\r
-.B ARES_NI_LOOKUPSERVICE\r
-was specified).\r
-If the query did not complete successfully, or one of the values\r
-was not requested, \r
-.I node\r
-or\r
-.I service\r
-will be \r
-.BR NULL .\r
-.SH SEE ALSO\r
-.BR ares_process (3),\r
-.BR ares_getaddrinfo (3)\r
-.SH AUTHOR\r
-Dominick Meglio\r
-.br\r
-Copyright 2005 by Dominick Meglio.\r
+.\"
+.\" Copyright 2005 by Dominick Meglio.
+.\"
+.\" 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 M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose.  It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_GETNAMEINFO 3 "1 May 2009"
+.SH NAME
+ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
+.B     int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
+.PP
+.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
+.B     ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
+.B     void *\fIarg\fP)
+.fi
+.SH DESCRIPTION
+The
+.B ares_getnameinfo
+function is defined for protocol-independent address translation. The function
+is a combination of \fIares_gethostbyaddr(3)\fP and \fIgetservbyport(3)\fP. The function will
+translate the address either by executing a host query on the name service channel
+identified by
+.IR channel 
+or it will attempt to resolve it locally if possible.
+The parameters
+.I sa
+and
+.I len
+give the address as a sockaddr structure, and
+.I flags
+gives the options that the function will use.  Valid flags are listed below:
+.TP 19
+.B ARES_NI_NOFQDN
+Only the nodename portion of the FQDN is returned for local hosts.
+.TP 19
+.B ARES_NI_NUMERICHOST
+The numeric form of the hostname is returned rather than the name.
+.TP 19
+.B ARES_NI_NAMEREQD
+An error is returned if the hostname cannot be found in the DNS.
+.TP 19
+.B ARES_NI_NUMERICSERV
+The numeric form of the service is returned rather than the name.
+.TP 19
+.B ARES_NI_TCP
+The service name is to be looked up for the TCP protocol.
+.TP 19
+.B ARES_NI_UDP
+The service name is to be looked up for the UDP protocol.
+.TP 19
+.B ARES_NI_SCTP
+The service name is to be looked up for the SCTP protocol.
+.TP 19
+.B ARES_NI_DCCP
+The service name is to be looked up for the DCCP protocol.
+.TP 19
+.B ARES_NI_NUMERICSCOPE
+The numeric form of the scope ID is returned rather than the name.
+.TP 19
+.B ARES_NI_LOOKUPHOST
+A hostname lookup is being requested.
+.TP 19
+.B ARES_NI_LOOKUPSERVICE
+A service name lookup is being requested.
+.PP
+When the query
+is complete or has 
+failed, the ares library will invoke \fIcallback\fP.  Completion or failure of 
+the query may happen immediately, or may happen during a later call to
+\fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP.
+.PP
+The callback argument
+.I arg
+is copied from the
+.B ares_getnameinfo
+argument
+.IR arg .
+The callback argument
+.I status
+indicates whether the query succeeded and, if not, how it failed.  It
+may have any of the following values:
+.TP 19
+.B ARES_SUCCESS
+The host lookup completed successfully.
+.TP 19
+.B ARES_ENOTIMP
+The ares library does not know how to look up addresses of type
+.IR family .
+.TP 19
+.B ARES_ENOTFOUND
+The address
+.I addr
+was not found.
+.TP 19
+.B ARES_ENOMEM
+Memory was exhausted.
+.TP 19
+.B ARES_EDESTRUCTION
+The name service channel
+.I channel
+is being destroyed; the query will not be completed.
+.TP 19
+.B ARES_EBADFLAGS
+The
+.I flags
+parameter contains an illegal value.
+.PP
+The callback argument
+.I timeouts
+reports how many times a query timed out during the execution of the
+given request.
+.PP
+On successful completion of the query, the callback argument
+.I node
+contains a string representing the hostname (assuming 
+.B ARES_NI_LOOKUPHOST
+was specified). Additionally, 
+.I service
+contains a string representing the service name (assuming
+.B ARES_NI_LOOKUPSERVICE
+was specified).
+If the query did not complete successfully, or one of the values
+was not requested, 
+.I node
+or
+.I service
+will be 
+.BR NULL .
+.SH SEE ALSO
+.BR ares_process (3),
+.BR ares_getaddrinfo (3)
+.SH AUTHOR
+Dominick Meglio
+.br
+Copyright 2005 by Dominick Meglio.