1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 2013-2015
18 #include <lib/version.h>
36 #include "distribute.h"
39 //#include "if_rmap.h"
41 #include "eigrpd/eigrp_structs.h"
42 #include "eigrpd/eigrpd.h"
43 #include "eigrpd/eigrp_dump.h"
44 #include "eigrpd/eigrp_interface.h"
45 #include "eigrpd/eigrp_neighbor.h"
46 #include "eigrpd/eigrp_packet.h"
47 #include "eigrpd/eigrp_vty.h"
48 #include "eigrpd/eigrp_zebra.h"
49 #include "eigrpd/eigrp_network.h"
50 #include "eigrpd/eigrp_snmp.h"
51 #include "eigrpd/eigrp_filter.h"
52 #include "eigrpd/eigrp_errors.h"
53 #include "eigrpd/eigrp_vrf.h"
54 #include "eigrpd/eigrp_cli.h"
55 #include "eigrpd/eigrp_yang.h"
56 //#include "eigrpd/eigrp_routemap.h"
58 /* eigprd privileges */
59 zebra_capabilities_t _caps_p
[] = {
60 ZCAP_NET_RAW
, ZCAP_BIND
, ZCAP_NET_ADMIN
,
63 struct zebra_privs_t eigrpd_privs
= {
64 #if defined(FRR_USER) && defined(FRR_GROUP)
68 #if defined(VTY_GROUP)
69 .vty_group
= VTY_GROUP
,
72 .cap_num_p
= array_size(_caps_p
),
76 struct option longopts
[] = {{0}};
78 /* Master of threads. */
79 struct event_loop
*master
;
81 /* Forward declaration of daemon info structure. */
82 static struct frr_daemon_info eigrpd_di
;
85 static void sighup(void)
87 zlog_info("SIGHUP received");
89 /* Reload config file. */
90 vty_read_config(NULL
, eigrpd_di
.config_file
, config_default
);
93 /* SIGINT / SIGTERM handler. */
94 static void sigint(void)
96 zlog_notice("Terminating on signal");
102 /* SIGUSR1 handler. */
103 static void sigusr1(void)
108 struct frr_signal_t eigrp_signals
[] = {
127 static const struct frr_yang_module_info
*const eigrpd_yang_modules
[] = {
135 FRR_DAEMON_INFO(eigrpd
, EIGRP
, .vty_port
= EIGRP_VTY_PORT
,
137 .proghelp
= "Implementation of the EIGRP routing protocol.",
139 .signals
= eigrp_signals
,
140 .n_signals
= array_size(eigrp_signals
),
142 .privs
= &eigrpd_privs
, .yang_modules
= eigrpd_yang_modules
,
143 .n_yang_modules
= array_size(eigrpd_yang_modules
),
146 /* EIGRPd main routine. */
147 int main(int argc
, char **argv
, char **envp
)
149 frr_preinit(&eigrpd_di
, argc
, argv
);
150 frr_opt_add("", longopts
, "");
155 opt
= frr_getopt(argc
, argv
, NULL
);
168 eigrp_sw_version_initialize();
170 /* EIGRP master init. */
172 eigrp_om
->master
= frr_init();
173 master
= eigrp_om
->master
;
177 vrf_init(NULL
, NULL
, NULL
, NULL
);
184 /* Get configuration file. */
185 /* EIGRP VTY inits */
188 eigrp_vty_show_init();
193 #endif /* HAVE_SNMP */
195 /* Access list install. */
197 access_list_add_hook(eigrp_distribute_update_all_wrapper
);
198 access_list_delete_hook(eigrp_distribute_update_all_wrapper
);
200 /* Prefix list initialize.*/
202 prefix_list_add_hook(eigrp_distribute_update_all
);
203 prefix_list_delete_hook(eigrp_distribute_update_all
);
206 * XXX: This is just to get the CLI installed to suppress VTYSH errors.
207 * Routemaps in EIGRP are not yet functional.
210 /*eigrp_route_map_init();
211 route_map_add_hook (eigrp_rmap_update);
212 route_map_delete_hook (eigrp_rmap_update);*/
213 /*if_rmap_init (EIGRP_NODE); */