static int bgp_dump_interval_func (struct thread *t) { struct bgp_dump *bgp_dump; bgp_dump = THREAD_ARG (t); bgp_dump->t_interval = NULL; /* Reschedule dump even if file couldn't be opened this time... */ if (bgp_dump_open_file (bgp_dump) != NULL) { /* In case of bgp_dump_routes, we need special route dump function. */ if (bgp_dump->type == BGP_DUMP_ROUTES) { unsigned int seq = bgp_dump_routes_func (AFI_IP, 1, 0); bgp_dump_routes_func (AFI_IP6, 0, seq); /* Close the file now. For a RIB dump there's no point in leaving * it open until the next scheduled dump starts. */ fclose(bgp_dump->fp); bgp_dump->fp = NULL; } } /* if interval is set reschedule */ if (bgp_dump->interval > 0) bgp_dump_interval_add (bgp_dump, bgp_dump->interval); return 0; }
int bgp_dump_interval_func (struct thread *t) { struct bgp_dump *bgp_dump; bgp_dump = THREAD_ARG (t); bgp_dump->t_interval = NULL; if (bgp_dump_open_file (bgp_dump) == NULL) return 0; /* In case of bgp_dump_routes, we need special route dump function. */ if (bgp_dump->type == BGP_DUMP_ROUTES) { bgp_dump_routes_func (AFI_IP); bgp_dump_routes_func (AFI_IP6); } bgp_dump_interval_add (bgp_dump, bgp_dump->interval); return 0; }