summaryrefslogtreecommitdiffstats
path: root/sharpd
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-06-04 19:11:35 +0200
committerMark Stapp <mjs@voltanet.io>2020-06-10 14:26:27 +0200
commit387831ffc39cb432c9cedfe1376b8361084c7bc1 (patch)
tree9eea0f71580c91399be95743e2f560eb582131ec /sharpd
parentlib,zebra: rename opaque decode api (diff)
downloadfrr-387831ffc39cb432c9cedfe1376b8361084c7bc1.tar.xz
frr-387831ffc39cb432c9cedfe1376b8361084c7bc1.zip
lib,zebra,sharpd: modify opaque zapi message to support unicast
Start modifying the OPAQUE zapi message to include optional unicast destination zapi client info. Add a 'decode' api and opaque msg struct to encapsulate that optional info. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'sharpd')
-rw-r--r--sharpd/sharp_zebra.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 34cc1a4b5..d94e272dd 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -483,16 +483,15 @@ static int sharp_redistribute_route(ZAPI_CALLBACK_ARGS)
/* Handler for opaque messages */
static int sharp_opaque_handler(ZAPI_CALLBACK_ARGS)
{
- uint32_t type;
struct stream *s;
+ struct zapi_opaque_msg info;
s = zclient->ibuf;
- STREAM_GETL(s, type);
-
- zlog_debug("%s: received opaque type %u", __func__, type);
+ if (zclient_opaque_decode(s, &info) != 0)
+ return -1;
-stream_failure:
+ zlog_debug("%s: received opaque type %u", __func__, info.type);
return 0;
}