1LWRES_GETRRSETBYNAME(3) BIND9 LWRES_GETRRSETBYNAME(3)
2
3
4
6 lwres_getrrsetbyname, lwres_freerrset - retrieve DNS records
7
9 #include <lwres/netdb.h>
10
11 int lwres_getrrsetbyname(const char *hostname, unsigned int rdclass,
12 unsigned int rdtype, unsigned int flags,
13 struct rrsetinfo **res);
14
15 void lwres_freerrset(struct rrsetinfo *rrset);
16
17 The following structures are used:
18
19 struct rdatainfo {
20 unsigned int rdi_length; /* length of data */
21 unsigned char *rdi_data; /* record data */
22 };
23
24 struct rrsetinfo {
25 unsigned int rri_flags; /* RRSET_VALIDATED... */
26 unsigned int rri_rdclass; /* class number */
27 unsigned int rri_rdtype; /* RR type number */
28 unsigned int rri_ttl; /* time to live */
29 unsigned int rri_nrdatas; /* size of rdatas array */
30 unsigned int rri_nsigs; /* size of sigs array */
31 char *rri_name; /* canonical name */
32 struct rdatainfo *rri_rdatas; /* individual records */
33 struct rdatainfo *rri_sigs; /* individual signatures */
34 };
35
36
38 lwres_getrrsetbyname() gets a set of resource records associated with a
39 hostname, class, and type. hostname is a pointer a to null-terminated
40 string. The flags field is currently unused and must be zero.
41
42 After a successful call to lwres_getrrsetbyname(), *res is a pointer to
43 an rrsetinfo structure, containing a list of one or more rdatainfo
44 structures containing resource records and potentially another list of
45 rdatainfo structures containing SIG resource records associated with
46 those records. The members rri_rdclass and rri_rdtype are copied from
47 the parameters. rri_ttl and rri_name are properties of the obtained
48 rrset. The resource records contained in rri_rdatas and rri_sigs are in
49 uncompressed DNS wire format. Properties of the rdataset are
50 represented in the rri_flags bitfield. If the RRSET_VALIDATED bit is
51 set, the data has been DNSSEC validated and the signatures verified.
52
53 All of the information returned by lwres_getrrsetbyname() is
54 dynamically allocated: the rrsetinfo and rdatainfo structures, and the
55 canonical host name strings pointed to by the rrsetinfostructure.
56 Memory allocated for the dynamically allocated structures created by a
57 successful call to lwres_getrrsetbyname() is released by
58 lwres_freerrset(). rrset is a pointer to a struct rrset created by a
59 call to lwres_getrrsetbyname().
60
62 lwres_getrrsetbyname() returns zero on success, and one of the
63 following error codes if an error occurred:
64
65 ERRSET_NONAME
66 the name does not exist
67
68 ERRSET_NODATA
69 the name exists, but does not have data of the desired type
70
71 ERRSET_NOMEMORY
72 memory could not be allocated
73
74 ERRSET_INVAL
75 a parameter is invalid
76
77 ERRSET_FAIL
78 other failure
79
81 lwres(3).
82
84 Internet Systems Consortium, Inc.
85
87 Copyright © 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018-2021 Internet
88 Systems Consortium, Inc. ("ISC")
89
90
91
92ISC 2007-06-18 LWRES_GETRRSETBYNAME(3)