#include "pim_msg.h"
#include "pim_pim.h"
#include "pim_join.h"
+#include "pim_oil.h"
#include "pim_iface.h"
#include "pim_hello.h"
#include "pim_ifchannel.h"
pim_ifchannel_join_add(ifp, neigh->source_addr, upstream,
&sg, source_flags, holdtime);
- if (I_am_RP (group) && sg.u.sg.src.s_addr == INADDR_ANY)
+ if (sg.u.sg.src.s_addr == INADDR_ANY)
{
- struct pim_upstream *up;
+ struct pim_upstream *up = pim_upstream_find (&sg);
+ struct pim_upstream *child;
+ struct listnode *up_node;
- up = pim_upstream_find_non_any (&sg);
-
- if (up)
+ for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
{
- char buff[100];
- strcpy (buff, pim_str_sg_dump (&up->sg));
- zlog_debug("%s %s: Join(S,G)=%s from %s",
- __FILE__, __PRETTY_FUNCTION__,
- buff, pim_str_sg_dump (&sg));
-
- pim_rp_set_upstream_addr (&up->upstream_addr, up->sg.u.sg.src);
- pim_nexthop_lookup (&up->rpf.source_nexthop, up->upstream_addr, NULL);
- pim_ifchannel_join_add (ifp, neigh->source_addr, upstream, &up->sg, source_flags, holdtime);
+ if (child->parent == up)
+ {
+ char buff[100];
+ strcpy (buff, pim_str_sg_dump (&up->sg));
+ zlog_debug("%s %s: Join(S,G)=%s from %s",
+ __FILE__, __PRETTY_FUNCTION__,
+ buff, pim_str_sg_dump (&sg));
+
+ pim_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+ }
}
}
pim_ifchannel_prune(ifp, upstream, &sg, source_flags, holdtime);
- if (I_am_RP (group) && sg.u.sg.src.s_addr == INADDR_ANY)
+ if (sg.u.sg.src.s_addr == INADDR_ANY)
{
- struct pim_upstream *up;
-
- up = pim_upstream_find_non_any (&sg);
+ struct pim_upstream *up = pim_upstream_find (&sg);
+ struct pim_upstream *child;
+ struct listnode *up_node;
- if (up)
+ for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
{
- char buff[100];
- strcpy (buff, pim_str_sg_dump (&up->sg));
- zlog_debug("%s %s: Prune(S,G)=%s from %s",
- __FILE__, __PRETTY_FUNCTION__,
- buff, pim_str_sg_dump (&sg));
- pim_ifchannel_prune (ifp, upstream, &up->sg, source_flags, holdtime);
+ if (child->parent == up)
+ {
+ char buff[100];
+ strcpy (buff, pim_str_sg_dump (&up->sg));
+ zlog_debug("%s %s: Prune(S,G)=%s from %s",
+ __FILE__, __PRETTY_FUNCTION__,
+ buff, pim_str_sg_dump (&sg));
+ pim_channel_del_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+ }
}
}
struct prefix anysrc;
int output_intf = 0;
+ pim_ifp = up->rpf.source_nexthop.interface->info;
+ zlog_debug ("Channel Oil%s: %p", pim_str_sg_dump (&up->sg), up->channel_oil);
+ if (!up->channel_oil)
+ up->channel_oil = pim_channel_oil_add (&up->sg, pim_ifp->mroute_vif_index);
anysrc = up->sg;
anysrc.u.sg.src.s_addr = INADDR_ANY;
for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch))
{
- struct pim_ifchannel *nch;
+ //struct pim_ifchannel *nch;
if (ch->upstream != anysrc_up)
continue;
if (ch->ifjoin_state == PIM_IFJOIN_JOIN)
{
- nch = pim_ifchannel_add (ifp, &up->sg);
- pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
- pim_forward_start (ch);
+ pim_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+ //nch = pim_ifchannel_add (ifp, &up->sg);
+ //pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
+ //pim_forward_start (ch);
output_intf++;
}
}