pim_oil_terminate(pim);
+#if PIM_IPV == 4
pim_msdp_exit(pim);
+#endif /* PIM_IPV == 4 */
close(pim->reg_sock);
pim->spt.switchover = PIM_SPT_IMMEDIATE;
pim->spt.plist = NULL;
+#if PIM_IPV == 4
pim_msdp_init(pim, router->master);
+#endif /* PIM_IPV == 4 */
pim_vxlan_init(pim);
snprintf(hash_name, sizeof(hash_name), "PIM %s RPF Hash", vrf->name);
struct rb_pim_oil_head channel_oil_head;
+#if PIM_IPV == 4
struct pim_msdp msdp;
+#endif /* PIM_IPV == 4 */
struct pim_vxlan_instance vxlan;
struct pim_autorp *autorp;
struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id);
-extern bool pim_msdp_log_neighbor_events(const struct pim_instance *pim);
-extern bool pim_msdp_log_sa_events(const struct pim_instance *pim);
-
#endif
#include "pim_msdp_packet.h"
#include "pim_msdp_socket.h"
-// struct pim_msdp pim_msdp, *msdp = &pim_msdp;
-
static void pim_msdp_peer_listen(struct pim_msdp_peer *mp);
static void pim_msdp_peer_cr_timer_setup(struct pim_msdp_peer *mp, bool start);
static void pim_msdp_peer_ka_timer_setup(struct pim_msdp_peer *mp, bool start);
return mbr;
}
+/* MSDP on RP needs to know if a source is registerable to this RP */
+static void pim_upstream_msdp_reg_timer(struct event *t)
+{
+ struct pim_upstream *up = EVENT_ARG(t);
+ struct pim_instance *pim = up->channel_oil->pim;
+
+ /* source is no longer active - pull the SA from MSDP's cache */
+ pim_msdp_sa_local_del(pim, &up->sg);
+}
+
+void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
+{
+ EVENT_OFF(up->t_msdp_reg_timer);
+ event_add_timer(router->master, pim_upstream_msdp_reg_timer, up, PIM_MSDP_REG_RXED_PERIOD,
+ &up->t_msdp_reg_timer);
+
+ pim_msdp_sa_local_update(up);
+}
+
void pim_msdp_shutdown(struct pim_instance *pim, bool state)
{
struct pim_msdp_peer *peer;
#define PIM_MSDP_PEER_READ_OFF(mp) event_cancel(&mp->t_read)
#define PIM_MSDP_PEER_WRITE_OFF(mp) event_cancel(&mp->t_write)
-#if PIM_IPV != 6
-// struct pim_msdp *msdp;
struct pim_instance;
void pim_msdp_init(struct pim_instance *pim, struct event_loop *master);
void pim_msdp_exit(struct pim_instance *pim);
enum pim_msdp_err pim_msdp_mg_del(struct pim_instance *pim,
const char *mesh_group_name);
+extern void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up);
+
/**
* Allocates a new mesh group data structure under PIM instance.
*/
*/
void pim_msdp_shutdown(struct pim_instance *pim, bool state);
-#else /* PIM_IPV == 6 */
-static inline void pim_msdp_init(struct pim_instance *pim,
- struct event_loop *master)
-{
-}
-
-static inline void pim_msdp_exit(struct pim_instance *pim)
-{
-}
-
-static inline void pim_msdp_i_am_rp_changed(struct pim_instance *pim)
-{
-}
-
-static inline void pim_msdp_up_join_state_changed(struct pim_instance *pim,
- struct pim_upstream *xg_up)
-{
-}
-
-static inline void pim_msdp_up_del(struct pim_instance *pim, pim_sgaddr *sg)
-{
-}
-
-static inline void pim_msdp_sa_local_update(struct pim_upstream *up)
-{
-}
-
-static inline void pim_msdp_sa_local_del(struct pim_instance *pim,
- pim_sgaddr *sg)
-{
-}
-
-static inline int pim_msdp_config_write(struct pim_instance *pim,
- struct vty *vty)
-{
- return 0;
-}
-
-static inline bool pim_msdp_peer_config_write(struct vty *vty,
- struct pim_instance *pim)
-{
- return false;
-}
-
-static inline void pim_msdp_shutdown(struct pim_instance *pim, bool state)
-{
-}
-#endif /* PIM_IPV == 6 */
+extern bool pim_msdp_log_neighbor_events(const struct pim_instance *pim);
+extern bool pim_msdp_log_sa_events(const struct pim_instance *pim);
#endif
// inherited_olist(S,G,rpt)
// This is taken care of by the kernel for us
}
+
+#if PIM_IPV == 4
pim_upstream_msdp_reg_timer_start(upstream);
+#endif /* PIM_IPV == 4 */
} else {
if (PIM_DEBUG_PIM_REG) {
if (!i_am_rp)
*/
void pim_rp_refresh_group_to_rp_mapping(struct pim_instance *pim)
{
+#if PIM_IPV == 4
pim_msdp_i_am_rp_changed(pim);
+#endif /* PIM_IPV == 4 */
pim_upstream_reeval_use_rpt(pim);
}
}
if (i_am_rp_changed) {
+#if PIM_IPV == 4
pim_msdp_i_am_rp_changed(pim);
+#endif /* PIM_IPV == 4 */
pim_upstream_reeval_use_rpt(pim);
}
}
}
if (i_am_rp_changed) {
+#if PIM_IPV == 4
pim_msdp_i_am_rp_changed(pim);
+#endif /* PIM_IPV == 4 */
pim_upstream_reeval_use_rpt(pim);
}
}
{
struct listnode *node, *nnode;
struct pim_ifchannel *ch;
+#if PIM_IPV == 4
bool notify_msdp = false;
+#endif /* PIM_IPV == 4 */
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
if (up->join_state == PIM_UPSTREAM_JOINED) {
pim_jp_agg_single_upstream_send(&up->rpf, up, 0);
+#if PIM_IPV == 4
if (pim_addr_is_any(up->sg.src)) {
/* if a (*, G) entry in the joined state is being
* deleted we
* need to notify MSDP */
notify_msdp = true;
}
+#endif /* PIM_IPV == 4 */
}
join_timer_stop(up);
if (!pim_addr_is_any(up->sg.src)) {
if (pim->upstream_sg_wheel)
wheel_remove_item(pim->upstream_sg_wheel, up);
+#if PIM_IPV == 4
notify_msdp = true;
+#endif /* PIM_IPV == 4 */
}
pim_mroute_del(up->channel_oil, __func__);
rb_pim_upstream_del(&pim->upstream_head, up);
+#if PIM_IPV == 4
if (notify_msdp) {
pim_msdp_up_del(pim, &up->sg);
}
+#endif /* PIM_IPV == 4 */
/* When RP gets deleted, pim_rp_del() deregister addr with Zebra NHT
* and assign up->upstream_addr as INADDR_ANY.
if (old_state != PIM_UPSTREAM_JOINED) {
int old_fhr = PIM_UPSTREAM_FLAG_TEST_FHR(up->flags);
+#if PIM_IPV == 4
pim_msdp_up_join_state_changed(pim, up);
+#endif /* PIM_IPV == 4 */
if (pim_upstream_could_register(up)) {
PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
if (!old_fhr
if (!pim_addr_is_any(up->sg.src))
up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;
+#if PIM_IPV == 4
if (old_state == PIM_UPSTREAM_JOINED)
pim_msdp_up_join_state_changed(pim, up);
+#endif /* PIM_IPV == 4 */
if (old_state != new_state) {
old_use_rpt =
*/
}
+#if PIM_IPV == 4
/* source is no longer active - pull the SA from MSDP's cache */
pim_msdp_sa_local_del(pim, &up->sg);
+#endif /* PIM_IPV == 4 */
/* JoinDesired can change when KAT is started or stopped */
pim_upstream_update_join_desired(pim, up);
event_add_timer(router->master, pim_upstream_keep_alive_timer, up, time,
&up->t_ka_timer);
+#if PIM_IPV == 4
/* any time keepalive is started against a SG we will have to
* re-evaluate our active source database */
pim_msdp_sa_local_update(up);
+#endif /* PIM_IPV == 4 */
/* JoinDesired can change when KAT is started or stopped */
pim_upstream_update_join_desired(up->pim, up);
}
-/* MSDP on RP needs to know if a source is registerable to this RP */
-static void pim_upstream_msdp_reg_timer(struct event *t)
-{
- struct pim_upstream *up = EVENT_ARG(t);
- struct pim_instance *pim = up->channel_oil->pim;
-
- /* source is no longer active - pull the SA from MSDP's cache */
- pim_msdp_sa_local_del(pim, &up->sg);
-}
-
-void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
-{
- EVENT_OFF(up->t_msdp_reg_timer);
- event_add_timer(router->master, pim_upstream_msdp_reg_timer, up,
- PIM_MSDP_REG_RXED_PERIOD, &up->t_msdp_reg_timer);
-
- pim_msdp_sa_local_update(up);
-}
-
/*
* 4.2.1 Last-Hop Switchover to the SPT
*
int pim_upstream_empty_inherited_olist(struct pim_upstream *up);
void pim_upstream_find_new_rpf(struct pim_instance *pim);
-void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up);
void pim_upstream_init(struct pim_instance *pim);
void pim_upstream_terminate(struct pim_instance *pim);