OpenDNSSEC-enforcer  1.4.8.2
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  data->rfc5011 = KSM_PAR_RFC5011;
361  data->revoke = KSM_PAR_REVOKE;
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  status = KsmParameterValue(KSM_PAR_RFC5011_STRING, KSM_PAR_RFC5011_CAT, &(data->rfc5011), policy_id, &param_id);
473  if (status > 0) return status;
474 
475  status = KsmParameterValue(KSM_PAR_REVOKE_STRING, KSM_PAR_REVOKE_CAT, &(data->revoke), policy_id, &param_id);
476  if (status > 0) return status;
477 
478 /* For now we only set our default KSK rollover scheme */
479 /* status = KsmParameterValue(KSM_PAR_KSK_ROLL_STRING, KSM_PAR_KSK_ROLL_CAT, &(data->kskroll), policy_id, &param_id);
480  if (status > 0) return status;
481  else if (status == -2)
482  { */
483  /* Not set, use our default */
484  data->kskroll = KSM_ROLL_DEFAULT;
485  /*}*/
486 
487  if (__parcoll_cache_enabled) {
488  memcpy(&__parcoll_cache, data, sizeof(KSM_PARCOLL));
489  __parcoll_cache_policy_id = policy_id;
490  __parcoll_cached = 1;
491  }
492 
493  return 0;
494 }
495 
496 
497 
498 
499 /*+
500  * KsmParameterSet - Set Parameter Entry
501  *
502  * Description:
503  * Sets the value of a parameter in the database.
504  *
505  * Arguments:
506  * const char* name
507  * Name of parameter to set. This must exist, else the setting
508  * will fail.
509  *
510  * int value
511  * Value of the parameter. For intervals, this is the value in
512  * seconds.
513  *
514  * Returns:
515  * int
516  * Status return. 0 => Success, non-zero => error.DisInt
517 -*/
518 
519 int KsmParameterSet(const char* name, const char* category, int value, int policy_id)
520 {
521  int curvalue; /* Current value */
522  int param_id; /* Unique ID of this param */
523  int status = 0; /* Status return */
524  int set = 0; /* SET clause value */
525  char* sql = NULL; /* SQL for the insert */
526  int where = 0; /* WHERE clause value */
527 
528  /* Check to see if the parameter exists */
529 
530  status = KsmParameterValue(name, category, &curvalue, policy_id, &param_id);
531  if (status == 0) {
532 
533  /* It does. Update the value */
534 
535  sql = DusInit("parameters_policies");
536  DusSetInt(&sql, "value", value, set++);
537  DusConditionInt(&sql, "parameter_id", DQS_COMPARE_EQ, param_id, where++);
538  DusConditionInt(&sql, "policy_id", DQS_COMPARE_EQ, policy_id, where++);
539  DusEnd(&sql);
540 
541  status = DbExecuteSqlNoResult(DbHandle(), sql);
542  DusFree(sql);
543  }
544  else if (status == -2) {
545  /* param name is legal, but is not set for this policy */
546  sql = DisInit("parameters_policies");
547  DisAppendInt(&sql, param_id);
548  DisAppendInt(&sql, policy_id);
549  DisAppendInt(&sql, value);
550  DisEnd(&sql);
551 
552  status = DbExecuteSqlNoResult(DbHandle(), sql);
553  DisFree(sql);
554  }
555  /*
556  * else {
557  * Error. A message will have been output.
558  * }
559  */
560 
561  return status;
562 }
563 
564 /*+
565  * KsmParameterShow - Show Parameter
566  *
567  * Description:
568  * Prints to stdout the values of the parameter (or parameters).
569  *
570  * Arguments:
571  * const char* name
572  * Name of parameter to output, or NULL for all parameters.
573 -*/
574 
575 int KsmParameterShow(const char* name, const char* category, int policy_id)
576 {
577  KSM_PARAMETER data; /* Parameter information */
578  DB_RESULT result; /* Result of parameter query */
579  int param_id; /* Unique ID of param */
580  int status = 0; /* Status return */
581  char text[32]; /* For translated string */
582  int value; /* Value of the parameter */
583 
584  /*
585  * If a parameter was given, does it exist? An error will be output if not
586  * and the status return will be non-zero.
587  */
588 
589  if (name) {
590  status = KsmParameterValue(name, category, &value, policy_id, &param_id);
591  }
592 
593  if (status == 0) {
594 
595  /* No problem to perform ther listing */
596 
597  status = KsmParameterInit(&result, name, category, policy_id);
598  if (status == 0) {
599  status = KsmParameter(result, &data);
600  while (status == 0) {
601 
602  /* Get a text form of the value */
603 
604  DtSecondsInterval(data.value, text, sizeof(text));
605 
606  /* ... and print */
607 
608  StrTrimR(data.name);
609  printf("%-12s %-12s %9d (%s)\n", data.name, data.category, data.value, text);
610 
611  /* Get the next parameter */
612 
613  status = KsmParameter(result, &data);
614  }
615 
616  /* All done, so tidy up */
617 
618  KsmParameterEnd(result);
619  }
620  }
621 
622  return 0;
623 }
void DbFreeResult(DB_RESULT result)
#define KSM_PAR_REGDELAY_CAT
Definition: ksm.h:454
int revoke
Definition: ksm.h:502
#define KSM_PAR_CLOCKSKEW_STRING
Definition: ksm.h:414
#define KSM_PAR_REVOKE_CAT
Definition: ksm.h:478
#define KSM_PAR_KSKLIFE_CAT
Definition: ksm.h:418
#define KSM_INVARG
Definition: ksmdef.h:66
#define KSM_PAR_KSKTTL
Definition: ksm.h:446
int DbFetchRow(DB_RESULT result, DB_ROW *row)
#define KSM_PAR_KSKPROPDELAY
Definition: ksm.h:449
char * DqsSpecifyInit(const char *table, const char *fields)
Definition: dq_string.c:117
#define KSM_PAR_SIGNINT
Definition: ksm.h:428
int kskttl
Definition: ksm.h:492
#define KSM_PAR_CLOCKSKEW
Definition: ksm.h:413
#define KSM_PAR_SOATTL_STRING
Definition: ksm.h:435
int pub_safety
Definition: ksm.h:495
#define KSM_PAR_ZSKTTL_CAT
Definition: ksm.h:445
#define KSM_PAR_ZSK_MAN_ROLL_STRING
Definition: ksm.h:465
#define KSM_PAR_RFC5011_STRING
Definition: ksm.h:474
#define DB_PARAMETER_NAME
Definition: db_fields.h:79
void DusFree(char *sql)
Definition: du_string.c:223
int rfc5011
Definition: ksm.h:501
#define KSM_PAR_PROPDELAY_STRING
Definition: ksm.h:420
void KsmParameterCollectionCache(int enable)
#define KSM_PAR_STANDBYZSKS_STRING
Definition: ksm.h:426
#define KSM_PAR_STANDBYZSKS_CAT
Definition: ksm.h:427
void KsmParameterEnd(DB_RESULT result)
int dsttl
Definition: ksm.h:499
#define DB_PARAMETER_VIEW_FIELDS
Definition: db_fields.h:77
#define KSM_PAR_PROPDELAY_CAT
Definition: ksm.h:421
int zsksiglife
Definition: ksm.h:489
#define KSM_ROLL_DEFAULT
Definition: ksm.h:400
void DqsOrderBy(char **query, const char *field)
Definition: dq_string.c:277
int value
Definition: ksm.h:159
int MsgLog(int status,...)
Definition: message.c:335
#define KSM_PAR_STANDBYZSKS
Definition: ksm.h:425
int KsmParameter(DB_RESULT result, KSM_PARAMETER *data)
#define KSM_PAR_REGDELAY
Definition: ksm.h:452
int KsmParameterSet(const char *name, const char *category, int value, int policy_id)
int clockskew
Definition: ksm.h:481
#define KSM_PAR_KSKLIFE_STRING
Definition: ksm.h:417
int regdelay
Definition: ksm.h:494
int ret_safety
Definition: ksm.h:496
#define KSM_PAR_RFC5011
Definition: ksm.h:473
#define KSM_PAR_KSKLIFE
Definition: ksm.h:416
#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:482
#define KSM_PAR_PUBSAFETY
Definition: ksm.h:455
#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:170
#define KSM_PAR_ZSKLIFE_STRING
Definition: ksm.h:441
DB_HANDLE DbHandle(void)
#define KSM_PAR_ZSKSIGLIFE
Definition: ksm.h:437
#define KSM_PAR_DSTTL_CAT
Definition: ksm.h:469
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:458
#define KSM_PAR_ZSKTTL_STRING
Definition: ksm.h:444
#define DB_PARAMETER_CATEGORY
Definition: db_fields.h:80
int kskmanroll
Definition: ksm.h:497
#define KSM_PAR_SOATTL_CAT
Definition: ksm.h:436
#define KSM_PAR_PUBSAFETY_STRING
Definition: ksm.h:456
#define KSM_PAR_ZSKLIFE
Definition: ksm.h:440
int KsmParameterExist(DB_RESULT *result, const char *name, const char *category, int *parameter_id)
#define KSM_PAR_RETSAFETY_CAT
Definition: ksm.h:460
#define KSM_PAR_SOAMIN
Definition: ksm.h:431
int KsmParameterValue(const char *name, const char *category, int *value, int policy_id, int *parameter_id)
#define KSM_PAR_KSKPROPDELAY_STRING
Definition: ksm.h:450
#define KSM_PAR_SIGNINT_STRING
Definition: ksm.h:429
#define KSM_PAR_PROPDELAY
Definition: ksm.h:419
void StrTrimR(char *text)
Definition: string_util.c:228
#define KSM_PAR_RFC5011_CAT
Definition: ksm.h:475
int propdelay
Definition: ksm.h:485
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:466
#define KSM_PAR_KSKPROPDELAY_CAT
Definition: ksm.h:451
#define KSM_PAR_SOATTL
Definition: ksm.h:434
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:459
#define KSM_PAR_ZSKSIGLIFE_CAT
Definition: ksm.h:439
void DusEnd(char **sql)
Definition: du_string.c:202
int zskttl
Definition: ksm.h:491
#define KSM_PAR_SIGNINT_CAT
Definition: ksm.h:430
#define KSM_PAR_KSKTTL_CAT
Definition: ksm.h:448
#define DB_PARAMETER_VALUE
Definition: db_fields.h:82
#define KSM_PAR_DSTTL_STRING
Definition: ksm.h:468
#define KSM_PAR_ZSKLIFE_CAT
Definition: ksm.h:442
int parameter_id
Definition: ksm.h:160
#define KSM_PAR_CLOCKSKEW_CAT
Definition: ksm.h:415
char * DusInit(const char *table)
Definition: du_string.c:60
int standbyzsks
Definition: ksm.h:484
#define KSM_PAR_ZSKSIGLIFE_STRING
Definition: ksm.h:438
#define KSM_PAR_STANDBYKSKS_CAT
Definition: ksm.h:424
#define KSM_PAR_PUBSAFETY_CAT
Definition: ksm.h:457
void DisFree(char *sql)
Definition: di_string.c:191
#define KSM_PAR_SOAMIN_STRING
Definition: ksm.h:432
#define KSM_PAR_REVOKE
Definition: ksm.h:476
int signint
Definition: ksm.h:486
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:493
char name[KSM_NAME_LENGTH]
Definition: ksm.h:157
#define KSM_PAR_REVOKE_STRING
Definition: ksm.h:477
#define KSM_PAR_KSKTTL_STRING
Definition: ksm.h:447
int zsklife
Definition: ksm.h:490
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:422
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:433
#define KSM_PAR_REGDELAY_STRING
Definition: ksm.h:453
#define KSM_PAR_KSK_MAN_ROLL_CAT
Definition: ksm.h:463
int standbyksks
Definition: ksm.h:483
#define KSM_PAR_STANDBYKSKS_STRING
Definition: ksm.h:423
int KsmParameterCollection(KSM_PARCOLL *data, int policy_id)
char category[KSM_NAME_LENGTH]
Definition: ksm.h:158
int soattl
Definition: ksm.h:488
int DbExecuteSqlNoResult(DB_HANDLE handle, const char *stmt_str)
int zskmanroll
Definition: ksm.h:498
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:462
#define KSM_PAR_ZSKTTL
Definition: ksm.h:443
int soamin
Definition: ksm.h:487
int kskroll
Definition: ksm.h:500