OpenDNSSEC-enforcer  1.4.9
Functions
ksmutil.h File Reference
#include <stdio.h>
#include <ksm/ksm.h>
#include <ksm/database.h>
#include <libxml/xpath.h>
#include <inttypes.h>
Include dependency graph for ksmutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int db_connect (DB_HANDLE *dbhandle, FILE **lock_fd, int backup)
 
void db_disconnect (FILE *lock_fd)
 
int read_filenames (char **zone_list_filename, char **kasp_filename)
 
int update_repositories ()
 
int update_policies (char *kasp_filename)
 
int update_zones (char *zone_list_filename)
 
int get_lite_lock (char *lock_filename, FILE *lock_fd)
 
int release_lite_lock (FILE *lock_fd)
 
int SetParamOnPolicy (const xmlChar *new_value, const char *name, const char *category, int current_value, int policy_id, int value_type)
 
void SetPolicyDefaults (KSM_POLICY *policy, char *name)
 
int backup_file (const char *orig_file, const char *backup_file)
 
int get_db_details (char **dbschema, char **host, char **port, char **user, char **password)
 
int read_zonelist_filename (char **zone_list_filename)
 
xmlDocPtr add_zone_node (const char *docname, const char *zone_name, const char *policy_name, const char *sig_conf_name, const char *input_name, const char *output_name, const char *input_type, const char *output_type)
 
xmlDocPtr del_zone_node (const char *docname, const char *zone_name)
 
void list_zone_node (const char *docname, int *zone_ids)
 
xmlDocPtr del_policy_node (const char *docname, const char *policy_name)
 
int append_policy (xmlDocPtr doc, KSM_POLICY *policy)
 
int printKey (void *context, KSM_KEYDATA *key_data)
 
void ksm_log_msg (const char *format)
 
int ListKeys (int zone_id)
 
int PurgeKeys (int zone_id, int policy_id)
 
int cmd_genkeys ()
 
int cmd_delkey ()
 
int fix_file_perms (const char *dbschema)
 
int CountKeys (int *zone_id, int keytag, const char *cka_id, int *key_count, char **temp_cka_id, int *temp_key_state, int *temp_keypair_id)
 
int GetKeyState (const char *cka_id, int *temp_key_state, int *temp_keypair_id)
 
int MarkDSSeen (int keypair_id, int zone_id, int policy_id, const char *datetime, int key_state)
 
int RetireOldKey (int zone_id, int policy_id, const char *datetime)
 
int RevokeOldKey (int zone_id, int policy_id, const char *datetime)
 
int CountKeysInState (int keytype, int keystate, int *count, int zone_id)
 
int ChangeKeyState (int keytype, const char *cka_id, int zone_id, int policy_id, const char *datetime, int key_state)
 
int get_conf_key_info (int *interval, int *man_key_gen)
 
int LinkKeys (const char *zone_name, int policy_id)
 
int allocateKeysToZone (KSM_POLICY *policy, int key_type, int zone_id, uint16_t interval, const char *zone_name, int man_key_gen, int rollover_scheme)
 
int keyRoll (int zone_id, int policy_id, int key_type)
 
int get_policy_name_from_id (KSM_ZONE *zone)
 
int append_zone (xmlDocPtr doc, KSM_ZONE *zone)
 
int ShellQuoteString (const char *string, char *buffer, size_t buflen)
 
int rename_signconf (const char *zonelist_filename, const char *o_zone)
 
int ListDS (int zone_id)
 

Function Documentation

xmlDocPtr add_zone_node ( const char *  docname,
const char *  zone_name,
const char *  policy_name,
const char *  sig_conf_name,
const char *  input_name,
const char *  output_name,
const char *  input_type,
const char *  output_type 
)

Definition at line 6405 of file ksmutil.c.

Referenced by cmd_addzone().

int allocateKeysToZone ( KSM_POLICY policy,
int  key_type,
int  zone_id,
uint16_t  interval,
const char *  zone_name,
int  man_key_gen,
int  rollover_scheme 
)
int append_policy ( xmlDocPtr  doc,
KSM_POLICY policy 
)
int append_zone ( xmlDocPtr  doc,
KSM_ZONE zone 
)
int backup_file ( const char *  orig_file,
const char *  backup_file 
)

Definition at line 6032 of file ksmutil.c.

Referenced by cmd_addzone(), cmd_dbbackup(), cmd_delzone(), cmd_purgepolicy(), and db_connect().

int ChangeKeyState ( int  keytype,
const char *  cka_id,
int  zone_id,
int  policy_id,
const char *  datetime,
int  key_state 
)
int cmd_delkey ( )
int cmd_genkeys ( )
int CountKeys ( int *  zone_id,
int  keytag,
const char *  cka_id,
int *  key_count,
char **  temp_cka_id,
int *  temp_key_state,
int *  temp_keypair_id 
)
int CountKeysInState ( int  keytype,
int  keystate,
int *  count,
int  zone_id 
)
int db_connect ( DB_HANDLE dbhandle,
FILE **  lock_fd,
int  backup 
)
void db_disconnect ( FILE *  lock_fd)
xmlDocPtr del_policy_node ( const char *  docname,
const char *  policy_name 
)

