Home | History | Annotate | Download | only in net

Lines Matching refs:threshold

647 pf_init_threshold(struct pf_threshold *threshold,
650 threshold->limit = limit * PF_THRESHOLD_MULT;
651 threshold->seconds = seconds;
652 threshold->count = 0;
653 threshold->last = time_second;
657 pf_add_threshold(struct pf_threshold *threshold)
659 u_int32_t t = time_second, diff = t - threshold->last;
661 if (diff >= threshold->seconds)
662 threshold->count = 0;
664 threshold->count -= threshold->count * diff /
665 threshold->seconds;
666 threshold->count += PF_THRESHOLD_MULT;
667 threshold->last = t;
671 pf_check_threshold(struct pf_threshold *threshold)
673 return (threshold->count > threshold->limit);