3 * Copyright (C) 2013-2015
15 * This file is part of GNU Zebra.
17 * GNU Zebra is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License as published by the
19 * Free Software Foundation; either version 2, or (at your option) any
22 * GNU Zebra is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
27 * You should have received a copy of the GNU General Public License along
28 * with this program; see the file COPYING; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 #include <lib/version.h>
51 #include "distribute.h"
54 //#include "if_rmap.h"
56 #include "eigrpd/eigrp_structs.h"
57 #include "eigrpd/eigrpd.h"
58 #include "eigrpd/eigrp_dump.h"
59 #include "eigrpd/eigrp_interface.h"
60 #include "eigrpd/eigrp_neighbor.h"
61 #include "eigrpd/eigrp_packet.h"
62 #include "eigrpd/eigrp_vty.h"
63 #include "eigrpd/eigrp_zebra.h"
64 #include "eigrpd/eigrp_network.h"
65 #include "eigrpd/eigrp_snmp.h"
66 #include "eigrpd/eigrp_filter.h"
67 #include "eigrpd/eigrp_errors.h"
68 #include "eigrpd/eigrp_vrf.h"
69 //#include "eigrpd/eigrp_routemap.h"
71 /* eigprd privileges */
72 zebra_capabilities_t _caps_p
[] = {
73 ZCAP_NET_RAW
, ZCAP_BIND
, ZCAP_NET_ADMIN
,
76 struct zebra_privs_t eigrpd_privs
= {
77 #if defined(FRR_USER) && defined(FRR_GROUP)
81 #if defined(VTY_GROUP)
82 .vty_group
= VTY_GROUP
,
85 .cap_num_p
= array_size(_caps_p
),
89 struct option longopts
[] = {{0}};
91 /* Master of threads. */
92 struct thread_master
*master
;
94 /* Forward declaration of daemon info structure. */
95 static struct frr_daemon_info eigrpd_di
;
98 static void sighup(void)
100 zlog_info("SIGHUP received");
102 /* Reload config file. */
103 vty_read_config(NULL
, eigrpd_di
.config_file
, config_default
);
106 /* SIGINT / SIGTERM handler. */
107 static void sigint(void)
109 zlog_notice("Terminating on signal");
115 /* SIGUSR1 handler. */
116 static void sigusr1(void)
121 struct quagga_signal_t eigrp_signals
[] = {
140 static const struct frr_yang_module_info
*const eigrpd_yang_modules
[] = {
147 FRR_DAEMON_INFO(eigrpd
, EIGRP
, .vty_port
= EIGRP_VTY_PORT
,
149 .proghelp
= "Implementation of the EIGRP routing protocol.",
151 .signals
= eigrp_signals
,
152 .n_signals
= array_size(eigrp_signals
),
154 .privs
= &eigrpd_privs
, .yang_modules
= eigrpd_yang_modules
,
155 .n_yang_modules
= array_size(eigrpd_yang_modules
), )
157 /* EIGRPd main routine. */
158 int main(int argc
, char **argv
, char **envp
)
160 frr_preinit(&eigrpd_di
, argc
, argv
);
161 frr_opt_add("", longopts
, "");
166 opt
= frr_getopt(argc
, argv
, NULL
);
180 eigrp_sw_version_initialize();
182 /* EIGRP master init. */
184 eigrp_om
->master
= frr_init();
185 master
= eigrp_om
->master
;
189 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
196 /* Get configuration file. */
197 /* EIGRP VTY inits */
200 eigrp_vty_show_init();
205 #endif /* HAVE_SNMP */
207 /* Access list install. */
209 access_list_add_hook(eigrp_distribute_update_all_wrapper
);
210 access_list_delete_hook(eigrp_distribute_update_all_wrapper
);
212 /* Prefix list initialize.*/
214 prefix_list_add_hook(eigrp_distribute_update_all
);
215 prefix_list_delete_hook(eigrp_distribute_update_all
);
218 * XXX: This is just to get the CLI installed to suppress VTYSH errors.
219 * Routemaps in EIGRP are not yet functional.
222 /*eigrp_route_map_init();
223 route_map_add_hook (eigrp_rmap_update);
224 route_map_delete_hook (eigrp_rmap_update);*/
225 /*if_rmap_init (EIGRP_NODE); */
226 /* Distribute list install. */
227 distribute_list_init(EIGRP_NODE
);