From: saravanank Date: Fri, 3 May 2019 13:51:42 +0000 (-0700) Subject: pimd: PIM BSM Processing g2rp timer start and expiry routine(dummy) X-Git-Tag: base_7.2~306^2~16 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a5164e9790c55b6534670a60e27813da9262a3b6;p=matthieu%2Ffrr.git pimd: PIM BSM Processing g2rp timer start and expiry routine(dummy) Expiry routine to be updated in later commit Signed-off-by: Saravanan K --- diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index e3948eb338..e316bc738d 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -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) {