Definition at line 6753 of file ksmutil.c.

Referenced by cmd_purgepolicy().

xmlDocPtr del_zone_node ( const char *  docname,
const char *  zone_name 
)

Definition at line 6460 of file ksmutil.c.

Referenced by cmd_delzone().

int fix_file_perms ( const char *  dbschema)

Definition at line 7966 of file ksmutil.c.

References StrAppend(), and StrFree.

Referenced by cmd_setup().

int get_conf_key_info ( int *  interval,
int *  man_key_gen 
)

Definition at line 9038 of file ksmutil.c.

References config, DtXMLIntervalSeconds(), and StrFree.

Referenced by LinkKeys().

int get_db_details ( char **  dbschema,
char **  host,
char **  port,
char **  user,
char **  password 
)

Definition at line 6100 of file ksmutil.c.

References config, DbFlavour(), MYSQL_DB, SQLITE_DB, StrAppend(), and StrFree.

Referenced by cmd_dbbackup(), cmd_setup(), and db_connect().

int get_lite_lock ( char *  lock_filename,
FILE *  lock_fd 
)

Definition at line 1169 of file daemon_util.c.

References log_msg().

Referenced by cmd_dbbackup(), cmd_setup(), db_connect(), and server_main().

int get_policy_name_from_id ( KSM_ZONE zone)
int GetKeyState ( const char *  cka_id,
int *  temp_key_state,
int *  temp_keypair_id 
)

Definition at line 8336 of file ksmutil.c.

References DbExecuteSql(), DbFetchRow(), DbFreeRow(), DbHandle(), DbInt(), KSM_STATE_DEAD, and KSM_STATE_GENERATE.

Referenced by cmd_delkey().

int keyRoll ( int  zone_id,
int  policy_id,
int  key_type 
)
void ksm_log_msg ( const char *  format)

Definition at line 313 of file daemon_util.c.

Referenced by main().

int LinkKeys ( const char *  zone_name,
int  policy_id 
)
void list_zone_node ( const char *  docname,
int *  zone_ids 
)

Definition at line 6514 of file ksmutil.c.

References KsmZoneIdFromName().

Referenced by cmd_listzone().

int ListDS ( int  zone_id)
int ListKeys ( int  zone_id)
int MarkDSSeen ( int  keypair_id,
int  zone_id,
int  policy_id,
const char *  datetime,
int  key_state 
)
int printKey ( void *  context,
KSM_KEYDATA key_data 
)
int PurgeKeys ( int  zone_id,
int  policy_id 
)
int read_filenames ( char **  zone_list_filename,
char **  kasp_filename 
)

Definition at line 4637 of file ksmutil.c.

References config, StrAppend(), and StrFree.

Referenced by cmd_purgepolicy(), cmd_setup(), and cmd_update().

int read_zonelist_filename ( char **  zone_list_filename)

Definition at line 6327 of file ksmutil.c.

References config, StrAppend(), and StrFree.

Referenced by cmd_addzone(), cmd_delzone(), and cmd_listzone().

int release_lite_lock ( FILE *  lock_fd)

Definition at line 1203 of file daemon_util.c.

Referenced by db_disconnect(), and server_main().

int rename_signconf ( const char *  zonelist_filename,
const char *  o_zone 
)

Definition at line 9726 of file ksmutil.c.

References StrAppend(), and StrFree.

Referenced by cmd_delzone().

int RetireOldKey ( int  zone_id,
int  policy_id,
const char *  datetime 
)
int RevokeOldKey ( int  zone_id,
int  policy_id,
const char *  datetime 
)
int SetParamOnPolicy ( const xmlChar *  new_value,
const char *  name,
const char *  category,
int  current_value,
int  policy_id,
int  value_type 
)
void SetPolicyDefaults ( KSM_POLICY policy,
char *  name 
)

Definition at line 5950 of file ksmutil.c.

