bgpd, lib, ospfd, pimd, zebra: Use nexthop_types_t

Use the 'enum nexthop_types_t' instead of
the zebra.h #defines.  And remove code from
zebra.h that does not belong there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-09-02 10:32:14 -04:00
parent 5b2c166731
commit 5b30316ea5
8 changed files with 64 additions and 72 deletions

View File

@ -397,25 +397,23 @@ bgp_parse_nexthop_update (int command, vrf_id_t vrf_id)
nexthop->type = stream_getc (s); nexthop->type = stream_getc (s);
switch (nexthop->type) switch (nexthop->type)
{ {
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s); nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
nexthop->ifindex = stream_getl (s); nexthop->ifindex = stream_getl (s);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s); nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
nexthop->ifindex = stream_getl (s); nexthop->ifindex = stream_getl (s);
break; break;
#ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6:
case ZEBRA_NEXTHOP_IPV6:
stream_get (&nexthop->gate.ipv6, s, 16); stream_get (&nexthop->gate.ipv6, s, 16);
break; break;
case ZEBRA_NEXTHOP_IPV6_IFINDEX: case NEXTHOP_TYPE_IPV6_IFINDEX:
stream_get (&nexthop->gate.ipv6, s, 16); stream_get (&nexthop->gate.ipv6, s, 16);
nexthop->ifindex = stream_getl (s); nexthop->ifindex = stream_getl (s);
break; break;
#endif
default: default:
/* do nothing */ /* do nothing */
break; break;

View File

@ -278,12 +278,12 @@ isis_zebra_route_add_ipv4 (struct prefix *prefix,
/* FIXME: can it be ? */ /* FIXME: can it be ? */
if (nexthop->ip.s_addr != INADDR_ANY) if (nexthop->ip.s_addr != INADDR_ANY)
{ {
stream_putc (stream, ZEBRA_NEXTHOP_IPV4); stream_putc (stream, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (stream, &nexthop->ip); stream_put_in_addr (stream, &nexthop->ip);
} }
else else
{ {
stream_putc (stream, ZEBRA_NEXTHOP_IFINDEX); stream_putc (stream, NEXTHOP_TYPE_IFINDEX);
stream_putl (stream, nexthop->ifindex); stream_putl (stream, nexthop->ifindex);
} }
} }

View File

@ -32,6 +32,7 @@
#include "zclient.h" #include "zclient.h"
#include "memory.h" #include "memory.h"
#include "table.h" #include "table.h"
#include "nexthop.h"
/* Zebra client events. */ /* Zebra client events. */
enum event {ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT}; enum event {ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT};
@ -746,7 +747,7 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p,
if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE)) if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
{ {
stream_putc (s, 1); stream_putc (s, 1);
stream_putc (s, ZEBRA_NEXTHOP_BLACKHOLE); stream_putc (s, NEXTHOP_TYPE_BLACKHOLE);
/* XXX assert(api->nexthop_num == 0); */ /* XXX assert(api->nexthop_num == 0); */
/* XXX assert(api->ifindex_num == 0); */ /* XXX assert(api->ifindex_num == 0); */
} }
@ -755,12 +756,12 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p,
for (i = 0; i < api->nexthop_num; i++) for (i = 0; i < api->nexthop_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4); stream_putc (s, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (s, api->nexthop[i]); stream_put_in_addr (s, api->nexthop[i]);
} }
for (i = 0; i < api->ifindex_num; i++) for (i = 0; i < api->ifindex_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
stream_putl (s, api->ifindex[i]); stream_putl (s, api->ifindex[i]);
} }
} }
@ -813,7 +814,7 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient,
if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE)) if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
{ {
stream_putc (s, 1); stream_putc (s, 1);
stream_putc (s, ZEBRA_NEXTHOP_BLACKHOLE); stream_putc (s, NEXTHOP_TYPE_BLACKHOLE);
/* XXX assert(api->nexthop_num == 0); */ /* XXX assert(api->nexthop_num == 0); */
/* XXX assert(api->ifindex_num == 0); */ /* XXX assert(api->ifindex_num == 0); */
} }
@ -822,12 +823,12 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient,
for (i = 0; i < api->nexthop_num; i++) for (i = 0; i < api->nexthop_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV6); stream_putc (s, NEXTHOP_TYPE_IPV6);
stream_write (s, (u_char *)api->nexthop[i], 16); stream_write (s, (u_char *)api->nexthop[i], 16);
} }
for (i = 0; i < api->ifindex_num; i++) for (i = 0; i < api->ifindex_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
stream_putl (s, api->ifindex[i]); stream_putl (s, api->ifindex[i]);
} }
} }
@ -879,7 +880,7 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p,
if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE)) if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
{ {
stream_putc (s, 1); stream_putc (s, 1);
stream_putc (s, ZEBRA_NEXTHOP_BLACKHOLE); stream_putc (s, NEXTHOP_TYPE_BLACKHOLE);
/* XXX assert(api->nexthop_num == 0); */ /* XXX assert(api->nexthop_num == 0); */
/* XXX assert(api->ifindex_num == 0); */ /* XXX assert(api->ifindex_num == 0); */
} }
@ -888,12 +889,12 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p,
for (i = 0; i < api->nexthop_num; i++) for (i = 0; i < api->nexthop_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV6); stream_putc (s, NEXTHOP_TYPE_IPV6);
stream_write (s, (u_char *)api->nexthop[i], 16); stream_write (s, (u_char *)api->nexthop[i], 16);
} }
for (i = 0; i < api->ifindex_num; i++) for (i = 0; i < api->ifindex_num; i++)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
stream_putl (s, api->ifindex[i]); stream_putl (s, api->ifindex[i]);
} }
} }

