diff options
| author | David Lamparter <equinox@diac24.net> | 2012-04-16 18:24:40 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2012-04-16 18:24:43 +0200 | 
| commit | d75318cc8de91d94649106f4ea3122d0d21ac9eb (patch) | |
| tree | 6d7c674c4026bccd1384e60ee228d8d67750fbf7 /isisd/isis_main.c | |
| parent | 6e493a44836d3b034ed3421e866878de3fbfcc5b (diff) | |
| parent | 48d8bea8b7c83cf186460f711ab166455b5ed676 (diff) | |
isisd: merge osr/google-is-is
this is essentially half of a rewrite of isisd. please note that a lot
of things are still broken and isisd is not ready for production use.
Diffstat (limited to 'isisd/isis_main.c')
| -rw-r--r-- | isisd/isis_main.c | 29 | 
1 files changed, 19 insertions, 10 deletions
| diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 15d85d6d..f5266aa2 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -44,6 +44,9 @@  #include "isisd/isis_circuit.h"  #include "isisd/isisd.h"  #include "isisd/isis_dynhn.h" +#include "isisd/isis_spf.h" +#include "isisd/isis_route.h" +#include "isisd/isis_zebra.h"  /* Default configuration file name */  #define ISISD_DEFAULT_CONFIG "isisd.conf" @@ -67,7 +70,7 @@ struct zebra_privs_t isisd_privs = {    .vty_group = VTY_GROUP,  #endif    .caps_p = _caps_p, -  .cap_num_p = 2, +  .cap_num_p = sizeof (_caps_p) / sizeof (*_caps_p),    .cap_num_i = 0  }; @@ -154,7 +157,10 @@ reload ()    zlog_debug ("Reload");    /* FIXME: Clean up func call here */    vty_reset (); +  (void) isisd_privs.change (ZPRIVS_RAISE);    execve (_progpath, _argv, _envp); +  zlog_err ("Reload failed: cannot exec %s: %s", _progpath, +      safe_strerror (errno));  }  static void @@ -325,28 +331,31 @@ main (int argc, char **argv, char **envp)    memory_init ();    access_list_init();    isis_init (); -  dyn_cache_init (); +  isis_circuit_init (); +  isis_spf_cmds_init (); + +  /* create the global 'isis' instance */ +  isis_new (1); + +  isis_zebra_init (); +    sort_node ();    /* parse config file */    /* this is needed three times! because we have interfaces before the areas */    vty_read_config (config_file, config_default); -  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) < 0) -    { -      zlog_err("ISISd daemon failed: %s", strerror(errno)); -      exit (1); -    } +  if (daemon_mode) +    daemon (0, 0);    /* Process ID file creation. */ -  pid_output (pid_file); +  if (pid_file[0] != '\0') +    pid_output (pid_file);    /* Make isis vty socket. */    vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH); | 
