11 struct timespec mtime;
14 typedef struct tr_cfgwatch_data {
15 struct timeval poll_interval; /* how often should we check for updates? */
16 struct timeval settling_time; /* how long should we wait for changes to settle before updating? */
17 char *config_dir; /* what directory are we watching? */
18 struct tr_fstat *fstat_list; /* file names and mtimes */
19 int n_files; /* number of files in fstat_list */
20 int change_detected; /* have we detected a change? */
21 struct timeval last_change_detected; /* when did we last note a changed mtime? */
22 TR_CFG_MGR *cfg_mgr; /* what trust router config are we updating? */
23 void (*update_cb)(TR_CFG *new_cfg, void *cookie); /* callback after config updated */
24 void *update_cookie; /* data for the update_cb() */
29 TR_CFGWATCH *tr_cfgwatch_create(TALLOC_CTX *mem_ctx);
30 int tr_read_and_apply_config(TR_CFGWATCH *cfgwatch);
31 int tr_cfgwatch_event_init(struct event_base *base, TR_CFGWATCH *cfg_status, struct event **cfgwatch_ev);
33 #endif /* TR_CFGWATCH_H */