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