return master;
}
+static struct thread_master *master;
+struct thread_master *frr_init_fast(void)
+{
+#if 0
+ struct option_chain *oc;
+ struct frrmod_runtime *module;
+ char moderr[256];
+ const char *dir;
+ dir = di->module_path ? di->module_path : frr_moduledir;
+#endif
+ char p_instance[16] = "", p_pathspace[256] = "";
+
+ srandom(time(NULL));
+
+ if (di->instance) {
+ snprintf(frr_protonameinst, sizeof(frr_protonameinst), "%s[%u]",
+ di->logname, di->instance);
+ snprintf(p_instance, sizeof(p_instance), "-%d", di->instance);
+ }
+ if (di->pathspace)
+ snprintf(p_pathspace, sizeof(p_pathspace), "%s/",
+ di->pathspace);
+
+ snprintf(config_default, sizeof(config_default), "%s%s%s%s.conf",
+ frr_sysconfdir, p_pathspace, di->name, p_instance);
+ snprintf(pidfile_default, sizeof(pidfile_default), "%s/%s%s.pid",
+ frr_vtydir, di->name, p_instance);
+#if 0
+#ifdef HAVE_SQLITE3
+ snprintf(dbfile_default, sizeof(dbfile_default), "%s/%s%s%s.db",
+ frr_dbdir, p_pathspace, di->name, p_instance);
+#endif
+#endif
+
+ zprivs_preinit(di->privs);
+
+ openzlog(di->progname, di->logname, di->instance,
+ LOG_CONS | LOG_NDELAY | LOG_PID, LOG_DAEMON);
+
+ command_setup_early_logging(di->early_logging, di->early_loglevel);
+
+ if (!frr_zclient_addr(&zclient_addr, &zclient_addr_len,
+ frr_zclientpath)) {
+ fprintf(stderr, "Invalid zserv socket path: %s\n",
+ frr_zclientpath);
+ exit(1);
+ }
+
+ /* don't mkdir these as root... */
+ if (!(di->flags & FRR_NO_PRIVSEP)) {
+ if (!di->pid_file || !di->vty_path)
+ frr_mkdir(frr_vtydir, false);
+ if (di->pid_file)
+ frr_mkdir(di->pid_file, true);
+ if (di->vty_path)
+ frr_mkdir(di->vty_path, true);
+ }
+
+#if 0
+ frrmod_init(di->module);
+ while (modules) {
+ modules = (oc = modules)->next;
+ module = frrmod_load(oc->arg, dir, moderr, sizeof(moderr));
+ if (!module) {
+ fprintf(stderr, "%s\n", moderr);
+ exit(1);
+ }
+ XFREE(MTYPE_TMP, oc);
+ }
+
+#endif
+
+ zprivs_init(di->privs);
+ master = thread_master_create(NULL);
+ signal_init(master, di->n_signals, di->signals);
+
+#if 0
+#ifdef HAVE_SQLITE3
+ if (!di->db_file)
+ di->db_file = dbfile_default;
+ db_init(di->db_file);
+#endif
+
+#endif
+ if (di->flags & FRR_LIMITED_CLI)
+ cmd_init(-1);
+ else
+ cmd_init(1);
+
+ vty_init(master, di->log_always);
+
+#if 0
+ log_filter_cmd_init();
+#endif
+
+#if 0
+ frr_pthread_init();
+#endif
+
+ log_ref_init();
+ log_ref_vty_init();
+ lib_error_init();
+
+#if 0
+ yang_init();
+
+ debug_init_cli();
+
+ nb_init(master, di->yang_modules, di->n_yang_modules);
+ if (nb_db_init() != NB_OK)
+ flog_warn(EC_LIB_NB_DATABASE,
+ "%s: failed to initialize northbound database",
+ __func__);
+#endif
+
+ return master;
+}
+
const char *frr_get_progname(void)
{
return di ? di->progname : NULL;