periodic_scan
add_timeout(cur_time + 5, periodic_scan, NULL);
add_timeout(cur_time + y, periodic_scan, NULL);
void periodic_scan(void *);