---
name: "ldns_buffer_end"
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_buffer_end"
---

# ldns\_buffer\_end(3)

buffer limits and pointers

## NAME

ldns\_buffer\_limit, ldns\_buffer\_set\_limit, ldns\_buffer\_capacity, ldns\_buffer\_set\_capacity, ldns\_buffer\_reserve, ldns\_buffer\_at, ldns\_buffer\_begin, ldns\_buffer\_end, ldns\_buffer\_current - buffer limits and pointers

## SYNOPSIS

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

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

size\_t ldns\_buffer\_limit(const ldns\_buffer \*buffer);

void ldns\_buffer\_set\_limit(ldns\_buffer \*buffer, size\_t limit);

size\_t ldns\_buffer\_capacity(const ldns\_buffer \*buffer);

bool ldns\_buffer\_set\_capacity(ldns\_buffer \*buffer, size\_t capacity);

bool ldns\_buffer\_reserve(ldns\_buffer \*buffer, size\_t amount);

uint8\_t \* ldns\_buffer\_at(const ldns\_buffer \*buffer, size\_t at);

uint8\_t \* ldns\_buffer\_begin(const ldns\_buffer \*buffer);

uint8\_t \* ldns\_buffer\_end(const ldns\_buffer \*buffer);

uint8\_t \* ldns\_buffer\_current(const ldns\_buffer \*buffer);

## DESCRIPTION

*ldns\_buffer\_limit*() returns the maximum size of the buffer \\param\[in\] buffer .br Returns the size

*ldns\_buffer\_set\_limit*() changes the buffer's limit.  If the buffer's position is greater than the new limit the position is set to the limit. .br **buffer**: the buffer .br **limit**: the new limit

*ldns\_buffer\_capacity*() returns the number of bytes the buffer can hold. .br **buffer**: the buffer .br Returns the number of bytes

*ldns\_buffer\_set\_capacity*() changes the buffer's capacity.  The data is reallocated so any pointers to the data may become invalid.  The buffer's limit is set to the buffer's new capacity. .br **buffer**: the buffer .br **capacity**: the capacity to use .br Returns whether this failed or succeeded

*ldns\_buffer\_reserve*() ensures BUFFER can contain at least AMOUNT more bytes.  The buffer's capacity is increased if necessary using buffer\_set\_capacity().

The buffer's limit is always set to the (possibly increased) capacity. .br **buffer**: the buffer .br **amount**: amount to use .br Returns whether this failed or succeeded

*ldns\_buffer\_at*() returns a pointer to the data at the indicated position. .br **buffer**: the buffer .br **at**: position .br Returns the pointer to the data

*ldns\_buffer\_begin*() returns a pointer to the beginning of the buffer (the data at position 0). .br **buffer**: the buffer .br Returns the pointer

*ldns\_buffer\_end*() returns a pointer to the end of the buffer (the data at the buffer's limit). .br **buffer**: the buffer .br Returns the pointer

*ldns\_buffer\_current*() returns a pointer to the data at the buffer's current position. .br **buffer**: the buffer .br Returns the pointer

## 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\_buffer*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
