]> git.puffer.fish Git - matthieu/frr.git/commitdiff
"ip forwarding" command. Patch from Jim Crumpler.
authorhasso <hasso>
Sun, 25 May 2003 11:43:52 +0000 (11:43 +0000)
committerhasso <hasso>
Sun, 25 May 2003 11:43:52 +0000 (11:43 +0000)
zebra/ChangeLog
zebra/zserv.c

index 8cd3cf8bd14763a199f63591437e2b4cad0abaf1..7f3d724cd832369ead97894d62237fb8c0521452 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-25 Jim Crumpler <Jim.Crumpler@edion.com>
+
+  * zserv.c: Add "ip forwarding" command.
+
 2003-05-16 Gilad Arnold <gilad.arnold@terayon.com>
 
        * zebra_rib.c: Fix memory leaks for ifname nexthops
index e27db44936a4d2af821b8a2ced41f9d3bcfab78b..61b1cc8ae1940ece9dc2345e83e5311143669013 100644 (file)
@@ -1748,6 +1748,32 @@ DEFUN (config_table,
   return CMD_SUCCESS;
 }
 
+DEFUN (ip_forwarding,
+       ip_forwarding_cmd,
+       "ip forwarding",
+       IP_STR
+       "Turn on IP forwarding")
+{
+  int ret;
+
+  ret = ipforward ();
+
+  if (ret != 0)
+    {
+      vty_out (vty, "IP forwarding is already on%s", VTY_NEWLINE);
+      return CMD_ERR_NOTHING_TODO;
+    }
+
+  ret = ipforward_on ();
+  if (ret == 0)
+    {
+      vty_out (vty, "Can't turn on IP forwarding%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  return CMD_SUCCESS;
+}
+
 DEFUN (no_ip_forwarding,
        no_ip_forwarding_cmd,
        "no ip forwarding",
@@ -1932,6 +1958,7 @@ zebra_init ()
 
   install_element (VIEW_NODE, &show_ip_forwarding_cmd);
   install_element (ENABLE_NODE, &show_ip_forwarding_cmd);
+  install_element (CONFIG_NODE, &ip_forwarding_cmd);
   install_element (CONFIG_NODE, &no_ip_forwarding_cmd);
   install_element (ENABLE_NODE, &show_zebra_client_cmd);