|
Packit |
514978 |
.\"
|
|
Packit |
514978 |
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
|
Packit |
514978 |
.\"
|
|
Packit |
514978 |
.\" Permission to use, copy, modify, and distribute this
|
|
Packit |
514978 |
.\" software and its documentation for any purpose and without
|
|
Packit |
514978 |
.\" fee is hereby granted, provided that the above copyright
|
|
Packit |
514978 |
.\" notice appear in all copies and that both that copyright
|
|
Packit |
514978 |
.\" notice and this permission notice appear in supporting
|
|
Packit |
514978 |
.\" documentation, and that the name of M.I.T. not be used in
|
|
Packit |
514978 |
.\" advertising or publicity pertaining to distribution of the
|
|
Packit |
514978 |
.\" software without specific, written prior permission.
|
|
Packit |
514978 |
.\" M.I.T. makes no representations about the suitability of
|
|
Packit |
514978 |
.\" this software for any purpose. It is provided "as is"
|
|
Packit |
514978 |
.\" without express or implied warranty.
|
|
Packit |
514978 |
.\"
|
|
Packit |
514978 |
.TH ARES_EXPAND_NAME 3 "20 Nov 2009"
|
|
Packit |
514978 |
.SH NAME
|
|
Packit |
514978 |
ares_expand_name \- Expand a DNS-encoded domain name
|
|
Packit |
514978 |
.SH SYNOPSIS
|
|
Packit |
514978 |
.nf
|
|
Packit |
514978 |
.B #include <ares.h>
|
|
Packit |
514978 |
.PP
|
|
Packit |
514978 |
.B int ares_expand_name(const unsigned char *\fIencoded\fP,
|
|
Packit |
514978 |
.B const unsigned char *\fIabuf\fP, int \fIalen\fP, char **\fIs\fP,
|
|
Packit |
514978 |
.B long *\fIenclen\fP)
|
|
Packit |
514978 |
.fi
|
|
Packit |
514978 |
.SH DESCRIPTION
|
|
Packit |
514978 |
The
|
|
Packit |
514978 |
.B ares_expand_name
|
|
Packit |
514978 |
function converts a DNS-encoded domain name to a dot-separated C
|
|
Packit |
514978 |
string. The argument
|
|
Packit |
514978 |
.I encoded
|
|
Packit |
514978 |
gives the beginning of the encoded domain name, and the arguments
|
|
Packit |
514978 |
.I abuf
|
|
Packit |
514978 |
and
|
|
Packit |
514978 |
.I alen
|
|
Packit |
514978 |
give the containing message buffer (necessary for the processing of
|
|
Packit |
514978 |
indirection pointers within the encoded domain name). The result is
|
|
Packit |
514978 |
placed in a NUL-terminated allocated buffer, a pointer to which is
|
|
Packit |
514978 |
stored in the variable pointed to by
|
|
Packit |
514978 |
.IR s .
|
|
Packit |
514978 |
The length of the encoded name is stored in the variable pointed to by
|
|
Packit |
514978 |
.I enclen
|
|
Packit |
514978 |
so that the caller can advance past the encoded domain name to read
|
|
Packit |
514978 |
further data in the message.
|
|
Packit |
514978 |
|
|
Packit |
514978 |
Use \fIares_free_string(3)\fP to free the allocated hostname.
|
|
Packit |
514978 |
.SH RETURN VALUES
|
|
Packit |
514978 |
.B ares_expand_name
|
|
Packit |
514978 |
can return any of the following values:
|
|
Packit |
514978 |
.TP 15
|
|
Packit |
514978 |
.B ARES_SUCCESS
|
|
Packit |
514978 |
Expansion of the encoded name succeeded.
|
|
Packit |
514978 |
.TP 15
|
|
Packit |
514978 |
.B ARES_EBADNAME
|
|
Packit |
514978 |
The encoded domain name was malformed and could not be expanded.
|
|
Packit |
514978 |
.TP 15
|
|
Packit |
514978 |
.B ARES_ENOMEM
|
|
Packit |
514978 |
Memory was exhausted.
|
|
Packit |
514978 |
.SH SEE ALSO
|
|
Packit |
514978 |
.BR ares_mkquery (3), ares_free_string (3)
|
|
Packit |
514978 |
.SH AUTHOR
|
|
Packit |
514978 |
Greg Hudson, MIT Information Systems
|
|
Packit |
514978 |
.br
|
|
Packit |
514978 |
Copyright 1998 by the Massachusetts Institute of Technology.
|