SNMP Manager Programmer's Guide

Encoding and Decoding Packets
SNMP Manager Programmer’s Guide134249
6-11
EBufferRemaining()
flags
is one of the following integers corresponding to the define you specify in your first
argument:
0 (BFL_IS_DYNAMIC)
1 (BFL_IS_STATIC)
The following call initializes ebuff pointers so that the value “Save me” is preserved:
EBUFFER_T ebuff;
char buff[20] = "xxSave me zzzz";
EBufferPreLoad(BFL_IS_STATIC, &ebuff, &buff[2], 7);
EBufferRemaining()
This function returns the value of the EBUFFER_T buffer descriptor named
remaining, which indicates the number of unused bytes in the buffer.
bytes-left
is an integer indicating the number of unused bytes in the buffer.
buffer
a pointer to the descriptor structure for the buffer for which you want to know how
many bytes are still available.
The following call returns the number of unused bytes in ebuff to the variable named
left:
EBUFFER_T ebuff;
ALENGTH_T left;
left = EBufferRemaining(&ebuff);
EBufferReset()
This function resets the buffer descriptors for an initialized and allocated buffer so that
start_bp and next_bp point to the first byte in the buffer and remaining is assigned the
number of bytes you allocated.
bytes-left = EBufferRemaining(buffer);
ALENGTH_T EBufferRemaining(EBUFFER_T *buffer);
EBufferReset(buffer);
void EBufferReset(EBUFFER_T *buffer);