---
name: "ldns_pkt_set_querytime"
section: "3"
platform: "linux"
package: "ldns"
version: "1.9.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ldns_pkt_set_querytime"
---

# ldns\_pkt\_set\_querytime(3)

set ldns\_pkt attributes

## 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

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

\#include \<ldns/ldns.h\>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## AUTHOR

The ldns team at NLnet Labs.

## REPORTING BUGS

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

## 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

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

## REMARKS

This manpage was automatically generated from the ldns source code.
