2086N/A - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC") 2086N/A - This Source Code Form is subject to the terms of the Mozilla Public 2086N/A - License, v. 2.0. If a copy of the MPL was not distributed with this 6983N/A<!-- Converted by db4-upgrade version 1.0 --> 6983N/A <
corpauthor>Internet Systems Consortium, Inc.</
corpauthor>
2086N/A <
refentrytitle>lwres_getrrsetbyname</
refentrytitle>
5199N/A <
refmiscinfo>BIND9</
refmiscinfo>
2086N/A <
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
2086N/A <
refname>lwres_getrrsetbyname</
refname>
2086N/A <
refname>lwres_freerrset</
refname>
2086N/A <
refpurpose>retrieve DNS records</
refpurpose>
2086N/A<
function>lwres_getrrsetbyname</
function></
funcdef>
2086N/A <
paramdef>const char *<
parameter>hostname</
parameter></
paramdef>
2086N/A <
paramdef>unsigned int <
parameter>rdclass</
parameter></
paramdef>
2086N/A <
paramdef>unsigned int <
parameter>rdtype</
parameter></
paramdef>
2086N/A <
paramdef>unsigned int <
parameter>flags</
parameter></
paramdef>
2086N/A <
paramdef>struct rrsetinfo **<
parameter>res</
parameter></
paramdef>
2086N/A<
function>lwres_freerrset</
function></
funcdef>
2086N/A <
paramdef>struct rrsetinfo *<
parameter>rrset</
parameter></
paramdef>
2960N/A The following structures are used:
2086N/A unsigned int rdi_length; /* length of data */
2086N/A unsigned char *rdi_data; /* record data */
2960N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
2960N/A unsigned int rri_rdclass; /* class number */
2960N/A unsigned int rri_rdtype; /* RR type number */
2960N/A unsigned int rri_ttl; /* time to live */
2086N/A unsigned int rri_nrdatas; /* size of rdatas array */
2960N/A unsigned int rri_nsigs; /* size of sigs array */
2086N/A char *rri_name; /* canonical name */
2960N/A struct rdatainfo *rri_rdatas; /* individual records */
2960N/A struct rdatainfo *rri_sigs; /* individual signatures */
2086N/A <
refsection><
info><
title>DESCRIPTION</
title></
info>
2086N/A <
para><
function>lwres_getrrsetbyname()</
function>
2960N/A gets a set of resource records associated with a
2960N/A <
parameter>hostname</
parameter>, <
parameter>class</
parameter>,
2086N/A and <
parameter>type</
parameter>.
2086N/A <
parameter>hostname</
parameter> is a pointer a to
2960N/A null-terminated string. The <
parameter>flags</
parameter> field
2086N/A is currently unused and must be zero.
2086N/A <
function>lwres_getrrsetbyname()</
function>,
2960N/A <
parameter>*res</
parameter> is a pointer to an
2086N/A <
type>rrsetinfo</
type> structure, containing a list of one or
2086N/A more <
type>rdatainfo</
type> structures containing resource
2960N/A records and potentially another list of <
type>rdatainfo</
type>
2960N/A structures containing SIG resource records associated with those
2086N/A records. The members <
constant>rri_rdclass</
constant> and
2960N/A <
constant>rri_rdtype</
constant> are copied from the parameters.
2960N/A <
constant>rri_ttl</
constant> and <
constant>rri_name</
constant>
2960N/A are properties of the obtained rrset. The resource records
2086N/A contained in <
constant>rri_rdatas</
constant> and
2960N/A <
constant>rri_sigs</
constant> are in uncompressed DNS wire
2086N/A format. Properties of the rdataset are represented in the
2086N/A <
constant>rri_flags</
constant> bitfield. If the RRSET_VALIDATED
2960N/A bit is set, the data has been DNSSEC validated and the
2960N/A All of the information returned by
2960N/A <
function>lwres_getrrsetbyname()</
function> is dynamically
2086N/A allocated: the <
constant>rrsetinfo</
constant> and
2960N/A <
constant>rdatainfo</
constant> structures, and the canonical
2086N/A host name strings pointed to by the
2086N/A <
constant>rrsetinfo</
constant>structure.
2960N/A Memory allocated for the dynamically allocated structures
2086N/A created by a successful call to
2086N/A <
function>lwres_getrrsetbyname()</
function> is released by
2960N/A <
function>lwres_freerrset()</
function>.
4381N/A <
parameter>rrset</
parameter> is a pointer to a <
type>struct
2960N/A rrset</
type> created by a call to
2960N/A <
function>lwres_getrrsetbyname()</
function>.
2086N/A <
refsection><
info><
title>RETURN VALUES</
title></
info>
2960N/A <
para><
function>lwres_getrrsetbyname()</
function>
2960N/A returns zero on success, and one of the following error codes if
2960N/A <
term><
constant>ERRSET_NONAME</
constant></
term>
2086N/A <
term><
constant>ERRSET_NODATA</
constant></
term>
2086N/A the name exists, but does not have data of the desired type
2086N/A <
term><
constant>ERRSET_NOMEMORY</
constant></
term>
2086N/A memory could not be allocated
2960N/A <
term><
constant>ERRSET_INVAL</
constant></
term>
2086N/A <
term><
constant>ERRSET_FAIL</
constant></
term>
2086N/A <
refsection><
info><
title>SEE ALSO</
title></
info>
2086N/A <
refentrytitle>lwres</
refentrytitle><
manvolnum>3</
manvolnum>