diff options
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
| -rw-r--r-- | ospf6d/ospf6_zebra.c | 88 |
1 files changed, 27 insertions, 61 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 3e4042d65d..76bee9cf55 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -217,7 +217,7 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, struct stream *s; struct zapi_ipv6 api; unsigned long ifindex; - struct prefix_ipv6 p; + struct prefix_ipv6 p, src_p; struct in6_addr *nexthop; if (ospf6 == NULL) @@ -240,6 +240,18 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, p.prefixlen = MIN(IPV6_MAX_PREFIXLEN, stream_getc (s)); stream_get (&p.prefix, s, PSIZE (p.prefixlen)); + memset (&src_p, 0, sizeof (struct prefix_ipv6)); + src_p.family = AF_INET6; + if (CHECK_FLAG (api.message, ZAPI_MESSAGE_SRCPFX)) + { + src_p.prefixlen = stream_getc (s); + stream_get (&src_p.prefix, s, PSIZE (src_p.prefixlen)); + } + + if (src_p.prefixlen) + /* we completely ignore srcdest routes for now. */ + return 0; + /* Nexthop, ifindex, distance, metric. */ if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) { @@ -325,30 +337,6 @@ DEFUN (show_zebra, return CMD_SUCCESS; } -DEFUN (router_zebra, - router_zebra_cmd, - "router zebra", - "Enable a routing process\n" - "Make connection to zebra daemon\n") -{ - vty->node = ZEBRA_NODE; - zclient->enable = 1; - zclient_start (zclient); - return CMD_SUCCESS; -} - -DEFUN (no_router_zebra, - no_router_zebra_cmd, - "no router zebra", - NO_STR - "Configure routing process\n" - "Disable connection to zebra daemon\n") -{ - zclient->enable = 0; - zclient_stop (zclient); - return CMD_SUCCESS; -} - /* Zebra configuration write function. */ static int config_write_ospf6_zebra (struct vty *vty) @@ -487,9 +475,9 @@ ospf6_zebra_route_update (int type, struct ospf6_route *request) api.distance = ospf6_distance_apply (dest, request); if (type == REM) - ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, dest, &api); + ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, dest, NULL, &api); else - ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, dest, &api); + ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, dest, NULL, &api); if (ret < 0) zlog_err ("zapi_ipv6_route() %s failed: %s", @@ -551,7 +539,7 @@ ospf6_zebra_add_discard (struct ospf6_route *request) dest = (struct prefix_ipv6 *) &request->prefix; - zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, dest, &api); + zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, dest, NULL, &api); if (IS_OSPF6_DEBUG_ZEBRA (SEND)) zlog_debug ("Zebra: Route add discard %s/%d", @@ -596,7 +584,7 @@ ospf6_zebra_delete_discard (struct ospf6_route *request) dest = (struct prefix_ipv6 *) &request->prefix; - zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, dest, &api); + zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, dest, NULL, &api); if (IS_OSPF6_DEBUG_ZEBRA (SEND)) zlog_debug ("Zebra: Route delete discard %s/%d", @@ -850,9 +838,6 @@ ospf6_zebra_init (struct thread_master *master) /* Install command element for zebra node. */ install_element (VIEW_NODE, &show_zebra_cmd); - install_element (CONFIG_NODE, &router_zebra_cmd); - install_element (CONFIG_NODE, &no_router_zebra_cmd); - install_default (ZEBRA_NODE); install_element (ZEBRA_NODE, &redistribute_ospf6_cmd); install_element (ZEBRA_NODE, &no_redistribute_ospf6_cmd); @@ -864,7 +849,7 @@ ospf6_zebra_init (struct thread_master *master) DEFUN (debug_ospf6_zebra_sendrecv, debug_ospf6_zebra_sendrecv_cmd, - "debug ospf6 zebra (send|recv)", + "debug ospf6 zebra [<send|recv>]", DEBUG_STR OSPF6_STR "Debug connection between zebra\n" @@ -872,13 +857,14 @@ DEFUN (debug_ospf6_zebra_sendrecv, "Debug Receiving zebra\n" ) { + int idx_send_recv = 3; unsigned char level = 0; - if (argc) + if (argc == 4) { - if (! strncmp (argv[0], "s", 1)) + if (strmatch(argv[idx_send_recv]->text, "send")) level = OSPF6_DEBUG_ZEBRA_SEND; - else if (! strncmp (argv[0], "r", 1)) + else if (strmatch(argv[idx_send_recv]->text, "recv")) level = OSPF6_DEBUG_ZEBRA_RECV; } else @@ -888,18 +874,9 @@ DEFUN (debug_ospf6_zebra_sendrecv, return CMD_SUCCESS; } -ALIAS (debug_ospf6_zebra_sendrecv, - debug_ospf6_zebra_cmd, - "debug ospf6 zebra", - DEBUG_STR - OSPF6_STR - "Debug connection between zebra\n" - ) - - DEFUN (no_debug_ospf6_zebra_sendrecv, no_debug_ospf6_zebra_sendrecv_cmd, - "no debug ospf6 zebra (send|recv)", + "no debug ospf6 zebra [<send|recv>]", NO_STR DEBUG_STR OSPF6_STR @@ -908,13 +885,14 @@ DEFUN (no_debug_ospf6_zebra_sendrecv, "Debug Receiving zebra\n" ) { + int idx_send_recv = 4; unsigned char level = 0; - if (argc) + if (argc == 5) { - if (! strncmp (argv[0], "s", 1)) + if (strmatch(argv[idx_send_recv]->text, "send")) level = OSPF6_DEBUG_ZEBRA_SEND; - else if (! strncmp (argv[0], "r", 1)) + else if (strmatch(argv[idx_send_recv]->text, "recv")) level = OSPF6_DEBUG_ZEBRA_RECV; } else @@ -924,14 +902,6 @@ DEFUN (no_debug_ospf6_zebra_sendrecv, return CMD_SUCCESS; } -ALIAS (no_debug_ospf6_zebra_sendrecv, - no_debug_ospf6_zebra_cmd, - "no debug ospf6 zebra", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug connection between zebra\n" - ) int config_write_ospf6_debug_zebra (struct vty *vty) @@ -951,12 +921,8 @@ config_write_ospf6_debug_zebra (struct vty *vty) void install_element_ospf6_debug_zebra (void) { - install_element (ENABLE_NODE, &debug_ospf6_zebra_cmd); - install_element (ENABLE_NODE, &no_debug_ospf6_zebra_cmd); install_element (ENABLE_NODE, &debug_ospf6_zebra_sendrecv_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_zebra_sendrecv_cmd); - install_element (CONFIG_NODE, &debug_ospf6_zebra_cmd); - install_element (CONFIG_NODE, &no_debug_ospf6_zebra_cmd); install_element (CONFIG_NODE, &debug_ospf6_zebra_sendrecv_cmd); install_element (CONFIG_NODE, &no_debug_ospf6_zebra_sendrecv_cmd); } |
