db2commexitRecv API - Receive
This function is called for each buffer that the database manager receives from a client. It is applicable only in communication buffer exit libraries.
This function is called by the database manager immediately after it receives a communication buffer from the client. The function is called after the buffer is decrypted so that the communication buffer exit library can access the unencrypted buffer.
API header file
db2commexit.h
API and data structure syntax
SQL_API_RC ( SQL_API_FN * db2commexitRecv )
(
void * pConnectionContext,
const db2commexitCommInfo_v1 * pCommInfo,
const db2commexitBuffer * pBuffer,
db2int64 * pReservedFlags,
char ** errormsg,
db2int32 * errormsglen
);
db2commexitRecv API Parameters
- pConnectionContext
- Input. A pointer to communication buffer exit library-specific data. This pointer is specific to the inbound connection. This parameter is passed as input to each function call for that connection. The database manager cannot access the memory pointed to by this parameter. This memory must be deallocated by this function.
- pCommInfo
- Input. A pointer to a structure that contains information which identifies the database server and protocol-specific information for the incoming connection. Some of the fields in the structure are not setup until multiple buffers are exchanged with the client. The fields are available in later calls to db2commexitRecv and db2commexitSend. This scenario applies specifically to inbound_appl_id, outbound_appl_id, and connection_type.
- pBuffer
- Input. A pointer to a structure that contains the length of the buffer that is received by the database manager and a pointer to the buffer. If the buffer is encrypted, it is unencrypted before this function is called.
- pReservedFlags
- Input/Output. The bit DB2COMMEXIT_RECV_IN_FLAG_END_DECRYPT is set to indicate that this call is the final call to this function for a DSS that is encrypted. The length of the DSS that is passed as input indicates the length of the encrypted DSS. However, the DSS is then unencrypted and the padding removed. Since there is always padding, the length of the DSS is less than indicated. The length indicated in the pBuffer structure is the final data for the DSS. It is possible that it is zero if a full block size of padding is added.
- errormsg
- Output. A pointer to the address of an ASCII error message string that is allocated by the communication buffer exit library. This error messages string might be returned in this parameter if the function execution is not successful. This memory is not freed by calling db2commexitFreeErrormsg.
- errormsglen
- Output. A pointer to an integer that indicates the length, in bytes, of the error message string in the errormsg parameter.