ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

ldns\_pkt\_set\_flags, ldns\_pkt\_set\_id, ldns\_pkt\_set\_qr, ldns\_pkt\_set\_aa, ldns\_pkt\_set\_tc, ldns\_pkt\_set\_rd, ldns\_pkt\_set\_cd, ldns\_pkt\_set\_ra, ldns\_pkt\_set\_ad, ldns\_pkt\_set\_opcode, ldns\_pkt\_set\_rcode, ldns\_pkt\_set\_qdcount, ldns\_pkt\_set\_ancount, ldns\_pkt\_set\_nscount, ldns\_pkt\_set\_arcount, ldns\_pkt\_set\_answerfrom, ldns\_pkt\_set\_querytime, ldns\_pkt\_set\_size, ldns\_pkt\_set\_section\_count, ldns\_pkt\_set\_tsig - set ldns\_pkt attributes

# [SYNOPSIS](#SYNOPSIS)

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

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

bool ldns\_pkt\_set\_flags(ldns\_pkt \*pkt, uint16\_t flags);

void ldns\_pkt\_set\_id(ldns\_pkt \*p, uint16\_t id);

void ldns\_pkt\_set\_qr(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_aa(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_tc(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_rd(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_cd(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_ra(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_ad(ldns\_pkt \*p, bool b);

void ldns\_pkt\_set\_opcode(ldns\_pkt \*p, ldns\_pkt\_opcode c);

void ldns\_pkt\_set\_rcode(ldns\_pkt \*p, uint8\_t c);

void ldns\_pkt\_set\_qdcount(ldns\_pkt \*p, uint16\_t c);

void ldns\_pkt\_set\_ancount(ldns\_pkt \*p, uint16\_t c);

void ldns\_pkt\_set\_nscount(ldns\_pkt \*p, uint16\_t c);

void ldns\_pkt\_set\_arcount(ldns\_pkt \*p, uint16\_t c);

void ldns\_pkt\_set\_answerfrom(ldns\_pkt \*p, ldns\_rdf \*r);

void ldns\_pkt\_set\_querytime(ldns\_pkt \*p, uint32\_t t);

void ldns\_pkt\_set\_size(ldns\_pkt \*p, size\_t s);

void ldns\_pkt\_set\_section\_count(ldns\_pkt \*p, ldns\_pkt\_section s, uint16\_t x);

void ldns\_pkt\_set\_tsig(ldns\_pkt \*p, ldns\_rr \*t);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_pkt\_set\_flags*() sets the flags in a packet.  
**pkt**: the packet to operate on  
**flags**: ORed values: LDNS\_QR| LDNS\_AR for instance  
Returns true on success otherwise false

*ldns\_pkt\_set\_id*() Set the packet's id  
**p**: the packet  
**id**: the id to set

*ldns\_pkt\_set\_qr*() Set the packet's qr bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_aa*() Set the packet's aa bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_tc*() Set the packet's tc bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_rd*() Set the packet's rd bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_cd*() Set the packet's cd bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_ra*() Set the packet's ra bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_ad*() Set the packet's ad bit  
**p**: the packet  
**b**: the value to set (boolean)

*ldns\_pkt\_set\_opcode*() Set the packet's opcode  
**p**: the packet  
**c**: the opcode

*ldns\_pkt\_set\_rcode*() Set the packet's response code  
**p**: the packet  
**c**: the rcode

*ldns\_pkt\_set\_qdcount*() Set the packet's qd count  
**p**: the packet  
**c**: the count

*ldns\_pkt\_set\_ancount*() Set the packet's an count  
**p**: the packet  
**c**: the count

*ldns\_pkt\_set\_nscount*() Set the packet's ns count  
**p**: the packet  
**c**: the count

*ldns\_pkt\_set\_arcount*() Set the packet's arcount  
**p**: the packet  
**c**: the count

*ldns\_pkt\_set\_answerfrom*() Set the packet's answering server  
**p**: the packet  
**r**: the address

*ldns\_pkt\_set\_querytime*() Set the packet's query time  
**p**: the packet  
**t**: the querytime in msec

*ldns\_pkt\_set\_size*() Set the packet's size  
**p**: the packet  
**s**: the size

*ldns\_pkt\_set\_section\_count*() Set a packet's section count to x  
**p**: the packet  
**s**: the section  
**x**: the section count

*ldns\_pkt\_set\_tsig*() Set the packet's tsig rr  
**p**: the packet  
**t**: the tsig rr

# [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_set_section_count(3) from ldns 1.9.2-r2 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
