Fix up just enough to make us not operate in complete darkness.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
/* TODO PIM6: next line is temporary since pim_cmd_init is disabled */
if_cmd_init(NULL);
-#if 0
pim_zebra_init();
+#if 0
pim_bfd_init();
pim_mlag_init();
XFREE(MTYPE_PIM_SEC_ADDR, sec_addr);
}
+__attribute__((unused))
static int pim_sec_addr_comp(const void *p1, const void *p2)
{
const struct pim_secondary_addr *sec1 = p1;
pim_ifp->pim = ifp->vrf->info;
pim_ifp->mroute_vif_index = -1;
+#if PIM_IPV == 4
pim_ifp->igmp_version = IGMP_DEFAULT_VERSION;
pim_ifp->gm_default_robustness_variable =
IGMP_DEFAULT_ROBUSTNESS_VARIABLE;
pim_sock_reset(ifp);
pim_if_add_vif(ifp, ispimreg, is_vxlan_term);
+#endif
pim_ifp->pim->mcast_if_count++;
return pim_ifp;
void pim_if_delete(struct interface *ifp)
{
struct pim_interface *pim_ifp;
- struct pim_ifchannel *ch;
assert(ifp);
pim_ifp = ifp->info;
assert(pim_ifp);
+ pim_ifp->pim->mcast_if_count--;
+#if PIM_IPV == 4
+ struct pim_ifchannel *ch;
+
if (pim_ifp->gm_join_list) {
pim_if_igmp_join_del_all(ifp);
}
pim_neighbor_delete_all(ifp, "Interface removed from configuration");
pim_if_del_vif(ifp);
- pim_ifp->pim->mcast_if_count--;
pim_igmp_if_fini(pim_ifp);
}
XFREE(MTYPE_PIM_INTERFACE, pim_ifp);
+#endif
ifp->info = NULL;
}
{
struct pim_interface *pim_ifp;
struct interface *ifp;
- struct in_addr ifaddr;
bool vxlan_term;
assert(ifc);
? "secondary"
: "primary");
- ifaddr = ifc->address->u.prefix4;
-
detect_address_change(ifp, 0, __func__);
// if (ifc->address->family != AF_INET)
// return;
+#if PIM_IPV == 4
+ struct in_addr ifaddr = ifc->address->u.prefix4;
+
if (PIM_IF_TEST_IGMP(pim_ifp->options)) {
struct gm_sock *igmp;
true);
}
} /* igmp mtrace only */
+#endif
if (PIM_IF_TEST_PIM(pim_ifp->options)) {
static void pim_if_addr_del_igmp(struct connected *ifc)
{
+#if PIM_IPV == 4
struct pim_interface *pim_ifp = ifc->ifp->info;
struct gm_sock *igmp;
struct in_addr ifaddr;
/* if addr found, del IGMP socket */
igmp_sock_delete(igmp);
}
+#endif
}
static void pim_if_addr_del_pim(struct connected *ifc)
return 0;
}
+__attribute__((unused))
static void pim_if_igmp_join_del_all(struct interface *ifp)
{
struct pim_interface *pim_ifp;
*/
if (pim_ifp)
pim_ifp->pim = pim;
+#if PIM_IPV == 4
pim_if_addr_add_all(ifp);
/*
* this is a no-op if it's already been done.
*/
pim_if_create_pimreg(pim);
+#endif
}
+#if PIM_IPV == 4
/*
* If we are a vrf device that is up, open up the pim_socket for
* listening
"%s: Cannot enable pim on %s. MAXVIFS(%d) reached. Deleting and readding the vxlan termimation device after unconfiguring pim from other interfaces may succeed.",
__func__, ifp->name, MAXVIFS);
}
+#endif
return 0;
}
{
struct pim_interface *pim_ifp;
struct pim_instance *pim;
- uint32_t table_id;
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
if (pim_ifp)
pim_ifp->pim = pim;
+#if PIM_IPV == 4
+ uint32_t table_id;
+
/*
pim_if_addr_add_all() suffices for bringing up both IGMP and
PIM
}
}
}
+#endif
return 0;
}
ifp->mtu, if_is_operative(ifp));
}
+#if PIM_IPV == 4
if (!if_is_operative(ifp)) {
pim_ifchannel_delete_all(ifp);
/*
pim_if_del_vif(ifp);
pim_ifstat_reset(ifp);
}
+#endif
return 0;
}
static int pim_ifp_destroy(struct interface *ifp)
{
- struct pim_instance *pim;
-
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
"%s: %s index %d vrf %s(%u) flags %ld metric %d mtu %d operative %d",
ifp->mtu, if_is_operative(ifp));
}
+#if PIM_IPV == 4
+ struct pim_instance *pim;
+
if (!if_is_operative(ifp))
pim_if_addr_del_all(ifp);
pim = ifp->vrf->info;
if (pim && pim->vxlan.term_if == ifp)
pim_vxlan_del_term_dev(pim);
+#endif
return 0;
}
int buf_size, ifindex_t ifindex)
{
struct interface *ifp;
- struct pim_interface *pim_ifp;
const struct ip *ip_hdr;
const struct igmpmsg *msg;
- struct in_addr ifaddr;
- struct gm_sock *igmp;
- const struct prefix *connected_src;
if (buf_size < (int)sizeof(struct ip))
return 0;
ip_hdr = (const struct ip *)buf;
if (ip_hdr->ip_p == IPPROTO_IGMP) {
+#if PIM_IPV == 4
+ struct pim_interface *pim_ifp;
+ struct in_addr ifaddr;
+ struct gm_sock *igmp;
+ const struct prefix *connected_src;
/* We have the IP packet but we do not know which interface this
* packet was
zlog_debug("No IGMP socket on interface: %s with connected source: %pFX",
ifp->name, connected_src);
}
+#endif
} else if (ip_hdr->ip_p) {
if (PIM_DEBUG_MROUTE_DETAIL) {
zlog_debug(
static void pim_ssm_range_reevaluate(struct pim_instance *pim)
{
+#if PIM_IPV == 4
/* 1. Setup register state for (S,G) entries if G has changed from SSM
* to
* ASM.
*/
pim_upstream_register_reevaluate(pim);
igmp_source_forward_reevaluate_all(pim);
+#endif
}
void pim_ssm_prefix_list_update(struct pim_instance *pim,
/* Router-id update message from zebra. */
+__attribute__((unused))
static int pim_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
return 0;
}
+__attribute__((unused))
static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct connected *c;
struct prefix *p;
struct pim_interface *pim_ifp;
- struct pim_instance *pim;
/*
zebra api notifies address adds/dels events by using the same call
#endif
}
+#if PIM_IPV == 4
if (p->family != PIM_AF)
SET_FLAG(c->flags, ZEBRA_IFA_SECONDARY);
else if (!CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)) {
pim_if_addr_add(c);
if (pim_ifp) {
+ struct pim_instance *pim;
+
pim = pim_get_pim_instance(vrf_id);
pim_ifp->pim = pim;
pim_if_addr_add_all(ifp);
}
}
-
+#else /* PIM_IPV != 4 */
+ /* unused - for now */
+ (void)pim_ifp;
+#endif
return 0;
}
struct connected *c;
struct prefix *p;
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
- struct pim_instance *pim;
if (!vrf)
return 0;
- pim = vrf->info;
/*
zebra api notifies address adds/dels events by using the same call
return 0;
p = c->address;
- if (p->family == AF_INET) {
- if (PIM_DEBUG_ZEBRA) {
- zlog_debug(
- "%s: %s(%u) disconnected IP address %pFX flags %u %s",
- __func__, c->ifp->name, vrf_id, p, c->flags,
- CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)
- ? "secondary"
- : "primary");
+ if (PIM_DEBUG_ZEBRA) {
+ zlog_debug(
+ "%s: %s(%u) disconnected IP address %pFX flags %u %s",
+ __func__, c->ifp->name, vrf_id, p, c->flags,
+ CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)
+ ? "secondary"
+ : "primary");
#ifdef PIM_DEBUG_IFADDR_DUMP
- dump_if_address(c->ifp);
+ dump_if_address(c->ifp);
#endif
- }
+ }
+#if PIM_IPV == 4
+ if (p->family == AF_INET) {
+ struct pim_instance *pim;
+
+ pim = vrf->info;
pim_if_addr_del(c, 0);
pim_rp_setup(pim);
pim_i_am_rp_re_evaluate(pim);
}
+#endif
connected_free(&c);
return 0;
pim_upstream_update_join_desired(pim, up);
}
+__attribute__((unused))
static int pim_zebra_vxlan_sg_proc(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
return 0;
}
+__attribute__((unused))
static void pim_zebra_vxlan_replay(void)
{
struct stream *s = NULL;
static void pim_zebra_connected(struct zclient *zclient)
{
+#if PIM_IPV == 4
/* Send the client registration */
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER, router->vrf_id);
+#endif
zclient_send_reg_requests(zclient, router->vrf_id);
+#if PIM_IPV == 4
/* request for VxLAN BUM group addresses */
pim_zebra_vxlan_replay();
+#endif
}
static void pim_zebra_capabilities(struct zclient_capabilities *cap)
}
static zclient_handler *const pim_handlers[] = {
- [ZEBRA_ROUTER_ID_UPDATE] = pim_router_id_update_zebra,
[ZEBRA_INTERFACE_ADDRESS_ADD] = pim_zebra_if_address_add,
[ZEBRA_INTERFACE_ADDRESS_DELETE] = pim_zebra_if_address_del,
+#if PIM_IPV == 4
+ [ZEBRA_ROUTER_ID_UPDATE] = pim_router_id_update_zebra,
[ZEBRA_INTERFACE_VRF_UPDATE] = pim_zebra_interface_vrf_update,
[ZEBRA_NEXTHOP_UPDATE] = pim_parse_nexthop_update,
[ZEBRA_MLAG_PROCESS_UP] = pim_zebra_mlag_process_up,
[ZEBRA_MLAG_PROCESS_DOWN] = pim_zebra_mlag_process_down,
[ZEBRA_MLAG_FORWARD_MSG] = pim_zebra_mlag_handle_msg,
+#endif
};
void pim_zebra_init(void)