diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-03-09 14:36:51 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-09 14:36:51 +0100 |
commit | 115ccb9acf6e9daa47c21bb6d49c1f8cab95c1ff (patch) | |
tree | c69fac8cfc0fba8069ca2967f03114577a062d25 /lib/log.c | |
parent | zebra: Make GR debug logs at least vrf aware (diff) | |
download | frr-115ccb9acf6e9daa47c21bb6d49c1f8cab95c1ff.tar.xz frr-115ccb9acf6e9daa47c21bb6d49c1f8cab95c1ff.zip |
lib, bgpd: Add more debugs to GR Capability exchange
a) Make it legible what type of message is being passed
back and forth instead of having to guess it from
the insufficient debugs
b) Make it explicit which bgp instance is sending this
data
c) Cleanup bgp_zebra_update to have a cleaner api
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -506,6 +506,26 @@ const char *zserv_command_string(unsigned int command) return command_types[command].string; } +#define DESC_ENTRY(T) [(T)] = {(T), (#T), '\0'} +static const struct zebra_desc_table gr_client_cap_types[] = { + DESC_ENTRY(ZEBRA_CLIENT_GR_CAPABILITIES), + DESC_ENTRY(ZEBRA_CLIENT_ROUTE_UPDATE_COMPLETE), + DESC_ENTRY(ZEBRA_CLIENT_ROUTE_UPDATE_PENDING), + DESC_ENTRY(ZEBRA_CLIENT_GR_DISABLE), + DESC_ENTRY(ZEBRA_CLIENT_RIB_STALE_TIME), +}; +#undef DESC_ENTRY + +const char *zserv_gr_client_cap_string(uint32_t zcc) +{ + if (zcc >= array_size(gr_client_cap_types)) { + flog_err(EC_LIB_DEVELOPMENT, "unknown zserv command type: %u", + zcc); + return unknown.string; + } + return gr_client_cap_types[zcc].string; +} + int proto_name2num(const char *s) { unsigned i; |