View File

@ -493,14 +493,6 @@ extern const char *zserv_command_string (unsigned int command);
#define ZEBRA_FLAG_REJECT 0x80 #define ZEBRA_FLAG_REJECT 0x80
#define ZEBRA_FLAG_SCOPE_LINK 0x100 #define ZEBRA_FLAG_SCOPE_LINK 0x100
/* Zebra nexthop flags. */
#define ZEBRA_NEXTHOP_IFINDEX 1
#define ZEBRA_NEXTHOP_IPV4 2
#define ZEBRA_NEXTHOP_IPV4_IFINDEX 3
#define ZEBRA_NEXTHOP_IPV6 4
#define ZEBRA_NEXTHOP_IPV6_IFINDEX 5
#define ZEBRA_NEXTHOP_BLACKHOLE 6
#ifndef INADDR_LOOPBACK #ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */ #define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
#endif #endif

View File

@ -35,6 +35,7 @@
#include "plist.h" #include "plist.h"
#include "log.h" #include "log.h"
#include "lib/bfd.h" #include "lib/bfd.h"
#include "nexthop.h"
#include "ospfd/ospfd.h" #include "ospfd/ospfd.h"
#include "ospfd/ospf_interface.h" #include "ospfd/ospf_interface.h"
@ -393,18 +394,18 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
(path->nexthop.s_addr != INADDR_ANY && (path->nexthop.s_addr != INADDR_ANY &&
path->ifindex != 0)) path->ifindex != 0))
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IPV4_IFINDEX);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
} }
else if (path->nexthop.s_addr != INADDR_ANY) else if (path->nexthop.s_addr != INADDR_ANY)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4); stream_putc (s, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
} }
else else
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
if (path->ifindex) if (path->ifindex)
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
else else
@ -414,18 +415,18 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
if (path->nexthop.s_addr != INADDR_ANY && if (path->nexthop.s_addr != INADDR_ANY &&
path->ifindex != 0) path->ifindex != 0)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IPV4_IFINDEX);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
} }
else if (path->nexthop.s_addr != INADDR_ANY) else if (path->nexthop.s_addr != INADDR_ANY)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4); stream_putc (s, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
} }
else else
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
if (path->ifindex) if (path->ifindex)
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
else else
@ -514,18 +515,18 @@ ospf_zebra_delete (struct prefix_ipv4 *p, struct ospf_route *or)
if (path->nexthop.s_addr != INADDR_ANY && if (path->nexthop.s_addr != INADDR_ANY &&
path->ifindex != 0) path->ifindex != 0)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IPV4_IFINDEX);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
} }
else if (path->nexthop.s_addr != INADDR_ANY) else if (path->nexthop.s_addr != INADDR_ANY)
{ {
stream_putc (s, ZEBRA_NEXTHOP_IPV4); stream_putc (s, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (s, &path->nexthop); stream_put_in_addr (s, &path->nexthop);
} }
else else
{ {
stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); stream_putc (s, NEXTHOP_TYPE_IFINDEX);
stream_putl (s, path->ifindex); stream_putl (s, path->ifindex);
} }

