77 if (repo_name == NULL) {
114 DusSetInt(&sql,
"requirebackup", require_backup, 1);
155 if (policy_name == NULL) {
218 int KsmImportZone(
const char* zone_name,
int policy_id,
int fail_if_exists,
int *new_zone,
const char* signconf,
const char* input,
const char* output,
const char* input_type,
const char* output_type)
223 char* zone_name_td = NULL;
227 if (zone_name == NULL || policy_id == 0) {
234 if (strlen(zone_name_td) > 1 && zone_name_td[strlen(zone_name_td)-1] ==
'.') {
235 zone_name_td[strlen(zone_name_td)-1] =
'\0';
237 else if (strlen(zone_name_td) > 1) {
241 snprintf(in_clause,
KSM_SQL_SIZE,
"(\"%s\",\"%s\")", zone_name, zone_name_td);
280 if (fail_if_exists == 1) {
284 DusSetInt(&sql,
"policy_id", policy_id, 0);
344 int KsmImportKeyPair(
int policy_id,
const char* HSMKeyID,
int smID,
int size,
int alg,
int state,
const char* time,
int fixDate,
DB_ID*
id)
349 char* columns = NULL;
356 StrAppend(&columns,
"policy_id, HSMkey_id, securitymodule_id, size, algorithm");
527 StrAppend(&sql,
" and pre_backup is null");
529 StrAppend(&sql,
" where pre_backup is null");
553 StrAppend(&sql,
" and pre_backup is null");
555 StrAppend(&sql,
" where pre_backup is null");
590 StrAppend(&sql,
" and pre_backup is not null");
593 StrAppend(&sql,
" where pre_backup is not null");
618 StrAppend(&sql,
" and pre_backup is not null");
621 StrAppend(&sql,
" where pre_backup is null");
660 StrAppend(&sql,
" and pre_backup is not null");
663 StrAppend(&sql,
" where pre_backup is not null");
689 StrAppend(&sql,
" and pre_backup is not null");
691 StrAppend(&sql,
" where backup is null");
692 StrAppend(&sql,
" and pre_backup is not null");
730 if (cka_id == NULL) {
char * DqsSpecifyInit(const char *table, const char *fields)
#define DB_SECURITY_MODULE_TABLE
int KsmMarkBackup(int repo_id, const char *datetime)
void DusConditionString(char **query, const char *field, DQS_COMPARISON compare, const char *value, int clause)
void DqsConditionKeyword(char **query, const char *field, DQS_COMPARISON compare, const char *value, int index)
char * DisSpecifyInit(const char *table, const char *cols)
int MsgLog(int status,...)
void DusSetInt(char **sql, const char *field, int data, int clause)
void DqsFree(char *query)
void DusConditionInt(char **query, const char *field, DQS_COMPARISON compare, int value, int clause)
const char * KsmKeywordStateValueToName(int value)
char * DqsCountInit(const char *table)
char * StrStrdup(const char *string)
void DqsConditionInt(char **query, const char *field, DQS_COMPARISON compare, int value, int index)
int KsmMarkPreBackup(int repo_id, const char *datetime)
int KsmImportZone(const char *zone_name, int policy_id, int fail_if_exists, int *new_zone, const char *signconf, const char *input, const char *output, const char *input_type, const char *output_type)
int DbQuoteString(DB_HANDLE handle, const char *in, char *buffer, size_t buflen)
int KsmSerialIdFromName(const char *name, int *id)
int DbLastRowId(DB_HANDLE handle, DB_ID *id)
const char * DbErrmsg(DB_HANDLE handle)
void DisAppendString(char **sql, const char *what)
#define KSM_POLICY_DESC_LENGTH
void StrAppend(char **str1, const char *str2)
int KsmSmIdFromName(const char *name, int *id)
int DbIntQuery(DB_HANDLE handle, int *value, const char *query)
char * DusInit(const char *table)
int KsmCheckHSMkeyID(int repo_id, const char *cka_id, int *exists)
int KsmImportKeyPair(int policy_id, const char *HSMKeyID, int smID, int size, int alg, int state, const char *time, int fixDate, DB_ID *id)
int KsmPolicyIdFromName(const char *name, int *id)
int KsmImportPolicy(const char *policy_name, const char *policy_description)
void DisAppendInt(char **sql, int what)
#define KSM_STATE_GENERATE
void DusSetString(char **sql, const char *field, const char *data, int clause)
void DqsEnd(char **query)
int DbExecuteSqlNoResult(DB_HANDLE handle, const char *stmt_str)
void DqsConditionString(char **query, const char *field, DQS_COMPARISON compare, const char *value, int index)
int KsmRollbackMarkPreBackup(int repo_id)
int KsmImportRepository(const char *repo_name, const char *repo_capacity, int require_backup)