1ARES_PARSE_PTR_REPLY(3)    Library Functions Manual    ARES_PARSE_PTR_REPLY(3)
2
3
4

NAME

6       ares_parse_ptr_reply  - Parse a reply to a DNS query of type PTR into a
7       hostent
8

SYNOPSIS

10       #include <ares.h>
11
12       int ares_parse_ptr_reply(const unsigned char *abuf, int alen,
13            const void *addr, int addrlen, int family,
14       struct hostent **host);
15

DESCRIPTION

17       The ares_parse_ptr_reply function parses the response  to  a  query  of
18       type  PTR into a struct hostent.  The parameters abuf and alen give the
19       contents of the response.  The parameters  addr,  addrlen,  and  family
20       specify  which address was queried for; they are not used to verify the
21       response, merely used to fill in the address  of  the  struct  hostent.
22       The  resulting  struct  hostent  is  stored  in  allocated memory and a
23       pointer to it stored into the variable pointed to by host.  It  is  the
24       caller's  responsibility  to  free  the  resulting host structure using
25       ares_free_hostent(3) when it is no longer needed.
26

RETURN VALUES

28       ares_parse_ptr_reply can return any of the following values:
29
30       ARES_SUCCESS   The response was successfully parsed.
31
32       ARES_EBADRESP  The response was malformatted.
33
34       ARES_ENODATA   The response did not contain an answer to the query.
35
36       ARES_ENOMEM    Memory was exhausted.
37

SEE ALSO

39       ares_gethostbyaddr(3), ares_free_hostent(3)
40

AUTHOR

42       Greg Hudson, MIT Information Systems
43       Copyright 1998 by the Massachusetts Institute of Technology.
44
45
46
47                                 25 July 1998          ARES_PARSE_PTR_REPLY(3)
Impressum