val_get_rrset(3)

πŸ“¦ version 2.2.3, in arch rolling, fedora 43, fedora 44

πŸ’– val_get_rrset β€” get DNSSEC-validated resource record info πŸ’–

okay bestie, welcome to the val_get_rrset(3) page from the Programmer's Manual 🫢 this one's your girl for pulling DNSSEC-validated RRset data, no cap.


✨ 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);

like. look at those structs. they're giving linked-list main character energy πŸ”₯


🌸 DESCRIPTION 🌸

so val_get_rrset() does the DNSSEC validation for whatever DNS name, class and type you throw at it. it hands you back the DNSSEC validation status for the resource record set β€” but not the authentication chain details, bestie, it's literally not about that. if you do need the auth chain details, you have to use val_resolve_and_check() instead. that's just the rules πŸ’…

val_get_rrset() drops its results into the val_answer_chain structure. and listen β€” the memory for that structure is allocated by val_get_rrset itself, so you have to free it after you're done, using the val_free_answer_chain() function. no forgetting, no leaking, we don't do that here πŸŽ€

the RRsets in the response come back inside the val_answer_chain structure. the val_ans_name member holds the DNS name of the actual resource record set that got returned. and plot twist: that value may differ from whatever you passed as the name argument to val_get_rrset() β€” that happens when the resource record came back after following a CNAME or DNAME alias πŸŒ€

val_ans_name and val_ans_type contain the actual class and type for the returned resource record. again, these values may differ from the values you passed as arguments to val_get_rrset() if the query type or class has the value 255 (ANY) πŸ‘€

the resource record set itself comes back in val_ans as a linked list of rr_length and rr_data tuples, one for the data returned in each resource record of the resource record set. oh and val_ans may be NULL if the name is non-existant. yes, exactly like that, non-existant, that's the vibe πŸ™ˆ

val_ans_status gives you the combined validation status value for the given RRset. you can use val_istrusted() and val_isvalidated() to figure out the trustworthiness of the data, and p_val_status() to show the status value to the user in ASCII format (peep libval(3) for more info on that) ⭐

the ctx parameter is the validation context, and you can set it to NULL for default values β€” see libval(3) and dnsval.conf for the whole tea on validation contexts and validation policy πŸ’œ


πŸ‘‘ RETURN VALUES πŸ‘‘

val_get_rrset() returns 0 on success, and one of the error codes defined in libval(3) on failure. periodt.


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


πŸ¦‹ AUTHORS πŸ¦‹

Suresh Krishnaswamy


🌈 SEE ALSO 🌈


and that's the whole page bestie, you ate it πŸ’…βœ¨

this was val_get_rrset(3), from perl v5.12.4, dated 2013-03-08 🌸 go validate some records, ily 🫢
πŸ“¦ where this page comes from