Lines Matching refs:cfg

102 	 XTOPT_POINTER(s, cfg.burst)},
105 XTOPT_POINTER(s, cfg.size)},
108 XTOPT_POINTER(s, cfg.max)},
111 XTOPT_POINTER(s, cfg.gc_interval)},
114 XTOPT_POINTER(s, cfg.expire)},
136 XTOPT_POINTER(s, cfg.size)},
139 XTOPT_POINTER(s, cfg.max)},
142 XTOPT_POINTER(s, cfg.gc_interval)},
145 XTOPT_POINTER(s, cfg.expire)},
270 r->cfg.burst = XT_HASHLIMIT_BURST; in hashlimit_init()
271 r->cfg.gc_interval = XT_HASHLIMIT_GCINTERVAL; in hashlimit_init()
279 info->cfg.mode = 0; in hashlimit_mt4_init()
280 info->cfg.burst = XT_HASHLIMIT_BURST; in hashlimit_mt4_init()
281 info->cfg.gc_interval = XT_HASHLIMIT_GCINTERVAL; in hashlimit_mt4_init()
282 info->cfg.srcmask = 32; in hashlimit_mt4_init()
283 info->cfg.dstmask = 32; in hashlimit_mt4_init()
290 info->cfg.mode = 0; in hashlimit_mt6_init()
291 info->cfg.burst = XT_HASHLIMIT_BURST; in hashlimit_mt6_init()
292 info->cfg.gc_interval = XT_HASHLIMIT_GCINTERVAL; in hashlimit_mt6_init()
293 info->cfg.srcmask = 128; in hashlimit_mt6_init()
294 info->cfg.dstmask = 128; in hashlimit_mt6_init()
333 if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata)) in hashlimit_parse()
338 if (parse_mode(&info->cfg.mode, cb->arg) < 0) in hashlimit_parse()
352 info->cfg.burst = parse_burst(cb->arg, info); in hashlimit_mt_parse()
356 info->cfg.mode |= XT_HASHLIMIT_INVERT; in hashlimit_mt_parse()
357 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata)) in hashlimit_mt_parse()
358 info->cfg.mode |= XT_HASHLIMIT_BYTES; in hashlimit_mt_parse()
359 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata)) in hashlimit_mt_parse()
365 info->cfg.mode |= XT_HASHLIMIT_INVERT; in hashlimit_mt_parse()
366 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata)) in hashlimit_mt_parse()
367 info->cfg.mode |= XT_HASHLIMIT_BYTES; in hashlimit_mt_parse()
368 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata)) in hashlimit_mt_parse()
373 if (parse_mode(&info->cfg.mode, cb->arg) < 0) in hashlimit_mt_parse()
378 info->cfg.srcmask = cb->val.hlen; in hashlimit_mt_parse()
381 info->cfg.dstmask = cb->val.hlen; in hashlimit_mt_parse()
395 info->cfg.expire = udata->mult * 1000; /* from s to msec */ in hashlimit_check()
407 info->cfg.expire = udata->mult * 1000; /* from s to msec */ in hashlimit_mt_check()
409 if (info->cfg.mode & XT_HASHLIMIT_BYTES) { in hashlimit_mt_check()
412 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
414 "burst cannot be smaller than %ub", cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check()
416 burst = info->cfg.burst; in hashlimit_mt_check()
417 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check()
418 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
421 info->cfg.expire = XT_HASHLIMIT_BYTE_EXPIRE_BURST * 1000; in hashlimit_mt_check()
423 info->cfg.burst = burst; in hashlimit_mt_check()
424 } else if (info->cfg.burst > XT_HASHLIMIT_BURST_MAX) in hashlimit_mt_check()
526 quantum = print_rate(r->cfg.avg); in hashlimit_print()
527 printf(" burst %u", r->cfg.burst); in hashlimit_print()
529 print_mode(r->cfg.mode, '-'); in hashlimit_print()
530 if (r->cfg.size) in hashlimit_print()
531 printf(" htable-size %u", r->cfg.size); in hashlimit_print()
532 if (r->cfg.max) in hashlimit_print()
533 printf(" htable-max %u", r->cfg.max); in hashlimit_print()
534 if (r->cfg.gc_interval != XT_HASHLIMIT_GCINTERVAL) in hashlimit_print()
535 printf(" htable-gcinterval %u", r->cfg.gc_interval); in hashlimit_print()
536 if (r->cfg.expire != quantum) in hashlimit_print()
537 printf(" htable-expire %u", r->cfg.expire); in hashlimit_print()
545 if (info->cfg.mode & XT_HASHLIMIT_INVERT) in hashlimit_mt_print()
550 if (info->cfg.mode & XT_HASHLIMIT_BYTES) { in hashlimit_mt_print()
551 quantum = print_bytes(info->cfg.avg, info->cfg.burst, ""); in hashlimit_mt_print()
553 quantum = print_rate(info->cfg.avg); in hashlimit_mt_print()
554 printf(" burst %u", info->cfg.burst); in hashlimit_mt_print()
556 if (info->cfg.mode & (XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | in hashlimit_mt_print()
559 print_mode(info->cfg.mode, '-'); in hashlimit_mt_print()
561 if (info->cfg.size != 0) in hashlimit_mt_print()
562 printf(" htable-size %u", info->cfg.size); in hashlimit_mt_print()
563 if (info->cfg.max != 0) in hashlimit_mt_print()
564 printf(" htable-max %u", info->cfg.max); in hashlimit_mt_print()
565 if (info->cfg.gc_interval != XT_HASHLIMIT_GCINTERVAL) in hashlimit_mt_print()
566 printf(" htable-gcinterval %u", info->cfg.gc_interval); in hashlimit_mt_print()
567 if (info->cfg.expire != quantum) in hashlimit_mt_print()
568 printf(" htable-expire %u", info->cfg.expire); in hashlimit_mt_print()
570 if (info->cfg.srcmask != dmask) in hashlimit_mt_print()
571 printf(" srcmask %u", info->cfg.srcmask); in hashlimit_mt_print()
572 if (info->cfg.dstmask != dmask) in hashlimit_mt_print()
573 printf(" dstmask %u", info->cfg.dstmask); in hashlimit_mt_print()
600 quantum = print_rate(r->cfg.avg); in hashlimit_save()
601 printf(" --hashlimit-burst %u", r->cfg.burst); in hashlimit_save()
604 print_mode(r->cfg.mode, ','); in hashlimit_save()
608 if (r->cfg.size) in hashlimit_save()
609 printf(" --hashlimit-htable-size %u", r->cfg.size); in hashlimit_save()
610 if (r->cfg.max) in hashlimit_save()
611 printf(" --hashlimit-htable-max %u", r->cfg.max); in hashlimit_save()
612 if (r->cfg.gc_interval != XT_HASHLIMIT_GCINTERVAL) in hashlimit_save()
613 printf(" --hashlimit-htable-gcinterval %u", r->cfg.gc_interval); in hashlimit_save()
614 if (r->cfg.expire != quantum) in hashlimit_save()
615 printf(" --hashlimit-htable-expire %u", r->cfg.expire); in hashlimit_save()
623 if (info->cfg.mode & XT_HASHLIMIT_INVERT) in hashlimit_mt_save()
628 if (info->cfg.mode & XT_HASHLIMIT_BYTES) { in hashlimit_mt_save()
629 quantum = print_bytes(info->cfg.avg, info->cfg.burst, "--hashlimit-"); in hashlimit_mt_save()
631 quantum = print_rate(info->cfg.avg); in hashlimit_mt_save()
632 printf(" --hashlimit-burst %u", info->cfg.burst); in hashlimit_mt_save()
635 if (info->cfg.mode & (XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | in hashlimit_mt_save()
638 print_mode(info->cfg.mode, ','); in hashlimit_mt_save()
643 if (info->cfg.size != 0) in hashlimit_mt_save()
644 printf(" --hashlimit-htable-size %u", info->cfg.size); in hashlimit_mt_save()
645 if (info->cfg.max != 0) in hashlimit_mt_save()
646 printf(" --hashlimit-htable-max %u", info->cfg.max); in hashlimit_mt_save()
647 if (info->cfg.gc_interval != XT_HASHLIMIT_GCINTERVAL) in hashlimit_mt_save()
648 printf(" --hashlimit-htable-gcinterval %u", info->cfg.gc_interval); in hashlimit_mt_save()
649 if (info->cfg.expire != quantum) in hashlimit_mt_save()
650 printf(" --hashlimit-htable-expire %u", info->cfg.expire); in hashlimit_mt_save()
652 if (info->cfg.srcmask != dmask) in hashlimit_mt_save()
653 printf(" --hashlimit-srcmask %u", info->cfg.srcmask); in hashlimit_mt_save()
654 if (info->cfg.dstmask != dmask) in hashlimit_mt_save()
655 printf(" --hashlimit-dstmask %u", info->cfg.dstmask); in hashlimit_mt_save()