Defines, Structures, Typedefs, Functions. More...
Files | |
file | clBufferApi.h |
Header file of Buffer Management related APIs. |
Classes | |
struct | ClBufferPoolConfigT |
The type of the buffer configuration info. More... |
Typedefs | |
typedef ClPtrT | ClBufferHandleT |
The type of the handle for the buffer messages. | |
typedef enum ClBufferMode | ClBufferModeT |
The config mode of the Buffer. |
Enumerations | |
enum | ClBufferMode { CL_BUFFER_NATIVE_MODE, CL_BUFFER_PREALLOCATED_MODE } |
The config mode of the Buffer. More... | |
enum | ClBufferSeekTypeT { CL_BUFFER_SEEK_SET = 0, CL_BUFFER_SEEK_CUR, CL_BUFFER_SEEK_END } |
Functions | |
ClRcT | clBufferChecksum16Compute (ClBufferHandleT messageHandle, ClUint32T startOffset, ClUint32T length, ClUint16T *pChecksum) |
Computes a 16-bit checksum on a message. | |
ClRcT | clBufferChecksum32Compute (ClBufferHandleT messageHandle, ClUint32T startOffset, ClUint32T length, ClUint32T *pChecksum) |
Computes a 32-bit checksum on a message. | |
ClRcT | clBufferClear (ClBufferHandleT messageHandle) |
Deletes the content of the buffer message. | |
ClRcT | clBufferConcatenate (ClBufferHandleT destination, ClBufferHandleT *pSource) |
Concatenates source message to destination message. | |
ClRcT | clBufferCreate (ClBufferHandleT *pMessageHandle) |
Creates a new message. | |
ClRcT | clBufferCreateAndAllocate (ClUint32T size, ClBufferHandleT *pMessageHandle) |
Creates buffers for a requested size of a message. | |
ClRcT | clBufferDataPrepend (ClBufferHandleT messageHandle, ClUint8T *pByteBuffer, ClUint32T numberOfBytesToWrite) |
Prepends specified number of bytes at the begining of message. | |
ClRcT | clBufferDelete (ClBufferHandleT *pMessageHandle) |
Deletes the Buffers. | |
ClRcT | clBufferDuplicate (ClBufferHandleT messageHandle, ClBufferHandleT *pDuplicatedMessage) |
Duplicates a message. | |
ClRcT | clBufferFinalize (void) |
Cleans up the Buffer Management library. | |
ClRcT | clBufferFlatten (ClBufferHandleT messageHandle, ClUint8T **ppFlattenBuffer) |
Flattens message into a single buffer. | |
ClRcT | clBufferHeaderTrim (ClBufferHandleT messageHandle, ClUint32T numberOfBytes) |
Trims the start of the message. | |
ClRcT | clBufferInitialize (const ClBufferPoolConfigT *pConfig) |
Initializes the Buffer Management library. | |
ClRcT | clBufferKernelToUserCopy (ClBufferHandleT kernelMessageHandle, ClBufferHandleT userMessageHandle) |
Copies message from kernel-space to user-space. | |
ClRcT | clBufferLengthCalc (ClBufferHandleT bufferHandle) |
Recompute the message length & set internal variable. | |
ClRcT | clBufferLengthGet (ClBufferHandleT messageHandle, ClUint32T *pMessageLength) |
Returns the length of the message. | |
ClRcT | clBufferNBytesRead (ClBufferHandleT messageHandle, ClUint8T *pByteBuffer, ClUint32T *pNumberOfBytesToRead) |
Reads the specified number of bytes of data from a message. | |
ClRcT | clBufferNBytesWrite (ClBufferHandleT messageHandle, ClUint8T *pByteBuffer, ClUint32T numberOfBytesToWrite) |
Writes the specified number bytes of data from a message. | |
ClRcT | clBufferReadOffsetGet (ClBufferHandleT messageHandle, ClUint32T *pReadOffset) |
Returns current read offset of the message. | |
ClRcT | clBufferReadOffsetSet (ClBufferHandleT messageHandle, ClInt32T newReadOffset, ClBufferSeekTypeT seekType) |
Sets current read offset of the message. | |
ClRcT | clBufferShrink (ClPoolShrinkOptionsT *pShrinkOptions) |
Frees up the unused pools of all sizes. | |
ClRcT | clBufferToBufferCopy (ClBufferHandleT sourceMessage, ClUint32T sourceMessageOffset, ClBufferHandleT destinationMessage, ClUint32T numberOfBytes) |
Copies specific number of bytes from one message to another. | |
ClRcT | clBufferTrailerTrim (ClBufferHandleT messageHandle, ClUint32T numberOfBytes) |
Trims the tail of the message. | |
ClRcT | clBufferUserToKernelCopy (ClBufferHandleT userMessageHandle, ClBufferHandleT *pKernelMessageHandle) |
Copies message from user-space to kernel-space. | |
ClRcT | clBufferWriteOffsetGet (ClBufferHandleT messageHandle, ClUint32T *pWriteOffset) |
Returns current write offset of the message. | |
ClRcT | clBufferWriteOffsetSet (ClBufferHandleT messageHandle, ClInt32T newWriteOffset, ClBufferSeekTypeT seekType) |
Sets current write offset of the message. | |
ClRcT | clDbgBufferPrint (ClBufferHandleT buffer) |
Dumps the buffer for debugging, etc. |
Defines, Structures, Typedefs, Functions.
typedef enum ClBufferMode ClBufferModeT |
The config mode of the Buffer.
When configured in native mode, malloc is used for fetching the memory for the configured buffer pools instead of the clovis pool implementation.
enum ClBufferMode |
The config mode of the Buffer.
When configured in native mode, malloc is used for fetching the memory for the configured buffer pools instead of the clovis pool implementation.
enum ClBufferSeekTypeT |
ClRcT clBufferChecksum16Compute | ( | ClBufferHandleT | messageHandle, |
ClUint32T | startOffset, | ||
ClUint32T | length, | ||
ClUint16T * | pChecksum | ||
) |
Computes a 16-bit checksum on a message.
messageHandle | Handle to the message returned by clBufferCreate() API for which the checksum is to be computed. |
startOffset | Offset from the beginning of the message, from which the data for computing the checksum begins. |
length | Number of bytes of data for which the checksum is to be computed. |
pChecksum | (out) Pointer to variable of type ClUint32T in which the computed checksum is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferChecksum32Compute | ( | ClBufferHandleT | messageHandle, |
ClUint32T | startOffset, | ||
ClUint32T | length, | ||
ClUint32T * | pChecksum | ||
) |
Computes a 32-bit checksum on a message.
messageHandle | Handle to the message returned by clBufferCreate() API for which the checksum is to be computed. |
startOffset | Offset from the beginning of the message, from which the data for computing the checksum begins. |
length | Number of bytes of data for which the checksum is to be computed. |
pChecksum | (out) Pointer to variable of type ClUint32T in which the computed checksum is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferClear | ( | ClBufferHandleT | messageHandle | ) |
Deletes the content of the buffer message.
pMessageHandle | Pointer to the message handle returned by clBufferCreate() API. |
CL_OK | The buffer message is cleared successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferConcatenate | ( | ClBufferHandleT | destination, |
ClBufferHandleT * | pSource | ||
) |
Concatenates source message to destination message.
destination | This is buffer message handle to which the pSource buffer message will be concatinated. The handle of the concatenated message will be the same destination buffer message handle . |
pSource | (in/out) Pointer to buffer message handle of the message, which is to be concatenated with destination buffer message. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferCreate | ( | ClBufferHandleT * | pMessageHandle | ) |
Creates a new message.
pMessageHandle | (out) A pointer to the handle of type ClBufferHandleT designating the buffer for a message created. |
CL_OK | The API successfully created a buffer for a message. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferCreateAndAllocate | ( | ClUint32T | size, |
ClBufferHandleT * | pMessageHandle | ||
) |
Creates buffers for a requested size of a message.
size | Initial size of a message buffer in bytes. |
pMessageHandle | A pointer to the buffer message of type ClBufferHandleT designating the message buffer created. |
CL_OK | The buffers for a message are successfully created. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferDataPrepend | ( | ClBufferHandleT | messageHandle, |
ClUint8T * | pByteBuffer, | ||
ClUint32T | numberOfBytesToWrite | ||
) |
Prepends specified number of bytes at the begining of message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
pByteBuffer | Pointer to a variable of type ClUint8T, in which numberOfBytesToRead bytes of data is returned. |
numberOfBytesToWrite | Number of bytes to be written. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferDelete | ( | ClBufferHandleT * | pMessageHandle | ) |
Deletes the Buffers.
pMessageHandle | Pointer to the message handle, which is to be deleted. |
CL_OK | The Buffers are deleted successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferDuplicate | ( | ClBufferHandleT | messageHandle, |
ClBufferHandleT * | pDuplicatedMessage | ||
) |
Duplicates a message.
messageHandle | Handle to the message returned by clBufferCreate() API, which is to be duplicated. |
pDuplicatedMessage | (out) Pointer to variable of type ClBufferHandleT, in which handle of the duplicate message is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | On passing an invalid parameter. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
ClRcT clBufferFinalize | ( | void | ) |
Cleans up the Buffer Management library.
CL_OK | The API executed successfully. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferFlatten | ( | ClBufferHandleT | messageHandle, |
ClUint8T ** | ppFlattenBuffer | ||
) |
Flattens message into a single buffer.
messageHandle | Handle to message returned by clBufferCreate() API. |
ppFlattenBuffer | (out) The flatten buffer would be returned in this location. This must be a valid pointer and cannot be NULL. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
ClRcT clBufferHeaderTrim | ( | ClBufferHandleT | messageHandle, |
ClUint32T | numberOfBytes | ||
) |
Trims the start of the message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
numberOfBytes | Number of bytes to delete from the start of the message. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | On passing an invalid parameter. |
ClRcT clBufferInitialize | ( | const ClBufferPoolConfigT * | pConfig | ) |
Initializes the Buffer Management library.
pConfig | This should contain the pool configuration to be used by the Buffer library. If NULL is passed then the default pool configuration will be used. |
CL_OK | The API executed successfully. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
CL_ERR_INITIALIZED | If the Buffer Management library is already initialized. |
ClRcT clBufferKernelToUserCopy | ( | ClBufferHandleT | kernelMessageHandle, |
ClBufferHandleT | userMessageHandle | ||
) |
Copies message from kernel-space to user-space.
kernelMessageHandle | Handle to kernel-space message returned by clBufferCreate() API, from which data is to be copied into user-space message. |
userMessageHandle | Handle to user-space message returned by clBufferCreate() API,into which data is to be copied from kernel-space message. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
ClRcT clBufferLengthCalc | ( | ClBufferHandleT | bufferHandle | ) |
Recompute the message length & set internal variable.
messageHandle | Handle to the message returned by clBufferCreate() API. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferLengthGet | ( | ClBufferHandleT | messageHandle, |
ClUint32T * | pMessageLength | ||
) |
Returns the length of the message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
pMessageLength | (out) Pointer to a variable of type ClUint32T, in which the total length of the message is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferNBytesRead | ( | ClBufferHandleT | messageHandle, |
ClUint8T * | pByteBuffer, | ||
ClUint32T * | pNumberOfBytesToRead | ||
) |
Reads the specified number of bytes of data from a message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
pByteBuffer | Pointer to a stream of memory of type ClUint8T*, in which *pNumberOfBytesToRead of the read data is returned. Memory allocation and deallocation for this parameter must be done by the caller. |
pNumberOfBytesToRead | Pointer to variable of type ClUint32T, which contains number of bytes of data to be read. And the number of bytes of data that has been successfully read is returned in this parameter. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferNBytesWrite | ( | ClBufferHandleT | messageHandle, |
ClUint8T * | pByteBuffer, | ||
ClUint32T | numberOfBytesToWrite | ||
) |
Writes the specified number bytes of data from a message.
messageHandle | Handle to the message returned by clBufferCreate() API into which n bytes of data is to be written. |
pByteBuffer | Pointer to the byte buffer from which numberOfBytesToWrite bytes are to be written into the buffer message. |
numberOfBytesToWrite | Number of bytes to be written. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferReadOffsetGet | ( | ClBufferHandleT | messageHandle, |
ClUint32T * | pReadOffset | ||
) |
Returns current read offset of the message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
pReadOffset | Pointer to a variable of type ClUint32T, in which the current read offset is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferReadOffsetSet | ( | ClBufferHandleT | messageHandle, |
ClInt32T | newReadOffset, | ||
ClBufferSeekTypeT | seekType | ||
) |
Sets current read offset of the message.
messageHandle | Handle to the message returned by clBufferCreate() API |
seekType | This parameter accepts the following values:
|
newReadOffset | The offset at which the current read offset is to be set. If seekType is set to CL_BUFFER_SEEK_SET then the value of newReadOffset should be 0 or greater, for CL_BUFFER_SEEK_CUR it can be a positive of negative number and for CL_BUFFER_END it should be 0 or a negative number. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | On passing an invalid parameter. |
ClRcT clBufferShrink | ( | ClPoolShrinkOptionsT * | pShrinkOptions | ) |
Frees up the unused pools of all sizes.
pShrinkOptions | This is pointer to the shrik option parameter of type ClPoolShrinkOptionsT. The values that can be passed are
|
CL_OK | The API executed successfully. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferToBufferCopy | ( | ClBufferHandleT | sourceMessage, |
ClUint32T | sourceMessageOffset, | ||
ClBufferHandleT | destinationMessage, | ||
ClUint32T | numberOfBytes | ||
) |
Copies specific number of bytes from one message to another.
sourceMessage | Handle to the message returned by clBufferCreate() API, from which data is to be copied. |
sourceMessageOffset | Offset with respect to beginning of sourceMessage, from where the copying is to begin. |
destinationMessage | Handle to the message returned by clBufferCreate() API, into which data is being copied. |
numberOfBytes | Number of bytes to be copied from sourceMessage to destinationMessage. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | On passing an invalid parameter. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
ClRcT clBufferTrailerTrim | ( | ClBufferHandleT | messageHandle, |
ClUint32T | numberOfBytes | ||
) |
Trims the tail of the message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
numberOfBytes | Number of bytes to delete from the tail of the message. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | On passing an invalid parameter. |
ClRcT clBufferUserToKernelCopy | ( | ClBufferHandleT | userMessageHandle, |
ClBufferHandleT * | pKernelMessageHandle | ||
) |
Copies message from user-space to kernel-space.
userMessageHandle | Handle to message returned by clBufferCreate() API, which is to be copied into kernel space. |
pKernelMessageHandle | (out) Pointer to variable of type ClBufferHandleT, in which the handle to message in the kernel space is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
ClRcT clBufferWriteOffsetGet | ( | ClBufferHandleT | messageHandle, |
ClUint32T * | pWriteOffset | ||
) |
Returns current write offset of the message.
messageHandle | Handle to the message returned by clBufferCreate API |
pWriteOffset | Pointer to a variable of type ClUint32T, in which the current write offset is returned. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
ClRcT clBufferWriteOffsetSet | ( | ClBufferHandleT | messageHandle, |
ClInt32T | newWriteOffset, | ||
ClBufferSeekTypeT | seekType | ||
) |
Sets current write offset of the message.
messageHandle | Handle to the message returned by clBufferCreate() API. |
seekType | This parameter can accept the following values:
|
newWriteOffset | The offset at which the current write offset is to be set. If seekType is set to CL_BUFFER_SEEK_SET then the value of newWriteOffset should be 0 or greater, for CL_BUFFER_SEEK_CUR it can be a positive of negative number and for CL_BUFFER_END it should be 0 or a negative number. |
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NOT_INITIALIZED | If Buffer Management library is not initialized. |
CL_ERR_INVALID_PARAMETER | If an invalid parameter is passed. |