3 * Copyright (C) Cumulus Networks, Inc.
6 * This file is part of FRR.
8 * FRR is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
13 * FRR is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <lib/version.h>
42 #include "distribute.h"
45 #include "nexthop_group.h"
47 #include "sharp_zebra.h"
48 #include "sharp_vty.h"
49 #include "sharp_globals.h"
50 #include "sharp_nht.h"
52 DEFINE_MGROUP(SHARPD
, "sharpd");
54 zebra_capabilities_t _caps_p
[] = {
57 struct zebra_privs_t sharp_privs
= {
58 #if defined(FRR_USER) && defined(FRR_GROUP)
62 #if defined(VTY_GROUP)
63 .vty_group
= VTY_GROUP
,
66 .cap_num_p
= array_size(_caps_p
),
69 struct option longopts
[] = {{0}};
71 /* Master of threads. */
72 struct thread_master
*master
;
75 static void sighup(void)
77 zlog_info("SIGHUP received");
80 /* SIGINT / SIGTERM handler. */
81 static void sigint(void)
83 zlog_notice("Terminating on signal");
90 /* SIGUSR1 handler. */
91 static void sigusr1(void)
96 struct quagga_signal_t sharp_signals
[] = {
115 #define SHARP_VTY_PORT 2614
117 static const struct frr_yang_module_info
*const sharpd_yang_modules
[] = {
124 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
126 .proghelp
= "Implementation of a Sharp of routes daemon.",
128 .signals
= sharp_signals
,
129 .n_signals
= array_size(sharp_signals
),
131 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
132 .n_yang_modules
= array_size(sharpd_yang_modules
),
135 struct sharp_global sg
;
137 static void sharp_global_init(void)
139 memset(&sg
, 0, sizeof(sg
));
143 static void sharp_start_configuration(void)
145 zlog_debug("Configuration has started to be read");
148 static void sharp_end_configuration(void)
150 zlog_debug("Configuration has finished being read");
153 int main(int argc
, char **argv
, char **envp
)
155 frr_preinit(&sharpd_di
, argc
, argv
);
156 frr_opt_add("", longopts
, "");
161 opt
= frr_getopt(argc
, argv
, NULL
);
177 cmd_init_config_callbacks(sharp_start_configuration
,
178 sharp_end_configuration
);
181 sharp_nhgroup_init();
182 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
186 /* Get configuration file. */