From: Donald Sharp Date: Fri, 16 Oct 2015 14:01:47 +0000 (-0700) Subject: pimd: Create some infrastructure code for RST(S,G) and KAT(S,G) X-Git-Tag: frr-2.0-rc1~828 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4a4c4a07c564d6a16063984d26e14b7659306a84;p=mirror%2Ffrr.git pimd: Create some infrastructure code for RST(S,G) and KAT(S,G) These two timers have some default values. Create the default defines to be used and start setting up the data structures for them. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 0cc3ff98e2..d22362fc07 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -116,7 +116,7 @@ static int on_join_timer(struct thread *t) send_join(up); - up->t_join_timer = 0; + up->t_join_timer = NULL; join_timer_start(up); return 0; @@ -373,10 +373,11 @@ static struct pim_upstream *pim_upstream_new(struct in_addr source_addr, up->group_addr = group_addr; up->flags = 0; up->ref_count = 1; - up->t_join_timer = 0; + up->t_join_timer = NULL; + up->t_ka_timer = NULL; up->join_state = 0; up->state_transition = pim_time_monotonic_sec(); - up->channel_oil = 0; + up->channel_oil = NULL; up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE; up->rpf.source_nexthop.interface = 0; diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index d6b4ed360f..6ffe165954 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -99,6 +99,14 @@ struct pim_upstream { struct pim_rpf rpf; struct thread *t_join_timer; + + /* + * KAT(S,G) + */ + struct thread *t_ka_timer; +#define PIM_KEEPALIVE_PERIOD (210) +#define PIM_RP_KEEPALIVE_PERIOD ( 3 * qpim_register_suppress_time + qpim_register_probe_time ) + int64_t state_transition; /* Record current state uptime */ }; diff --git a/pimd/pimd.c b/pimd/pimd.c index 8de469e7fd..8ed110dc5c 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -71,6 +71,9 @@ int64_t qpim_mroute_del_last = 0; struct list *qpim_static_route_list = 0; struct in_addr qpim_rp; +int32_t qpim_register_suppress_time = PIM_REGISTER_SUPPRESSION_TIME_DEFAULT; +int32_t qpim_register_probe_time = PIM_REGISTER_PROBE_TIME_DEFAULT; + static void pim_free() { pim_ssmpingd_destroy(); diff --git a/pimd/pimd.h b/pimd/pimd.h index b763b2760d..239c618438 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -108,6 +108,15 @@ extern struct in_addr qpim_rp; #define PIM_MROUTE_IS_ENABLED (qpim_mroute_socket_fd >= 0) #define PIM_MROUTE_IS_DISABLED (qpim_mroute_socket_fd < 0) +/* + * Register-Stop Timer (RST(S,G)) + * Default values + */ +extern int32_t qpim_register_suppress_time; +extern int32_t qpim_register_probe_time; +#define PIM_REGISTER_SUPPRESSION_TIME_DEFAULT (60) +#define PIM_REGISTER_PROBE_TIME_DEFAULT (5) + #define PIM_DEBUG_PIM_EVENTS (qpim_debugs & PIM_MASK_PIM_EVENTS) #define PIM_DEBUG_PIM_PACKETS (qpim_debugs & PIM_MASK_PIM_PACKETS) #define PIM_DEBUG_PIM_PACKETDUMP_SEND (qpim_debugs & PIM_MASK_PIM_PACKETDUMP_SEND)