diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-07 11:23:58 -0500 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-12 14:57:06 -0400 |
| commit | 124ead27dbd7e61e79a334533adc702fdf172ddb (patch) | |
| tree | 53ba58c76499766a96ca68d0c90bece3ea29a50b /lib/zclient.c | |
| parent | 1002497af5aedffc661cb457c8775634a65c3a19 (diff) | |
lib, zebra: use existing zapi header struct
Nobody uses it, but it's got the same definition. Move the parser
function into zclient.c and use it.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index fa3a5f6691..20aaaca161 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_GETC(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) |
