| 170 | } |
| 171 | |
| 172 | void doschedule(void){ |
| 173 | struct schedule *sched, *prevsched = NULL, *nextsched; |
| 174 | int res; |
| 175 | |
| 176 | conf.time = time(0); |
| 177 | for(sched=schedule; sched; sched=sched->next){ |
| 178 | if(conf.needreload || conf.timetoexit || (conf.time > sched->start_time && timechanged(sched->start_time, conf.time, sched->type))){ |
| 179 | sched->start_time = conf.time; |
| 180 | nextsched = sched->next; |
| 181 | res = (*sched->function)(sched->data); |
| 182 | switch(res){ |
| 183 | case 1: |
| 184 | if(prevsched) prevsched->next = nextsched; |
| 185 | else schedule = nextsched; |
| 186 | break; |
| 187 | } |
| 188 | } |
| 189 | prevsched = sched; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | void dumpcounters(struct trafcount *tlin, int counterd){ |
| 194 |
no test coverage detected