summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2018-03-12 22:43:05 -0300
committerGitHub <noreply@github.com>2018-03-12 22:43:05 -0300
commitecef81cea9f2f1df598e4ce8e2e9ff76af55c4dd (patch)
treeee3fcae8e7b085a6938c2f404beead8b15da64e3 /lib/zclient.c
parentfac615f43b18bf88ccf78d8b0c20046f73f046a4 (diff)
parent41903a407407bcdf73dbd471dea3f53d2d056b0b (diff)
Merge pull request #1828 from qlyoung/zapi-cleanup
zebra: giant zapi cleanup
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index fa3a5f6691..c720e2519b 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -322,6 +322,18 @@ stream_failure:
return 0;
}
+bool zapi_parse_header(struct stream *zmsg, struct zmsghdr *hdr)
+{
+ STREAM_GETW(zmsg, hdr->length);
+ STREAM_GETC(zmsg, hdr->marker);
+ STREAM_GETC(zmsg, hdr->version);
+ STREAM_GETL(zmsg, hdr->vrf_id);
+ STREAM_GETW(zmsg, hdr->command);
+ return true;
+stream_failure:
+ return false;
+}
+
/* Send simple Zebra message. */
static int zebra_message_send(struct zclient *zclient, int command,
vrf_id_t vrf_id)