]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2989 from donaldsharp/static_debug
authorDavid Lamparter <equinox@diac24.net>
Sat, 8 Sep 2018 15:38:48 +0000 (17:38 +0200)
committerGitHub <noreply@github.com>
Sat, 8 Sep 2018 15:38:48 +0000 (17:38 +0200)
Static debug

1  2 
sharpd/sharp_vty.c

diff --combined sharpd/sharp_vty.c
index 9462eb575c602473cc48622264a917d27a1678dd,e9ca18c5df218cbb625898e7d003f9b1d24253a0..797e336c2d2de814d91a6a5e3437d34e9146a9a0
@@@ -81,14 -81,13 +81,14 @@@ DEFPY(watch_nexthop_v4, watch_nexthop_v
  
  DEFPY (install_routes,
         install_routes_cmd,
 -       "sharp install routes A.B.C.D$start nexthop A.B.C.D$nexthop (1-1000000)$routes [instance (0-255)$instance]",
 +       "sharp install routes A.B.C.D$start nexthop <A.B.C.D$nexthop4|X:X::X:X$nexthop6> (1-1000000)$routes [instance (0-255)$instance]",
         "Sharp routing Protocol\n"
         "install some routes\n"
         "Routes to install\n"
         "Address to start /32 generation at\n"
 -       "Nexthop to use\n"
 -       "Nexthop address\n"
 +       "Nexthop to use(Can be an IPv4 or IPv6 address)\n"
 +       "V4 Nexthop address to use\n"
 +       "V6 Nexthop address to use\n"
         "How many to create\n"
         "Instance to use\n"
         "Instance\n")
        p.prefixlen = 32;
        p.u.prefix4 = start;
  
 -      nhop.gate.ipv4 = nexthop;
 -      nhop.type = NEXTHOP_TYPE_IPV4;
 +      if (nexthop4.s_addr != INADDR_ANY) {
 +              nhop.gate.ipv4 = nexthop4;
 +              nhop.type = NEXTHOP_TYPE_IPV4;
 +      } else {
 +              memcpy(&nhop.gate.ipv6, &nexthop6, IPV6_MAX_BYTELEN);
 +              nhop.type = NEXTHOP_TYPE_IPV6;
 +      }
  
        zlog_debug("Inserting %ld routes", routes);
  
@@@ -191,6 -185,18 +191,18 @@@ DEFPY (remove_routes
        return CMD_SUCCESS;
  }
  
+ DEFUN_NOSH (show_debugging_sharpd,
+           show_debugging_sharpd_cmd,
+           "show debugging [sharp]",
+           SHOW_STR
+           DEBUG_STR
+           "Sharp Information\n")
+ {
+       vty_out(vty, "Sharp debugging status\n");
+       return CMD_SUCCESS;
+ }
  void sharp_vty_init(void)
  {
        install_element(ENABLE_NODE, &install_routes_cmd);
        install_element(ENABLE_NODE, &vrf_label_cmd);
        install_element(ENABLE_NODE, &watch_nexthop_v6_cmd);
        install_element(ENABLE_NODE, &watch_nexthop_v4_cmd);
+       install_element(VIEW_NODE, &show_debugging_sharpd_cmd);
        return;
  }