Merge branch 'vendor/TCSH'
[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.6 2006/06/29 13:02:31 marka Exp $
17 .\"
18 .hy 0
19 .ad l
20 .\"     Title: lwres_getrrsetbyname
21 .\"    Author: 
22 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
23 .\"      Date: Oct 18, 2000
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "LWRES_GETRRSETBYNAME" "3" "Oct 18, 2000" "BIND9" "BIND9"
28 .\" disable hyphenation
29 .nh
30 .\" disable justification (adjust text to left margin only)
31 .ad l
32 .SH "NAME"
33 lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
34 .SH "SYNOPSIS"
35 .nf
36 #include <lwres/netdb.h>
37 .fi
38 .HP 25
39 .BI "int lwres_getrrsetbyname(const\ char\ *hostname, unsigned\ int\ rdclass, unsigned\ int\ rdtype, unsigned\ int\ flags, struct\ rrsetinfo\ **res);"
40 .HP 21
41 .BI "void lwres_freerrset(struct\ rrsetinfo\ *rrset);"
42 .PP
43 The following structures are used:
44 .sp
45 .RS 3n
46 .nf
47 struct  rdatainfo {
48         unsigned int            rdi_length;     /* length of data */
49         unsigned char           *rdi_data;      /* record data */
50 };
51 struct  rrsetinfo {
52         unsigned int            rri_flags;      /* RRSET_VALIDATED... */
53         unsigned int            rri_rdclass;    /* class number */
54         unsigned int            rri_rdtype;     /* RR type number */
55         unsigned int            rri_ttl;        /* time to live */
56         unsigned int            rri_nrdatas;    /* size of rdatas array */
57         unsigned int            rri_nsigs;      /* size of sigs array */
58         char                    *rri_name;      /* canonical name */
59         struct rdatainfo        *rri_rdatas;    /* individual records */
60         struct rdatainfo        *rri_sigs;      /* individual signatures */
61 };
62 .fi
63 .RE
64 .sp
65 .SH "DESCRIPTION"
66 .PP
67 \fBlwres_getrrsetbyname()\fR
68 gets a set of resource records associated with a
69 \fIhostname\fR,
70 \fIclass\fR, and
71 \fItype\fR.
72 \fIhostname\fR
73 is a pointer a to null\-terminated string. The
74 \fIflags\fR
75 field is currently unused and must be zero.
76 .PP
77 After a successful call to
78 \fBlwres_getrrsetbyname()\fR,
79 \fI*res\fR
80 is a pointer to an
81 \fBrrsetinfo\fR
82 structure, containing a list of one or more
83 \fBrdatainfo\fR
84 structures containing resource records and potentially another list of
85 \fBrdatainfo\fR
86 structures containing SIG resource records associated with those records. The members
87 \fBrri_rdclass\fR
88 and
89 \fBrri_rdtype\fR
90 are copied from the parameters.
91 \fBrri_ttl\fR
92 and
93 \fBrri_name\fR
94 are properties of the obtained rrset. The resource records contained in
95 \fBrri_rdatas\fR
96 and
97 \fBrri_sigs\fR
98 are in uncompressed DNS wire format. Properties of the rdataset are represented in the
99 \fBrri_flags\fR
100 bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified.
101 .PP
102 All of the information returned by
103 \fBlwres_getrrsetbyname()\fR
104 is dynamically allocated: the
105 \fBrrsetinfo\fR
106 and
107 \fBrdatainfo\fR
108 structures, and the canonical host name strings pointed to by the
109 \fBrrsetinfo\fRstructure. Memory allocated for the dynamically allocated structures created by a successful call to
110 \fBlwres_getrrsetbyname()\fR
111 is released by
112 \fBlwres_freerrset()\fR.
113 \fIrrset\fR
114 is a pointer to a
115 \fBstruct rrset\fR
116 created by a call to
117 \fBlwres_getrrsetbyname()\fR.
118 .PP
119 .SH "RETURN VALUES"
120 .PP
121 \fBlwres_getrrsetbyname()\fR
122 returns zero on success, and one of the following error codes if an error occurred:
123 .TP 3n
124 \fBERRSET_NONAME\fR
125 the name does not exist
126 .TP 3n
127 \fBERRSET_NODATA\fR
128 the name exists, but does not have data of the desired type
129 .TP 3n
130 \fBERRSET_NOMEMORY\fR
131 memory could not be allocated
132 .TP 3n
133 \fBERRSET_INVAL\fR
134 a parameter is invalid
135 .TP 3n
136 \fBERRSET_FAIL\fR
137 other failure
138 .TP 3n
139 .SH "SEE ALSO"
140 .PP
141 \fBlwres\fR(3).
142 .SH "COPYRIGHT"
143 Copyright \(co 2004, 2005 Internet Systems Consortium, Inc. ("ISC")