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"
51 zebra_capabilities_t _caps_p
[] = {
54 struct zebra_privs_t sharp_privs
= {
55 #if defined(FRR_USER) && defined(FRR_GROUP)
59 #if defined(VTY_GROUP)
60 .vty_group
= VTY_GROUP
,
63 .cap_num_p
= array_size(_caps_p
),
66 struct option longopts
[] = {{0}};
68 /* Master of threads. */
69 struct thread_master
*master
;
72 static void sighup(void)
74 zlog_info("SIGHUP received");
77 /* SIGINT / SIGTERM handler. */
78 static void sigint(void)
80 zlog_notice("Terminating on signal");
85 /* SIGUSR1 handler. */
86 static void sigusr1(void)
91 struct quagga_signal_t sharp_signals
[] = {
110 #define SHARP_VTY_PORT 2614
112 static const struct frr_yang_module_info
*sharpd_yang_modules
[] = {
115 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
117 .proghelp
= "Implementation of a Sharp of routes daemon.",
119 .signals
= sharp_signals
,
120 .n_signals
= array_size(sharp_signals
),
122 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
123 .n_yang_modules
= array_size(sharpd_yang_modules
), )
125 struct sharp_global sg
;
127 static void sharp_global_init(void)
129 memset(&sg
, 0, sizeof(sg
));
132 int main(int argc
, char **argv
, char **envp
)
134 frr_preinit(&sharpd_di
, argc
, argv
);
135 frr_opt_add("", longopts
, "");
140 opt
= frr_getopt(argc
, argv
, NULL
);
158 nexthop_group_init(NULL
, NULL
, NULL
, NULL
);
159 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
166 /* Get configuration file. */