]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Add support for displaying ip mroute
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 1 Jun 2016 19:31:02 +0000 (15:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 1 Jun 2016 19:31:02 +0000 (15:31 -0400)
When you enter a static mroute under an interface
the 'show run' is not displaying this information.
Add code to allow this.

Ticket: CM-11257
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
pimd/pim_static.c
pimd/pim_static.h
pimd/pim_vty.c

index 26743b59612fe9ef9d14d4481cd17f8c2b6b5d82..5114901dad1ea1f61a09e434454f91ab6760e2a4 100644 (file)
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
+#include "vty.h"
+
 #include "pim_static.h"
 #include "pim_time.h"
 #include "pim_str.h"
@@ -303,3 +307,32 @@ int pim_static_del(struct interface *iif, struct interface *oif, struct in_addr
 
    return 0;
 }
+
+int
+pim_static_write_mroute (struct vty *vty, struct interface *ifp)
+{
+  struct listnode *node;
+  struct static_route *sroute;
+  int count = 0;
+  char sbuf[100];
+  char gbuf[100];
+
+  for (ALL_LIST_ELEMENTS_RO (qpim_static_route_list, node, sroute))
+    {
+      pim_inet4_dump ("<ifaddr?>", sroute->group, gbuf, sizeof (gbuf));
+      pim_inet4_dump ("<ifaddr?>", sroute->source, sbuf, sizeof (sbuf));
+      if (sroute->iif == ifp->ifindex)
+       {
+         int i;
+         for (i = 0; i < MAXVIFS; i++)
+           if (sroute->oif_ttls[i])
+             {
+               struct interface *oifp = if_lookup_by_index (i);
+               vty_out (vty, " ip mroute %s %s %s%s", oifp->name, gbuf, sbuf, VTY_NEWLINE);
+               count ++;
+             }
+       }
+    }
+
+  return count;
+}
index 3a096932d23c2f0755881f4aa9e1643ade934f12..b3be09e9137a157a4a855509aa4308da71b0dc67 100644 (file)
@@ -43,5 +43,6 @@ void pim_static_route_free(struct static_route *s_route);
 
 int pim_static_add(struct interface *iif, struct interface *oif, struct in_addr group, struct in_addr source);
 int pim_static_del(struct interface *iif, struct interface *oif, struct in_addr group, struct in_addr source);
+int pim_static_write_mroute (struct vty *vty, struct interface *ifp);
 
 #endif /* PIM_STATIC_H_ */
index eeeda9d43fabac790eeb7be6d3daf08e4fd44c55..beb0622a3f4675e7603bafeb3db14a2f11aebcf3 100644 (file)
@@ -33,6 +33,7 @@
 #include "pim_str.h"
 #include "pim_ssmpingd.h"
 #include "pim_pim.h"
+#include "pim_static.h"
 
 int pim_debug_config_write(struct vty *vty)
 {
@@ -200,6 +201,8 @@ int pim_interface_config_write(struct vty *vty)
          ++writes;
        }
       }
+
+       writes += pim_static_write_mroute (vty, ifp);
     }
     vty_out(vty, "!%s", VTY_NEWLINE);
     ++writes;