diff options
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r-- | zebra/zserv.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index 0508f905..975574af 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -451,6 +451,7 @@ zsend_ipv4_add_multipath (struct zserv *client, struct prefix *p, { stream_putc (s, 1); + /* XXX: Waht's about NEXTHOP_TYPE_IPV4_IFNAME ? */ if (nexthop->type == NEXTHOP_TYPE_IPV4 || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) stream_put_in_addr (s, &nexthop->gate.ipv4); @@ -532,6 +533,8 @@ zsend_ipv4_delete_multipath (struct zserv *client, struct prefix *p, return 0; } +#if 0 +#warning oldies int zsend_ipv4_add (struct zserv *client, int type, int flags, struct prefix_ipv4 *p, struct in_addr *nexthop, @@ -613,8 +616,11 @@ zsend_ipv4_delete (struct zserv *client, int type, int flags, return 0; } +#endif /* oldies */ #ifdef HAVE_IPV6 +#if 0 +#warning oldies int zsend_ipv6_add (struct zserv *client, int type, int flags, struct prefix_ipv6 *p, struct in6_addr *nexthop, @@ -655,6 +661,7 @@ zsend_ipv6_add (struct zserv *client, int type, int flags, return 0; } +#endif /* oldies */ int zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p, @@ -690,7 +697,9 @@ zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p, { stream_putc (s, 1); - if (nexthop->type == NEXTHOP_TYPE_IPV6) + if (nexthop->type == NEXTHOP_TYPE_IPV6 + || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX + || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) stream_write (s, (u_char *) &nexthop->gate.ipv6, 16); else stream_write (s, (u_char *) &empty, 16); @@ -714,6 +723,8 @@ zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p, return 0; } +#if 0 +#warning oldies int zsend_ipv6_delete (struct zserv *client, int type, int flags, struct prefix_ipv6 *p, struct in6_addr *nexthop, @@ -754,6 +765,7 @@ zsend_ipv6_delete (struct zserv *client, int type, int flags, return 0; } +#endif /* oldies */ int zsend_ipv6_delete_multipath (struct zserv *client, struct prefix *p, @@ -1089,9 +1101,9 @@ zread_ipv4_add (struct zserv *client, u_short length) case ZEBRA_NEXTHOP_IPV6: stream_forward (s, IPV6_MAX_BYTELEN); break; - case ZEBRA_NEXTHOP_BLACKHOLE: - nexthop_blackhole_add (rib); - break; + case ZEBRA_NEXTHOP_BLACKHOLE: + nexthop_blackhole_add (rib); + break; } } } @@ -1757,6 +1769,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", @@ -1941,6 +1979,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); |