From 2ae26387131aab068450f9fb9761f1f41c4cf4de Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 14 Sep 2016 19:13:11 -0400 Subject: [PATCH] lib, zebra: Remove ZEBRA_IPV[4|6]_IMPORT_NEXTHOP Zebra api that was never used. Signed-off-by: Donald Sharp (cherry picked from commit 33361d3992c8bff66247b76e5adaf4b0de8217df) --- lib/log.c | 2 -- lib/zebra.h | 2 -- zebra/zserv.c | 61 --------------------------------------------------- 3 files changed, 65 deletions(-) diff --git a/lib/log.c b/lib/log.c index 1d251f4aae..0d1a8eb4f0 100644 --- a/lib/log.c +++ b/lib/log.c @@ -898,8 +898,6 @@ static const struct zebra_desc_table command_types[] = { DESC_ENTRY (ZEBRA_REDISTRIBUTE_DELETE), DESC_ENTRY (ZEBRA_REDISTRIBUTE_DEFAULT_ADD), DESC_ENTRY (ZEBRA_REDISTRIBUTE_DEFAULT_DELETE), - DESC_ENTRY (ZEBRA_IPV4_IMPORT_LOOKUP), - DESC_ENTRY (ZEBRA_IPV6_IMPORT_LOOKUP), DESC_ENTRY (ZEBRA_INTERFACE_RENAME), DESC_ENTRY (ZEBRA_ROUTER_ID_ADD), DESC_ENTRY (ZEBRA_ROUTER_ID_DELETE), diff --git a/lib/zebra.h b/lib/zebra.h index d393a05727..884cd76e8a 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -411,8 +411,6 @@ typedef enum { ZEBRA_REDISTRIBUTE_DELETE, ZEBRA_REDISTRIBUTE_DEFAULT_ADD, ZEBRA_REDISTRIBUTE_DEFAULT_DELETE, - ZEBRA_IPV4_IMPORT_LOOKUP, - ZEBRA_IPV6_IMPORT_LOOKUP, ZEBRA_INTERFACE_RENAME, ZEBRA_ROUTER_ID_ADD, ZEBRA_ROUTER_ID_DELETE, diff --git a/zebra/zserv.c b/zebra/zserv.c index c6026b6795..6acda98906 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -939,50 +939,6 @@ zsend_ipv4_nexthop_lookup_mrib (struct zserv *client, struct in_addr addr, struc return zebra_server_send_message(client); } -static int -zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p, - vrf_id_t vrf_id) -{ - struct stream *s; - struct rib *rib; - unsigned long nump; - u_char num; - struct nexthop *nexthop; - - /* Lookup nexthop. */ - rib = rib_lookup_ipv4 (p, vrf_id); - - /* Get output stream. */ - s = client->obuf; - stream_reset (s); - - /* Fill in result. */ - zserv_create_header (s, ZEBRA_IPV4_IMPORT_LOOKUP, vrf_id); - stream_put_in_addr (s, &p->prefix); - - if (rib) - { - stream_putl (s, rib->metric); - num = 0; - nump = stream_get_endp(s); - stream_putc (s, 0); - for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next) - if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) - || nexthop_has_fib_child(nexthop)) - num += zsend_write_nexthop (s, nexthop); - stream_putc_at (s, nump, num); - } - else - { - stream_putl (s, 0); - stream_putc (s, 0); - } - - stream_putw_at (s, 0, stream_get_endp (s)); - - return zebra_server_send_message(client); -} - /* Router-id is updated. Send ZEBRA_ROUTER_ID_ADD to client. */ int zsend_router_id_update (struct zserv *client, struct prefix *p, @@ -1276,20 +1232,6 @@ zread_ipv4_nexthop_lookup_mrib (struct zserv *client, u_short length, struct zeb return zsend_ipv4_nexthop_lookup_mrib (client, addr, rib, zvrf); } -/* Nexthop lookup for IPv4. */ -static int -zread_ipv4_import_lookup (struct zserv *client, u_short length, - struct zebra_vrf *zvrf) -{ - struct prefix_ipv4 p; - - p.family = AF_INET; - p.prefixlen = stream_getc (client->ibuf); - p.prefix.s_addr = stream_get_ipv4 (client->ibuf); - - return zsend_ipv4_import_lookup (client, &p, zvrf->vrf_id); -} - /* Zebra server IPv6 prefix add function. */ static int zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf) @@ -1947,9 +1889,6 @@ zebra_client_read (struct thread *thread) case ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB: zread_ipv4_nexthop_lookup_mrib (client, length, zvrf); break; - case ZEBRA_IPV4_IMPORT_LOOKUP: - zread_ipv4_import_lookup (client, length, zvrf); - break; case ZEBRA_HELLO: zread_hello (client); break; -- 2.39.5