VxWorks Reference Manual : Libraries
snmpEbufLib - extended-buffer manipulation functions
EBufferClone( ) - make a copy of an extended buffer
EBufferClean( ) - release dynamic memory in an extended buffer
EBufferInitialize( ) - place an extended buffer in a known state
EBufferSetup( ) - attach an empty memory buffer to an extended buffer
EBufferPreLoad( ) - attach a full memory buffer to an extended buffer
EBufferNext( ) - return a pointer to the next unused byte of the buffer memory
EBufferStart( ) - return a pointer to the first byte in the buffer memory
EBufferUsed( ) - return the number of used bytes in the buffer memory
EBufferReset( ) - reset the extended buffer
EBufferRemaining( ) - return the number of unused bytes remaining in buffer memory
This module defines the routines used to manipulate extended buffers.
buffer.h
EBufferClone( ) - make a copy of an extended buffer
int EBufferClone ( EBUFFER_T * srcp, /* source buffer */ EBUFFER_T * dstp /* destination buffer */ )
This routine creates a copy of an extended buffer, allocating space from the dynamic pool. Parameter srcp is the old buffer, and dstp the new.
0 if successful, otherwise -1.
EBufferClean( ) - release dynamic memory in an extended buffer
void EBufferClean ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine releases any dynamic memory attached to ebuffp
N/A
EBufferInitialize( ) - place an extended buffer in a known state
void EBufferInitialize ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine places the buffer-control block in a known state. The buffer is not ready to accept data, but may be safely handled by the extended-buffer routines.
N/A
EBufferSetup( ) - attach an empty memory buffer to an extended buffer
void EBufferSetup ( unsigned int flags, /* storage type flags */ EBUFFER_T * ebuffp, /* extended buffer */ OCTET_T * datap, /* data pointer */ ALENGTH_T datal /* data length */ )
This routine attaches an empty memory buffer to a buffer-control block.
flags should be set to the manifest constant BFL_IS_DYNAMIC if the buffer has been allocated from the dynamic pool. Otherwise, flags should be set to BFL_IS_STATIC. The location and length of the buffer are described by datap and datal, respectively.
N/A
EBufferPreLoad( ) - attach a full memory buffer to an extended buffer
void EBufferPreLoad ( unsigned int flags, /* storage type flags */ EBUFFER_T * ebuffp, /* extended buffer */ OCTET_T * datap, /* data pointer */ ALENGTH_T datal /* data length */ )
This routine attaches a full memory buffer to a buffer-control block. Use this routine when constructing a parameter for a procedure which requires buffers in the extended-buffer format.
flags should be set to the manifest constant BFL_IS_DYNAMIC if the buffer has been allocated from the dynamic pool. Otherwise, flags should be set to BFL_IS_STATIC. The location and length of the buffer are described by datap and datal, respectively.
N/A
EBufferNext( ) - return a pointer to the next unused byte of the buffer memory
OCTET_T * EBufferNext ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine returns a pointer to the next unused byte in the buffer memory. The pointer is valid only if there are unused bytes remaining in the buffer.
a pointer to the first unused byte.
EBufferStart( ) - return a pointer to the first byte in the buffer memory
OCTET_T * EBufferStart ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine returns a pointer to the first byte in the buffer memory.
a pointer to the first memory byte.
EBufferUsed( ) - return the number of used bytes in the buffer memory
ALENGTH_T EBufferUsed ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine returns the number of used bytes currently in the buffer.
the number of used bytes.
EBufferReset( ) - reset the extended buffer
void EBufferReset ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine sets the various pointers and counters so that the buffer is exactly as it would be after a call to EBufferSetup( ). The memory buffer itself is left unchanged.
N/A
EBufferRemaining( ) - return the number of unused bytes remaining in buffer memory
void EBufferRemaining ( EBUFFER_T * ebuffp /* extended buffer */ )
This routine returns the number of unused bytes remaining in the extended buffer memory.
the number of unused bytes.