]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/libfrr.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / libfrr.h
index fe6c46670a3c6b312cb83fcd59b535a0d7f3c623..2705397b8571bac27b8f096ea0ca9f2c6127ebcc 100644 (file)
 #include "getopt.h"
 #include "module.h"
 #include "hook.h"
+#include "northbound.h"
 
+/* The following options disable specific command line options that
+ * are not applicable for a particular daemon.
+ */
 #define FRR_NO_PRIVSEP         (1 << 0)
 #define FRR_NO_TCPVTY          (1 << 1)
 #define FRR_LIMITED_CLI                (1 << 2)
-#define FRR_NO_CFG_PID_DRY             (1 << 3)
+#define FRR_NO_CFG_PID_DRY     (1 << 3)
 #define FRR_NO_ZCLIENT         (1 << 4)
+/* If FRR_DETACH_LATER is used, the daemon will keep its parent running
+ * until frr_detach() is called.  Normally "somedaemon -d" returns once the
+ * main event loop is reached in the daemon;  use this for extra startup bits.
+ *
+ * Does nothing if -d isn't used.
+ */
+#define FRR_DETACH_LATER       (1 << 5)
+
+enum frr_cli_mode {
+       FRR_CLI_CLASSIC = 0,
+       FRR_CLI_TRANSACTIONAL,
+};
 
 struct frr_daemon_info {
        unsigned flags;
@@ -50,11 +66,20 @@ struct frr_daemon_info {
        bool dryrun;
        bool daemon_mode;
        bool terminal;
+       enum frr_cli_mode cli_mode;
+
+       struct thread *read_in;
        const char *config_file;
+       const char *backup_config_file;
        const char *pid_file;
+#ifdef HAVE_SQLITE3
+       const char *db_file;
+#endif
        const char *vty_path;
        const char *module_path;
        const char *pathspace;
+       const char *early_logging;
+       const char *early_loglevel;
 
        const char *proghelp;
        void (*printhelp)(FILE *target);
@@ -65,6 +90,9 @@ struct frr_daemon_info {
        size_t n_signals;
 
        struct zebra_privs_t *privs;
+
+       const struct frr_yang_module_info **yang_modules;
+       size_t n_yang_modules;
 };
 
 /* execname is the daemon's executable (and pidfile and configfile) name,
@@ -93,14 +121,14 @@ extern int frr_getopt(int argc, char *const argv[], int *longindex);
 extern void frr_help_exit(int status);
 
 extern struct thread_master *frr_init(void);
+extern const char *frr_get_progname(void);
+extern enum frr_cli_mode frr_get_cli_mode(void);
 
 DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm))
 extern void frr_config_fork(void);
 
-extern void frr_vty_serv(void);
-
-/* note: contains call to frr_vty_serv() */
 extern void frr_run(struct thread_master *master);
+extern void frr_detach(void);
 
 extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,
                             const char *path);
@@ -113,7 +141,7 @@ extern void frr_early_fini(void);
 DECLARE_KOOH(frr_fini, (), ())
 extern void frr_fini(void);
 
-extern char config_default[256];
+extern char config_default[512];
 extern char frr_zclientpath[256];
 extern const char frr_sysconfdir[];
 extern const char frr_vtydir[];