1LWRES_GETRRSETBYNAME(3)              BIND9             LWRES_GETRRSETBYNAME(3)
2
3
4

NAME

6       lwres_getrrsetbyname, lwres_freerrset - retrieve DNS records
7

SYNOPSIS

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
25           struct  rrsetinfo {
26                   unsigned int            rri_flags;      /* RRSET_VALIDATED... */
27                   unsigned int            rri_rdclass;    /* class number */
28                   unsigned int            rri_rdtype;     /* RR type number */
29                   unsigned int            rri_ttl;        /* time to live */
30                   unsigned int            rri_nrdatas;    /* size of rdatas array */
31                   unsigned int            rri_nsigs;      /* size of sigs array */
32                   char                    *rri_name;      /* canonical name */
33                   struct rdatainfo        *rri_rdatas;    /* individual records */
34                   struct rdatainfo        *rri_sigs;      /* individual signatures */
35           };
36
37

DESCRIPTION

39       lwres_getrrsetbyname() gets a set of resource records associated with a
40       hostname, class, and type.  hostname is a pointer a to null-terminated
41       string. The flags field is currently unused and must be zero.
42
43       After a successful call to lwres_getrrsetbyname(), *res is a pointer to
44       an rrsetinfo structure, containing a list of one or more rdatainfo
45       structures containing resource records and potentially another list of
46       rdatainfo structures containing SIG resource records associated with
47       those records. The members rri_rdclass and rri_rdtype are copied from
48       the parameters.  rri_ttl and rri_name are properties of the obtained
49       rrset. The resource records contained in rri_rdatas and rri_sigs are in
50       uncompressed DNS wire format. Properties of the rdataset are
51       represented in the rri_flags bitfield. If the RRSET_VALIDATED bit is
52       set, the data has been DNSSEC validated and the signatures verified.
53
54       All of the information returned by lwres_getrrsetbyname() is
55       dynamically allocated: the rrsetinfo and rdatainfo structures, and the
56       canonical host name strings pointed to by the rrsetinfostructure.
57       Memory allocated for the dynamically allocated structures created by a
58       successful call to lwres_getrrsetbyname() is released by
59       lwres_freerrset().  rrset is a pointer to a struct rrset created by a
60       call to lwres_getrrsetbyname().
61

RETURN VALUES

63       lwres_getrrsetbyname() returns zero on success, and one of the
64       following error codes if an error occurred:
65
66       ERRSET_NONAME
67           the name does not exist
68
69       ERRSET_NODATA
70           the name exists, but does not have data of the desired type
71
72       ERRSET_NOMEMORY
73           memory could not be allocated
74
75       ERRSET_INVAL
76           a parameter is invalid
77
78       ERRSET_FAIL
79           other failure
80

SEE ALSO

82       lwres(3).
83
85       Copyright © 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
86       Copyright © 2000, 2001 Internet Software Consortium.
87
88
89
90BIND9                            Oct 18, 2000          LWRES_GETRRSETBYNAME(3)
Impressum