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"
46 #include "link_state.h"
48 #include "sharp_zebra.h"
49 #include "sharp_vty.h"
50 #include "sharp_globals.h"
51 #include "sharp_nht.h"
53 DEFINE_MGROUP(SHARPD
, "sharpd");
55 zebra_capabilities_t _caps_p
[] = {
58 struct zebra_privs_t sharp_privs
= {
59 #if defined(FRR_USER) && defined(FRR_GROUP)
63 #if defined(VTY_GROUP)
64 .vty_group
= VTY_GROUP
,
67 .cap_num_p
= array_size(_caps_p
),
70 struct option longopts
[] = {{0}};
72 /* Master of threads. */
73 struct thread_master
*master
;
76 static void sighup(void)
78 zlog_info("SIGHUP received");
81 /* SIGINT / SIGTERM handler. */
82 static void sigint(void)
84 zlog_notice("Terminating on signal");
91 /* SIGUSR1 handler. */
92 static void sigusr1(void)
97 struct quagga_signal_t sharp_signals
[] = {
116 #define SHARP_VTY_PORT 2614
118 static const struct frr_yang_module_info
*const sharpd_yang_modules
[] = {
125 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
127 .proghelp
= "Implementation of a Sharp of routes daemon.",
129 .signals
= sharp_signals
,
130 .n_signals
= array_size(sharp_signals
),
132 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
133 .n_yang_modules
= array_size(sharpd_yang_modules
),
136 struct sharp_global sg
;
138 static void sharp_global_init(void)
140 memset(&sg
, 0, sizeof(sg
));
145 static void sharp_start_configuration(void)
147 zlog_debug("Configuration has started to be read");
150 static void sharp_end_configuration(void)
152 zlog_debug("Configuration has finished being read");
155 int main(int argc
, char **argv
, char **envp
)
157 frr_preinit(&sharpd_di
, argc
, argv
);
158 frr_opt_add("", longopts
, "");
163 opt
= frr_getopt(argc
, argv
, NULL
);
179 cmd_init_config_callbacks(sharp_start_configuration
,
180 sharp_end_configuration
);
183 sharp_nhgroup_init();
184 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
188 /* Get configuration file. */