summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.h
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/zserv.h
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/zserv.h')
-rw-r--r--zebra/zserv.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 74ff31bcf..a055a28c0 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -47,8 +47,12 @@ struct zserv {
int sock;
/* Input/output buffer to the client. */
- struct stream *ibuf;
- struct stream *obuf;
+ struct stream_fifo *ibuf_fifo;
+ struct stream_fifo *obuf_fifo;
+
+ /* Private I/O buffers */
+ struct stream *ibuf_work;
+ struct stream *obuf_work;
/* Buffer of data waiting to be written to client. */
struct buffer *wb;
@@ -129,7 +133,7 @@ struct zserv {
int last_write_cmd;
};
-/* ZAPI protocol message header */
+/* ZAPI protocol structs */
struct zmsghdr {
uint16_t length;
uint8_t marker;
@@ -139,7 +143,8 @@ struct zmsghdr {
};
#define ZAPI_HANDLER_ARGS \
- struct zserv *client, struct zmsghdr *hdr, struct zebra_vrf *zvrf
+ struct zserv *client, struct zmsghdr *hdr, struct stream *msg, \
+ struct zebra_vrf *zvrf
/* Zebra instance */
struct zebra_t {
@@ -197,7 +202,7 @@ extern void zsend_rule_notify_owner(struct zebra_pbr_rule *rule,
extern void zserv_nexthop_num_warn(const char *, const struct prefix *,
const unsigned int);
-extern int zebra_server_send_message(struct zserv *client);
+extern int zebra_server_send_message(struct zserv *client, struct stream *msg);
extern struct zserv *zebra_find_client(u_char proto, u_short instance);