From: Donald Sharp Date: Wed, 28 Oct 2015 17:14:06 +0000 (-0700) Subject: pimd: Add New Source type for where a (S,G) mroute is learned X-Git-Tag: frr-2.0-rc1~811 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0fba6e638ac2e9c9514fd98540feda589334311d;p=mirror%2Ffrr.git pimd: Add New Source type for where a (S,G) mroute is learned 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 --- diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index f15d6059f0..705aa72ead 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -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, diff --git a/pimd/pim_oil.h b/pimd/pim_oil.h index 1753545ab9..16d2dd7e4b 100644 --- a/pimd/pim_oil.h +++ b/pimd/pim_oil.h @@ -25,9 +25,19 @@ #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.