void do_whacklisten() { fflush(stderr); fflush(stdout); close_peerlog(); /* close any open per-peer logs */ libreswan_log("listening for IKE messages"); listening = TRUE; daily_log_reset(); reset_adns_restart_count(); set_myFQDN(); find_ifaces(); load_preshared_secrets(); load_groups(); }
static void do_whacklisten(void) { fflush(stderr); fflush(stdout); close_peerlog(); /* close any open per-peer logs */ #ifdef USE_SYSTEMD_WATCHDOG pluto_sd(PLUTO_SD_RELOADING, SD_REPORT_NO_STATUS); #endif libreswan_log("listening for IKE messages"); listening = TRUE; daily_log_reset(); set_myFQDN(); find_ifaces(); load_preshared_secrets(); load_groups(); #ifdef USE_SYSTEMD_WATCHDOG pluto_sd(PLUTO_SD_READY, SD_REPORT_NO_STATUS); #endif }
void daily_log_event(void) { struct tm *ltime; time_t n, interval; /* attempt to schedule oneself to midnight, local time * do this by getting seconds in the day, and delaying * by 86400 - hour*3600+minutes*60+seconds. */ time(&n); ltime = localtime(&n); interval = (24 * 60 * 60) - (ltime->tm_sec + ltime->tm_min * 60 + ltime->tm_hour * 3600); event_schedule(EVENT_LOG_DAILY, interval, NULL); daily_log_reset(); }
void daily_log_event(void) { struct tm tm1, *ltime; time_t interval; realtime_t n = realnow(); /* schedule event for midnight, local time */ tzset(); ltime = localtime_r(&n.real_secs, &tm1); interval = secs_per_day - (ltime->tm_sec + ltime->tm_min * secs_per_minute + ltime->tm_hour * secs_per_hour); /* this might happen during a leap second */ if (interval <= 0) interval = secs_per_day; event_schedule(EVENT_LOG_DAILY, interval, NULL); daily_log_reset(); }