References KSM_DENIAL_POLICY::algorithm, KSM_KEY_POLICY::algorithm, KSM_ENFORCER_POLICY::backup_interval, KSM_KEY_POLICY::bits, KSM_SIGNATURE_POLICY::clockskew, KSM_POLICY::denial, KSM_PARENT_POLICY::ds_ttl, KSM_POLICY::enforcer, KSM_DENIAL_POLICY::iteration, KSM_SIGNER_POLICY::jitter, KSM_ENFORCER_POLICY::keycreate, KSM_ENFORCER_POLICY::keygeninterval, KSM_POLICY::keys, KSM_POLICY::ksk, KSM_NAME_LENGTH, KSM_ROLL_DEFAULT, KSM_TYPE_KSK, KSM_TYPE_ZSK, KSM_KEY_POLICY::lifetime, KSM_KEY_POLICY::manual_rollover, KSM_POLICY::name, KSM_DENIAL_POLICY::optout, KSM_KEY_POLICY::overlap, KSM_POLICY::parent, KSM_SIGNER_POLICY::propdelay, KSM_ZONE_POLICY::propdelay, KSM_PARENT_POLICY::propdelay, KSM_COMMON_KEY_POLICY::publish_safety, KSM_COMMON_KEY_POLICY::purge, KSM_SIGNER_POLICY::refresh, KSM_DENIAL_POLICY::resalt, KSM_SIGNATURE_POLICY::resign, KSM_COMMON_KEY_POLICY::retire_safety, KSM_KEY_POLICY::rfc5011, KSM_KEY_POLICY::rollover_scheme, KSM_DENIAL_POLICY::saltlength, KSM_SIGNER_POLICY::serial, KSM_ZONE_POLICY::serial, KSM_COMMON_KEY_POLICY::share_keys, KSM_POLICY::signature, KSM_POLICY::signer, KSM_KEY_POLICY::sm, KSM_ZONE_POLICY::soa_min, KSM_PARENT_POLICY::soa_min, KSM_ZONE_POLICY::soa_ttl, KSM_PARENT_POLICY::soa_ttl, KSM_SIGNER_POLICY::soamin, KSM_SIGNER_POLICY::soattl, KSM_KEY_POLICY::standby_keys, KSM_DENIAL_POLICY::ttl, KSM_COMMON_KEY_POLICY::ttl, KSM_KEY_POLICY::ttl, KSM_KEY_POLICY::type, KSM_SIGNATURE_POLICY::valdefault, KSM_SIGNATURE_POLICY::valdenial, KSM_DENIAL_POLICY::version, KSM_POLICY::zone, and KSM_POLICY::zsk.

Referenced by cmd_genkeys(), LinkKeys(), and update_policies().

int ShellQuoteString ( const char *  string,
char *  buffer,
size_t  buflen 
)

Definition at line 9703 of file ksmutil.c.

Referenced by cmd_setup().

int update_policies ( char *  kasp_filename)

Definition at line 4852 of file ksmutil.c.

References KSM_DENIAL_POLICY::algorithm, KSM_KEY_POLICY::algorithm, KSM_KEY_POLICY::bits, BOOL_TYPE, KSM_SIGNATURE_POLICY::clockskew, config, DEFAULT_LOG_FACILITY, KSM_POLICY::denial, KSM_POLICY::description, KSM_PARENT_POLICY::ds_ttl, DURATION_TYPE, KSM_POLICY::id, INT_TYPE, INT_TYPE_NO_FREE, KSM_DENIAL_POLICY::iteration, KSM_SIGNER_POLICY::jitter, KSM_POLICY::keys, KSM_POLICY::ksk, KSM_MSG_LENGTH, KSM_POLICY_DESC_LENGTH, KsmImportPolicy(), KsmParameterSet(), KsmPolicyAlloc(), KsmPolicyExists(), KsmPolicyFree(), KsmPolicyRead(), KsmPolicySetIdFromName(), KsmPolicyUpdateDesc(), KSM_KEY_POLICY::lifetime, KSM_KEY_POLICY::manual_rollover, KSM_DENIAL_POLICY::optout, KSM_POLICY::parent, KSM_ZONE_POLICY::propdelay, KSM_PARENT_POLICY::propdelay, KSM_COMMON_KEY_POLICY::publish_safety, KSM_COMMON_KEY_POLICY::purge, KSM_SIGNER_POLICY::refresh, REPO_TYPE, KSM_DENIAL_POLICY::resalt, KSM_SIGNATURE_POLICY::resign, KSM_COMMON_KEY_POLICY::retire_safety, KSM_KEY_POLICY::rfc5011, KSM_DENIAL_POLICY::saltlength, KSM_ZONE_POLICY::serial, SERIAL_TYPE, SetParamOnPolicy(), SetPolicyDefaults(), KSM_COMMON_KEY_POLICY::share_keys, KSM_POLICY::signature, KSM_POLICY::signer, KSM_KEY_POLICY::sm, KSM_ZONE_POLICY::soa_min, KSM_PARENT_POLICY::soa_min, KSM_ZONE_POLICY::soa_ttl, KSM_PARENT_POLICY::soa_ttl, KSM_KEY_POLICY::standby_keys, StrAppend(), StrFree, StrStrdup(), StrStrtoi(), KSM_DENIAL_POLICY::ttl, KSM_COMMON_KEY_POLICY::ttl, KSM_SIGNATURE_POLICY::valdefault, KSM_SIGNATURE_POLICY::valdenial, KSM_POLICY::zone, and KSM_POLICY::zsk.

Referenced by cmd_setup(), and cmd_update().

int update_repositories ( )

Definition at line 4747 of file ksmutil.c.

References config, KsmImportRepository(), StrAppend(), and StrFree.

Referenced by cmd_setup(), and cmd_update().

int update_zones ( char *  zone_list_filename)