diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-02-26 03:34:27 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-02-26 03:34:27 +0000 |
commit | 00a1a0aa22084666166904ec332afcd3da679152 (patch) | |
tree | 4a294d67e14522d1fb8f5d15be6de03144e0da7e | |
parent | 4bb140ab42637792bb537f207c2c7c38a6e461fe (diff) |
Merge from the Ericsson repository
| revision 1.14
| date: 1999/02/25 11:38:47; author: niklas; state: Exp; lines: +3 -1
| include sysdep.h everywhere
| ----------------------------
| revision 1.13
| date: 1999/02/25 11:09:31; author: niklas; state: Exp; lines: +7 -4
| Make conf_get_num take a default value to give back when tag does not exist
| ----------------------------
| revision 1.12
| date: 1999/01/31 01:20:42; author: niklas; state: Exp; lines: +7 -1
| on-demand keying
| ----------------------------
-rw-r--r-- | sbin/isakmpd/conf.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sbin/isakmpd/conf.c b/sbin/isakmpd/conf.c index 59c0d892aa9..cd6b4bd0707 100644 --- a/sbin/isakmpd/conf.c +++ b/sbin/isakmpd/conf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: conf.c,v 1.5 1998/12/21 21:52:56 niklas Exp $ */ -/* $EOM: conf.c,v 1.11 1998/12/21 21:28:55 niklas Exp $ */ +/* $OpenBSD: conf.c,v 1.6 1999/02/26 03:34:26 niklas Exp $ */ +/* $EOM: conf.c,v 1.14 1999/02/25 11:38:47 niklas Exp $ */ /* * Copyright (c) 1998 Niklas Hallqvist. All rights reserved. @@ -46,6 +46,9 @@ #include <string.h> #include <unistd.h> +#include "sysdep.h" + +#include "app.h" #include "conf.h" #include "log.h" @@ -246,17 +249,25 @@ conf_init (void) LIST_INIT (&conf_bindings); conf_parse (); + +#ifdef NEED_SYSDEP_APP + /* Let the application layer record on-demand keyed connections. */ + app_conf_init_hook (); +#endif } -/* Return the numeric value denoted by TAG in section SECTION. */ +/* + * Return the numeric value denoted by TAG in section SECTION or DEF + * if that tag does not exist. + */ int -conf_get_num (char *section, char *tag) +conf_get_num (char *section, char *tag, int def) { char *value = conf_get_str (section, tag); if (value) return atoi (value); - return 0; + return def; } /* Validate X according to the range denoted by TAG in section SECTION. */ |