X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=zebra%2Fzserv.h;h=f0b8934ae13053cfc2a0e988f6c812f3e99b15dc;hb=91d227b7e3cb53ad8fdbcd9d4cff7f0a666918e3;hp=78cc200fa8c4576aff24a4669ebba1e1143e44ac;hpb=d5a91f926b7aec85c9a3c7bcb662822f099e5595;p=mirror_frr.git diff --git a/zebra/zserv.h b/zebra/zserv.h index 78cc200fa..f0b8934ae 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -73,6 +73,12 @@ struct zserv { struct thread *t_read; struct thread *t_write; + /* Event for message processing, for the main pthread */ + struct thread *t_process; + + /* Threads for the main pthread */ + struct thread *t_cleanup; + /* default routing table this client munges */ int rtm_table; @@ -130,6 +136,10 @@ struct zserv { uint32_t macipdel_cnt; uint32_t prefixadd_cnt; uint32_t prefixdel_cnt; + uint32_t v4_nh_watch_add_cnt; + uint32_t v4_nh_watch_rem_cnt; + uint32_t v6_nh_watch_add_cnt; + uint32_t v6_nh_watch_rem_cnt; time_t nh_reg_time; time_t nh_dereg_time; @@ -150,9 +160,9 @@ struct zserv { /* monotime of last message sent */ _Atomic uint32_t last_write_time; /* command code of last message read */ - _Atomic uint16_t last_read_cmd; + _Atomic uint32_t last_read_cmd; /* command code of last message written */ - _Atomic uint16_t last_write_cmd; + _Atomic uint32_t last_write_cmd; }; #define ZAPI_HANDLER_ARGS \ @@ -177,6 +187,7 @@ struct zebra_t { /* rib work queue */ #define ZEBRA_RIB_PROCESS_HOLD_TIME 10 +#define ZEBRA_RIB_PROCESS_RETRY_TIME 1 struct work_queue *ribq; struct meta_queue *mq; @@ -232,8 +243,23 @@ 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. + * + * Kills a client's thread, removes the client from the client list and cleans + * up its resources. + * + * client + * the client to close + */ +extern void zserv_close_client(struct zserv *client); + #if defined(HANDLE_ZAPI_FUZZING) extern void zserv_read_file(char *input); #endif +/* TODO */ +int zebra_finalize(struct thread *event); + #endif /* _ZEBRA_ZEBRA_H */