]>
git.proxmox.com Git - mirror_frr.git/blob - lib/libfrr.h
2 * libfrr overall management functions
4 * Copyright (C) 2016 David Lamparter for NetDEF, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place, Suite 330, Boston, MA 02111-1307 USA
32 #define FRR_NO_PRIVSEP (1 << 0)
33 #define FRR_NO_TCPVTY (1 << 1)
34 #define FRR_LIMITED_CLI (1 << 2)
35 #define FRR_NO_CFG_PID_DRY (1 << 3)
36 #define FRR_NO_ZCLIENT (1 << 4)
38 struct frr_daemon_info
{
44 unsigned short instance
;
45 struct frrmod_runtime
*module
;
52 const char *config_file
;
55 const char *module_path
;
58 void (*printhelp
)(FILE *target
);
59 const char *copyright
;
62 struct quagga_signal_t
*signals
;
65 struct zebra_privs_t
*privs
;
68 /* execname is the daemon's executable (and pidfile and configfile) name,
69 * i.e. "zebra" or "bgpd"
70 * constname is the daemons source-level name, primarily for the logging ID,
71 * i.e. "ZEBRA" or "BGP"
73 * note that this macro is also a latch-on point for other changes (e.g.
74 * upcoming module support) that need to place some per-daemon things. Each
75 * daemon should have one of these.
77 #define FRR_DAEMON_INFO(execname, constname, ...) \
78 static struct frr_daemon_info execname##_di = {.name = #execname, \
79 .logname = #constname, \
80 .module = THIS_MODULE, \
82 FRR_COREMOD_SETUP(.name = #execname, \
83 .description = #execname " daemon", \
84 .version = FRR_VERSION, ) \
87 extern void frr_preinit(struct frr_daemon_info
*daemon
, int argc
, char **argv
);
88 extern void frr_opt_add(const char *optstr
, const struct option
*longopts
,
90 extern int frr_getopt(int argc
, char *const argv
[], int *longindex
);
91 extern void frr_help_exit(int status
);
93 extern struct thread_master
*frr_init(void);
95 DECLARE_HOOK(frr_late_init
, (struct thread_master
* tm
), (tm
))
96 extern void frr_config_fork(void);
98 extern void frr_vty_serv(void);
100 /* note: contains call to frr_vty_serv() */
101 extern void frr_run(struct thread_master
*master
);
103 extern char config_default
[256];
104 extern const char frr_sysconfdir
[];
105 extern const char frr_vtydir
[];
106 extern const char frr_moduledir
[];
108 #endif /* _ZEBRA_FRR_H */