diff options
author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2007-04-09 15:36:33 -0500 |
---|---|---|
committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2007-04-09 15:36:33 -0500 |
commit | 37e11172f8ed157340783b73d56595bb02d0a2d2 (patch) | |
tree | 65163a9cdb8ded9c55c94da92e8a6327bda9067c /isisd/isis_main.c | |
parent | 8d3e3ccfd0d0cb82b253f937339d1c6189a2bf54 (diff) | |
parent | 43cd33a44e010f818633b7f144b5a0be352b41e7 (diff) | |
download | quagga-0.99.6-realms.patch.tar.bz2 quagga-0.99.6-realms.patch.tar.xz |
Merge commit 'quagga_0_99_6_release' into linux-realmsquagga-0.99.6-realms.patch
Diffstat (limited to 'isisd/isis_main.c')
-rw-r--r-- | isisd/isis_main.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 6971874d..2411518d 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -80,6 +80,7 @@ struct option longopts[] = { {"user", required_argument, NULL, 'u'}, {"group", required_argument, NULL, 'g'}, {"version", no_argument, NULL, 'v'}, + {"dryrun", no_argument, NULL, 'C'}, {"help", no_argument, NULL, 'h'}, {0} }; @@ -106,6 +107,16 @@ int _argc; char **_argv; char **_envp; +/* + * Prototypes. + */ +void reload(void); +void sighup(void); +void sigint(void); +void sigterm(void); +void sigusr1(void); + + /* Help information display. */ static void usage (int status) @@ -124,6 +135,7 @@ Daemon which manages IS-IS routing\n\n\ -u, --user User to run as\n\ -g, --group Group to run as\n\ -v, --version Print program version\n\ +-C, --dryrun Check configuration for validity and exit\n\ -h, --help Display this help and exit\n\ \n\ Report bugs to http://bugzilla.quagga.net\n", progname); @@ -213,6 +225,7 @@ main (int argc, char **argv, char **envp) struct thread thread; char *config_file = NULL; char *vty_addr = NULL; + int dryrun = 0; /* Get the programname without the preceding path. */ progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]); @@ -233,7 +246,7 @@ main (int argc, char **argv, char **envp) /* Command line argument treatment. */ while (1) { - opt = getopt_long (argc, argv, "df:i:hA:p:P:u:g:v", longopts, 0); + opt = getopt_long (argc, argv, "df:i:hA:p:P:u:g:vC", longopts, 0); if (opt == EOF) break; @@ -278,6 +291,9 @@ main (int argc, char **argv, char **envp) print_version ("Zebra"); exit (0); break; + case 'C': + dryrun = 1; + break; case 'h': usage (0); break; @@ -312,6 +328,10 @@ main (int argc, char **argv, char **envp) vty_read_config (config_file, config_default); vty_read_config (config_file, config_default); + /* Start execution only if not in dry-run mode */ + if (dryrun) + return(0); + /* demonize */ if (daemon_mode) daemon (0, 0); |