Lines Matching defs:threshold
1173 pf_init_threshold(struct pf_threshold *threshold,
1176 threshold->limit = limit * PF_THRESHOLD_MULT;
1177 threshold->seconds = seconds;
1178 threshold->count = 0;
1179 threshold->last = pf_time_second();
1183 pf_add_threshold(struct pf_threshold *threshold)
1185 u_int32_t t = pf_time_second(), diff = t - threshold->last;
1187 if (diff >= threshold->seconds)
1188 threshold->count = 0;
1190 threshold->count -= threshold->count * diff /
1191 threshold->seconds;
1192 threshold->count += PF_THRESHOLD_MULT;
1193 threshold->last = t;
1197 pf_check_threshold(struct pf_threshold *threshold)
1199 return (threshold->count > threshold->limit);