]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zapi_msg.c
lib,zebra: add zapi msg top level error handling
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 17 Dec 2019 22:00:52 +0000 (17:00 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Wed, 8 Jan 2020 17:22:29 +0000 (12:22 -0500)
commit9ab0b2a37afc6b098e9ae444459dbb783ad0a5ff
tree3b8a18344f931ad514ee2123f99e653576e04bf7
parentf84f7121f6e142be732a25b4e7cd1105f7593495
lib,zebra: add zapi msg top level error handling

Add error handling for top level failures (not able to
execute command, unable to find vrf for command, etc.)

With this error handling we add a new zapi message type
of ZEBRA_ERROR used when we are unable to properly handle
a zapi command and pass it down into the lower level code.

In the event of this, we reply with a message of type
enum zebra_error_types containing the error type.

The sent packet will look like so:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Length            |     Marker    |    Version    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             VRF ID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Command            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            ERROR TYPE         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Also add appropriate hooks for clients to subscribe to for
handling these types of errors.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
lib/log.c
lib/zclient.c
lib/zclient.h
zebra/zapi_msg.c
zebra/zserv.h