View File

@ -229,8 +229,8 @@ static int zclient_read_nexthop(struct zclient *zlookup,
--length; --length;
switch (nexthop_type) { switch (nexthop_type) {
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
if (num_ifindex >= tab_size) { if (num_ifindex >= tab_size) {
char addr_str[100]; char addr_str[100];
pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
@ -239,7 +239,7 @@ static int zclient_read_nexthop(struct zclient *zlookup,
(num_ifindex + 1), tab_size, addr_str); (num_ifindex + 1), tab_size, addr_str);
return num_ifindex; return num_ifindex;
} }
if (nexthop_type == ZEBRA_NEXTHOP_IPV4_IFINDEX) { if (nexthop_type == NEXTHOP_TYPE_IPV4_IFINDEX) {
if (length < 4) { if (length < 4) {
zlog_err("%s: socket %d short input expecting nexthop IPv4-addr: len=%d", zlog_err("%s: socket %d short input expecting nexthop IPv4-addr: len=%d",
__func__, zlookup->sock, length); __func__, zlookup->sock, length);
@ -256,7 +256,7 @@ static int zclient_read_nexthop(struct zclient *zlookup,
nexthop_tab[num_ifindex].route_metric = metric; nexthop_tab[num_ifindex].route_metric = metric;
++num_ifindex; ++num_ifindex;
break; break;
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
if (num_ifindex >= tab_size) { if (num_ifindex >= tab_size) {
char addr_str[100]; char addr_str[100];
pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));

View File

@ -886,21 +886,21 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr
stream_putc (s, nexthop->type); stream_putc (s, nexthop->type);
switch (nexthop->type) switch (nexthop->type)
{ {
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_put (s, &nexthop->gate.ipv6, 16); stream_put (s, &nexthop->gate.ipv6, 16);
break; break;
case ZEBRA_NEXTHOP_IPV6_IFINDEX: case NEXTHOP_TYPE_IPV6_IFINDEX:
stream_put (s, &nexthop->gate.ipv6, 16); stream_put (s, &nexthop->gate.ipv6, 16);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;

View File

@ -758,21 +758,21 @@ zsend_nexthop_lookup (struct zserv *client, afi_t afi, safi_t safi,
stream_putc (s, nexthop->type); stream_putc (s, nexthop->type);
switch (nexthop->type) switch (nexthop->type)
{ {
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_put (s, &nexthop->gate.ipv6, 16); stream_put (s, &nexthop->gate.ipv6, 16);
break; break;
case ZEBRA_NEXTHOP_IPV6_IFINDEX: case NEXTHOP_TYPE_IPV6_IFINDEX:
stream_put (s, &nexthop->gate.ipv6, 16); stream_put (s, &nexthop->gate.ipv6, 16);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
default: default:
@ -946,14 +946,14 @@ zsend_ipv4_nexthop_lookup_mrib (struct zserv *client, struct in_addr addr, struc
stream_putc (s, nexthop->type); stream_putc (s, nexthop->type);
switch (nexthop->type) switch (nexthop->type)
{ {
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
default: default:
@ -1011,14 +1011,14 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p,
stream_putc (s, nexthop->type); stream_putc (s, nexthop->type);
switch (nexthop->type) switch (nexthop->type)
{ {
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
stream_put_in_addr (s, &nexthop->gate.ipv4); stream_put_in_addr (s, &nexthop->gate.ipv4);
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
stream_putl (s, nexthop->ifindex); stream_putl (s, nexthop->ifindex);
break; break;
default: default:
@ -1177,23 +1177,23 @@ zread_ipv4_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
switch (nexthop_type) switch (nexthop_type)
{ {
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
ifindex = stream_getl (s); ifindex = stream_getl (s);
rib_nexthop_ifindex_add (rib, ifindex); rib_nexthop_ifindex_add (rib, ifindex);
break; break;
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
nexthop.s_addr = stream_get_ipv4 (s); nexthop.s_addr = stream_get_ipv4 (s);
rib_nexthop_ipv4_add (rib, &nexthop, NULL); rib_nexthop_ipv4_add (rib, &nexthop, NULL);
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
nexthop.s_addr = stream_get_ipv4 (s); nexthop.s_addr = stream_get_ipv4 (s);
ifindex = stream_getl (s); ifindex = stream_getl (s);
rib_nexthop_ipv4_ifindex_add (rib, &nexthop, NULL, ifindex); rib_nexthop_ipv4_ifindex_add (rib, &nexthop, NULL, ifindex);
break; break;
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_forward_getp (s, IPV6_MAX_BYTELEN); stream_forward_getp (s, IPV6_MAX_BYTELEN);
break; break;
case ZEBRA_NEXTHOP_BLACKHOLE: case NEXTHOP_TYPE_BLACKHOLE:
rib_nexthop_blackhole_add (rib); rib_nexthop_blackhole_add (rib);
break; break;
} }
@ -1276,19 +1276,19 @@ zread_ipv4_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
switch (nexthop_type) switch (nexthop_type)
{ {
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
ifindex = stream_getl (s); ifindex = stream_getl (s);
break; break;
case ZEBRA_NEXTHOP_IPV4: case NEXTHOP_TYPE_IPV4:
nexthop.s_addr = stream_get_ipv4 (s); nexthop.s_addr = stream_get_ipv4 (s);
nexthop_p = (union g_addr *)&nexthop; nexthop_p = (union g_addr *)&nexthop;
break; break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV4_IFINDEX:
nexthop.s_addr = stream_get_ipv4 (s); nexthop.s_addr = stream_get_ipv4 (s);
nexthop_p = (union g_addr *)&nexthop; nexthop_p = (union g_addr *)&nexthop;
ifindex = stream_getl (s); ifindex = stream_getl (s);
break; break;
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_forward_getp (s, IPV6_MAX_BYTELEN); stream_forward_getp (s, IPV6_MAX_BYTELEN);
break; break;
} }
@ -1423,18 +1423,18 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length, struct
switch (nexthop_type) switch (nexthop_type)
{ {
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_get (&nexthop, s, 16); stream_get (&nexthop, s, 16);
if (nh_count < MULTIPATH_NUM) { if (nh_count < MULTIPATH_NUM) {
nexthops[nh_count++] = nexthop; nexthops[nh_count++] = nexthop;
} }
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
if (if_count < MULTIPATH_NUM) { if (if_count < MULTIPATH_NUM) {
ifindices[if_count++] = stream_getl (s); ifindices[if_count++] = stream_getl (s);
} }
break; break;
case ZEBRA_NEXTHOP_BLACKHOLE: case NEXTHOP_TYPE_BLACKHOLE:
rib_nexthop_blackhole_add (rib); rib_nexthop_blackhole_add (rib);
break; break;
} }
@ -1547,18 +1547,18 @@ zread_ipv6_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
switch (nexthop_type) switch (nexthop_type)
{ {
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_get (&nexthop, s, 16); stream_get (&nexthop, s, 16);
if (nh_count < MULTIPATH_NUM) { if (nh_count < MULTIPATH_NUM) {
nexthops[nh_count++] = nexthop; nexthops[nh_count++] = nexthop;
} }
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
if (if_count < MULTIPATH_NUM) { if (if_count < MULTIPATH_NUM) {
ifindices[if_count++] = stream_getl (s); ifindices[if_count++] = stream_getl (s);
} }
break; break;
case ZEBRA_NEXTHOP_BLACKHOLE: case NEXTHOP_TYPE_BLACKHOLE:
rib_nexthop_blackhole_add (rib); rib_nexthop_blackhole_add (rib);
break; break;
} }
@ -1654,11 +1654,11 @@ zread_ipv6_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
switch (nexthop_type) switch (nexthop_type)
{ {
case ZEBRA_NEXTHOP_IPV6: case NEXTHOP_TYPE_IPV6:
stream_get (&nexthop, s, 16); stream_get (&nexthop, s, 16);
pnexthop = (union g_addr *)&nexthop; pnexthop = (union g_addr *)&nexthop;
break; break;
case ZEBRA_NEXTHOP_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
ifindex = stream_getl (s); ifindex = stream_getl (s);
break; break;
} }