]> git.puffer.fish Git - matthieu/frr.git/commitdiff
doc, lib, zebra: Remove deprecated encode and decode functionality
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 24 Aug 2018 14:56:15 +0000 (10:56 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 24 Aug 2018 14:56:15 +0000 (10:56 -0400)
The ZEBRA_IPV4_ROUTE_[ADD|DELETE] and ZEBRA_IPV6_ROUTE_[ADD|DELETE] functionality
has been deprecated for a year now, let's remove this code from the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
doc/developer/zebra.rst
lib/log.c
lib/zclient.c
lib/zclient.h
zebra/zapi_msg.c

index 3d64b671155067cf3abe8d9750fc77c0fd968c70..1bf31e96244f5c4c893f398875b98b021813c770 100644 (file)
@@ -102,14 +102,6 @@ Zebra Protocol Commands
 +-----------------------------------+-------+
 | ZEBRA_INTERFACE_DOWN              | 6     |
 +-----------------------------------+-------+
-| ZEBRA_IPV4_ROUTE_ADD              | 7     |
-+-----------------------------------+-------+
-| ZEBRA_IPV4_ROUTE_DELETE           | 8     |
-+-----------------------------------+-------+
-| ZEBRA_IPV6_ROUTE_ADD              | 9     |
-+-----------------------------------+-------+
-| ZEBRA_IPV6_ROUTE_DELETE           | 10    |
-+-----------------------------------+-------+
 | ZEBRA_REDISTRIBUTE_ADD            | 11    |
 +-----------------------------------+-------+
 | ZEBRA_REDISTRIBUTE_DELETE         | 12    |
index 361521f56823335f749f3aa059ed62efedb8939e..b067018e08de3bdef4b33f9b2b635a3fc0b3833f 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -908,10 +908,6 @@ static const struct zebra_desc_table command_types[] = {
        DESC_ENTRY(ZEBRA_ROUTE_ADD),
        DESC_ENTRY(ZEBRA_ROUTE_DELETE),
        DESC_ENTRY(ZEBRA_ROUTE_NOTIFY_OWNER),
-       DESC_ENTRY(ZEBRA_IPV4_ROUTE_ADD),
-       DESC_ENTRY(ZEBRA_IPV4_ROUTE_DELETE),
-       DESC_ENTRY(ZEBRA_IPV6_ROUTE_ADD),
-       DESC_ENTRY(ZEBRA_IPV6_ROUTE_DELETE),
        DESC_ENTRY(ZEBRA_REDISTRIBUTE_ADD),
        DESC_ENTRY(ZEBRA_REDISTRIBUTE_DELETE),
        DESC_ENTRY(ZEBRA_REDISTRIBUTE_DEFAULT_ADD),
index cc91705ee227c8fd1565328cf050b230e635895a..b2bafcb7d8f831e2c5f8a69037b331cde2ae2a51 100644 (file)
@@ -676,11 +676,11 @@ int zclient_send_rnh(struct zclient *zclient, int command, struct prefix *p,
  * "xdr_encode"-like interface that allows daemon (client) to send
  * a message to zebra server for a route that needs to be
  * added/deleted to the kernel. Info about the route is specified
- * by the caller in a struct zapi_ipv4. zapi_ipv4_read() then writes
+ * by the caller in a struct zapi_route. zapi_route_encode() then writes
  * the info down the zclient socket using the stream_* functions.
  *
  * The corresponding read ("xdr_decode") function on the server
- * side is zread_ipv4_add()/zread_ipv4_delete().
+ * side is zapi_route_decode().
  *
  *  0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -707,21 +707,16 @@ int zclient_send_rnh(struct zclient *zclient, int command, struct prefix *p,
  * is set to 1 and a nexthop of type NEXTHOP_TYPE_BLACKHOLE is the sole
  * nexthop.
  *
- * The original struct zapi_ipv4, zapi_ipv4_route() and zread_ipv4_*()
- * infrastructure was built around the traditional (32-bit "gate OR
- * ifindex") nexthop data unit. A special encoding can be used to feed
- * onlink (64-bit "gate AND ifindex") nexthops into zapi_ipv4_route()
- * using the same zapi_ipv4 structure. This is done by setting zapi_ipv4
- * fields as follows:
+ * The original struct zapi_route_*() infrastructure was built around
+ * the traditional (32-bit "gate OR ifindex") nexthop data unit.
+ * A special encoding can be used to feed onlink (64-bit "gate AND ifindex")
+ * nexthops into zapi_route_encode() using the same zapi_route structure.
+ * This is done by setting zapi_route fields as follows:
  *  - .message |= ZAPI_MESSAGE_NEXTHOP | ZAPI_MESSAGE_ONLINK
  *  - .nexthop_num == .ifindex_num
  *  - .nexthop and .ifindex are filled with gate and ifindex parts of
  *    each compound nexthop, both in the same order
  *
- * zapi_ipv4_route() will produce two nexthop data units for each such
- * interleaved 64-bit nexthop. On the zserv side of the socket it will be
- * mapped to a singlle NEXTHOP_TYPE_IPV4_IFINDEX_OL RIB nexthop structure.
- *
  * If ZAPI_MESSAGE_DISTANCE is set, the distance value is written as a 1
  * byte value.
  *
@@ -734,226 +729,6 @@ int zclient_send_rnh(struct zclient *zclient, int command, struct prefix *p,
  *
  * XXX: No attention paid to alignment.
  */
-int zapi_ipv4_route(uint8_t cmd, struct zclient *zclient, struct prefix_ipv4 *p,
-                   struct zapi_ipv4 *api)
-{
-       int i;
-       int psize;
-       struct stream *s;
-
-       /* Reset stream. */
-       s = zclient->obuf;
-       stream_reset(s);
-
-       /* Some checks for labeled-unicast. The current expectation is that each
-        * nexthop is accompanied by a label in the case of labeled-unicast.
-        */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL)
-           && CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               /* We expect prefixes installed with labels and the number to
-                * match
-                * the number of nexthops.
-                */
-               assert(api->label_num == api->nexthop_num);
-       }
-
-       zclient_create_header(s, cmd, api->vrf_id);
-
-       /* Put type and nexthop. */
-       stream_putc(s, api->type);
-       stream_putw(s, api->instance);
-       stream_putl(s, api->flags);
-       stream_putc(s, api->message);
-       stream_putw(s, api->safi);
-
-       /* Put prefix information. */
-       psize = PSIZE(p->prefixlen);
-       stream_putc(s, p->prefixlen);
-       stream_write(s, (uint8_t *)&p->prefix, psize);
-
-       /* Nexthop, ifindex, distance and metric information. */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               stream_putc(s, api->nexthop_num + api->ifindex_num);
-
-               for (i = 0; i < api->nexthop_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IPV4);
-                       stream_put_in_addr(s, api->nexthop[i]);
-                       /* For labeled-unicast, each nexthop is followed by
-                        * label. */
-                       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL))
-                               stream_putl(s, api->label[i]);
-               }
-               for (i = 0; i < api->ifindex_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IFINDEX);
-                       stream_putl(s, api->ifindex[i]);
-               }
-       }
-
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_DISTANCE))
-               stream_putc(s, api->distance);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_METRIC))
-               stream_putl(s, api->metric);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TAG))
-               stream_putl(s, api->tag);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
-               stream_putl(s, api->mtu);
-
-       /* Put length at the first point of the stream. */
-       stream_putw_at(s, 0, stream_get_endp(s));
-
-       return zclient_send_message(zclient);
-}
-
-int zapi_ipv4_route_ipv6_nexthop(uint8_t cmd, struct zclient *zclient,
-                                struct prefix_ipv4 *p, struct zapi_ipv6 *api)
-{
-       int i;
-       int psize;
-       struct stream *s;
-
-       /* Reset stream. */
-       s = zclient->obuf;
-       stream_reset(s);
-
-       /* Some checks for labeled-unicast. The current expectation is that each
-        * nexthop is accompanied by a label in the case of labeled-unicast.
-        */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL)
-           && CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               /* We expect prefixes installed with labels and the number to
-                * match
-                * the number of nexthops.
-                */
-               assert(api->label_num == api->nexthop_num);
-       }
-
-       zclient_create_header(s, cmd, api->vrf_id);
-
-       /* Put type and nexthop. */
-       stream_putc(s, api->type);
-       stream_putw(s, api->instance);
-       stream_putl(s, api->flags);
-       stream_putc(s, api->message);
-       stream_putw(s, api->safi);
-
-       /* Put prefix information. */
-       psize = PSIZE(p->prefixlen);
-       stream_putc(s, p->prefixlen);
-       stream_write(s, (uint8_t *)&p->prefix, psize);
-
-       /* Nexthop, ifindex, distance and metric information. */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               stream_putc(s, api->nexthop_num + api->ifindex_num);
-
-               for (i = 0; i < api->nexthop_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IPV6);
-                       stream_write(s, (uint8_t *)api->nexthop[i], 16);
-                       /* For labeled-unicast, each nexthop is followed by
-                        * label. */
-                       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL))
-                               stream_putl(s, api->label[i]);
-               }
-               for (i = 0; i < api->ifindex_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IFINDEX);
-                       stream_putl(s, api->ifindex[i]);
-               }
-       }
-
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_DISTANCE))
-               stream_putc(s, api->distance);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_METRIC))
-               stream_putl(s, api->metric);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TAG))
-               stream_putl(s, api->tag);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
-               stream_putl(s, api->mtu);
-
-       /* Put length at the first point of the stream. */
-       stream_putw_at(s, 0, stream_get_endp(s));
-
-       return zclient_send_message(zclient);
-}
-
-int zapi_ipv6_route(uint8_t cmd, struct zclient *zclient, struct prefix_ipv6 *p,
-                   struct prefix_ipv6 *src_p, struct zapi_ipv6 *api)
-{
-       int i;
-       int psize;
-       struct stream *s;
-
-       /* either we have !SRCPFX && src_p == NULL, or SRCPFX && src_p != NULL
-        */
-       assert(!(api->message & ZAPI_MESSAGE_SRCPFX) == !src_p);
-
-       /* Reset stream. */
-       s = zclient->obuf;
-       stream_reset(s);
-
-       /* Some checks for labeled-unicast. The current expectation is that each
-        * nexthop is accompanied by a label in the case of labeled-unicast.
-        */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL)
-           && CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               /* We expect prefixes installed with labels and the number to
-                * match
-                * the number of nexthops.
-                */
-               assert(api->label_num == api->nexthop_num);
-       }
-
-       zclient_create_header(s, cmd, api->vrf_id);
-
-       /* Put type and nexthop. */
-       stream_putc(s, api->type);
-       stream_putw(s, api->instance);
-       stream_putl(s, api->flags);
-       stream_putc(s, api->message);
-       stream_putw(s, api->safi);
-
-       /* Put prefix information. */
-       psize = PSIZE(p->prefixlen);
-       stream_putc(s, p->prefixlen);
-       stream_write(s, (uint8_t *)&p->prefix, psize);
-
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_SRCPFX)) {
-               psize = PSIZE(src_p->prefixlen);
-               stream_putc(s, src_p->prefixlen);
-               stream_write(s, (uint8_t *)&src_p->prefix, psize);
-       }
-
-       /* Nexthop, ifindex, distance and metric information. */
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) {
-               stream_putc(s, api->nexthop_num + api->ifindex_num);
-
-               for (i = 0; i < api->nexthop_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IPV6);
-                       stream_write(s, (uint8_t *)api->nexthop[i], 16);
-                       /* For labeled-unicast, each nexthop is followed by
-                        * label. */
-                       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_LABEL))
-                               stream_putl(s, api->label[i]);
-               }
-               for (i = 0; i < api->ifindex_num; i++) {
-                       stream_putc(s, NEXTHOP_TYPE_IFINDEX);
-                       stream_putl(s, api->ifindex[i]);
-               }
-       }
-
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_DISTANCE))
-               stream_putc(s, api->distance);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_METRIC))
-               stream_putl(s, api->metric);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TAG))
-               stream_putl(s, api->tag);
-       if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
-               stream_putl(s, api->mtu);
-
-       /* Put length at the first point of the stream. */
-       stream_putw_at(s, 0, stream_get_endp(s));
-
-       return zclient_send_message(zclient);
-}
-
 int zclient_route_send(uint8_t cmd, struct zclient *zclient,
                       struct zapi_route *api)
 {
index 962b1707c948c9ebc6ff79533c4239dffca73d3d..b8ff85e80ff584f954f990abcc695d0d15d45c70 100644 (file)
@@ -73,10 +73,6 @@ typedef enum {
        ZEBRA_ROUTE_ADD,
        ZEBRA_ROUTE_DELETE,
        ZEBRA_ROUTE_NOTIFY_OWNER,
-       ZEBRA_IPV4_ROUTE_ADD,
-       ZEBRA_IPV4_ROUTE_DELETE,
-       ZEBRA_IPV6_ROUTE_ADD,
-       ZEBRA_IPV6_ROUTE_DELETE,
        ZEBRA_REDISTRIBUTE_ADD,
        ZEBRA_REDISTRIBUTE_DELETE,
        ZEBRA_REDISTRIBUTE_DEFAULT_ADD,
@@ -286,7 +282,7 @@ struct zclient {
  */
 #define ZAPI_MESSAGE_TABLEID  0x80
 
-#define ZSERV_VERSION 5
+#define ZSERV_VERSION 6
 /* Zserv protocol message header */
 struct zmsghdr {
        uint16_t length;
@@ -353,37 +349,6 @@ struct zapi_route {
        uint32_t tableid;
 };
 
-/* Zebra IPv4 route message API. */
-struct zapi_ipv4 {
-       uint8_t type;
-       unsigned short instance;
-
-       uint32_t flags;
-
-       uint8_t message;
-
-       safi_t safi;
-
-       uint8_t nexthop_num;
-       struct in_addr **nexthop;
-
-       uint8_t ifindex_num;
-       ifindex_t *ifindex;
-
-       uint8_t label_num;
-       unsigned int *label;
-
-       uint8_t distance;
-
-       uint32_t metric;
-
-       route_tag_t tag;
-
-       uint32_t mtu;
-
-       vrf_id_t vrf_id;
-};
-
 struct zapi_pw {
        char ifname[IF_NAMESIZE];
        ifindex_t ifindex;
@@ -600,15 +565,6 @@ extern struct interface *zebra_interface_vrf_update_read(struct stream *s,
 extern void zebra_interface_if_set_value(struct stream *, struct interface *);
 extern void zebra_router_id_update_read(struct stream *s, struct prefix *rid);
 
-/* clang-format off */
-#if CONFDATE > 20180823
-CPP_NOTICE("zapi_ipv4_route, zapi_ipv6_route, zapi_ipv4_route_ipv6_nexthop as well as the zapi_ipv4 and zapi_ipv6 data structures should be removed now");
-#endif
-/* clang-format on */
-
-extern int zapi_ipv4_route(uint8_t, struct zclient *, struct prefix_ipv4 *,
-                          struct zapi_ipv4 *) __attribute__((deprecated));
-
 extern struct interface *zebra_interface_link_params_read(struct stream *);
 extern size_t zebra_interface_link_params_write(struct stream *,
                                                struct interface *);
@@ -635,45 +591,6 @@ extern void zebra_read_pw_status_update(int command, struct zclient *zclient,
                                        zebra_size_t length, vrf_id_t vrf_id,
                                        struct zapi_pw_status *pw);
 
-/* IPv6 prefix add and delete function prototype. */
-
-struct zapi_ipv6 {
-       uint8_t type;
-       unsigned short instance;
-
-       uint32_t flags;
-
-       uint8_t message;
-
-       safi_t safi;
-
-       uint8_t nexthop_num;
-       struct in6_addr **nexthop;
-
-       uint8_t ifindex_num;
-       ifindex_t *ifindex;
-
-       uint8_t label_num;
-       unsigned int *label;
-
-       uint8_t distance;
-
-       uint32_t metric;
-
-       route_tag_t tag;
-
-       uint32_t mtu;
-
-       vrf_id_t vrf_id;
-};
-
-extern int zapi_ipv6_route(uint8_t cmd, struct zclient *zclient,
-                          struct prefix_ipv6 *p, struct prefix_ipv6 *src_p,
-                          struct zapi_ipv6 *api) __attribute__((deprecated));
-extern int zapi_ipv4_route_ipv6_nexthop(uint8_t, struct zclient *,
-                                       struct prefix_ipv4 *,
-                                       struct zapi_ipv6 *)
-       __attribute__((deprecated));
 extern int zclient_route_send(uint8_t, struct zclient *, struct zapi_route *);
 extern int zclient_send_rnh(struct zclient *zclient, int command,
                            struct prefix *p, bool exact_match,
index 008fc8f066c4554afe4c4aa4f843d947b70ec7e7..6990fd95f522e38b42ccb0949787dae9dfdf2e27 100644 (file)
@@ -1584,202 +1584,6 @@ static void zread_route_del(ZAPI_HANDLER_ARGS)
        }
 }
 
-/* This function support multiple nexthop. */
-/*
- * Parse the ZEBRA_IPV4_ROUTE_ADD sent from client. Update re and
- * add kernel route.
- */
-static void zread_ipv4_add(ZAPI_HANDLER_ARGS)
-{
-       int i;
-       struct route_entry *re;
-       struct prefix p;
-       uint8_t message;
-       struct in_addr nhop_addr;
-       uint8_t nexthop_num;
-       uint8_t nexthop_type;
-       struct stream *s;
-       ifindex_t ifindex;
-       safi_t safi;
-       int ret;
-       enum lsp_types_t label_type = ZEBRA_LSP_NONE;
-       mpls_label_t label;
-       struct nexthop *nexthop;
-       enum blackhole_type bh_type = BLACKHOLE_NULL;
-
-       /* Get input stream.  */
-       s = msg;
-
-       /* Allocate new re. */
-       re = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
-
-       /* Type, flags, message. */
-       STREAM_GETC(s, re->type);
-       if (re->type > ZEBRA_ROUTE_MAX) {
-               zlog_warn("%s: Specified route type %d is not a legal value\n",
-                         __PRETTY_FUNCTION__, re->type);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GETW(s, re->instance);
-       STREAM_GETL(s, re->flags);
-       STREAM_GETC(s, message);
-       STREAM_GETW(s, safi);
-       re->uptime = time(NULL);
-
-       /* IPv4 prefix. */
-       memset(&p, 0, sizeof(struct prefix_ipv4));
-       p.family = AF_INET;
-       STREAM_GETC(s, p.prefixlen);
-       if (p.prefixlen > IPV4_MAX_BITLEN) {
-               zlog_warn(
-                       "%s: Specified prefix length %d is greater than what v4 can be",
-                       __PRETTY_FUNCTION__, p.prefixlen);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
-
-       /* VRF ID */
-       re->vrf_id = zvrf_id(zvrf);
-
-       /* Nexthop parse. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_NEXTHOP)) {
-               STREAM_GETC(s, nexthop_num);
-               zserv_nexthop_num_warn(__func__, (const struct prefix *)&p,
-                                      nexthop_num);
-
-               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL))
-                       label_type = lsp_type_from_re_type(client->proto);
-
-               for (i = 0; i < nexthop_num; i++) {
-                       STREAM_GETC(s, nexthop_type);
-
-                       switch (nexthop_type) {
-                       case NEXTHOP_TYPE_IFINDEX:
-                               STREAM_GETL(s, ifindex);
-                               route_entry_nexthop_ifindex_add(re, ifindex,
-                                                               re->vrf_id);
-                               break;
-                       case NEXTHOP_TYPE_IPV4:
-                               STREAM_GET(&nhop_addr.s_addr, s,
-                                          IPV4_MAX_BYTELEN);
-                               nexthop = route_entry_nexthop_ipv4_add(
-                                       re, &nhop_addr, NULL, re->vrf_id);
-                               /*
-                                * For labeled-unicast, each nexthop is followed
-                                * by the label.
-                                */
-                               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL)) {
-                                       STREAM_GETL(s, label);
-                                       nexthop_add_labels(nexthop, label_type,
-                                                          1, &label);
-                               }
-                               break;
-                       case NEXTHOP_TYPE_IPV4_IFINDEX:
-                               STREAM_GET(&nhop_addr.s_addr, s,
-                                          IPV4_MAX_BYTELEN);
-                               STREAM_GETL(s, ifindex);
-                               route_entry_nexthop_ipv4_ifindex_add(
-                                       re, &nhop_addr, NULL, ifindex,
-                                       re->vrf_id);
-                               break;
-                       case NEXTHOP_TYPE_IPV6:
-                               zlog_warn(
-                                       "%s: Please use ZEBRA_ROUTE_ADD if you want to pass v6 nexthops",
-                                       __PRETTY_FUNCTION__);
-                               nexthops_free(re->ng.nexthop);
-                               XFREE(MTYPE_RE, re);
-                               return;
-                       case NEXTHOP_TYPE_BLACKHOLE:
-                               route_entry_nexthop_blackhole_add(re, bh_type);
-                               break;
-                       default:
-                               zlog_warn(
-                                       "%s: Specified nexthop type: %d does not exist",
-                                       __PRETTY_FUNCTION__, nexthop_type);
-                               nexthops_free(re->ng.nexthop);
-                               XFREE(MTYPE_RE, re);
-                               return;
-                       }
-               }
-       }
-
-       /* Distance. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_DISTANCE))
-               STREAM_GETC(s, re->distance);
-
-       /* Metric. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_METRIC))
-               STREAM_GETL(s, re->metric);
-
-       /* Tag */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_TAG))
-               STREAM_GETL(s, re->tag);
-       else
-               re->tag = 0;
-
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_MTU))
-               STREAM_GETL(s, re->mtu);
-       else
-               re->mtu = 0;
-
-       /* Table */
-       re->table = zvrf->table_id;
-
-       ret = rib_add_multipath(AFI_IP, safi, &p, NULL, re);
-
-       /* Stats */
-       if (ret > 0)
-               client->v4_route_add_cnt++;
-       else if (ret < 0)
-               client->v4_route_upd8_cnt++;
-
-       return;
-
-stream_failure:
-       nexthops_free(re->ng.nexthop);
-       XFREE(MTYPE_RE, re);
-}
-
-/* Zebra server IPv4 prefix delete function. */
-static void zread_ipv4_delete(ZAPI_HANDLER_ARGS)
-{
-       struct stream *s;
-       struct zapi_ipv4 api;
-       struct prefix p;
-       uint32_t table_id;
-
-       s = msg;
-
-       /* Type, flags, message. */
-       STREAM_GETC(s, api.type);
-       STREAM_GETW(s, api.instance);
-       STREAM_GETL(s, api.flags);
-       STREAM_GETC(s, api.message);
-       STREAM_GETW(s, api.safi);
-
-       /* IPv4 prefix. */
-       memset(&p, 0, sizeof(struct prefix));
-       p.family = AF_INET;
-       STREAM_GETC(s, p.prefixlen);
-       if (p.prefixlen > IPV4_MAX_BITLEN) {
-               zlog_warn("%s: Passed in prefixlen %d is impossible",
-                         __PRETTY_FUNCTION__, p.prefixlen);
-               return;
-       }
-       STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
-
-       table_id = zvrf->table_id;
-
-       rib_delete(AFI_IP, api.safi, zvrf_id(zvrf), api.type, api.instance,
-                  api.flags, &p, NULL, NULL, table_id, 0, 0, false);
-       client->v4_route_del_cnt++;
-
-stream_failure:
-       return;
-}
-
 /* MRIB Nexthop lookup for IPv4. */
 static void zread_ipv4_nexthop_lookup_mrib(ZAPI_HANDLER_ARGS)
 {
@@ -1794,417 +1598,6 @@ stream_failure:
        return;
 }
 
