diff options
author | Santosh P K <sapk@vmware.com> | 2019-10-22 16:01:58 +0200 |
---|---|---|
committer | Santosh P K <sapk@vmware.com> | 2020-01-30 19:26:04 +0100 |
commit | 8062cbe2d04ddc76b8ad3d90e3393753461fd41e (patch) | |
tree | 0917b0e6441d5bbd84f884d7315096c44763d495 /zebra/zserv.h | |
parent | lib: Adding GR capabilites encode and decode. (diff) | |
download | frr-8062cbe2d04ddc76b8ad3d90e3393753461fd41e.tar.xz frr-8062cbe2d04ddc76b8ad3d90e3393753461fd41e.zip |
zebra: Header file changes and show commands.
Adding header files changes where structure to hold
received graceful restart info from client is defined.
Also there are changes for show commands where exisiting
commands are extended.
Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Soman K S <somanks@vmware.com>
Signed-off-by: Santosh P K <sapk@vmware.com>
Diffstat (limited to 'zebra/zserv.h')
-rw-r--r-- | zebra/zserv.h | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/zebra/zserv.h b/zebra/zserv.h index d8d82a52e..8bf092916 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -52,6 +52,42 @@ extern "C" { #define ZEBRA_RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */ + +/* Stale route marker timer */ +#define ZEBRA_DEFAULT_STALE_UPDATE_DELAY 1 + +/* Count of stale routes processed in timer context */ +#define ZEBRA_MAX_STALE_ROUTE_COUNT 50000 + +/* Graceful Restart information */ +struct client_gr_info { + /* VRF for which GR enabled */ + vrf_id_t vrf_id; + + /* AFI */ + afi_t current_afi; + + /* Stale time and GR cap */ + uint32_t stale_removal_time; + enum zserv_client_capabilities capabilities; + + /* GR commands */ + bool delete; + bool gr_enable; + bool stale_client; + + /* Route sync and enable flags for AFI/SAFI */ + bool af_enabled[AFI_MAX][SAFI_MAX]; + bool route_sync[AFI_MAX][SAFI_MAX]; + + /* Book keeping */ + struct prefix *current_prefix; + void *stale_client_ptr; + struct thread *t_stale_removal; + + TAILQ_ENTRY(client_gr_info) gr_info; +}; + /* Client structure. */ struct zserv { /* Client pthread */ @@ -170,6 +206,19 @@ struct zserv { _Atomic uint32_t last_read_cmd; /* command code of last message written */ _Atomic uint32_t last_write_cmd; + + /* + * Number of instances configured with + * graceful restart + */ + uint32_t gr_instance_count; + time_t restart_time; + + /* + * Graceful restart information for + * each instance + */ + TAILQ_HEAD(info_list, client_gr_info) gr_info_queue; }; #define ZAPI_HANDLER_ARGS \ @@ -230,7 +279,6 @@ extern int zserv_send_message(struct zserv *client, struct stream *msg); */ extern struct zserv *zserv_find_client(uint8_t proto, unsigned short instance); - /* * Close a client. * @@ -242,7 +290,6 @@ extern struct zserv *zserv_find_client(uint8_t proto, unsigned short instance); */ extern void zserv_close_client(struct zserv *client); - /* * Log a ZAPI message hexdump. * |