ldns(3) Library Functions Manual ldns(3)

# [NAME](#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](#SYNOPSIS)

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

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

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](#DESCRIPTION)

*ldns\_buffer\_limit*() returns the maximum size of the buffer \\param\[in] buffer  
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.  
**buffer**: the buffer  
**limit**: the new limit

*ldns\_buffer\_capacity*() returns the number of bytes the buffer can hold.  
**buffer**: the buffer  
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.  
**buffer**: the buffer  
**capacity**: the capacity to use  
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.  
**buffer**: the buffer  
**amount**: amount to use  
Returns whether this failed or succeeded

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

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

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

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

# [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\_buffer*. 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_buffer_begin(3) from ldns 1.9.2-r3 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