-/* Zebra server IPv6 prefix add function. */
-static void zread_ipv4_route_ipv6_nexthop_add(ZAPI_HANDLER_ARGS)
-{
-       unsigned int i;
-       struct stream *s;
-       struct in6_addr nhop_addr;
-       struct route_entry *re;
-       uint8_t message;
-       uint8_t nexthop_num;
-       uint8_t nexthop_type;
-       struct prefix p;
-       safi_t safi;
-       static struct in6_addr nexthops[MULTIPATH_NUM];
-       static unsigned int ifindices[MULTIPATH_NUM];
-       int ret;
-       static mpls_label_t labels[MULTIPATH_NUM];
-       enum lsp_types_t label_type = ZEBRA_LSP_NONE;
-       mpls_label_t label;
-       struct nexthop *nexthop;
-       enum blackhole_type bh_type = BLACKHOLE_NULL;
-
-       /* Get input stream.  */
-       s = msg;
-
-       memset(&nhop_addr, 0, sizeof(struct in6_addr));
-
-       /* Allocate new re. */
-       re = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
-
-       /* Type, flags, message. */
-       STREAM_GETC(s, re->type);
-       if (re->type > ZEBRA_ROUTE_MAX) {
-               zlog_warn("%s: Specified route type: %d is not a legal value\n",
-                         __PRETTY_FUNCTION__, re->type);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GETW(s, re->instance);
-       STREAM_GETL(s, re->flags);
-       STREAM_GETC(s, message);
-       STREAM_GETW(s, safi);
-       re->uptime = time(NULL);
-
-       /* IPv4 prefix. */
-       memset(&p, 0, sizeof(struct prefix_ipv4));
-       p.family = AF_INET;
-       STREAM_GETC(s, p.prefixlen);
-       if (p.prefixlen > IPV4_MAX_BITLEN) {
-               zlog_warn(
-                       "%s: Prefix Length %d is greater than what a v4 address can use",
-                       __PRETTY_FUNCTION__, p.prefixlen);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
-
-       /* VRF ID */
-       re->vrf_id = zvrf_id(zvrf);
-
-       /*
-        * We need to give nh-addr, nh-ifindex with the same next-hop object
-        * to the re to ensure that IPv6 multipathing works; need to coalesce
-        * these. Clients should send the same number of paired set of
-        * next-hop-addr/next-hop-ifindices.
-        */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_NEXTHOP)) {
-               unsigned int nh_count = 0;
-               unsigned int if_count = 0;
-               unsigned int max_nh_if = 0;
-
-               STREAM_GETC(s, nexthop_num);
-               zserv_nexthop_num_warn(__func__, (const struct prefix *)&p,
-                                      nexthop_num);
-
-               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL))
-                       label_type = lsp_type_from_re_type(client->proto);
-
-               for (i = 0; i < nexthop_num; i++) {
-                       STREAM_GETC(s, nexthop_type);
-
-                       switch (nexthop_type) {
-                       case NEXTHOP_TYPE_IPV6:
-                               STREAM_GET(&nhop_addr, s, 16);
-                               if (nh_count < MULTIPATH_NUM) {
-                                       /*
-                                        * For labeled-unicast, each nexthop is
-                                        * followed by the label.
-                                        */
-                                       if (CHECK_FLAG(message,
-                                                      ZAPI_MESSAGE_LABEL)) {
-                                               STREAM_GETL(s, label);
-                                               labels[nh_count] = label;
-                                       }
-                                       nexthops[nh_count] = nhop_addr;
-                                       nh_count++;
-                               }
-                               break;
-                       case NEXTHOP_TYPE_IFINDEX:
-                               if (if_count < multipath_num)
-                                       STREAM_GETL(s, ifindices[if_count++]);
-                               break;
-                       case NEXTHOP_TYPE_BLACKHOLE:
-                               route_entry_nexthop_blackhole_add(re, bh_type);
-                               break;
-                       default:
-                               zlog_warn(
-                                       "%s: Please use ZEBRA_ROUTE_ADD if you want to pass non v6 nexthops",
-                                       __PRETTY_FUNCTION__);
-                               nexthops_free(re->ng.nexthop);
-                               XFREE(MTYPE_RE, re);
-                               return;
-                       }
-               }
-
-               max_nh_if = (nh_count > if_count) ? nh_count : if_count;
-               for (i = 0; i < max_nh_if; i++) {
-                       if ((i < nh_count)
-                           && !IN6_IS_ADDR_UNSPECIFIED(&nexthops[i])) {
-                               if ((i < if_count) && ifindices[i])
-                                       nexthop =
-                                               route_entry_nexthop_ipv6_ifindex_add(
-                                                       re, &nexthops[i],
-                                                       ifindices[i],
-                                                       re->vrf_id);
-                               else
-                                       nexthop = route_entry_nexthop_ipv6_add(
-                                               re, &nexthops[i], re->vrf_id);
-
-                               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL))
-                                       nexthop_add_labels(nexthop, label_type,
-                                                          1, &labels[i]);
-                       } else {
-                               if ((i < if_count) && ifindices[i])
-                                       route_entry_nexthop_ifindex_add(
-                                               re, ifindices[i], re->vrf_id);
-                       }
-               }
-       }
-
-       /* Distance. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_DISTANCE))
-               STREAM_GETC(s, re->distance);
-
-       /* Metric. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_METRIC))
-               STREAM_GETL(s, re->metric);
-
-       /* Tag */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_TAG))
-               STREAM_GETL(s, re->tag);
-       else
-               re->tag = 0;
-
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_MTU))
-               STREAM_GETL(s, re->mtu);
-       else
-               re->mtu = 0;
-
-       /* Table */
-       re->table = zvrf->table_id;
-
-       ret = rib_add_multipath(AFI_IP6, safi, &p, NULL, re);
-       /* Stats */
-       if (ret > 0)
-               client->v4_route_add_cnt++;
-       else if (ret < 0)
-               client->v4_route_upd8_cnt++;
-
-       return;
-
-stream_failure:
-       nexthops_free(re->ng.nexthop);
-       XFREE(MTYPE_RE, re);
-}
-
-static void zread_ipv6_add(ZAPI_HANDLER_ARGS)
-{
-       unsigned int i;
-       struct stream *s;
-       struct in6_addr nhop_addr;
-       ifindex_t ifindex;
-       struct route_entry *re;
-       uint8_t message;
-       uint8_t nexthop_num;
-       uint8_t nexthop_type;
-       struct prefix p;
-       struct prefix_ipv6 src_p, *src_pp;
-       safi_t safi;
-       static struct in6_addr nexthops[MULTIPATH_NUM];
-       static unsigned int ifindices[MULTIPATH_NUM];
-       int ret;
-       static mpls_label_t labels[MULTIPATH_NUM];
-       enum lsp_types_t label_type = ZEBRA_LSP_NONE;
-       mpls_label_t label;
-       struct nexthop *nexthop;
-       enum blackhole_type bh_type = BLACKHOLE_NULL;
-
-       /* Get input stream.  */
-       s = msg;
-
-       memset(&nhop_addr, 0, sizeof(struct in6_addr));
-
-       /* Allocate new re. */
-       re = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
-
-       /* Type, flags, message. */
-       STREAM_GETC(s, re->type);
-       if (re->type > ZEBRA_ROUTE_MAX) {
-               zlog_warn("%s: Specified route type: %d is not a legal value\n",
-                         __PRETTY_FUNCTION__, re->type);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GETW(s, re->instance);
-       STREAM_GETL(s, re->flags);
-       STREAM_GETC(s, message);
-       STREAM_GETW(s, safi);
-       re->uptime = time(NULL);
-
-       /* IPv6 prefix. */
-       memset(&p, 0, sizeof(p));
-       p.family = AF_INET6;
-       STREAM_GETC(s, p.prefixlen);
-       if (p.prefixlen > IPV6_MAX_BITLEN) {
-               zlog_warn(
-                       "%s: Specified prefix length %d is to large for v6 prefix",
-                       __PRETTY_FUNCTION__, p.prefixlen);
-               XFREE(MTYPE_RE, re);
-               return;
-       }
-       STREAM_GET(&p.u.prefix6, s, PSIZE(p.prefixlen));
-
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_SRCPFX)) {
-               memset(&src_p, 0, sizeof(src_p));
-               src_p.family = AF_INET6;
-               STREAM_GETC(s, src_p.prefixlen);
-               if (src_p.prefixlen > IPV6_MAX_BITLEN) {
-                       zlog_warn(
-                               "%s: Specified src prefix length %d is to large for v6 prefix",
-                               __PRETTY_FUNCTION__, src_p.prefixlen);
-                       XFREE(MTYPE_RE, re);
-                       return;
-               }
-               STREAM_GET(&src_p.prefix, s, PSIZE(src_p.prefixlen));
-               src_pp = &src_p;
-       } else
-               src_pp = NULL;
-
-       /* VRF ID */
-       re->vrf_id = zvrf_id(zvrf);
-
-       /*
-        * We need to give nh-addr, nh-ifindex with the same next-hop object
-        * to the re to ensure that IPv6 multipathing works; need to coalesce
-        * these. Clients should send the same number of paired set of
-        * next-hop-addr/next-hop-ifindices.
-        */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_NEXTHOP)) {
-               unsigned int nh_count = 0;
-               unsigned int if_count = 0;
-               unsigned int max_nh_if = 0;
-
-               STREAM_GETC(s, nexthop_num);
-               zserv_nexthop_num_warn(__func__, (const struct prefix *)&p,
-                                      nexthop_num);
-
-               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL))
-                       label_type = lsp_type_from_re_type(client->proto);
-
-               for (i = 0; i < nexthop_num; i++) {
-                       STREAM_GETC(s, nexthop_type);
-
-                       switch (nexthop_type) {
-                       case NEXTHOP_TYPE_IPV6:
-                               STREAM_GET(&nhop_addr, s, 16);
-                               if (nh_count < MULTIPATH_NUM) {
-                                       /*
-                                        * For labeled-unicast, each nexthop is
-                                        * followed by label.
-                                        */
-                                       if (CHECK_FLAG(message,
-                                                      ZAPI_MESSAGE_LABEL)) {
-                                               STREAM_GETL(s, label);
-                                               labels[nh_count] = label;
-                                       }
-                                       nexthops[nh_count++] = nhop_addr;
-                               }
-                               break;
-                       case NEXTHOP_TYPE_IPV6_IFINDEX:
-                               STREAM_GET(&nhop_addr, s, 16);
-                               STREAM_GETL(s, ifindex);
-                               route_entry_nexthop_ipv6_ifindex_add(
-                                       re, &nhop_addr, ifindex, re->vrf_id);
-                               break;
-                       case NEXTHOP_TYPE_IFINDEX:
-                               if (if_count < multipath_num)
-                                       STREAM_GETL(s, ifindices[if_count++]);
-                               break;
-                       case NEXTHOP_TYPE_BLACKHOLE:
-                               route_entry_nexthop_blackhole_add(re, bh_type);
-                               break;
-                       default:
-                               zlog_warn(
-                                       "%s: Please use ZEBRA_ROUTE_ADD if you want to pass non v6 nexthops",
-                                       __PRETTY_FUNCTION__);
-                               nexthops_free(re->ng.nexthop);
-                               XFREE(MTYPE_RE, re);
-                               return;
-                       }
-               }
-
-               max_nh_if = (nh_count > if_count) ? nh_count : if_count;
-               for (i = 0; i < max_nh_if; i++) {
-                       if ((i < nh_count)
-                           && !IN6_IS_ADDR_UNSPECIFIED(&nexthops[i])) {
-                               if ((i < if_count) && ifindices[i])
-                                       nexthop =
-                                               route_entry_nexthop_ipv6_ifindex_add(
-                                                       re, &nexthops[i],
-                                                       ifindices[i],
-                                                       re->vrf_id);
-                               else
-                                       nexthop = route_entry_nexthop_ipv6_add(
-                                               re, &nexthops[i], re->vrf_id);
-                               if (CHECK_FLAG(message, ZAPI_MESSAGE_LABEL))
-                                       nexthop_add_labels(nexthop, label_type,
-                                                          1, &labels[i]);
-                       } else {
-                               if ((i < if_count) && ifindices[i])
-                                       route_entry_nexthop_ifindex_add(
-                                               re, ifindices[i], re->vrf_id);
-                       }
-               }
-       }
-
-       /* Distance. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_DISTANCE))
-               STREAM_GETC(s, re->distance);
-
-       /* Metric. */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_METRIC))
-               STREAM_GETL(s, re->metric);
-
-       /* Tag */
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_TAG))
-               STREAM_GETL(s, re->tag);
-       else
-               re->tag = 0;
-
-       if (CHECK_FLAG(message, ZAPI_MESSAGE_MTU))
-               STREAM_GETL(s, re->mtu);
-       else
-               re->mtu = 0;
-
-       re->table = zvrf->table_id;
-
-       ret = rib_add_multipath(AFI_IP6, safi, &p, src_pp, re);
-       /* Stats */
-       if (ret > 0)
-               client->v6_route_add_cnt++;
-       else if (ret < 0)
-               client->v6_route_upd8_cnt++;
-
-       return;
-
-stream_failure:
-       nexthops_free(re->ng.nexthop);
-       XFREE(MTYPE_RE, re);
-}
-
-/* Zebra server IPv6 prefix delete function. */
-static void zread_ipv6_delete(ZAPI_HANDLER_ARGS)
-{
-       struct stream *s;
-       struct zapi_ipv6 api;
-       struct prefix p;
-       struct prefix_ipv6 src_p, *src_pp;
-
-       s = msg;
-
-       /* Type, flags, message. */
-       STREAM_GETC(s, api.type);
-       STREAM_GETW(s, api.instance);
-       STREAM_GETL(s, api.flags);
-       STREAM_GETC(s, api.message);
-       STREAM_GETW(s, api.safi);
-
-       /* IPv4 prefix. */
-       memset(&p, 0, sizeof(struct prefix));
-       p.family = AF_INET6;
-       STREAM_GETC(s, p.prefixlen);
-       STREAM_GET(&p.u.prefix6, s, PSIZE(p.prefixlen));
-
-       if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {
-               memset(&src_p, 0, sizeof(struct prefix_ipv6));
-               src_p.family = AF_INET6;
-               STREAM_GETC(s, src_p.prefixlen);
-               STREAM_GET(&src_p.prefix, s, PSIZE(src_p.prefixlen));
-               src_pp = &src_p;
-       } else
-               src_pp = NULL;
-
-       rib_delete(AFI_IP6, api.safi, zvrf_id(zvrf), api.type, api.instance,
-                  api.flags, &p, src_pp, NULL, client->rtm_table, 0, 0, false);
-
-       client->v6_route_del_cnt++;
-
-stream_failure:
-       return;
-}
-
 /* Register zebra server router-id information.  Send current router-id */
 static void zread_router_id_add(ZAPI_HANDLER_ARGS)
 {
@@ -3011,11 +2404,6 @@ void (*zserv_handlers[])(ZAPI_HANDLER_ARGS) = {
        [ZEBRA_INTERFACE_DELETE] = zread_interface_delete,
        [ZEBRA_ROUTE_ADD] = zread_route_add,
        [ZEBRA_ROUTE_DELETE] = zread_route_del,
-       [ZEBRA_IPV4_ROUTE_ADD] = zread_ipv4_add,
-       [ZEBRA_IPV4_ROUTE_DELETE] = zread_ipv4_delete,
-       [ZEBRA_IPV4_ROUTE_IPV6_NEXTHOP_ADD] = zread_ipv4_route_ipv6_nexthop_add,
-       [ZEBRA_IPV6_ROUTE_ADD] = zread_ipv6_add,
-       [ZEBRA_IPV6_ROUTE_DELETE] = zread_ipv6_delete,
        [ZEBRA_REDISTRIBUTE_ADD] = zebra_redistribute_add,
        [ZEBRA_REDISTRIBUTE_DELETE] = zebra_redistribute_delete,
        [ZEBRA_REDISTRIBUTE_DEFAULT_ADD] = zebra_redistribute_default_add,