diff options
author | hasso <hasso> | 2003-05-25 11:43:52 +0000 |
---|---|---|
committer | hasso <hasso> | 2003-05-25 11:43:52 +0000 |
commit | 647e4f1fb76f01695f29a877e61d2e4a33cfefee (patch) | |
tree | adeaab9faa6fda9544417c247fc1662248599c32 /zebra | |
parent | 269c67c5ea350bbf5562edceff00cee0b2ef3b68 (diff) | |
download | quagga-647e4f1fb76f01695f29a877e61d2e4a33cfefee.tar.bz2 quagga-647e4f1fb76f01695f29a877e61d2e4a33cfefee.tar.xz |
"ip forwarding" command. Patch from Jim Crumpler.
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/ChangeLog | 4 | ||||
-rw-r--r-- | zebra/zserv.c | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog index 8cd3cf8b..7f3d724c 100644 --- a/zebra/ChangeLog +++ b/zebra/ChangeLog @@ -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 diff --git a/zebra/zserv.c b/zebra/zserv.c index e27db449..61b1cc8a 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -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); |