3 * Copyright (C) 2008 Everton da Silva Marques
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include "memory_vty.h"
43 #include "pim_instance.h"
44 #include "pim_version.h"
45 #include "pim_signals.h"
46 #include "pim_zebra.h"
48 #include "pim_iface.h"
50 #include "pim_errors.h"
52 extern struct host host
;
54 struct option longopts
[] = {{0}};
57 zebra_capabilities_t _caps_p
[] = {
58 ZCAP_NET_ADMIN
, ZCAP_SYS_ADMIN
, ZCAP_NET_RAW
, ZCAP_BIND
,
61 /* pimd privileges to run with */
62 struct zebra_privs_t pimd_privs
= {
63 #if defined(FRR_USER) && defined(FRR_GROUP)
68 .vty_group
= VTY_GROUP
,
71 .cap_num_p
= sizeof(_caps_p
) / sizeof(_caps_p
[0]),
74 FRR_DAEMON_INFO(pimd
, PIM
, .vty_port
= PIMD_VTY_PORT
,
76 .proghelp
= "Implementation of the PIM routing protocol.",
78 .signals
= pimd_signals
,
79 .n_signals
= 4 /* XXX array_size(pimd_signals) XXX*/,
81 .privs
= &pimd_privs
, )
84 int main(int argc
, char **argv
, char **envp
)
86 frr_preinit(&pimd_di
, argc
, argv
);
87 frr_opt_add("", longopts
, "");
89 /* this while just reads the options */
93 opt
= frr_getopt(argc
, argv
, NULL
);
116 prefix_list_add_hook(pim_prefix_list_update
);
117 prefix_list_delete_hook(pim_prefix_list_update
);
119 pim_route_map_init();
123 * Initialize zclient "update" and "lookup" sockets
130 #ifdef PIM_DEBUG_BYDEFAULT
131 zlog_notice("PIM_DEBUG_BYDEFAULT: Enabling all debug commands");
132 PIM_DO_DEBUG_PIM_EVENTS
;
133 PIM_DO_DEBUG_PIM_PACKETS
;
134 PIM_DO_DEBUG_PIM_TRACE
;
135 PIM_DO_DEBUG_IGMP_EVENTS
;
136 PIM_DO_DEBUG_IGMP_PACKETS
;
137 PIM_DO_DEBUG_IGMP_TRACE
;
141 #ifdef PIM_CHECK_RECV_IFINDEX_SANITY
143 "PIM_CHECK_RECV_IFINDEX_SANITY: will match sock/recv ifindex");
144 #ifdef PIM_REPORT_RECV_IFINDEX_MISMATCH
146 "PIM_REPORT_RECV_IFINDEX_MISMATCH: will report sock/recv ifindex mismatch");
150 #ifdef PIM_UNEXPECTED_KERNEL_UPCALL
152 "PIM_UNEXPECTED_KERNEL_UPCALL: report unexpected kernel upcall");