#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 */
.cap_num_i = 0};
-/* RIPngd program name */
-
-/* Route retain mode flag. */
-int retain_mode = 0;
-
/* Master of threads. */
struct thread_master *master;
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. */
{
zlog_notice("Terminating on signal");
- if (!retain_mode)
- ripng_clean();
+ ripng_clean();
ripng_zebra_stop();
+ frr_fini();
exit(0);
}
},
};
+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.",
.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;
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();