diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-12-17 17:00:52 -0500 | 
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2020-01-08 12:22:29 -0500 | 
| commit | 9ab0b2a37afc6b098e9ae444459dbb783ad0a5ff (patch) | |
| tree | 3b8a18344f931ad514ee2123f99e653576e04bf7 /lib/log.c | |
| parent | f84f7121f6e142be732a25b4e7cd1105f7593495 (diff) | |
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>
Diffstat (limited to 'lib/log.c')
| -rw-r--r-- | lib/log.c | 1 | 
1 files changed, 1 insertions, 0 deletions
@@ -1093,6 +1093,7 @@ static const struct zebra_desc_table command_types[] = {  	DESC_ENTRY(ZEBRA_VXLAN_SG_ADD),  	DESC_ENTRY(ZEBRA_VXLAN_SG_DEL),  	DESC_ENTRY(ZEBRA_VXLAN_SG_REPLAY), +	DESC_ENTRY(ZEBRA_ERROR),  };  #undef DESC_ENTRY  | 
