]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Add New Source type for where a (S,G) mroute is learned
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Oct 2015 17:14:06 +0000 (10:14 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:35 +0000 (20:38 -0400)
Add Source type for (S,G) mroute.  This will allow us to know that
a (S,G) route came from an actual Source( ie the kernel called us
back with information about a multicast packet it received with
no mroute for it ).

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

index f15d6059f0ae77d3717525263c5c8de2eb105bdf..705aa72eadc10405993b74bfadb2cbab1887d521 100644 (file)
@@ -2174,7 +2174,7 @@ static void show_mroute(struct vty *vty)
   struct static_route *s_route;
   time_t              now;
 
-  vty_out(vty, "Proto: I=IGMP P=PIM S=STATIC%s%s", VTY_NEWLINE, VTY_NEWLINE);
+  vty_out(vty, "Proto: I=IGMP P=PIM S=STATIC O=SOURCE%s%s", VTY_NEWLINE, VTY_NEWLINE);
   
   vty_out(vty, "Source          Group           Proto Input iVifI Output oVifI TTL Uptime  %s",
          VTY_NEWLINE);
@@ -2213,6 +2213,9 @@ static void show_mroute(struct vty *vty)
       if (c_oil->oif_flags[oif_vif_index] & PIM_OIF_FLAG_PROTO_IGMP) {
        strcat(proto, "I");
       }
+      if (c_oil->oif_flags[oif_vif_index] & PIM_OIF_FLAG_PROTO_SOURCE) {
+       strcat(proto, "O");
+      }
 
       vty_out(vty, "%-15s %-15s %-5s %-5s %5d %-6s %5d %3d %8s %s",
              source_str,
index 1753545ab91f7c20ed78f6debae339959714ac05..16d2dd7e4b9362c125db9c1e18dd2c2e39d0bb2f 100644 (file)
 
 #include "pim_mroute.h"
 
-#define PIM_OIF_FLAG_PROTO_IGMP (1 << 0) /* bitmask 1 */
-#define PIM_OIF_FLAG_PROTO_PIM  (1 << 1) /* bitmask 2 */
-#define PIM_OIF_FLAG_PROTO_ANY  (3)      /* bitmask (1 | 2) */
+/*
+ * Where did we get this (S,G) from?
+ *
+ * IGMP - Learned from IGMP
+ * PIM - Learned from PIM
+ * SOURCE - Learned from Source multicast packet received
+ */
+#define PIM_OIF_FLAG_PROTO_IGMP   (1 << 0)
+#define PIM_OIF_FLAG_PROTO_PIM    (1 << 1)
+#define PIM_OIF_FLAG_PROTO_SOURCE (2 << 1)
+#define PIM_OIF_FLAG_PROTO_ANY    (PIM_OIF_FLAG_PROTO_IGMP | \
+                                   PIM_OIF_FLAG_PROTO_PIM | \
+                                   PIM_OIF_FLAG_PROTO_SOURCE)
 
 /*
   qpim_channel_oil_list holds a list of struct channel_oil.