mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 16:20:08 +00:00
sharpd: add handler for OPAQUE messages
Add a simple handler to receive OPAQUE zapi messages for testing. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
6e2a33a843
commit
7f5ac77319
@ -480,12 +480,29 @@ static int sharp_redistribute_route(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handler for opaque messages */
|
||||||
|
static int sharp_opaque_handler(ZAPI_CALLBACK_ARGS)
|
||||||
|
{
|
||||||
|
uint32_t type;
|
||||||
|
struct stream *s;
|
||||||
|
|
||||||
|
s = zclient->ibuf;
|
||||||
|
|
||||||
|
STREAM_GETL(s, type);
|
||||||
|
|
||||||
|
zlog_debug("%s: received opaque type %u", __func__, type);
|
||||||
|
|
||||||
|
stream_failure:
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send OPAQUE messages, using subtype 'type'.
|
* Send OPAQUE messages, using subtype 'type'.
|
||||||
*/
|
*/
|
||||||
void sharp_opaque_send(uint32_t type, uint32_t count)
|
void sharp_opaque_send(uint32_t type, uint32_t count)
|
||||||
{
|
{
|
||||||
uint8_t buf[100];
|
uint8_t buf[32];
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
@ -561,4 +578,5 @@ void sharp_zebra_init(void)
|
|||||||
|
|
||||||
zclient->redistribute_route_add = sharp_redistribute_route;
|
zclient->redistribute_route_add = sharp_redistribute_route;
|
||||||
zclient->redistribute_route_del = sharp_redistribute_route;
|
zclient->redistribute_route_del = sharp_redistribute_route;
|
||||||
|
zclient->opaque_msg_handler = sharp_opaque_handler;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user