Diff for /embedaddon/quagga/zebra/test_main.c between versions 1.1 and 1.1.1.3

version 1.1, 2012/02/21 17:26:11 version 1.1.1.3, 2016/11/02 10:09:10
Line 29 Line 29
 #include "log.h"  #include "log.h"
 #include "privs.h"  #include "privs.h"
 #include "sigevent.h"  #include "sigevent.h"
   #include "vrf.h"
   
 #include "zebra/rib.h"  #include "zebra/rib.h"
 #include "zebra/zserv.h"  #include "zebra/zserv.h"
Line 103  usage (char *progname, int status) Line 104  usage (char *progname, int status)
   
   exit (status);    exit (status);
 }  }
   
 static unsigned int test_ifindex = 0;  
   
   static ifindex_t test_ifindex = 0;
   
 /* testrib commands */  /* testrib commands */
 DEFUN (test_interface_state,  DEFUN (test_interface_state,
        test_interface_state_cmd,         test_interface_state_cmd,
Line 149  test_cmd_init (void) Line 150  test_cmd_init (void)
 {  {
   install_element (INTERFACE_NODE, &test_interface_state_cmd);    install_element (INTERFACE_NODE, &test_interface_state_cmd);
 }  }
 /* SIGHUP handler. */  /* SIGHUP handler. */
 static void   static void 
 sighup (void)  sighup (void)
Line 195  struct quagga_signal_t zebra_signals[] = Line 196  struct quagga_signal_t zebra_signals[] =
     .handler = &sigint,      .handler = &sigint,
   },    },
 };  };
 /* Callback upon creating a new VRF. */
 static int
 zebra_vrf_new (vrf_id_t vrf_id, void **info)
 {
   struct zebra_vrf *zvrf = *info;
 
   if (! zvrf)
     {
       zvrf = zebra_vrf_alloc (vrf_id);
       *info = (void *)zvrf;
     }
 
   return 0;
 }
 
 /* Callback upon enabling a VRF. */
 static int
 zebra_vrf_enable (vrf_id_t vrf_id, void **info)
 {
   struct zebra_vrf *zvrf = (struct zebra_vrf *) (*info);
 
   assert (zvrf);
 
   kernel_init (zvrf);
   route_read (zvrf);
 
   return 0;
 }
 
 /* Callback upon disabling a VRF. */
 static int
 zebra_vrf_disable (vrf_id_t vrf_id, void **info)
 {
   struct zebra_vrf *zvrf = (struct zebra_vrf *) (*info);
   struct listnode *list_node;
   struct interface *ifp;
 
   assert (zvrf);
 
   rib_close_table (zvrf->table[AFI_IP][SAFI_UNICAST]);
   rib_close_table (zvrf->table[AFI_IP6][SAFI_UNICAST]);
 
   for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), list_node, ifp))
     {
       int operative = if_is_operative (ifp);
       UNSET_FLAG (ifp->flags, IFF_UP);
       if (operative)
         if_down (ifp);
     }
 
   kernel_terminate (zvrf);
 
   return 0;
 }
 
 /* Zebra VRF initialization. */
 static void
 zebra_vrf_init (void)
 {
   vrf_add_hook (VRF_NEW_HOOK, zebra_vrf_new);
   vrf_add_hook (VRF_ENABLE_HOOK, zebra_vrf_enable);
   vrf_add_hook (VRF_DISABLE_HOOK, zebra_vrf_disable);
   vrf_init ();
 }
 
 /* Main startup routine. */  /* Main startup routine. */
 int  int
 main (int argc, char **argv)  main (int argc, char **argv)
Line 280  main (int argc, char **argv) Line 346  main (int argc, char **argv)
   zebrad.master = thread_master_create ();    zebrad.master = thread_master_create ();
   
   /* Vty related initialize. */    /* Vty related initialize. */
  signal_init (zebrad.master, Q_SIGC(zebra_signals), zebra_signals);  signal_init (zebrad.master, array_size(zebra_signals), zebra_signals);
   cmd_init (1);    cmd_init (1);
   vty_init (zebrad.master);    vty_init (zebrad.master);
   memory_init ();    memory_init ();
   if_init();  
   zebra_debug_init ();    zebra_debug_init ();
   zebra_if_init ();    zebra_if_init ();
   test_cmd_init ();    test_cmd_init ();
Line 294  main (int argc, char **argv) Line 359  main (int argc, char **argv)
   access_list_init ();    access_list_init ();
   
   /* Make kernel routing socket. */    /* Make kernel routing socket. */
  kernel_init ();  zebra_vrf_init ();
  route_read (); 
   zebra_vty_init();    zebra_vty_init();
   
   /* Sort VTY commands. */  
   sort_node ();  
   
   /* Configuration file read*/    /* Configuration file read*/
   vty_read_config (config_file, config_default);    vty_read_config (config_file, config_default);

Removed from v.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>