=pod

=head1 NAME

I<val_get_rrset()> - get DNSSEC-validated resource record
information

=head1 SYNOPSIS

  #include <validator/validator.h>

  struct val_answer_chain {
      val_status_t   val_ans_status;
      char          *val_ans_name;
      int            val_ans_class;
      int            val_ans_type;
      struct rr_rec *val_ans;
      struct val_answer_chain *val_ans_next;
  };

  struct rr_rec {
      size_t         rr_length;
      unsigned char *rr_data;
      struct rr_rec *rr_next;
  };

  int val_get_rrset(val_context_t *ctx,
                    const char *name,
                    int class,
                    int type,
                    unsigned int flags,
                    struct val_answer_chain **answers);
      
  void val_free_answer_chain(struct val_answer_chain *answers); 

=head1 DESCRIPTION

I<val_get_rrset()> performs DNSSEC validation for the given DNS
name, class and type. It returns the DNSSEC validation status
for the resource record set, but does not return any 
authentication chain details. If the authentication chain details are
required, the I<val_resolve_and_check()> function must be used instead.

I<val_get_rrset()> returns its results in the val_answer_chain structure. The
memory for this structure is allocated by val_get_rrset; the user must
release this memory after use using the I<val_free_answer_chain()> function.

The RRsets in the response are returned in the val_answer_chain structure.
The val_ans_name member contains the DNS name of the actual resource 
record set returned.  This value may differ from the value passed as the 
I<name> argument to val_get_rrset() if the resource record was returned after 
following a CNAME or DNAME alias. val_ans_name and val_ans_type
contains the actual class and type for the returned resource record. These
values may differ from the values passed as arguments to val_get_rrset() if 
the query type or class has the value 255 (ANY). The resource record set is 
returned in I<val_ans>as a linked list of rr_length and rr_data tuples, 
for data returned in each resource record of the resource record set. 
I<val_ans> may be NULL if the name is non-existant.

I<val_ans_status> gives the combined validation status value for the 
the given RRset.  I<val_istrusted()> and
I<val_isvalidated()> can be used to determine the trustworthiness of data and
I<p_val_status()> can be used to display the status value to the user in ASCII
format (See I<libval(3)> more for information).

The I<ctx> parameter specifies the validation context, which can be set to NULL
for default values (see I<libval(3)> and I<dnsval.conf> for more details on 
validation contexts and validation policy).

=head1 RETURN VALUES

The I<val_get_rrset()> function returns 0 on success and one of the error codes
defined in libval(3) on failure.

=head1 COPYRIGHT

Copyright 2004-2013 SPARTA, Inc.  All rights reserved.
See the COPYING file included with the DNSSEC-Tools package for details.

=head1 AUTHORS

Suresh Krishnaswamy

=head1 SEE ALSO

I<val_getaddrinfo(3)>

I<val_gethostbyname(3)>, I<val_res_query(3)>

I<libval(3)>

http://www.dnssec-tools.org

=cut
