1 .\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
16 .\" $Id: lwres_getrrsetbyname.3,v 1.11.2.1.8.5 2005/10/13 02:33:53 marka Exp $
20 .\" ** You probably do not want to edit this file directly **
21 .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
22 .\" Instead of manually editing it, you probably should edit the DocBook XML
23 .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
24 .TH "LWRES_GETRRSETBYNAME" "3" "Oct 18, 2000" "BIND9" "BIND9"
25 .\" disable hyphenation
27 .\" disable justification (adjust text to left margin only)
30 lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
33 #include <lwres/netdb.h>
36 \fBint\ \fBlwres_getrrsetbyname\fR\fR\fB(\fR\fBconst\ char\ *hostname\fR\fB, \fR\fBunsigned\ int\ rdclass\fR\fB, \fR\fBunsigned\ int\ rdtype\fR\fB, \fR\fBunsigned\ int\ flags\fR\fB, \fR\fBstruct\ rrsetinfo\ **res\fR\fB);\fR
38 \fBvoid\ \fBlwres_freerrset\fR\fR\fB(\fR\fBstruct\ rrsetinfo\ *rrset\fR\fB);\fR
40 The following structures are used:
44 unsigned int rdi_length; /* length of data */
45 unsigned char *rdi_data; /* record data */
48 unsigned int rri_flags; /* RRSET_VALIDATED... */
49 unsigned int rri_rdclass; /* class number */
50 unsigned int rri_rdtype; /* RR type number */
51 unsigned int rri_ttl; /* time to live */
52 unsigned int rri_nrdatas; /* size of rdatas array */
53 unsigned int rri_nsigs; /* size of sigs array */
54 char *rri_name; /* canonical name */
55 struct rdatainfo *rri_rdatas; /* individual records */
56 struct rdatainfo *rri_sigs; /* individual signatures */
62 \fBlwres_getrrsetbyname()\fR
63 gets a set of resource records associated with a
68 is a pointer a to null\-terminated string. The
70 field is currently unused and must be zero.
72 After a successful call to
73 \fBlwres_getrrsetbyname()\fR,
77 structure, containing a list of one or more
79 structures containing resource records and potentially another list of
81 structures containing SIG resource records associated with those records. The members
85 are copied from the parameters.
89 are properties of the obtained rrset. The resource records contained in
93 are in uncompressed DNS wire format. Properties of the rdataset are represented in the
95 bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified.
97 All of the information returned by
98 \fBlwres_getrrsetbyname()\fR
99 is dynamically allocated: the
103 structures, and the canonical host name strings pointed to by the
104 \fBrrsetinfo\fRstructure. Memory allocated for the dynamically allocated structures created by a successful call to
105 \fBlwres_getrrsetbyname()\fR
107 \fBlwres_freerrset()\fR.
112 \fBlwres_getrrsetbyname()\fR.
116 \fBlwres_getrrsetbyname()\fR
117 returns zero on success, and one of the following error codes if an error occurred:
120 the name does not exist
123 the name exists, but does not have data of the desired type
125 \fBERRSET_NOMEMORY\fR
126 memory could not be allocated
129 a parameter is invalid