1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) Cumulus Networks, Inc.
9 #include <lib/version.h>
27 #include "distribute.h"
30 #include "nexthop_group.h"
31 #include "link_state.h"
33 #include "sharp_zebra.h"
34 #include "sharp_vty.h"
35 #include "sharp_globals.h"
36 #include "sharp_nht.h"
38 DEFINE_MGROUP(SHARPD
, "sharpd");
40 zebra_capabilities_t _caps_p
[] = {
43 struct zebra_privs_t sharp_privs
= {
44 #if defined(FRR_USER) && defined(FRR_GROUP)
48 #if defined(VTY_GROUP)
49 .vty_group
= VTY_GROUP
,
52 .cap_num_p
= array_size(_caps_p
),
55 struct option longopts
[] = {{0}};
57 /* Master of threads. */
58 struct thread_master
*master
;
61 static void sighup(void)
63 zlog_info("SIGHUP received");
66 /* SIGINT / SIGTERM handler. */
67 static void sigint(void)
69 zlog_notice("Terminating on signal");
76 /* SIGUSR1 handler. */
77 static void sigusr1(void)
82 struct frr_signal_t sharp_signals
[] = {
101 #define SHARP_VTY_PORT 2614
103 static const struct frr_yang_module_info
*const sharpd_yang_modules
[] = {
110 FRR_DAEMON_INFO(sharpd
, SHARP
, .vty_port
= SHARP_VTY_PORT
,
112 .proghelp
= "Implementation of a Sharp of routes daemon.",
114 .signals
= sharp_signals
,
115 .n_signals
= array_size(sharp_signals
),
117 .privs
= &sharp_privs
, .yang_modules
= sharpd_yang_modules
,
118 .n_yang_modules
= array_size(sharpd_yang_modules
),
121 struct sharp_global sg
;
123 static void sharp_global_init(void)
125 memset(&sg
, 0, sizeof(sg
));
128 sg
.srv6_locators
= list_new();
131 static void sharp_start_configuration(void)
133 zlog_debug("Configuration has started to be read");
136 static void sharp_end_configuration(void)
138 zlog_debug("Configuration has finished being read");
141 int main(int argc
, char **argv
, char **envp
)
143 frr_preinit(&sharpd_di
, argc
, argv
);
144 frr_opt_add("", longopts
, "");
149 opt
= frr_getopt(argc
, argv
, NULL
);
164 cmd_init_config_callbacks(sharp_start_configuration
,
165 sharp_end_configuration
);
168 sharp_nhgroup_init();
169 vrf_init(NULL
, NULL
, NULL
, NULL
);
173 /* Get configuration file. */