]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3
MFC r363988:
[FreeBSD/stable/9.git] / contrib / bind9 / lib / lwres / man / lwres_getrrsetbyname.3
1 .\" Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and/or 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 .hy 0
17 .ad l
18 '\" t
19 .\"     Title: lwres_getrrsetbyname
20 .\"    Author: 
21 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
22 .\"      Date: 2007-06-18
23 .\"    Manual: BIND9
24 .\"    Source: ISC
25 .\"  Language: English
26 .\"
27 .TH "LWRES_GETRRSETBYNAME" "3" "2007\-06\-18" "ISC" "BIND9"
28 .\" -----------------------------------------------------------------
29 .\" * Define some portability stuff
30 .\" -----------------------------------------------------------------
31 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" http://bugs.debian.org/507673
33 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .ie \n(.g .ds Aq \(aq
36 .el       .ds Aq '
37 .\" -----------------------------------------------------------------
38 .\" * set default formatting
39 .\" -----------------------------------------------------------------
40 .\" disable hyphenation
41 .nh
42 .\" disable justification (adjust text to left margin only)
43 .ad l
44 .\" -----------------------------------------------------------------
45 .\" * MAIN CONTENT STARTS HERE *
46 .\" -----------------------------------------------------------------
47 .SH "NAME"
48 lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
49 .SH "SYNOPSIS"
50 .sp
51 .ft B
52 .nf
53 #include <lwres/netdb\&.h>
54 .fi
55 .ft
56 .HP \w'int\ lwres_getrrsetbyname('u
57 .BI "int lwres_getrrsetbyname(const\ char\ *" "hostname" ", unsigned\ int\ " "rdclass" ", unsigned\ int\ " "rdtype" ", unsigned\ int\ " "flags" ", struct\ rrsetinfo\ **" "res" ");"
58 .HP \w'void\ lwres_freerrset('u
59 .BI "void lwres_freerrset(struct\ rrsetinfo\ *" "rrset" ");"
60 .PP
61 The following structures are used:
62 .PP
63 .nf
64 struct  rdatainfo {
65         unsigned int            rdi_length;     /* length of data */
66         unsigned char           *rdi_data;      /* record data */
67 };
68 .fi
69 .PP
70 .nf
71 struct  rrsetinfo {
72         unsigned int            rri_flags;      /* RRSET_VALIDATED\&.\&.\&. */
73         unsigned int            rri_rdclass;    /* class number */
74         unsigned int            rri_rdtype;     /* RR type number */
75         unsigned int            rri_ttl;        /* time to live */
76         unsigned int            rri_nrdatas;    /* size of rdatas array */
77         unsigned int            rri_nsigs;      /* size of sigs array */
78         char                    *rri_name;      /* canonical name */
79         struct rdatainfo        *rri_rdatas;    /* individual records */
80         struct rdatainfo        *rri_sigs;      /* individual signatures */
81 };
82 .fi
83 .sp
84 .SH "DESCRIPTION"
85 .PP
86 \fBlwres_getrrsetbyname()\fR
87 gets a set of resource records associated with a
88 \fIhostname\fR,
89 \fIclass\fR, and
90 \fItype\fR\&.
91 \fIhostname\fR
92 is a pointer a to null\-terminated string\&. The
93 \fIflags\fR
94 field is currently unused and must be zero\&.
95 .PP
96 After a successful call to
97 \fBlwres_getrrsetbyname()\fR,
98 \fI*res\fR
99 is a pointer to an
100 \fBrrsetinfo\fR
101 structure, containing a list of one or more
102 \fBrdatainfo\fR
103 structures containing resource records and potentially another list of
104 \fBrdatainfo\fR
105 structures containing SIG resource records associated with those records\&. The members
106 \fBrri_rdclass\fR
107 and
108 \fBrri_rdtype\fR
109 are copied from the parameters\&.
110 \fBrri_ttl\fR
111 and
112 \fBrri_name\fR
113 are properties of the obtained rrset\&. The resource records contained in
114 \fBrri_rdatas\fR
115 and
116 \fBrri_sigs\fR
117 are in uncompressed DNS wire format\&. Properties of the rdataset are represented in the
118 \fBrri_flags\fR
119 bitfield\&. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified\&.
120 .PP
121 All of the information returned by
122 \fBlwres_getrrsetbyname()\fR
123 is dynamically allocated: the
124 \fBrrsetinfo\fR
125 and
126 \fBrdatainfo\fR
127 structures, and the canonical host name strings pointed to by the
128 \fBrrsetinfo\fRstructure\&. Memory allocated for the dynamically allocated structures created by a successful call to
129 \fBlwres_getrrsetbyname()\fR
130 is released by
131 \fBlwres_freerrset()\fR\&.
132 \fIrrset\fR
133 is a pointer to a
134 \fBstruct rrset\fR
135 created by a call to
136 \fBlwres_getrrsetbyname()\fR\&.
137 .PP
138 .SH "RETURN VALUES"
139 .PP
140 \fBlwres_getrrsetbyname()\fR
141 returns zero on success, and one of the following error codes if an error occurred:
142 .PP
143 \fBERRSET_NONAME\fR
144 .RS 4
145 the name does not exist
146 .RE
147 .PP
148 \fBERRSET_NODATA\fR
149 .RS 4
150 the name exists, but does not have data of the desired type
151 .RE
152 .PP
153 \fBERRSET_NOMEMORY\fR
154 .RS 4
155 memory could not be allocated
156 .RE
157 .PP
158 \fBERRSET_INVAL\fR
159 .RS 4
160 a parameter is invalid
161 .RE
162 .PP
163 \fBERRSET_FAIL\fR
164 .RS 4
165 other failure
166 .RE
167 .PP
168 .RS 4
169 .RE
170 .SH "SEE ALSO"
171 .PP
172 \fBlwres\fR(3)\&.
173 .SH "AUTHOR"
174 .PP
175 \fBInternet Systems Consortium, Inc\&.\fR
176 .SH "COPYRIGHT"
177 .br
178 Copyright \(co 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
179 .br
180 Copyright \(co 2000, 2001 Internet Software Consortium.
181 .br