// Configuration release void ElFreeConfig(EL *e) { UINT i; LIST *o; // Validate arguments if (e == NULL) { return; } // Write the configuration file ElSaveConfig(e); FreeCfgRw(e->CfgRw); // Stop all capture o = NewList(NULL); LockList(e->DeviceList); { for (i = 0;i < LIST_NUM(e->DeviceList);i++) { EL_DEVICE *d = LIST_DATA(e->DeviceList, i); Insert(o, CopyStr(d->DeviceName)); } for (i = 0;i < LIST_NUM(o);i++) { char *name = LIST_DATA(o, i); ElDeleteCaptureDevice(e, name); Free(name); } ReleaseList(o); } UnlockList(e->DeviceList); ReleaseList(e->DeviceList); }
// Release the NAT configuration void NiFreeConfig(NAT *n) { // Validate arguments if (n == NULL) { return; } // Write the latest configuration NiWriteConfig(n); // Release the configuration R/W FreeCfgRw(n->CfgRw); n->CfgRw = NULL; Free(n->ClientOption); CiFreeClientAuth(n->ClientAuth); FreeX(n->AdminX); FreeK(n->AdminK); }
// NAT の設定の解放 void NiFreeConfig(NAT *n) { // 引数チェック if (n == NULL) { return; } // 最新の設定の書き込み NiWriteConfig(n); // 設定 R/W の解放 FreeCfgRw(n->CfgRw); n->CfgRw = NULL; Free(n->ClientOption); CiFreeClientAuth(n->ClientAuth); FreeX(n->AdminX); FreeK(n->AdminK); }