release
Releases DataGuard configuration.
int release (
DG_Cfg *config
)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
config |
Initialized configuration. |
The input is the initialized configuration. |
Input |
Return Values
Success: 0 is returned.
Dependency
#include "data_guard_config.h": the header file where the API declaration is stored.
Example
#include "data_guard_config.h" #include "data_guard_mpc.h" // opts is the result of the successful DG_InitConfigOpts call, and teeCfg is the result of the successful initialization. int res = opts->release(&teeCfg);
Running result: res is 0.
The following is an example of setting the KCAL configuration.
#include "data_guard_config.h"
#include "data_guard_mpc.h"
DG_ConfigOpts *opts = NULL;
int rv = DG_InitConfigOpts(DG_BusinessType::MPC, &opts);
if (rv != 0) {
printf("DG_InitConfigOpts error!code:%d\n", rv);
return rv;
}
void *teeCfg = NULL;
rv = opts->init(&teeCfg);
if (rv != 0) {
printf(" opts->init(dgCfg)!-%d\n", rv);
return rv;
}
rv = opts->setIntValue(teeCfg, DG_CON_MPC_TEE_INT_NODEID, nodeId);
if (rv != 0) {
printf(" opts-> setIntValue(dgCfg)!-%d\n", rv);
return rv;
}
//SendData and RecvData are implemented by the product.
TEE_NET_RES teeNet = {SendData, RecvData};
DG_Void netFunc;
netFunc.data = &teeNet;
netFunc.size = sizeof(TEE_NET_RES);
rv = opts->setVoidValue(teeCfg, DG_CON_MPC_TEE_VOID_NET_API, &netFunc);
if (rv != 0) {
printf(" opts-> setVoidValue(dgCfg)!-%d\n", rv);
return rv;
}
Running result: The value of each rv is 0.
Call the release API using the opts output of the successful DG_InitConfigOpts call.
Parent topic: DataGuard APIs for Configuring an Operation Set