summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetwroks.com>2016-09-02 10:32:14 -0400
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-09-02 10:36:28 -0400
commit5b30316ea51a86de29450b59ea288afa858953b6 (patch)
tree005f4ccdedb006ad4f3782d5748447ef098e93de /lib/zclient.c
parent5b2c166731c351fd04507b5d495a2ae012cc7ca1 (diff)
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>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 0259af5971..dd13587d74 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -32,6 +32,7 @@
#include "zclient.h"
#include "memory.h"
#include "table.h"
+#include "nexthop.h"
/* Zebra client events. */
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))
{
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->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++)
{
- stream_putc (s, ZEBRA_NEXTHOP_IPV4);
+ stream_putc (s, NEXTHOP_TYPE_IPV4);
stream_put_in_addr (s, api->nexthop[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]);
}
}
@@ -813,7 +814,7 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient,
if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
{
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->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++)
{
- stream_putc (s, ZEBRA_NEXTHOP_IPV6);
+ stream_putc (s, NEXTHOP_TYPE_IPV6);
stream_write (s, (u_char *)api->nexthop[i], 16);
}
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]);
}
}
@@ -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))
{
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->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++)
{
- stream_putc (s, ZEBRA_NEXTHOP_IPV6);
+ stream_putc (s, NEXTHOP_TYPE_IPV6);
stream_write (s, (u_char *)api->nexthop[i], 16);
}
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]);
}
}