]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_main.c
Merge pull request #3422 from pguibert6WIND/license_gplv3_rule
[mirror_frr.git] / ripngd / ripng_main.c
index 0cb54d43356c728cb03198a7d53e5b6be2c3dd61..10e19efe77f6962fc39cea79f2378adcb0a52f1c 100644 (file)
@@ -40,6 +40,9 @@
 #include "ripngd/ripngd.h"
 
 /* RIPngd options. */
+#if CONFDATE > 20190521
+       CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
+#endif
 struct option longopts[] = {{"retain", no_argument, NULL, 'r'}, {0}};
 
 /* ripngd privileges */
@@ -60,11 +63,6 @@ struct zebra_privs_t ripngd_privs = {
        .cap_num_i = 0};
 
 
-/* RIPngd program name */
-
-/* Route retain mode flag. */
-int retain_mode = 0;
-
 /* Master of threads. */
 struct thread_master *master;
 
@@ -74,13 +72,9 @@ static struct frr_daemon_info ripngd_di;
 static void sighup(void)
 {
        zlog_info("SIGHUP received");
-       ripng_clean();
-       ripng_reset();
 
        /* Reload config file. */
-       vty_read_config(ripngd_di.config_file, config_default);
-
-       /* Try to return to normal operation. */
+       vty_read_config(NULL, ripngd_di.config_file, config_default);
 }
 
 /* SIGINT handler. */
@@ -88,10 +82,10 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
 
-       if (!retain_mode)
-               ripng_clean();
+       ripng_clean();
 
        ripng_zebra_stop();
+       frr_fini();
        exit(0);
 }
 
@@ -120,6 +114,11 @@ struct quagga_signal_t ripng_signals[] = {
        },
 };
 
+static const struct frr_yang_module_info *ripngd_yang_modules[] = {
+       &frr_interface_info,
+       &frr_ripngd_info,
+};
+
 FRR_DAEMON_INFO(ripngd, RIPNG, .vty_port = RIPNG_VTY_PORT,
 
                .proghelp = "Implementation of the RIPng routing protocol.",
@@ -127,30 +126,41 @@ FRR_DAEMON_INFO(ripngd, RIPNG, .vty_port = RIPNG_VTY_PORT,
                .signals = ripng_signals,
                .n_signals = array_size(ripng_signals),
 
-               .privs = &ripngd_privs, )
+               .privs = &ripngd_privs,
+
+               .yang_modules = ripngd_yang_modules,
+               .n_yang_modules = array_size(ripngd_yang_modules), )
+
+#if CONFDATE > 20190521
+CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
+#endif
+#define DEPRECATED_OPTIONS "r"
 
 /* RIPngd main routine. */
 int main(int argc, char **argv)
 {
        frr_preinit(&ripngd_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, "");
 
        while (1) {
                int opt;
 
                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,10 +170,11 @@ int main(int argc, char **argv)
        master = frr_init();
 
        /* Library inits. */
-       vrf_init(NULL, NULL, NULL, NULL);
+       vrf_init(NULL, NULL, NULL, NULL, NULL);
 
        /* RIPngd inits. */
        ripng_init();
+       ripng_cli_init();
        zebra_init(master);
        ripng_peer_init();