redhat man page for lwres_getrrsetbyname

Query: lwres_getrrsetbyname

OS: redhat

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

LWRES_GETRRSETBYNAME(3) 												   LWRES_GETRRSETBYNAME(3)

NAME
lwres_getrrsetbyname, lwres_freerrset - retrieve DNS records
SYNOPSIS
#include <lwres/netdb.h> int lwres_getrrsetbyname(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res); void lwres_freerrset(struct rrsetinfo *rrset); .PP The following structures are used: struct rdatainfo { unsigned int rdi_length; /* length of data */ unsigned char *rdi_data; /* record data */ }; struct rrsetinfo { unsigned int rri_flags; /* RRSET_VALIDATED... */ unsigned int rri_rdclass; /* class number */ unsigned int rri_rdtype; /* RR type number */ unsigned int rri_ttl; /* time to live */ unsigned int rri_nrdatas; /* size of rdatas array */ unsigned int rri_nsigs; /* size of sigs array */ char *rri_name; /* canonical name */ struct rdatainfo *rri_rdatas; /* individual records */ struct rdatainfo *rri_sigs; /* individual signatures */ };
DESCRIPTION
lwres_getrrsetbyname() gets a set of resource records associated with a hostname, class, and type. hostname is a pointer a to null-termi- nated string. The flags field is currently unused and must be zero. After a successful call to lwres_getrrsetbyname(), *res is a pointer to an rrsetinfo structure, containing a list of one or more rdatainfo structures containing resource records and potentially another list of rdatainfo structures containing SIG resource records associated with those records. The members rri_rdclass and rri_rdtype are copied from the parameters. rri_ttl and rri_name are properties of the obtained rrset. The resource records contained in rri_rdatas and rri_sigs are in uncompressed DNS wire format. Properties of the rdataset are rep- resented in the rri_flags bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified. All of the information returned by lwres_getrrsetbyname() is dynamically allocated: the rrsetinfo and rdatainfo structures, and the canoni- cal host name strings pointed to by the rrsetinfostructure. Memory allocated for the dynamically allocated structures created by a suc- cessful call to lwres_getrrsetbyname() is released by lwres_freerrset(). rrset is a pointer to a struct rrset created by a call to lwres_getrrsetbyname().
RETURN VALUES
lwres_getrrsetbyname() returns zero on success, and one of the following error codes if an error occurred: ERRSET_NONAME the name does not exist ERRSET_NODATA the name exists, but does not have data of the desired type ERRSET_NOMEMORY memory could not be allocated ERRSET_INVAL a parameter is invalid ERRSET_FAIL other failure
SEE ALSO
lwres(3). BIND9 Oct 18, 2000 LWRES_GETRRSETBYNAME(3)
Related Man Pages
lwres_getrrsetbyname(3) - redhat
argus(5) - debian
lwres_getaddrinfo(3) - centos
xquerydevicestate(3x11) - xfree86
lwres_freeaddrinfo(3) - redhat
Similar Topics in the Unix Linux Community
reallocating structures dynamically in functions
pointer to structures
Dynamically allocated structures in C