Merge from vendor branch FILE:
[dragonfly.git] / contrib / bind-9.3 / lib / lwres / man / lwres_getrrsetbyname.3
1 .\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
3 .\" 
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.
7 .\" 
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.
15 .\"
16 .\" $Id: lwres_getrrsetbyname.3,v 1.11.2.1.8.5 2005/10/13 02:33:53 marka Exp $
17 .\"
18 .hy 0
19 .ad l
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
26 .nh
27 .\" disable justification (adjust text to left margin only)
28 .ad l
29 .SH "NAME"
30 lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
31 .SH "SYNOPSIS"
32 .nf
33 #include <lwres/netdb.h>
34 .fi
35 .HP 25
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
37 .HP 21
38 \fBvoid\ \fBlwres_freerrset\fR\fR\fB(\fR\fBstruct\ rrsetinfo\ *rrset\fR\fB);\fR
39 .PP
40 The following structures are used:
41 .sp
42 .nf
43 struct  rdatainfo {
44         unsigned int            rdi_length;     /* length of data */
45         unsigned char           *rdi_data;      /* record data */
46 };
47 struct  rrsetinfo {
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 */
57 };
58 .fi
59 .sp
60 .SH "DESCRIPTION"
61 .PP
62 \fBlwres_getrrsetbyname()\fR
63 gets a set of resource records associated with a
64 \fIhostname\fR,
65 \fIclass\fR, and
66 \fItype\fR.
67 \fIhostname\fR
68 is a pointer a to null\-terminated string. The
69 \fIflags\fR
70 field is currently unused and must be zero.
71 .PP
72 After a successful call to
73 \fBlwres_getrrsetbyname()\fR,
74 \fI*res\fR
75 is a pointer to an
76 \fBrrsetinfo\fR
77 structure, containing a list of one or more
78 \fBrdatainfo\fR
79 structures containing resource records and potentially another list of
80 \fBrdatainfo\fR
81 structures containing SIG resource records associated with those records. The members
82 \fBrri_rdclass\fR
83 and
84 \fBrri_rdtype\fR
85 are copied from the parameters.
86 \fBrri_ttl\fR
87 and
88 \fBrri_name\fR
89 are properties of the obtained rrset. The resource records contained in
90 \fBrri_rdatas\fR
91 and
92 \fBrri_sigs\fR
93 are in uncompressed DNS wire format. Properties of the rdataset are represented in the
94 \fBrri_flags\fR
95 bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified.
96 .PP
97 All of the information returned by
98 \fBlwres_getrrsetbyname()\fR
99 is dynamically allocated: the
100 \fBrrsetinfo\fR
101 and
102 \fBrdatainfo\fR
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
106 is released by
107 \fBlwres_freerrset()\fR.
108 \fIrrset\fR
109 is a pointer to a
110 \fBstruct rrset\fR
111 created by a call to
112 \fBlwres_getrrsetbyname()\fR.
113 .PP
114 .SH "RETURN VALUES"
115 .PP
116 \fBlwres_getrrsetbyname()\fR
117 returns zero on success, and one of the following error codes if an error occurred:
118 .TP
119 \fBERRSET_NONAME\fR
120 the name does not exist
121 .TP
122 \fBERRSET_NODATA\fR
123 the name exists, but does not have data of the desired type
124 .TP
125 \fBERRSET_NOMEMORY\fR
126 memory could not be allocated
127 .TP
128 \fBERRSET_INVAL\fR
129 a parameter is invalid
130 .TP
131 \fBERRSET_FAIL\fR
132 other failure
133 .TP
134 .SH "SEE ALSO"
135 .PP
136 \fBlwres\fR(3).