69
69
static const struct option hashlimit_opts[] = {
70
{ "hashlimit", 1, NULL, '%' },
71
{ "hashlimit-burst", 1, NULL, '$' },
72
{ "hashlimit-htable-size", 1, NULL, '&' },
73
{ "hashlimit-htable-max", 1, NULL, '*' },
74
{ "hashlimit-htable-gcinterval", 1, NULL, '(' },
75
{ "hashlimit-htable-expire", 1, NULL, ')' },
76
{ "hashlimit-mode", 1, NULL, '_' },
77
{ "hashlimit-name", 1, NULL, '"' },
70
{.name = "hashlimit", .has_arg = true, .val = '%'},
71
{.name = "hashlimit-burst", .has_arg = true, .val = '$'},
72
{.name = "hashlimit-htable-size", .has_arg = true, .val = '&'},
73
{.name = "hashlimit-htable-max", .has_arg = true, .val = '*'},
74
{.name = "hashlimit-htable-gcinterval", .has_arg = true, .val = '('},
75
{.name = "hashlimit-htable-expire", .has_arg = true, .val = ')'},
76
{.name = "hashlimit-mode", .has_arg = true, .val = '_'},
77
{.name = "hashlimit-name", .has_arg = true, .val = '"'},
81
81
static const struct option hashlimit_mt_opts[] = {
659
657
hashlimit_mt_save(info, 128);
662
static struct xtables_match hashlimit_match = {
663
.family = NFPROTO_IPV4,
665
.version = XTABLES_VERSION,
667
.size = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
668
.userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
669
.help = hashlimit_help,
670
.init = hashlimit_init,
671
.parse = hashlimit_parse,
672
.final_check = hashlimit_check,
673
.print = hashlimit_print,
674
.save = hashlimit_save,
675
.extra_opts = hashlimit_opts,
678
static struct xtables_match hashlimit_match6 = {
679
.family = NFPROTO_IPV6,
681
.version = XTABLES_VERSION,
683
.size = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
684
.userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
685
.help = hashlimit_help,
686
.init = hashlimit_init,
687
.parse = hashlimit_parse,
688
.final_check = hashlimit_check,
689
.print = hashlimit_print,
690
.save = hashlimit_save,
691
.extra_opts = hashlimit_opts,
694
static struct xtables_match hashlimit_mt_reg = {
695
.version = XTABLES_VERSION,
698
.family = NFPROTO_IPV4,
699
.size = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
700
.userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
701
.help = hashlimit_mt_help,
702
.init = hashlimit_mt4_init,
703
.parse = hashlimit_mt4_parse,
704
.final_check = hashlimit_mt_check,
705
.print = hashlimit_mt4_print,
706
.save = hashlimit_mt4_save,
707
.extra_opts = hashlimit_mt_opts,
710
static struct xtables_match hashlimit_mt6_reg = {
711
.version = XTABLES_VERSION,
714
.family = NFPROTO_IPV6,
715
.size = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
716
.userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
717
.help = hashlimit_mt_help,
718
.init = hashlimit_mt6_init,
719
.parse = hashlimit_mt6_parse,
720
.final_check = hashlimit_mt_check,
721
.print = hashlimit_mt6_print,
722
.save = hashlimit_mt6_save,
723
.extra_opts = hashlimit_mt_opts,
660
static struct xtables_match hashlimit_mt_reg[] = {
662
.family = NFPROTO_UNSPEC,
664
.version = XTABLES_VERSION,
666
.size = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
667
.userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
668
.help = hashlimit_help,
669
.init = hashlimit_init,
670
.parse = hashlimit_parse,
671
.final_check = hashlimit_check,
672
.print = hashlimit_print,
673
.save = hashlimit_save,
674
.extra_opts = hashlimit_opts,
677
.version = XTABLES_VERSION,
680
.family = NFPROTO_IPV4,
681
.size = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
682
.userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
683
.help = hashlimit_mt_help,
684
.init = hashlimit_mt4_init,
685
.parse = hashlimit_mt4_parse,
686
.final_check = hashlimit_mt_check,
687
.print = hashlimit_mt4_print,
688
.save = hashlimit_mt4_save,
689
.extra_opts = hashlimit_mt_opts,
692
.version = XTABLES_VERSION,
695
.family = NFPROTO_IPV6,
696
.size = XT_ALIGN(sizeof(struct xt_hashlimit_mtinfo1)),
697
.userspacesize = offsetof(struct xt_hashlimit_mtinfo1, hinfo),
698
.help = hashlimit_mt_help,
699
.init = hashlimit_mt6_init,
700
.parse = hashlimit_mt6_parse,
701
.final_check = hashlimit_mt_check,
702
.print = hashlimit_mt6_print,
703
.save = hashlimit_mt6_save,
704
.extra_opts = hashlimit_mt_opts,
728
xtables_register_match(&hashlimit_match);
729
xtables_register_match(&hashlimit_match6);
730
xtables_register_match(&hashlimit_mt_reg);
731
xtables_register_match(&hashlimit_mt6_reg);
710
xtables_register_matches(hashlimit_mt_reg, ARRAY_SIZE(hashlimit_mt_reg));