]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Add code to start the KAT(S,G) as needed
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Oct 2015 14:50:16 +0000 (07:50 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:34 +0000 (20:38 -0400)
The KAT(S,G) timer can now be started and on
expiry the timer clears the PMBR(S,G).

More work needs to be done for when this timer pops, but
good enough of a start now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_br.c
pimd/pim_br.h
pimd/pim_upstream.c
pimd/pim_upstream.h

index db4aa3e864637c8c897c27be863b098bdeda4556..6958ad545db42d3cd0981df717c0cf81b72694dc 100644 (file)
@@ -81,6 +81,26 @@ pim_br_set_pmbr (struct in_addr source, struct in_addr group, struct in_addr br)
   pim_br->pmbr = br;
 }
 
+/*
+ * Remove the (S,G) from the stored values
+ */
+void
+pim_br_clear_pmbr (struct in_addr source, struct in_addr group)
+{
+  struct listnode *node, *next;
+  struct pim_br *pim_br;
+
+  for (ALL_LIST_ELEMENTS (pim_br_list, node, next, pim_br)) {
+    if (source.s_addr == pim_br->source.s_addr &&
+       group.s_addr == pim_br->group.s_addr)
+      break;
+  }
+
+  if (!pim_br)
+    return;
+
+  listnode_delete (pim_br_list, pim_br);
+}
 
 void pim_br_init (void)
 {
index 8986d016223e522f1741307afc32836525f7cb16..06b10ada30f0b7d8eab7ffa89e326bb908a47c7c 100644 (file)
@@ -24,6 +24,7 @@
 struct in_addr pim_br_get_pmbr (struct in_addr source, struct in_addr group);
 
 void pim_br_set_pmbr (struct in_addr source, struct in_addr group, struct in_addr value);
+void pim_br_clear_pmbr (struct in_addr source, struct in_addr group);
 
 void pim_br_init (void);
 
index d22362fc074027a5a84f755e09727a59af06cbdc..6ac968ac115d94a42f7802c4905ea492f51a1e07 100644 (file)
@@ -45,6 +45,7 @@
 #include "pim_oil.h"
 #include "pim_macro.h"
 #include "pim_rp.h"
+#include "pim_br.h"
 
 static void join_timer_start(struct pim_upstream *up);
 static void pim_upstream_update_assert_tracking_desired(struct pim_upstream *up);
@@ -65,6 +66,7 @@ static void upstream_channel_oil_detach(struct pim_upstream *up)
 void pim_upstream_delete(struct pim_upstream *up)
 {
   THREAD_OFF(up->t_join_timer);
+  THREAD_OFF(up->t_ka_timer);
 
   upstream_channel_oil_detach(up);
 
@@ -699,3 +701,34 @@ static void pim_upstream_update_assert_tracking_desired(struct pim_upstream *up)
     } /* scan iface channel list */
   } /* scan iflist */
 }
+
+/*
+ * On an RP, the PMBR value must be cleared when the
+ * Keepalive Timer expires
+ */
+static int
+pim_upstream_keep_alive_timer (struct thread *t)
+{
+  struct pim_upstream *up;
+
+  up = THREAD_ARG(t);
+
+  pim_br_clear_pmbr (up->source_addr, up->group_addr);
+  /*
+   * We need to do more here :)
+   * But this is the start.
+   */
+
+  return 0;
+}
+
+
+void
+pim_upstream_keep_alive_timer_start (struct pim_upstream *up,
+                                    uint32_t time)
+{
+  THREAD_TIMER_ON (master,
+                  up->t_ka_timer,
+                  pim_upstream_keep_alive_timer,
+                  up, time);
+}
index 6ffe1659545d4232c575b3217bd1fd859f9e6464..fd277c1f6e71122c2022860351e103854274c808 100644 (file)
@@ -135,4 +135,5 @@ void pim_upstream_rpf_interface_changed(struct pim_upstream *up,
 void pim_upstream_update_could_assert(struct pim_upstream *up);
 void pim_upstream_update_my_assert_metric(struct pim_upstream *up);
 
+void pim_upstream_keep_alive_timer_start (struct pim_upstream *up, uint32_t time);
 #endif /* PIM_UPSTREAM_H */