ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

ldns\_pkt\_id, ldns\_pkt\_qr, ldns\_pkt\_aa, ldns\_pkt\_tc, ldns\_pkt\_rd, ldns\_pkt\_cd, ldns\_pkt\_ra, ldns\_pkt\_ad, ldns\_pkt\_get\_opcode, ldns\_pkt\_get\_rcode, ldns\_pkt\_qdcount, ldns\_pkt\_ancount, ldns\_pkt\_nscount, ldns\_pkt\_arcount, ldns\_pkt\_answerfrom, ldns\_pkt\_querytime, ldns\_pkt\_size, ldns\_pkt\_tsig, ldns\_pkt\_question, ldns\_pkt\_answer, ldns\_pkt\_authority, ldns\_pkt\_additional, ldns\_pkt\_get\_section\_clone, ldns\_pkt\_rr\_list\_by\_name, ldns\_pkt\_rr\_list\_by\_type, ldns\_pkt\_rr\_list\_by\_name\_and\_type - get ldns\_pkt attributes

# [SYNOPSIS](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

ldns\_pkt\_id();

bool ldns\_pkt\_qr(const ldns\_pkt \*p);

bool ldns\_pkt\_aa(const ldns\_pkt \*p);

bool ldns\_pkt\_tc(const ldns\_pkt \*p);

bool ldns\_pkt\_rd(const ldns\_pkt \*p);

bool ldns\_pkt\_cd(const ldns\_pkt \*p);

bool ldns\_pkt\_ra(const ldns\_pkt \*p);

bool ldns\_pkt\_ad(const ldns\_pkt \*p);

ldns\_pkt\_opcode ldns\_pkt\_get\_opcode(const ldns\_pkt \*p);

ldns\_pkt\_rcode ldns\_pkt\_get\_rcode(const ldns\_pkt \*p);

uint16\_t ldns\_pkt\_qdcount(const ldns\_pkt \*p);

uint16\_t ldns\_pkt\_ancount(const ldns\_pkt \*p);

uint16\_t ldns\_pkt\_nscount(const ldns\_pkt \*p);

uint16\_t ldns\_pkt\_arcount(const ldns\_pkt \*p);

ldns\_rdf* ldns\_pkt\_answerfrom(const ldns\_pkt \*p);

uint32\_t ldns\_pkt\_querytime(const ldns\_pkt \*p);

size\_t ldns\_pkt\_size(const ldns\_pkt \*p);

ldns\_rr* ldns\_pkt\_tsig(const ldns\_pkt \*p);

ldns\_rr\_list* ldns\_pkt\_question(const ldns\_pkt \*p);

ldns\_rr\_list* ldns\_pkt\_answer(const ldns\_pkt \*p);

ldns\_rr\_list* ldns\_pkt\_authority(const ldns\_pkt \*p);

ldns\_rr\_list* ldns\_pkt\_additional(const ldns\_pkt \*p);

ldns\_rr\_list* ldns\_pkt\_get\_section\_clone(const ldns\_pkt \*p, ldns\_pkt\_section s);

ldns\_rr\_list* ldns\_pkt\_rr\_list\_by\_name(const ldns\_pkt \*p, const ldns\_rdf \*r, ldns\_pkt\_section s);

ldns\_rr\_list* ldns\_pkt\_rr\_list\_by\_type(const ldns\_pkt \*p, ldns\_rr\_type t, ldns\_pkt\_section s);

ldns\_rr\_list* ldns\_pkt\_rr\_list\_by\_name\_and\_type(const ldns\_pkt \*packet, const ldns\_rdf \*ownername, ldns\_rr\_type type, ldns\_pkt\_section sec);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_pkt\_id*()

*ldns\_pkt\_qr*() Read the packet's qr bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_aa*() Read the packet's aa bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_tc*() Read the packet's tc bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_rd*() Read the packet's rd bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_cd*() Read the packet's cd bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_ra*() Read the packet's ra bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_ad*() Read the packet's ad bit  
**p**: the packet  
Returns value of the bit

*ldns\_pkt\_get\_opcode*() Read the packet's code  
**p**: the packet  
Returns the opcode

*ldns\_pkt\_get\_rcode*() Return the packet's response code  
**p**: the packet  
Returns the response code

*ldns\_pkt\_qdcount*() Return the packet's qd count  
**p**: the packet  
Returns the qd count

*ldns\_pkt\_ancount*() Return the packet's an count  
**p**: the packet  
Returns the an count

*ldns\_pkt\_nscount*() Return the packet's ns count  
**p**: the packet  
Returns the ns count

*ldns\_pkt\_arcount*() Return the packet's ar count  
**p**: the packet  
Returns the ar count

*ldns\_pkt\_answerfrom*() Return the packet's answerfrom  
**p**: packet  
Returns the name of the server

*ldns\_pkt\_querytime*() Return the packet's querytime  
**p**: the packet  
Returns the querytime

*ldns\_pkt\_size*() Return the packet's size in bytes  
**p**: the packet  
Returns the size

*ldns\_pkt\_tsig*() Return the packet's tsig pseudo rr's  
**p**: the packet  
Returns the tsig rr

*ldns\_pkt\_question*() Return the packet's question section  
**p**: the packet  
Returns the section

*ldns\_pkt\_answer*() Return the packet's answer section  
**p**: the packet  
Returns the section

*ldns\_pkt\_authority*() Return the packet's authority section  
**p**: the packet  
Returns the section

*ldns\_pkt\_additional*() Return the packet's additional section  
**p**: the packet  
Returns the section

*ldns\_pkt\_get\_section\_clone*() return all the rr\_list's in the packet. Clone the lists, instead of returning pointers.  
**p**: the packet to look in  
**s**: what section(s) to return  
Returns ldns\_rr\_list with the rr's or NULL if none were found

*ldns\_pkt\_rr\_list\_by\_name*() return all the rr with a specific name from a packet. Optionally specify from which section in the packet  
**p**: the packet  
**r**: the name  
**s**: the packet's section  
Returns a list with the rr's or NULL if none were found

*ldns\_pkt\_rr\_list\_by\_type*() return all the rr with a specific type from a packet. Optionally specify from which section in the packet  
**p**: the packet  
**t**: the type  
**s**: the packet's section  
Returns a list with the rr's or NULL if none were found

*ldns\_pkt\_rr\_list\_by\_name\_and\_type*() return all the rr with a specific type and type from a packet. Optionally specify from which section in the packet  
**packet**: the packet  
**ownername**: the name  
**type**: the type  
**sec**: the packet's section  
Returns a list with the rr's or NULL if none were found

# [AUTHOR](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

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

# [COPYRIGHT](#COPYRIGHT)

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.

# [SEE ALSO](#SEE_ALSO)

*ldns\_pkt*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_pkt_ad(3) from ldns 1.9.2-r3 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
