OpenDNSSEC-enforcer  1.4.7
ksm_parameter.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2009 Nominet UK. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 /*+
28  * ksm_parameter.c - Manipulation of Parameter Information
29  *
30  * Description:
31  * Holds the functions needed to manipulate the PARAMETER table.
32  *
33  * N.B. The table is the KEYDATA table - rather than the KEY table - as
34  * KEY is a reserved word in SQL.
35 
36 -*/
37 
38 #include <assert.h>
39 #include <stdio.h>
40 #include <stdlib.h>
41 #include <string.h>
42 #include <time.h>
43 
44 #include "ksm/database.h"
45 #include "ksm/database_statement.h"
46 #include "ksm/datetime.h"
47 #include "ksm/db_fields.h"
48 #include "ksm/debug.h"
49 #include "ksm/kmedef.h"
50 #include "ksm/ksmdef.h"
51 #include "ksm/ksm.h"
52 #include "ksm/ksm_internal.h"
53 #include "ksm/message.h"
54 #include "ksm/string_util.h"
55 
56 
57 
58 
59 /*+
60  * KsmParameterInit - Query for Key Information
61  *
62  * Description:
63  * Performs a query for parameters in the parameter table that match the
64  * given conditions.
65  *
66  * Arguments:
67  * DB_RESULT* result
68  * Pointer to a result set to be used for information retrieval. Will
69  * be undefined on error.
70  *
71  * const char* name
72  * Name of the parameter to retrieve information on. If NULL,
73  * information on all parameters is retrieved.
74  *
75  * Returns:
76  * int
77  * Status return.
78  *
79  * 0 Success
80  * Other Error. A message will have been output.
81 -*/
82 
83 int KsmParameterInit(DB_RESULT* result, const char* name, const char* category, int policy_id)
84 {
85  int where = 0; /* WHERE clause value */
86  char* sql = NULL; /* SQL query */
87  int status = 0; /* Status return */
88 
89  /* Construct the query */
90 
91  sql = DqsSpecifyInit("PARAMETER_VIEW", DB_PARAMETER_VIEW_FIELDS);
92  if (name) {
93  DqsConditionString(&sql, "NAME", DQS_COMPARE_EQ, name, where++);
94  DqsConditionString(&sql, "CATEGORY", DQS_COMPARE_EQ, category, where++);
95  }
96  DqsConditionInt(&sql, "policy_id", DQS_COMPARE_EQ, policy_id, where++);
97 
98  DqsOrderBy(&sql, "NAME");
99 
100  /* Execute query and free up the query string */
101 
102  status = DbExecuteSql(DbHandle(), sql, result);
103 
104  DqsFree(sql);
105 
106  return status;
107 }
108 
109 /*+
110  * KsmParameterExist - Does the parameter exist at all?
111  *
112  * Description:
113  * Performs a query for parameters in the parameter table that match the
114  * given conditions.
115  *
116  * Arguments:
117  * DB_RESULT* result
118  * Pointer to a result set to be used for information retrieval. Will
119  * be undefined on error.
120  *
121  * const char* name
122  * Name of the parameter to retrieve information on. If NULL,
123  * information on all parameters is retrieved.
124  *
125  * Returns:
126  * int
127  * Status return.
128  *
129  * 0 Success
130  * Other Error. A message will have been output.
131 -*/
132 
133 int KsmParameterExist(DB_RESULT* result, const char* name, const char* category, int* parameter_id)
134 {
135  int where = 0; /* WHERE clause value */
136  char* sql = NULL; /* SQL query */
137  DB_ROW row = NULL; /* Row data */
138  int status = 0; /* Status return */
139 
140  /* Construct the query */
141 
142  sql = DqsSpecifyInit("PARAMETER_LIST", DB_PARAMETER_LIST_FIELDS);
143  DqsConditionString(&sql, "NAME", DQS_COMPARE_EQ, name, where++);
144  DqsConditionString(&sql, "CATEGORY", DQS_COMPARE_EQ, category, where++);
145 
146  DqsOrderBy(&sql, "NAME");
147 
148  /* Execute query and free up the query string */
149 
150  status = DbExecuteSql(DbHandle(), sql, result);
151 
152  if (status == 0) {
153  status = DbFetchRow(*result, &row);
154  }
155  if (status == 0) {
156  status = DbInt(row, DB_PARAMETER_ID, parameter_id);
157  }
158 
159  DqsFree(sql);
160  DbFreeRow(row);
161 
162  return status;
163 }
164 
165 /*+
166  * KsmParameter - Return Parameter Information
167  *
168  * Description:
169  * Returns information about the next key in the result set.
170  *
171  * Arguments:
172  * DB_RESULT result
173  * Result set from KsmParameterInit.
174  *
175  * KSM_PARAMETER* data
176  * Data is returned in here.
177  *
178  * Returns:
179  * int
180  * Status return:
181  * 0 success
182  * -1 end of record set reached
183  * non-zero some error occurred and a message has been output.
184  *
185  * If the status is non-zero, the returned data is meaningless.
186 -*/
187 
189 {
190  int status = 0; /* Return status */
191  DB_ROW row = NULL; /* Row data */
192 
193  if (data == NULL) {
194  return MsgLog(KSM_INVARG, "NULL data");
195  }
196 
197  /* Initialize */
198 
199  memset(data, 0, sizeof(KSM_PARAMETER));
200 
201  /* Get the next row from the data */
202 
203  status = DbFetchRow(result, &row);
204 
205  if (status == 0) {
206  status = DbStringBuffer(row, DB_PARAMETER_NAME, data->name,
207  sizeof(data->name));
208  }
209  if (status == 0) {
210  status = DbStringBuffer(row, DB_PARAMETER_CATEGORY, data->category,
211  sizeof(data->category));
212  }
213  if (status == 0) {
214  status = DbInt(row, DB_PARAMETER_ID, &(data->parameter_id));
215  }
216  if (status == 0) {
217  status = DbInt(row, DB_PARAMETER_VALUE, &(data->value));
218  }
219 
220  if (row != NULL) {
221  DbFreeRow(row);
222  }
223 
224  return status;
225 }
226 
227 
228 /*+
229  * KsmParameterEnd - End Parameter Information
230  *
231  * Description:
232  * Called at the end of a KsmParameter cycle, frees up a result set.
233  *
234  * Arguments:
235  * DB_RESULT result
236  * Handle from KsmParameterInit
237 -*/
238 
240 {
241  DbFreeResult(result);
242 }
243 
244 
245 
246 /*+
247  * KsmParameterValue - Get Parameter Value
248  *
249  * Description:
250  * Gets the data for the named parameter. If the parameter does not
251  * exist, a warning is output and an error returned.
252  *
253  * Arguments:
254  * const char* name
255  * Name of the parameter.
256  *
257  * const char* category
258  * Category of the parameter.
259  *
260  * int* value
261  * Location into which the value of the parameter is put.
262  *
263  * int policy_id
264  * ID of the policy we are interested in
265  *
266  * int* parameter_id
267  * Location into which the ID of the parameter is put.
268  *
269  * Returns:
270  * int
271  * 0 Success, value found
272  * -2 Success, value not set
273  * Other Error, message has been output
274 -*/
275 
276 int KsmParameterValue(const char* name, const char* category, int* value, int policy_id, int* parameter_id)
277 {
278  DB_RESULT handle; /* Handle to the parameter information */
279  DB_RESULT handle2; /* Handle to the parameter information */
280  KSM_PARAMETER data; /* Parameter data */
281  int status; /* Status return */
282 
283  /* check the arguments */
284  if (value == NULL || parameter_id == NULL) {
285  return MsgLog(KSM_INVARG, "NULL arg");
286  }
287  status = KsmParameterInit(&handle, name, category, policy_id);
288  if (status == 0) {
289 
290  /* Initialized OK, get the value */
291 
292  status = KsmParameter(handle, &data);
293  if (status == 0) {
294  *value = data.value;
295  *parameter_id = data.parameter_id;
296  }
297  else if (status == -1) {
298  status = KsmParameterExist(&handle2, name, category, parameter_id);
299  if (status == 0) {
300  /* parameter by that name exists, but is not set */
301  status = -2;
302  }
303  else {
304  status = MsgLog(KME_NOSUCHPAR, name);
305  }
306  DbFreeResult(handle2);
307  }
308 
309  /* ... and tidy up */
310 
311  }
312  DbFreeResult(handle);
313 
314  return status;
315 }
316 
317 
318 
319 /*+
320  * KsmCollectionInit - Fill In Parameter Collection with defaults
321  *
322  * Description:
323  * Fills in the parameter collection object with the values of the
324  * parameters given in ksm.h.
325  *
326  * Arguments:
327  * KSM_PARCOLL* data
328  * Pointer to the parameter collection object. This will be filled in
329  * by this function.
330  *
331  * Returns:
332  * int
333  * 0 Success
334  * Other One or more errors, in which case a message will have been
335  * output.
336 -*/
337 
339 {
340  if (data == NULL) {
341  return MsgLog(KSM_INVARG, "NULL data");
342  }
343 
345  data->ksklife = KSM_PAR_KSKLIFE;
349  data->signint = KSM_PAR_SIGNINT;
350  data->soamin = KSM_PAR_SOAMIN;
351  data->soattl = KSM_PAR_SOATTL;
353  data->zsklife = KSM_PAR_ZSKLIFE;
354  data->zskttl = KSM_PAR_ZSKTTL;
355  data->kskttl = KSM_PAR_KSKTTL;
357  data->regdelay = KSM_PAR_REGDELAY;
360 
361  return(0);
362 }
363 
364 /*+
365  * KsmParameterCollection - Fill In Parameter Collection Given Name
366  *
367  * Description:
368  * Fills in the parameter collection object with the values of the
369  * parameters.
370  *
371  * Arguments:
372  * KSM_PARCOLL* data
373  * Pointer to the parameter collection object. This will be filled in
374  * by this function.
375  *
376  * Returns:
377  * int
378  * 0 Success
379  * Other One or more errors, in which case a message will have been
380  * output.
381 -*/
382 
383 static KSM_PARCOLL __parcoll_cache;
384 static int __parcoll_cache_policy_id;
385 static int __parcoll_cached = 0;
386 static int __parcoll_cache_enabled = 0;
387 
388 void KsmParameterCollectionCache(int enable) {
389  if (enable && !__parcoll_cache_enabled) {
390  __parcoll_cache_enabled = 1;
391  __parcoll_cached = 0;
392  }
393  else if (!enable && __parcoll_cache_enabled) {
394  __parcoll_cache_enabled = 0;
395  }
396 }
397 
398 int KsmParameterCollection(KSM_PARCOLL* data, int policy_id)
399 {
400  int status = 0;
401  int param_id;
402 
403  /* check the arguments */
404  if (data == NULL) {
405  return MsgLog(KSM_INVARG, "NULL data");
406  }
407 
408  if (__parcoll_cache_enabled && __parcoll_cached && __parcoll_cache_policy_id == policy_id) {
409  memcpy(data, &__parcoll_cache, sizeof(KSM_PARCOLL));
410  return 0;
411  }
412 
413  status = KsmParameterValue(KSM_PAR_CLOCKSKEW_STRING, KSM_PAR_CLOCKSKEW_CAT, &(data->clockskew), policy_id, &param_id);
414  if (status > 0) return status;
415 
416  status = KsmParameterValue(KSM_PAR_KSKLIFE_STRING, KSM_PAR_KSKLIFE_CAT, &(data->ksklife), policy_id, &param_id);
417  if (status > 0) return status;
418 
419  status = KsmParameterValue(KSM_PAR_STANDBYKSKS_STRING, KSM_PAR_STANDBYKSKS_CAT, &(data->standbyksks), policy_id, &param_id);
420  if (status > 0) return status;
421 
422  status = KsmParameterValue(KSM_PAR_STANDBYZSKS_STRING, KSM_PAR_STANDBYZSKS_CAT, &(data->standbyzsks), policy_id, &param_id);
423  if (status > 0) return status;
424 
425  status = KsmParameterValue(KSM_PAR_PROPDELAY_STRING, KSM_PAR_PROPDELAY_CAT, &(data->propdelay), policy_id, &param_id);
426  if (status > 0) return status;
427 
428  status = KsmParameterValue(KSM_PAR_SIGNINT_STRING, KSM_PAR_SIGNINT_CAT, &(data->signint), policy_id, &param_id);
429  if (status > 0) return status;
430 
431  status = KsmParameterValue(KSM_PAR_SOAMIN_STRING, KSM_PAR_SOAMIN_CAT, &(data->soamin), policy_id, &param_id);
432  if (status > 0) return status;
433 
434  status = KsmParameterValue(KSM_PAR_SOATTL_STRING, KSM_PAR_SOATTL_CAT, &(data->soattl), policy_id, &param_id);
435  if (status > 0) return status;
436 
437  status = KsmParameterValue(KSM_PAR_ZSKSIGLIFE_STRING, KSM_PAR_ZSKSIGLIFE_CAT, &(data->zsksiglife), policy_id, &param_id);
438  if (status > 0) return status;
439 
440  status = KsmParameterValue(KSM_PAR_ZSKLIFE_STRING, KSM_PAR_ZSKLIFE_CAT, &(data->zsklife), policy_id, &param_id);
441  if (status > 0) return status;
442 
443  status = KsmParameterValue(KSM_PAR_ZSKTTL_STRING, KSM_PAR_ZSKTTL_CAT, &(data->zskttl), policy_id, &param_id);
444  if (status > 0) return status;
445 
446  status = KsmParameterValue(KSM_PAR_KSKTTL_STRING, KSM_PAR_KSKTTL_CAT, &(data->kskttl), policy_id, &param_id);
447  if (status > 0) return status;
448 
449  status = KsmParameterValue(KSM_PAR_KSKPROPDELAY_STRING, KSM_PAR_KSKPROPDELAY_CAT, &(data->kskpropdelay), policy_id, &param_id);
450  if (status > 0) return status;
451 
452  status = KsmParameterValue(KSM_PAR_REGDELAY_STRING, KSM_PAR_REGDELAY_CAT, &(data->regdelay), policy_id, &param_id);
453  if (status > 0) return status;
454 
455  status = KsmParameterValue(KSM_PAR_PUBSAFETY_STRING, KSM_PAR_PUBSAFETY_CAT, &(data->pub_safety), policy_id, &param_id);
456  if (status > 0) return status;
457 
458  status = KsmParameterValue(KSM_PAR_RETSAFETY_STRING, KSM_PAR_RETSAFETY_CAT, &(data->ret_safety), policy_id, &param_id);
459  if (status > 0) return status;
460 
461  status = KsmParameterValue(KSM_PAR_KSK_MAN_ROLL_STRING, KSM_PAR_KSK_MAN_ROLL_CAT, &(data->kskmanroll), policy_id, &param_id);
462  if (status > 0) return status;
463 
464  status = KsmParameterValue(KSM_PAR_ZSK_MAN_ROLL_STRING, KSM_PAR_ZSK_MAN_ROLL_CAT, &(data->zskmanroll), policy_id, &param_id);
465  if (status > 0) return status;
466 
467  status = KsmParameterValue(KSM_PAR_DSTTL_STRING, KSM_PAR_DSTTL_CAT, &(data->dsttl), policy_id, &param_id);
468  if (status > 0) return status;
469 
470 /* For now we only set our default KSK rollover scheme */
471 /* status = KsmParameterValue(KSM_PAR_KSK_ROLL_STRING, KSM_PAR_KSK_ROLL_CAT, &(data->kskroll), policy_id, &param_id);
472  if (status > 0) return status;
473  else if (status == -2)
474  { */
475  /* Not set, use our default */
476  data->kskroll = KSM_ROLL_DEFAULT;
477  /*}*/
478 
479  if (__parcoll_cache_enabled) {
480  memcpy(&__parcoll_cache, data, sizeof(KSM_PARCOLL));
481  __parcoll_cache_policy_id = policy_id;
482  __parcoll_cached = 1;
483  }
484 
485  return 0;
486 }
487 
488 
489 
490 
491 /*+
492  * KsmParameterSet - Set Parameter Entry
493  *
494  * Description:
495  * Sets the value of a parameter in the database.
496  *
497  * Arguments:
498  * const char* name
499  * Name of parameter to set. This must exist, else the setting
500  * will fail.
501  *
502  * int value
503  * Value of the parameter. For intervals, this is the value in
504  * seconds.
505  *
506  * Returns:
507  * int
508  * Status return. 0 => Success, non-zero => error.DisInt
509 -*/
510 
511 int KsmParameterSet(const char* name, const char* category, int value, int policy_id)
512 {
513  int curvalue; /* Current value */
514  int param_id; /* Unique ID of this param */
515  int status = 0; /* Status return */
516  int set = 0; /* SET clause value */
517  char* sql = NULL; /* SQL for the insert */
518  int where = 0; /* WHERE clause value */
519 
520  /* Check to see if the parameter exists */
521 
522  status = KsmParameterValue(name, category, &curvalue, policy_id, &param_id);
523  if (status == 0) {
524 
525  /* It does. Update the value */
526 
527  sql = DusInit("parameters_policies");
528  DusSetInt(&sql, "value", value, set++);
529  DusConditionInt(&sql, "parameter_id", DQS_COMPARE_EQ, param_id, where++);
530  DusConditionInt(&sql, "policy_id", DQS_COMPARE_EQ, policy_id, where++);
531  DusEnd(&sql);
532 
533  status = DbExecuteSqlNoResult(DbHandle(), sql);
534  DusFree(sql);
535  }
536  else if (status == -2) {
537  /* param name is legal, but is not set for this policy */
538  sql = DisInit("parameters_policies");
539  DisAppendInt(&sql, param_id);
540  DisAppendInt(&sql, policy_id);
541  DisAppendInt(&sql, value);
542  DisEnd(&sql);
543 
544  status = DbExecuteSqlNoResult(DbHandle(), sql);
545  DisFree(sql);
546  }
547  /*
548  * else {
549  * Error. A message will have been output.
550  * }
551  */
552 
553  return status;
554 }
555 
556 /*+
557  * KsmParameterShow - Show Parameter
558  *
559  * Description:
560  * Prints to stdout the values of the parameter (or parameters).
561  *
562  * Arguments:
563  * const char* name
564  * Name of parameter to output, or NULL for all parameters.
565 -*/
566 
567 int KsmParameterShow(const char* name, const char* category, int policy_id)
568 {
569  KSM_PARAMETER data; /* Parameter information */
570  DB_RESULT result; /* Result of parameter query */
571  int param_id; /* Unique ID of param */
572  int status = 0; /* Status return */
573  char text[32]; /* For translated string */
574  int value; /* Value of the parameter */
575 
576  /*
577  * If a parameter was given, does it exist? An error will be output if not
578  * and the status return will be non-zero.
579  */
580 
581  if (name) {
582  status = KsmParameterValue(name, category, &value, policy_id, &param_id);
583  }
584 
585  if (status == 0) {
586 
587  /* No problem to perform ther listing */
588 
589  status = KsmParameterInit(&result, name, category, policy_id);
590  if (status == 0) {
591  status = KsmParameter(result, &data);
592  while (status == 0) {
593 
594  /* Get a text form of the value */
595 
596  DtSecondsInterval(data.value, text, sizeof(text));
597 
598  /* ... and print */
599 
600  StrTrimR(data.name);
601  printf("%-12s %-12s %9d (%s)\n", data.name, data.category, data.value, text);
602 
603  /* Get the next parameter */
604 
605  status = KsmParameter(result, &data);
606  }
607 
608  /* All done, so tidy up */
609 
610  KsmParameterEnd(result);
611  }
612  }
613 
614  return 0;
615 }
void DbFreeResult(DB_RESULT result)
#define KSM_PAR_REGDELAY_CAT
Definition: ksm.h:447
#define KSM_PAR_CLOCKSKEW_STRING
Definition: ksm.h:407
#define KSM_PAR_KSKLIFE_CAT
Definition: ksm.h:411
#define KSM_INVARG
Definition: ksmdef.h:66
#define KSM_PAR_KSKTTL
Definition: ksm.h:439
int DbFetchRow(DB_RESULT result, DB_ROW *row)
#define KSM_PAR_KSKPROPDELAY
Definition: ksm.h:442
char * DqsSpecifyInit(const char *table, const char *fields)
Definition: dq_string.c:117
#define KSM_PAR_SIGNINT
Definition: ksm.h:421
int kskttl
Definition: ksm.h:479
#define KSM_PAR_CLOCKSKEW
Definition: ksm.h:406
#define KSM_PAR_SOATTL_STRING
Definition: ksm.h:428
int pub_safety
Definition: ksm.h:482
#define KSM_PAR_ZSKTTL_CAT
Definition: ksm.h:438
#define KSM_PAR_ZSK_MAN_ROLL_STRING
Definition: ksm.h:458
#define DB_PARAMETER_NAME
Definition: db_fields.h:77
void DusFree(char *sql)
Definition: du_string.c:223
#define KSM_PAR_PROPDELAY_STRING
Definition: ksm.h:413
void KsmParameterCollectionCache(int enable)
#define KSM_PAR_STANDBYZSKS_STRING
Definition: ksm.h:419
#define KSM_PAR_STANDBYZSKS_CAT
Definition: ksm.h:420
void KsmParameterEnd(DB_RESULT result)
int dsttl
Definition: ksm.h:486
#define DB_PARAMETER_VIEW_FIELDS
Definition: db_fields.h:75
#define KSM_PAR_PROPDELAY_CAT
Definition: ksm.h:414
int zsksiglife
Definition: ksm.h:476
#define KSM_ROLL_DEFAULT
Definition: ksm.h:393
void DqsOrderBy(char **query, const char *field)
Definition: dq_string.c:277
int value
Definition: ksm.h:154
int MsgLog(int status,...)
Definition: message.c:335
#define KSM_PAR_STANDBYZSKS
Definition: ksm.h:418
int KsmParameter(DB_RESULT result, KSM_PARAMETER *data)
#define KSM_PAR_REGDELAY
Definition: ksm.h:445
int KsmParameterSet(const char *name, const char *category, int value, int policy_id)
int clockskew
Definition: ksm.h:468
#define KSM_PAR_KSKLIFE_STRING
Definition: ksm.h:410
int regdelay
Definition: ksm.h:481
int ret_safety
Definition: ksm.h:483
#define KSM_PAR_KSKLIFE
Definition: ksm.h:409
#define KME_NOSUCHPAR
Definition: kmedef.h:58
void DusSetInt(char **sql, const char *field, int data, int clause)
Definition: du_string.c:97
void DqsFree(char *query)
Definition: dq_string.c:320
int ksklife
Definition: ksm.h:469
#define KSM_PAR_PUBSAFETY
Definition: ksm.h:448
#define DB_PARAMETER_ID
Definition: db_fields.h:79
void DusConditionInt(char **query, const char *field, DQS_COMPARISON compare, int value, int clause)
Definition: du_string.c:170
#define KSM_PAR_ZSKLIFE_STRING
Definition: ksm.h:434
DB_HANDLE DbHandle(void)
#define KSM_PAR_ZSKSIGLIFE
Definition: ksm.h:430
#define KSM_PAR_DSTTL_CAT
Definition: ksm.h:462
void DqsConditionInt(char **query, const char *field, DQS_COMPARISON compare, int value, int index)
Definition: dq_string.c:224
#define KSM_PAR_RETSAFETY
Definition: ksm.h:451
#define KSM_PAR_ZSKTTL_STRING
Definition: ksm.h:437
#define DB_PARAMETER_CATEGORY
Definition: db_fields.h:78
int kskmanroll
Definition: ksm.h:484
#define KSM_PAR_SOATTL_CAT
Definition: ksm.h:429
#define KSM_PAR_PUBSAFETY_STRING
Definition: ksm.h:449
#define KSM_PAR_ZSKLIFE
Definition: ksm.h:433
int KsmParameterExist(DB_RESULT *result, const char *name, const char *category, int *parameter_id)
#define KSM_PAR_RETSAFETY_CAT
Definition: ksm.h:453
#define KSM_PAR_SOAMIN
Definition: ksm.h:424
int KsmParameterValue(const char *name, const char *category, int *value, int policy_id, int *parameter_id)
#define KSM_PAR_KSKPROPDELAY_STRING
Definition: ksm.h:443
#define KSM_PAR_SIGNINT_STRING
Definition: ksm.h:422
#define KSM_PAR_PROPDELAY
Definition: ksm.h:412
void StrTrimR(char *text)
Definition: string_util.c:228
int propdelay
Definition: ksm.h:472
void DbFreeRow(DB_ROW row)
#define DB_PARAMETER_LIST_FIELDS
Definition: db_fields.h:76
int KsmCollectionInit(KSM_PARCOLL *data)
#define KSM_PAR_ZSK_MAN_ROLL_CAT
Definition: ksm.h:459
#define KSM_PAR_KSKPROPDELAY_CAT
Definition: ksm.h:444
#define KSM_PAR_SOATTL
Definition: ksm.h:427
int DbExecuteSql(DB_HANDLE handle, const char *stmt_str, DB_RESULT *result)
void DisEnd(char **sql)
Definition: di_string.c:170
int DbStringBuffer(DB_ROW row, int field_index, char *buffer, size_t buflen)
#define KSM_PAR_RETSAFETY_STRING
Definition: ksm.h:452
#define KSM_PAR_ZSKSIGLIFE_CAT
Definition: ksm.h:432
void DusEnd(char **sql)
Definition: du_string.c:202
int zskttl
Definition: ksm.h:478
#define KSM_PAR_SIGNINT_CAT
Definition: ksm.h:423
#define KSM_PAR_KSKTTL_CAT
Definition: ksm.h:441
#define DB_PARAMETER_VALUE
Definition: db_fields.h:80
#define KSM_PAR_DSTTL_STRING
Definition: ksm.h:461
#define KSM_PAR_ZSKLIFE_CAT
Definition: ksm.h:435
int parameter_id
Definition: ksm.h:155
#define KSM_PAR_CLOCKSKEW_CAT
Definition: ksm.h:408
char * DusInit(const char *table)
Definition: du_string.c:60
int standbyzsks
Definition: ksm.h:471
#define KSM_PAR_ZSKSIGLIFE_STRING
Definition: ksm.h:431
#define KSM_PAR_STANDBYKSKS_CAT
Definition: ksm.h:417
#define KSM_PAR_PUBSAFETY_CAT
Definition: ksm.h:450
void DisFree(char *sql)
Definition: di_string.c:191
#define KSM_PAR_SOAMIN_STRING
Definition: ksm.h:425
int signint
Definition: ksm.h:473
int KsmParameterInit(DB_RESULT *result, const char *name, const char *category, int policy_id)
Definition: ksm_parameter.c:83
char * DisInit(const char *table)
Definition: di_string.c:65
int kskpropdelay
Definition: ksm.h:480
char name[KSM_NAME_LENGTH]
Definition: ksm.h:152
#define KSM_PAR_KSKTTL_STRING
Definition: ksm.h:440
int zsklife
Definition: ksm.h:477
void DtSecondsInterval(int interval, char *text, size_t textlen)
Definition: datetime.c:774
int DbInt(DB_ROW row, int field_index, int *value)
#define KSM_PAR_STANDBYKSKS
Definition: ksm.h:415
int KsmParameterShow(const char *name, const char *category, int policy_id)
void DisAppendInt(char **sql, int what)
Definition: di_string.c:131
#define KSM_PAR_SOAMIN_CAT
Definition: ksm.h:426
#define KSM_PAR_REGDELAY_STRING
Definition: ksm.h:446
#define KSM_PAR_KSK_MAN_ROLL_CAT
Definition: ksm.h:456
int standbyksks
Definition: ksm.h:470
#define KSM_PAR_STANDBYKSKS_STRING
Definition: ksm.h:416
int KsmParameterCollection(KSM_PARCOLL *data, int policy_id)
char category[KSM_NAME_LENGTH]
Definition: ksm.h:153
int soattl
Definition: ksm.h:475
int DbExecuteSqlNoResult(DB_HANDLE handle, const char *stmt_str)
int zskmanroll
Definition: ksm.h:485
void DqsConditionString(char **query, const char *field, DQS_COMPARISON compare, const char *value, int index)
Definition: dq_string.c:238
#define KSM_PAR_KSK_MAN_ROLL_STRING
Definition: ksm.h:455
#define KSM_PAR_ZSKTTL
Definition: ksm.h:436
int soamin
Definition: ksm.h:474
int kskroll
Definition: ksm.h:487