diff options
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 84 |
1 files changed, 71 insertions, 13 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index e1dfb00061..9c1cb38012 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -2311,6 +2311,41 @@ static void json_object_pim_upstream_add(json_object *json, /* XXX: need to print ths flag in the plain text display as well */ if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_MSDP) json_object_boolean_true_add(json, "sourceMsdp"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_SEND_SG_RPT_PRUNE) + json_object_boolean_true_add(json, "sendSGRptPrune"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_LHR) + json_object_boolean_true_add(json, "lastHopRouter"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY) + json_object_boolean_true_add(json, "disableKATExpiry"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_STATIC_IIF) + json_object_boolean_true_add(json, "staticIncomingInterface"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_ALLOW_IIF_IN_OIL) + json_object_boolean_true_add(json, + "allowIncomingInterfaceinOil"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_NO_PIMREG_DATA) + json_object_boolean_true_add(json, "noPimRegistrationData"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_FORCE_PIMREG) + json_object_boolean_true_add(json, "forcePimRegistration"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG) + json_object_boolean_true_add(json, "sourceVxlanOrigination"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM) + json_object_boolean_true_add(json, "sourceVxlanTermination"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_MLAG_VXLAN) + json_object_boolean_true_add(json, "mlagVxlan"); + + if (up->flags & PIM_UPSTREAM_FLAG_MASK_MLAG_NON_DF) + json_object_boolean_true_add(json, + "mlagNonDesignatedForwarder"); } static const char * @@ -4557,8 +4592,8 @@ DEFUN (show_ip_multicast_vrf_all, return CMD_SUCCESS; } -static void show_mroute(struct pim_instance *pim, struct vty *vty, bool fill, - bool uj) +static void show_mroute(struct pim_instance *pim, struct vty *vty, + struct prefix_sg *sg, bool fill, bool uj) { struct listnode *node; struct channel_oil *c_oil; @@ -4595,6 +4630,13 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty, bool fill, if (!c_oil->installed && !uj) continue; + if (sg->grp.s_addr != 0 && + sg->grp.s_addr != c_oil->oil.mfcc_mcastgrp.s_addr) + continue; + if (sg->src.s_addr != 0 && + sg->src.s_addr != c_oil->oil.mfcc_origin.s_addr) + continue; + pim_inet4_dump("<group?>", c_oil->oil.mfcc_mcastgrp, grp_str, sizeof(grp_str)); pim_inet4_dump("<source?>", c_oil->oil.mfcc_origin, src_str, @@ -4892,28 +4934,43 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty, bool fill, } } -DEFUN (show_ip_mroute, +DEFPY (show_ip_mroute, show_ip_mroute_cmd, - "show ip mroute [vrf NAME] [fill] [json]", + "show ip mroute [vrf NAME] [A.B.C.D$s_or_g [A.B.C.D$g]] [fill$fill] [json$json]", SHOW_STR IP_STR MROUTE_STR VRF_CMD_HELP_STR + "The Source or Group\n" + "The Group\n" "Fill in Assumed data\n" JSON_STR) { - bool uj = use_json(argc, argv); - bool fill = false; - int idx = 2; - struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); + struct prefix_sg sg = {0}; + struct pim_instance *pim; + struct vrf *v; - if (!vrf) + v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME); + + if (!v) { + vty_out(vty, "%% Vrf specified: %s does not exist\n", vrf); return CMD_WARNING; + } + pim = pim_get_pim_instance(v->vrf_id); - if (argv_find(argv, argc, "fill", &idx)) - fill = true; + if (!pim) { + vty_out(vty, "%% Unable to find pim instance\n"); + return CMD_WARNING; + } - show_mroute(vrf->info, vty, fill, uj); + if (s_or_g.s_addr != 0) { + if (g.s_addr != 0) { + sg.src = s_or_g; + sg.grp = g; + } else + sg.grp = s_or_g; + } + show_mroute(pim, vty, &sg, !!fill, !!json); return CMD_SUCCESS; } @@ -4927,6 +4984,7 @@ DEFUN (show_ip_mroute_vrf_all, "Fill in Assumed data\n" JSON_STR) { + struct prefix_sg sg = {0}; bool uj = use_json(argc, argv); int idx = 4; struct vrf *vrf; @@ -4946,7 +5004,7 @@ DEFUN (show_ip_mroute_vrf_all, first = false; } else vty_out(vty, "VRF: %s\n", vrf->name); - show_mroute(vrf->info, vty, fill, uj); + show_mroute(vrf->info, vty, &sg, fill, uj); } if (uj) vty_out(vty, "}\n"); |
