ldns(3)

πŸ“¦
version 1.9.2 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

okay bestie, welcome to ldns(3) β€” this is the page for ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new, ldns_pkt_query_new_frm_str, and ldns_pkt_reply_type πŸ’–

it's giving "ldns_pkt creation, destruction and printing" β€” making packets, yeeting packets, and showing packets off. iconic behaviour, no cap.


✨ SYNOPSIS ✨

#include <stdint.h>
#include <stdbool.h>

#include <ldns/ldns.h>

ldns_pkt* ldns_pkt_new(void);

void ldns_pkt_free(ldns_pkt *packet);

void ldns_pkt_print(FILE *output, const ldns_pkt *pkt);

ldns_pkt* ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type,
ldns_rr_class rr_class, uint16_t flags);

ldns_status ldns_pkt_query_new_frm_str(ldns_pkt **p, const char
*rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class , uint16_t
flags);

ldns_pkt_type ldns_pkt_reply_type(const ldns_pkt *p);

like… the whole squad is here 🫢


πŸ’… DESCRIPTION πŸ’…

πŸŽ€ ldns_pkt_new()

allocates and initializes a ldns_pkt structure. brand new packet, fresh out the box, main character energy fr fr ✨

Returns pointer to the new packet.

πŸŽ€ ldns_pkt_free()

frees the packet structure and all data that it contains. like, it does not leave crumbs β€” everything inside goes too. πŸ’€

  • packet: The packet structure to free
  • Returns void

πŸŽ€ ldns_pkt_print()

prints the data in the DNS packet to the given file stream (in presentation format). it's the vibe check β€” you get to see the packet πŸ¦‹

  • output: the file stream to print to
  • pkt: the packet to print
  • Returns void

πŸŽ€ ldns_pkt_query_new()

creates a packet with a query in it for the given name, type and class. πŸ’Œ

  • rr_name: the name to query for (not copied). The returned packet will take ownership of rr_name, so the caller should not free it.
  • rr_type: the type to query for
  • rr_class: the class to query for
  • flags: packet flags
  • Returns ldns_pkt* β€” a pointer to the new pkt
bestie listen, that "not copied / takes ownership" thing is REAL. you hand over rr_name and the packet claims it. free it yourself afterwards and it's over for you 😭

πŸŽ€ ldns_pkt_query_new_frm_str()

creates a query packet for the given name, type, class β€” but this time the name comes in as a string, cute and convenient πŸ“

  • p: the packet to be returned
  • rr_name: the name to query for (as string)
  • rr_type: the type to query for
  • rr_class: the class to query for
  • flags: packet flags
  • Returns LDNS_STATUS_OK or a ldns_status mesg with the error

πŸŽ€ ldns_pkt_reply_type()

looks inside the packet to determine what kind of packet it is β€” AUTH, NXDOMAIN, REFERRAL, etc. detective mode πŸ”βœ¨

  • p: the packet to examine
  • Returns the type of packet

πŸ‘‘ AUTHOR πŸ‘‘

The ldns team at NLnet Labs. absolute legends, periodt.


😭 REPORTING BUGS 😭

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

(they wanna hear about it, fr fr β€” don't suffer in silence bestie)


Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

so real for that disclaimer. no warranty, not even a little one. use it responsibly 🫢

🌈 SEE ALSO 🌈

ldns_pkt. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. iykyk πŸ“šβœ¨


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. (yes, a robot wrote it. still slay.)


and that's the whole page bestie β€” this was the ldns(3) manual from the Library Functions Manual, dated 30 May 2006 πŸ’– go make some packets πŸ’–