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 DEFINE_MGROUP(SHARPD
, "sharpd")
53 zebra_capabilities_t _caps_p
[] = {
56 struct zebra_privs_t sharp_privs
= {
57 #if defined(FRR_USER) && defined(FRR_GROUP)
61 #if defined(VTY_GROUP)
62 .vty_group
= VTY_GROUP
,
65 .cap_num_p
= array_size(_caps_p
),
68 struct option longopts
[] = {{0}};
70 /* Master of threads. */
71 struct thread_master
*master
;
74 static void sighup(void)
76 zlog_info("SIGHUP received");
79 /* SIGINT / SIGTERM handler. */
80 static void sigint(void)
82 zlog_notice("Terminating on signal");
87 /* SIGUSR1 handler. */
88 static void sigusr1(void)
93 struct quagga_signal_t sharp_signals
[] = {
112 #define SHARP_VTY_PORT 2614
114 static const struct frr_yang_module_info
*const sharpd_yang_modules
[] = {
117 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
119 .proghelp
= "Implementation of a Sharp of routes daemon.",
121 .signals
= sharp_signals
,
122 .n_signals
= array_size(sharp_signals
),
124 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
125 .n_yang_modules
= array_size(sharpd_yang_modules
), )
127 struct sharp_global sg
;
129 static void sharp_global_init(void)
131 memset(&sg
, 0, sizeof(sg
));
135 int main(int argc
, char **argv
, char **envp
)
137 frr_preinit(&sharpd_di
, argc
, argv
);
138 frr_opt_add("", longopts
, "");
143 opt
= frr_getopt(argc
, argv
, NULL
);
161 nexthop_group_init(NULL
, NULL
, NULL
, NULL
);
162 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
169 /* Get configuration file. */