]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: PIM BSM Processing g2rp timer start and expiry routine(dummy)
authorsaravanank <saravanank@vmware.com>
Fri, 3 May 2019 13:51:42 +0000 (06:51 -0700)
committersaravanank <saravanank@vmware.com>
Wed, 15 May 2019 04:39:26 +0000 (21:39 -0700)
Expiry routine to be updated in later commit

Signed-off-by: Saravanan K <saravanank@vmware.com>
pimd/pim_bsm.c

index e3948eb338ab6673f9d0b18216871830112fbc88..e316bc738da397accc95133ee55842a9efc723ad 100644 (file)
@@ -32,6 +32,9 @@
 
 /* Functions forward declaration */
 static void pim_bs_timer_start(struct bsm_scope *scope, int bs_timeout);
+static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time);
+static inline void pim_g2rp_timer_restart(struct bsm_rpinfo *bsrp,
+                                         int hold_time);
 
 /* Memory Types */
 DEFINE_MTYPE_STATIC(PIMD, PIM_BSGRP_NODE, "PIM BSR advertised grp info")
@@ -133,6 +136,41 @@ void pim_bsm_proc_free(struct pim_instance *pim)
                route_table_finish(pim->global_scope.bsrp_table);
 }
 
+static int pim_on_g2rp_timer(struct thread *t)
+{
+       return 0;
+}
+
+static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time)
+{
+       if (!bsrp) {
+               if (PIM_DEBUG_BSM)
+                       zlog_debug("%s : Invalid brsp(NULL).",
+                                  __PRETTY_FUNCTION__);
+               return;
+       }
+       THREAD_OFF(bsrp->g2rp_timer);
+       if (PIM_DEBUG_BSM) {
+               char buf[48];
+
+               zlog_debug(
+                       "%s : starting g2rp timer for grp: %s - rp: %s with timeout  %d secs(Actual Hold time : %d secs)",
+                       __PRETTY_FUNCTION__,
+                       prefix2str(&bsrp->bsgrp_node->group, buf, 48),
+                       inet_ntoa(bsrp->rp_address), hold_time,
+                       bsrp->rp_holdtime);
+       }
+
+       thread_add_timer(router->master, pim_on_g2rp_timer, bsrp, hold_time,
+                        &bsrp->g2rp_timer);
+}
+
+static inline void pim_g2rp_timer_restart(struct bsm_rpinfo *bsrp,
+                                         int hold_time)
+{
+       pim_g2rp_timer_start(bsrp, hold_time);
+}
+
 struct bsgrp_node *pim_bsm_get_bsgrp_node(struct bsm_scope *scope,
                                          struct prefix *grp)
 {