]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/babel_main.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / babeld / babel_main.c
index d02d86f77b2a15befc6fb4e029f69e2ce715ce96..6f4b905c15edc626a9f2a8cca3b2890ab2c3add8 100644 (file)
@@ -68,13 +68,13 @@ const unsigned char ones[16] =
     {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
      0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
 
-static const char *state_file = DAEMON_VTY_DIR "/babel-state";
+static char state_file[1024];
 
 unsigned char protocol_group[16]; /* babel's link-local multicast address */
 int protocol_port;                /* babel's port */
 int protocol_socket = -1;         /* socket: communicate with others babeld */
 
-static char babel_config_default[] = SYSCONFDIR BABEL_DEFAULT_CONFIG;
+static const char babel_config_default[] = SYSCONFDIR BABEL_DEFAULT_CONFIG;
 static char *babel_vty_addr = NULL;
 static int babel_vty_port = BABEL_VTY_PORT;
 
@@ -136,6 +136,11 @@ struct option longopts[] =
     { 0 }
   };
 
+static const struct frr_yang_module_info *const babeld_yang_modules[] =
+  {
+    &frr_interface_info,
+  };
+
 FRR_DAEMON_INFO(babeld, BABELD,
                .vty_port = BABEL_VTY_PORT,
                .proghelp = "Implementation of the BABEL routing protocol.",
@@ -144,6 +149,9 @@ FRR_DAEMON_INFO(babeld, BABELD,
                .n_signals = array_size(babel_signals),
 
                .privs = &babeld_privs,
+
+               .yang_modules = babeld_yang_modules,
+               .n_yang_modules = array_size(babeld_yang_modules),
                )
 
 int
@@ -179,6 +187,9 @@ main(int argc, char **argv)
          }
     }
 
+    snprintf(state_file, sizeof(state_file), "%s/%s",
+            frr_vtydir, "babel-state");
+
     /* create the threads handler */
     master = frr_init ();
 
@@ -191,6 +202,8 @@ main(int argc, char **argv)
     babel_replace_by_null(STDIN_FILENO);
 
     /* init some quagga's dependencies, and babeld's commands */
+    if_zapi_callbacks(babel_ifp_create, babel_ifp_up,
+                     babel_ifp_down, babel_ifp_destroy);
     babeld_quagga_init();
     /* init zebra client's structure and it's commands */
     /* this replace kernel_setup && kernel_setup_socket */
@@ -385,7 +398,7 @@ show_babel_main_configuration (struct vty *vty)
     vty_out (vty,
             "state file              = %s\n"
             "configuration file      = %s\n"
-            "protocol informations:\n"
+            "protocol information:\n"
             "  multicast address     = %s\n"
             "  port                  = %d\n"
             "vty address             = %s\n"