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