Blame lib/lwres/man/lwres_getrrsetbyname.3

Packit Service ae04f2
.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018-2020 Internet Systems Consortium, Inc. ("ISC")
Packit Service ae04f2
.\" 
Packit Service ae04f2
.\" This Source Code Form is subject to the terms of the Mozilla Public
Packit Service ae04f2
.\" License, v. 2.0. If a copy of the MPL was not distributed with this
Packit Service ae04f2
.\" file, You can obtain one at http://mozilla.org/MPL/2.0/.
Packit Service ae04f2
.\"
Packit Service ae04f2
.hy 0
Packit Service ae04f2
.ad l
Packit Service ae04f2
'\" t
Packit Service ae04f2
.\"     Title: lwres_getrrsetbyname
Packit Service ae04f2
.\"    Author: 
Packit Service ae04f2
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
Packit Service ae04f2
.\"      Date: 2007-06-18
Packit Service ae04f2
.\"    Manual: BIND9
Packit Service ae04f2
.\"    Source: ISC
Packit Service ae04f2
.\"  Language: English
Packit Service ae04f2
.\"
Packit Service ae04f2
.TH "LWRES_GETRRSETBYNAME" "3" "2007\-06\-18" "ISC" "BIND9"
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.\" * Define some portability stuff
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit Service ae04f2
.\" http://bugs.debian.org/507673
Packit Service ae04f2
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
Packit Service ae04f2
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit Service ae04f2
.ie \n(.g .ds Aq \(aq
Packit Service ae04f2
.el       .ds Aq '
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.\" * set default formatting
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.\" disable hyphenation
Packit Service ae04f2
.nh
Packit Service ae04f2
.\" disable justification (adjust text to left margin only)
Packit Service ae04f2
.ad l
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.\" * MAIN CONTENT STARTS HERE *
Packit Service ae04f2
.\" -----------------------------------------------------------------
Packit Service ae04f2
.SH "NAME"
Packit Service ae04f2
lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
Packit Service ae04f2
.SH "SYNOPSIS"
Packit Service ae04f2
.sp
Packit Service ae04f2
.ft B
Packit Service ae04f2
.nf
Packit Service ae04f2
#include <lwres/netdb\&.h>
Packit Service ae04f2
.fi
Packit Service ae04f2
.ft
Packit Service ae04f2
.HP \w'int\ lwres_getrrsetbyname('u
Packit Service ae04f2
.BI "int lwres_getrrsetbyname(const\ char\ *" "hostname" ", unsigned\ int\ " "rdclass" ", unsigned\ int\ " "rdtype" ", unsigned\ int\ " "flags" ", struct\ rrsetinfo\ **" "res" ");"
Packit Service ae04f2
.HP \w'void\ lwres_freerrset('u
Packit Service ae04f2
.BI "void lwres_freerrset(struct\ rrsetinfo\ *" "rrset" ");"
Packit Service ae04f2
.PP
Packit Service ae04f2
The following structures are used:
Packit Service ae04f2
.PP
Packit Service ae04f2
.nf
Packit Service ae04f2
struct  rdatainfo {
Packit Service ae04f2
        unsigned int            rdi_length;     /* length of data */
Packit Service ae04f2
        unsigned char           *rdi_data;      /* record data */
Packit Service ae04f2
};
Packit Service ae04f2
.fi
Packit Service ae04f2
.PP
Packit Service ae04f2
.nf
Packit Service ae04f2
struct  rrsetinfo {
Packit Service ae04f2
        unsigned int            rri_flags;      /* RRSET_VALIDATED\&.\&.\&. */
Packit Service ae04f2
        unsigned int            rri_rdclass;    /* class number */
Packit Service ae04f2
        unsigned int            rri_rdtype;     /* RR type number */
Packit Service ae04f2
        unsigned int            rri_ttl;        /* time to live */
Packit Service ae04f2
        unsigned int            rri_nrdatas;    /* size of rdatas array */
Packit Service ae04f2
        unsigned int            rri_nsigs;      /* size of sigs array */
Packit Service ae04f2
        char                    *rri_name;      /* canonical name */
Packit Service ae04f2
        struct rdatainfo        *rri_rdatas;    /* individual records */
Packit Service ae04f2
        struct rdatainfo        *rri_sigs;      /* individual signatures */
Packit Service ae04f2
};
Packit Service ae04f2
.fi
Packit Service ae04f2
.sp
Packit Service ae04f2
.SH "DESCRIPTION"
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR
Packit Service ae04f2
gets a set of resource records associated with a
Packit Service ae04f2
\fIhostname\fR,
Packit Service ae04f2
\fIclass\fR, and
Packit Service ae04f2
\fItype\fR\&.
Packit Service ae04f2
\fIhostname\fR
Packit Service ae04f2
is a pointer a to null\-terminated string\&. The
Packit Service ae04f2
\fIflags\fR
Packit Service ae04f2
field is currently unused and must be zero\&.
Packit Service ae04f2
.PP
Packit Service ae04f2
After a successful call to
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR,
Packit Service ae04f2
\fI*res\fR
Packit Service ae04f2
is a pointer to an
Packit Service ae04f2
\fBrrsetinfo\fR
Packit Service ae04f2
structure, containing a list of one or more
Packit Service ae04f2
\fBrdatainfo\fR
Packit Service ae04f2
structures containing resource records and potentially another list of
Packit Service ae04f2
\fBrdatainfo\fR
Packit Service ae04f2
structures containing SIG resource records associated with those records\&. The members
Packit Service ae04f2
\fBrri_rdclass\fR
Packit Service ae04f2
and
Packit Service ae04f2
\fBrri_rdtype\fR
Packit Service ae04f2
are copied from the parameters\&.
Packit Service ae04f2
\fBrri_ttl\fR
Packit Service ae04f2
and
Packit Service ae04f2
\fBrri_name\fR
Packit Service ae04f2
are properties of the obtained rrset\&. The resource records contained in
Packit Service ae04f2
\fBrri_rdatas\fR
Packit Service ae04f2
and
Packit Service ae04f2
\fBrri_sigs\fR
Packit Service ae04f2
are in uncompressed DNS wire format\&. Properties of the rdataset are represented in the
Packit Service ae04f2
\fBrri_flags\fR
Packit Service ae04f2
bitfield\&. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified\&.
Packit Service ae04f2
.PP
Packit Service ae04f2
All of the information returned by
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR
Packit Service ae04f2
is dynamically allocated: the
Packit Service ae04f2
\fBrrsetinfo\fR
Packit Service ae04f2
and
Packit Service ae04f2
\fBrdatainfo\fR
Packit Service ae04f2
structures, and the canonical host name strings pointed to by the
Packit Service ae04f2
\fBrrsetinfo\fRstructure\&. Memory allocated for the dynamically allocated structures created by a successful call to
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR
Packit Service ae04f2
is released by
Packit Service ae04f2
\fBlwres_freerrset()\fR\&.
Packit Service ae04f2
\fIrrset\fR
Packit Service ae04f2
is a pointer to a
Packit Service ae04f2
\fBstruct rrset\fR
Packit Service ae04f2
created by a call to
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR\&.
Packit Service ae04f2
.PP
Packit Service ae04f2
.SH "RETURN VALUES"
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBlwres_getrrsetbyname()\fR
Packit Service ae04f2
returns zero on success, and one of the following error codes if an error occurred:
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBERRSET_NONAME\fR
Packit Service ae04f2
.RS 4
Packit Service ae04f2
the name does not exist
Packit Service ae04f2
.RE
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBERRSET_NODATA\fR
Packit Service ae04f2
.RS 4
Packit Service ae04f2
the name exists, but does not have data of the desired type
Packit Service ae04f2
.RE
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBERRSET_NOMEMORY\fR
Packit Service ae04f2
.RS 4
Packit Service ae04f2
memory could not be allocated
Packit Service ae04f2
.RE
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBERRSET_INVAL\fR
Packit Service ae04f2
.RS 4
Packit Service ae04f2
a parameter is invalid
Packit Service ae04f2
.RE
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBERRSET_FAIL\fR
Packit Service ae04f2
.RS 4
Packit Service ae04f2
other failure
Packit Service ae04f2
.RE
Packit Service ae04f2
.PP
Packit Service ae04f2
.RS 4
Packit Service ae04f2
.RE
Packit Service ae04f2
.SH "SEE ALSO"
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBlwres\fR(3)\&.
Packit Service ae04f2
.SH "AUTHOR"
Packit Service ae04f2
.PP
Packit Service ae04f2
\fBInternet Systems Consortium, Inc\&.\fR
Packit Service ae04f2
.SH "COPYRIGHT"
Packit Service ae04f2
.br
Packit Service ae04f2
Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018-2020 Internet Systems Consortium, Inc. ("ISC")
Packit Service ae04f2
.br