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"
50 uint32_t total_routes
= 0;
51 uint32_t installed_routes
= 0;
52 uint32_t removed_routes
= 0;
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");
88 /* SIGUSR1 handler. */
89 static void sigusr1(void)
94 struct quagga_signal_t sharp_signals
[] = {
113 #define SHARP_VTY_PORT 2614
115 static const struct frr_yang_module_info
*sharpd_yang_modules
[] = {
118 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
120 .proghelp
= "Implementation of a Sharp of routes daemon.",
122 .signals
= sharp_signals
,
123 .n_signals
= array_size(sharp_signals
),
125 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
126 .n_yang_modules
= array_size(sharpd_yang_modules
), )
128 extern void sharp_vty_init(void);
130 int main(int argc
, char **argv
, char **envp
)
132 frr_preinit(&sharpd_di
, argc
, argv
);
133 frr_opt_add("", longopts
, "");
138 opt
= frr_getopt(argc
, argv
, NULL
);
154 nexthop_group_init(NULL
, NULL
, NULL
, NULL
);
155 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
162 /* Get configuration file. */