Lines Matching refs:threshold
464 pf_init_threshold(struct pf_threshold *threshold,
467 threshold->limit = limit * PF_THRESHOLD_MULT;
468 threshold->seconds = seconds;
469 threshold->count = 0;
470 threshold->last = time_uptime;
474 pf_add_threshold(struct pf_threshold *threshold)
476 u_int32_t t = time_uptime, diff = t - threshold->last;
478 if (diff >= threshold->seconds)
479 threshold->count = 0;
481 threshold->count -= threshold->count * diff /
482 threshold->seconds;
483 threshold->count += PF_THRESHOLD_MULT;
484 threshold->last = t;
488 pf_check_threshold(struct pf_threshold *threshold)
490 return (threshold->count > threshold->limit);