]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripd/rip_main.c
yang, ripd: add 'frr-ripd.yang' and associated stub callbacks
[mirror_frr.git] / ripd / rip_main.c
index 9a448e895890fdc9dd18e0362eacaa18d5aa944e..23981d6d6651952c11a036a2d3a9ec14c3082bec 100644 (file)
 #include "libfrr.h"
 
 #include "ripd/ripd.h"
+#include "ripd/rip_errors.h"
 
 /* ripd options. */
+#if CONFDATE > 20190521
+       CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
+#endif
 static struct option longopts[] = {{"retain", no_argument, NULL, 'r'}, {0}};
 
 /* ripd privileges */
@@ -58,9 +62,6 @@ struct zebra_privs_t ripd_privs = {
        .cap_num_p = 2,
        .cap_num_i = 0};
 
-/* Route retain mode flag. */
-int retain_mode = 0;
-
 /* Master of threads. */
 struct thread_master *master;
 
@@ -75,7 +76,7 @@ static void sighup(void)
        zlog_info("ripd restarting!");
 
        /* Reload config file. */
-       vty_read_config(ripd_di.config_file, config_default);
+       vty_read_config(NULL, ripd_di.config_file, config_default);
 
        /* Try to return to normal operation. */
 }
@@ -85,8 +86,7 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
 
-       if (!retain_mode)
-               rip_clean();
+       rip_clean();
 
        rip_zclient_stop();
        frr_fini();
@@ -119,21 +119,31 @@ static struct quagga_signal_t ripd_signals[] = {
        },
 };
 
+static const struct frr_yang_module_info *ripd_yang_modules[] = {
+       &frr_interface_info,
+       &frr_ripd_info,
+};
+
 FRR_DAEMON_INFO(ripd, RIP, .vty_port = RIP_VTY_PORT,
 
                .proghelp = "Implementation of the RIP routing protocol.",
 
                .signals = ripd_signals, .n_signals = array_size(ripd_signals),
 
-               .privs = &ripd_privs, )
+               .privs = &ripd_privs, .yang_modules = ripd_yang_modules,
+               .n_yang_modules = array_size(ripd_yang_modules), )
+
+#if CONFDATE > 20190521
+CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
+#endif
+#define DEPRECATED_OPTIONS "r"
 
 /* Main routine of ripd. */
 int main(int argc, char **argv)
 {
        frr_preinit(&ripd_di, argc, argv);
-       frr_opt_add(
-               "r", longopts,
-               "  -r, --retain       When program terminates, retain added route by ripd.\n");
+
+       frr_opt_add("" DEPRECATED_OPTIONS, longopts, "");
 
        /* Command line option parse. */
        while (1) {
@@ -141,15 +151,19 @@ int main(int argc, char **argv)
 
                opt = frr_getopt(argc, argv, NULL);
 
+               if (opt && opt < 128 && strchr(DEPRECATED_OPTIONS, opt)) {
+                       fprintf(stderr,
+                               "The -%c option no longer exists.\nPlease refer to the manual.\n",
+                               opt);
+                       continue;
+               }
+
                if (opt == EOF)
                        break;
 
                switch (opt) {
                case 0:
                        break;
-               case 'r':
-                       retain_mode = 1;
-                       break;
                default:
                        frr_help_exit(1);
                        break;
@@ -160,12 +174,14 @@ int main(int argc, char **argv)
        master = frr_init();
 
        /* Library initialization. */
+       rip_error_init();
        keychain_init();
-       vrf_init(NULL, NULL, NULL, NULL);
+       vrf_init(NULL, NULL, NULL, NULL, NULL);
 
        /* RIP related initialization. */
        rip_init();
        rip_if_init();
+       rip_cli_init();
        rip_zclient_init(master);
        rip_peer_init();