summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mroute.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-07 00:08:37 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-12 19:57:05 +0100
commit1002497af5aedffc661cb457c8775634a65c3a19 (patch)
treeac62e91f373b3d274440861984440aa242fd957b /zebra/zebra_mroute.c
parentzebra: standardize ZAPI message handler args (diff)
downloadfrr-1002497af5aedffc661cb457c8775634a65c3a19.tar.xz
frr-1002497af5aedffc661cb457c8775634a65c3a19.zip
zebra: reorganize zserv, batch i/o
Group send and receive functions together, change handlers to take a message instead of looking at ->ibuf and ->obuf, allow zebra to read multiple packets off the wire at a time. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mroute.c')
-rw-r--r--zebra/zebra_mroute.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/zebra/zebra_mroute.c b/zebra/zebra_mroute.c
index e70b963cf..042bd3769 100644
--- a/zebra/zebra_mroute.c
+++ b/zebra/zebra_mroute.c
@@ -31,7 +31,6 @@
#include "zebra/zebra_mroute.h"
#include "zebra/rt.h"
#include "zebra/debug.h"
-#include "zebra/zserv.h"
void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS)
{
@@ -40,9 +39,9 @@ void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS)
int suc = -1;
memset(&mroute, 0, sizeof(mroute));
- STREAM_GET(&mroute.sg.src, client->ibuf, 4);
- STREAM_GET(&mroute.sg.grp, client->ibuf, 4);
- STREAM_GETL(client->ibuf, mroute.ifindex);
+ STREAM_GET(&mroute.sg.src, msg, 4);
+ STREAM_GET(&mroute.sg.grp, msg, 4);
+ STREAM_GETL(msg, mroute.ifindex);
if (IS_ZEBRA_DEBUG_KERNEL) {
char sbuf[40];
@@ -57,7 +56,7 @@ void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS)
suc = kernel_get_ipmr_sg_stats(zvrf, &mroute);
stream_failure:
- s = client->obuf;
+ s = stream_new(ZEBRA_MAX_PACKET_SIZ);
stream_reset(s);
@@ -68,5 +67,5 @@ stream_failure:
stream_putl(s, suc);
stream_putw_at(s, 0, stream_get_endp(s));
- zebra_server_send_message(client);
+ zebra_server_send_message(client, s);
}