lwres_getrrsetbyname.html revision 8a66318e41ed14c5a88130e8c362610e8faa2121
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - Copyright (C) 2001 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Permission to use, copy, modify, and distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - copyright notice and this permission notice appear in all copies.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - PERFORMANCE OF THIS SOFTWARE.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews<!-- $Id: lwres_getrrsetbyname.html,v 1.6 2004/03/05 08:32:20 marka Exp $ -->
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname</TITLE
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonNAME="GENERATOR"
8a66318e41ed14c5a88130e8c362610e8faa2121Mark AndrewsCONTENT="Modular DocBook HTML Stylesheet Version 1.73
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonBGCOLOR="#FFFFFF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonVLINK="#840084"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonALINK="#0000FF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname</A
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFNAMEDIV"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname, lwres_freerrset -- retrieve DNS records</DIV
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSYNOPSISDIV"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCSYNOPSIS"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCSYNOPSISINFO"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCDEF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonlwres_getrrsetbyname</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res);</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCDEF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonlwres_freerrset</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>(struct rrsetinfo *rrset);</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>The following structures are used:
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PROGRAMLISTING"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>struct rdatainfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rdi_length; /* length of data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned char *rdi_data; /* record data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstruct rrsetinfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_flags; /* RRSET_VALIDATED... */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdclass; /* class number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdtype; /* RR type number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_ttl; /* time to live */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nrdatas; /* size of rdatas array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nsigs; /* size of sigs array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson char *rri_name; /* canonical name */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_rdatas; /* individual records */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_sigs; /* individual signatures */
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>DESCRIPTION</H2
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssongets a set of resource records associated with a
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssona pointer a to null-terminated string. The
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfield is currently unused and must be zero.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>After a successful call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis a pointer to an
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rrsetinfo</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructure, containing a list of one or more
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rdatainfo</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructures containing resource records and potentially another list of
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rdatainfo</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructures containing SIG resource records
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonassociated with those records.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rri_rdclass</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rri_rdtype</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare copied from the parameters.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare properties of the obtained rrset.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe resource records contained in
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>rri_rdatas</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare in uncompressed DNS wire format.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonProperties of the rdataset are represented in the
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonbitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonvalidated and the signatures verified. </P
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>All of the information returned by
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis dynamically allocated: the
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonand the canonical host name strings pointed to by the
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonMemory allocated for the dynamically allocated structures created by
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssona successful call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_freerrset()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis a pointer to a
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>struct rrset</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoncreated by a call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>RETURN VALUES</H2
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getrrsetbyname()</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafssonreturns zero on success, and one of the following error
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafssoncodes if an error occurred:
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="VARIABLELIST"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>ERRSET_NONAME</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>the name does not exist</P
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>ERRSET_NODATA</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>the name exists, but does not have data of the desired type</P
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>ERRSET_NOMEMORY</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>memory could not be allocated</P
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>ERRSET_INVAL</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>a parameter is invalid</P
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>ERRSET_FAIL</TT
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas Gustafsson>other failure</P
00380255bd1a9359fd3791ea33d5bee37af9e41aAndreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"