Proposal to change CLI syntax of 'show ip rib <u_addr> to 'show ip pim rib <u_addr>

Chirag Shah chirag at cumulusnetworks.com
Tue Apr 4 17:53:47 EDT 2017


Hello All,

The CLI command 'show ip rib <unicast addr> is in pim_cmd.c which invokes
zebra lookup for nexthops and return the first available path to user.

Ideally the command is for PIMd (Zebra Client for nexthop info).

I would like to propose to change to CLI to specific to PIMd  'show ip *pim
*rib <uincat addr>  rather generic than "ip rib" term.

Please share your opinion.


Kind Regards,
Chirag Shah

P.S. :

Cli implementation from pim_cli.c

DEFUN (show_ip_rib,
       show_ip_rib_cmd,
       "*show ip rib A.B.C.D*",
       SHOW_STR
       IP_STR
       RIB_STR
       "Unicast address\n")
{
  struct in_addr addr;
  const char *addr_str;
  struct pim_nexthop nexthop;
  char nexthop_addr_str[PREFIX_STRLEN];
  int result;

  memset (&nexthop, 0, sizeof (nexthop));
  addr_str = argv[0];
  result = inet_pton(AF_INET, addr_str, &addr);
  if (result <= 0) {
    vty_out(vty, "Bad unicast address %s: errno=%d: %s%s",
            addr_str, errno, safe_strerror(errno), VTY_NEWLINE);
    return CMD_WARNING;
  }

  if (*pim_nexthop_lookup*(&nexthop, addr, 0)) {
    vty_out(vty, "Failure querying RIB nexthop for unicast address %s%s",
            addr_str, VTY_NEWLINE);
    return CMD_WARNING;
  }

  vty_out(vty, "Address         NextHop         Interface Metric
Preference%s",
          VTY_NEWLINE);

  pim_addr_dump("<nexthop?>", &nexthop.mrib_nexthop_addr,
                nexthop_addr_str, sizeof(nexthop_addr_str));

  vty_out(vty, "%-15s %-15s %-9s %6d %10d%s",
          addr_str,
          nexthop_addr_str,
          nexthop.interface ? nexthop.interface->name : "<ifname?>",
          nexthop.mrib_route_metric,
          nexthop.mrib_metric_preference,
          VTY_NEWLINE);

  return CMD_SUCCESS;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frrouting.org/pipermail/dev/attachments/20170404/6f5311c3/attachment.html>


More information about the dev mailing list