VxWorks Reference Manual : Libraries

snmpEbufLib

NAME

snmpEbufLib - extended-buffer manipulation functions

ROUTINES

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

DESCRIPTION

This module defines the routines used to manipulate extended buffers.

INCLUDE FILES

buffer.h

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferClone( )

NAME

EBufferClone( ) - make a copy of an extended buffer

SYNOPSIS

int EBufferClone
    (
    EBUFFER_T * srcp, /* source buffer */
    EBUFFER_T * dstp  /* destination buffer */
    )

DESCRIPTION

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.

RETURNS

0 if successful, otherwise -1.

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferClean( )

NAME

EBufferClean( ) - release dynamic memory in an extended buffer

SYNOPSIS

void EBufferClean
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

This routine releases any dynamic memory attached to ebuffp

RETURNS

N/A

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferInitialize( )

NAME

EBufferInitialize( ) - place an extended buffer in a known state

SYNOPSIS

void EBufferInitialize
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferSetup( )

NAME

EBufferSetup( ) - attach an empty memory buffer to an extended buffer

SYNOPSIS

void EBufferSetup
    (
    unsigned int flags,  /* storage type flags */
    EBUFFER_T *  ebuffp, /* extended buffer */
    OCTET_T *    datap,  /* data pointer */
    ALENGTH_T    datal   /* data length */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferPreLoad( )

NAME

EBufferPreLoad( ) - attach a full memory buffer to an extended buffer

SYNOPSIS

void EBufferPreLoad
    (
    unsigned int flags,  /* storage type flags */
    EBUFFER_T *  ebuffp, /* extended buffer */
    OCTET_T *    datap,  /* data pointer */
    ALENGTH_T    datal   /* data length */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferNext( )

NAME

EBufferNext( ) - return a pointer to the next unused byte of the buffer memory

SYNOPSIS

OCTET_T * EBufferNext
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

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.

RETURNS

a pointer to the first unused byte.

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferStart( )

NAME

EBufferStart( ) - return a pointer to the first byte in the buffer memory

SYNOPSIS

OCTET_T * EBufferStart
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

This routine returns a pointer to the first byte in the buffer memory.

RETURNS

a pointer to the first memory byte.

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferUsed( )

NAME

EBufferUsed( ) - return the number of used bytes in the buffer memory

SYNOPSIS

ALENGTH_T EBufferUsed
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

This routine returns the number of used bytes currently in the buffer.

RETURNS

the number of used bytes.

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferReset( )

NAME

EBufferReset( ) - reset the extended buffer

SYNOPSIS

void EBufferReset
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

snmpEbufLib


Libraries : Routines

EBufferRemaining( )

NAME

EBufferRemaining( ) - return the number of unused bytes remaining in buffer memory

SYNOPSIS

void EBufferRemaining
    (
    EBUFFER_T * ebuffp /* extended buffer */
    )

DESCRIPTION

This routine returns the number of unused bytes remaining in the extended buffer memory.

RETURNS

the number of unused bytes.

SEE ALSO

snmpEbufLib