]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: create pim_upstream_state2str
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 17 Jul 2016 23:45:16 +0000 (19:45 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:02 +0000 (20:26 -0500)
Allow update of show command to understant all
pim upstream states.

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

index e50837ebedf7ae60f69557a28c27db50e5f91174..b595d337e7d8af2ffcf199eed27a735a3d8b5a0c 100644 (file)
@@ -996,7 +996,7 @@ static void pim_show_upstream(struct vty *vty)
              up->rpf.source_nexthop.interface->name,
              src_str,
              grp_str,
-             up->join_state == PIM_UPSTREAM_JOINED ? "Jnd" : "NtJnd",
+             pim_upstream_state2str (up),
              uptime,
              join_timer,
              up->ref_count,
index 82678857565c2ab2af910be704f1f9de0c6e7274..8f1b019808ce4eadf4b5cff5c5b71bcc3f2e2be4 100644 (file)
@@ -415,7 +415,7 @@ struct pim_upstream *pim_upstream_find(struct in_addr source_addr,
     }
   }
 
-  return 0;
+  return NULL;
 }
 
 struct pim_upstream *pim_upstream_add(struct in_addr source_addr,
@@ -784,3 +784,24 @@ pim_upstream_switch_to_spt_desired (struct in_addr source, struct in_addr group)
 {
   return 0;
 }
+
+const char *
+pim_upstream_state2str (struct pim_upstream *up)
+{
+  switch (up->join_state)
+    {
+    case PIM_UPSTREAM_NOTJOINED:
+      return "NtJnd";
+      break;
+    case PIM_UPSTREAM_JOINED:
+      return "Jnd";
+      break;
+    case PIM_UPSTREAM_JOIN_PENDING:
+      return "JPend";
+      break;
+    case PIM_UPSTREAM_PRUNE:
+      return "Prune";
+      break;
+    }
+  return "Unkwn";
+}
index 71a4c85f18a790460cb5b0584a701aa1386182c8..1ae3893d47b64bed8d0f2ed30af58cbfb5bc6e74 100644 (file)
@@ -69,7 +69,9 @@ enum pim_rpf_result {
 
 enum pim_upstream_state {
   PIM_UPSTREAM_NOTJOINED,
-  PIM_UPSTREAM_JOINED
+  PIM_UPSTREAM_JOINED,
+  PIM_UPSTREAM_JOIN_PENDING,
+  PIM_UPSTREAM_PRUNE,
 };
 
 enum pim_upstream_sptbit {
@@ -148,4 +150,5 @@ void pim_upstream_keep_alive_timer_start (struct pim_upstream *up, uint32_t time
 int pim_upstream_switch_to_spt_desired (struct in_addr source, struct in_addr group);
 #define SwitchToSptDesired(S,G) pim_upstream_switch_to_spt_desired ((S), (G))
 
+const char *pim_upstream_state2str (struct pim_upstream *up);
 #endif /* PIM_UPSTREAM_H */