[quagga-dev,15453] pimd: Add support for displaying ip mroute

Message ID 1464849046-22634-1-git-send-email-sharpd@cumulusnetworks.com
State Under Review
Headers show

Commit Message

Donald Sharp June 2, 2016, 6:30 a.m.
When you enter a static mroute under an interface
the 'show run' is not displaying this information.
Add code to allow this.

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 | 31 +++++++++++++++++++++++++++++++
 pimd/pim_static.h |  1 +
 pimd/pim_vty.c    |  3 +++
 3 files changed, 35 insertions(+)

Comments

cisystem@netdef.org June 7, 2016, 2 a.m. | #1
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1964: http://patchwork.quagga.net/patch/1964
       [quagga-dev,15453] pimd: Add support for displaying ip mroute
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-303/


Get source and apply patch from patchwork: Successful
----------------

Building Stage: Successful
----------------

Basic Tests: Failed
----------------
Ipv6 protocols on ubuntu 14.04: Successful
Static analyzer (clang): Successful


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
cisystem@netdef.org June 7, 2016, 3:40 a.m. | #2
Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF CI System <cisystem@netdef.org>

This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1964: http://patchwork.quagga.net/patch/1964
       [quagga-dev,15453] pimd: Add support for displaying ip mroute
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-303/


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Jafar Al-Gharaibeh June 7, 2016, 2:43 p.m. | #3
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>

On 6/2/2016 1:30 AM, Donald Sharp wrote:
> When you enter a static mroute under an interface
> the 'show run' is not displaying this information.
> Add code to allow this.
>
> 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 | 31 +++++++++++++++++++++++++++++++
>   pimd/pim_static.h |  1 +
>   pimd/pim_vty.c    |  3 +++
>   3 files changed, 35 insertions(+)
>
> diff --git a/pimd/pim_static.c b/pimd/pim_static.c
> index cbbcaaa..5114901 100644
> --- a/pimd/pim_static.c
> +++ b/pimd/pim_static.c
> @@ -22,6 +22,8 @@
>   
>   #include <zebra.h>
>   
> +#include "vty.h"
> +
>   #include "pim_static.h"
>   #include "pim_time.h"
>   #include "pim_str.h"
> @@ -305,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;
> +}
> diff --git a/pimd/pim_static.h b/pimd/pim_static.h
> index 3a09693..b3be09e 100644
> --- a/pimd/pim_static.h
> +++ b/pimd/pim_static.h
> @@ -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_ */
> diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
> index 810dbe8..56de83c 100644
> --- a/pimd/pim_vty.c
> +++ b/pimd/pim_vty.c
> @@ -32,6 +32,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)
>   {
> @@ -191,6 +192,8 @@ int pim_interface_config_write(struct vty *vty)
>   	  ++writes;
>   	}
>         }
> +
> +	writes += pim_static_write_mroute (vty, ifp);
>       }
>       vty_out(vty, "!%s", VTY_NEWLINE);
>       ++writes;

Patch hide | download patch | download mbox

diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index cbbcaaa..5114901 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -22,6 +22,8 @@ 
 
 #include <zebra.h>
 
+#include "vty.h"
+
 #include "pim_static.h"
 #include "pim_time.h"
 #include "pim_str.h"
@@ -305,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;
+}
diff --git a/pimd/pim_static.h b/pimd/pim_static.h
index 3a09693..b3be09e 100644
--- a/pimd/pim_static.h
+++ b/pimd/pim_static.h
@@ -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_ */
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index 810dbe8..56de83c 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -32,6 +32,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)
 {
@@ -191,6 +192,8 @@  int pim_interface_config_write(struct vty *vty)
 	  ++writes;
 	}
       }
+
+	writes += pim_static_write_mroute (vty, ifp);
     }
     vty_out(vty, "!%s", VTY_NEWLINE);
     ++writes;