306
306
static const struct option addrtype_opts[] = {
307
{ "src-type", 1, NULL, '1' },
308
{ "dst-type", 1, NULL, '2' },
307
{.name = "src-type", .has_arg = true, .val = '1'},
308
{.name = "dst-type", .has_arg = true, .val = '2'},
312
312
static const struct option addrtype_opts_v0[] = {
313
{ "src-type", 1, NULL, '1' },
314
{ "dst-type", 1, NULL, '2' },
313
{.name = "src-type", .has_arg = true, .val = '1'},
314
{.name = "dst-type", .has_arg = true, .val = '2'},
318
318
static const struct option addrtype_opts_v1[] = {
319
{ "src-type", 1, NULL, '1' },
320
{ "dst-type", 1, NULL, '2' },
321
{ "limit-iface-in", 0, NULL, '3' },
322
{ "limit-iface-out", 0, NULL, '4' },
326
static struct xtables_match addrtype_mt_reg_v0 = {
328
.version = XTABLES_VERSION,
329
.family = NFPROTO_IPV4,
330
.size = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
331
.userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
332
.help = addrtype_help_v0,
333
.parse = addrtype_parse_v0,
334
.final_check = addrtype_check_v0,
335
.print = addrtype_print_v0,
336
.save = addrtype_save_v0,
337
.extra_opts = addrtype_opts_v0,
340
static struct xtables_match addrtype_mt_reg_v1 = {
342
.version = XTABLES_VERSION,
343
.family = NFPROTO_IPV4,
344
.size = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
345
.userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
346
.help = addrtype_help_v1,
347
.parse = addrtype_parse_v1,
348
.final_check = addrtype_check_v1,
349
.print = addrtype_print_v1,
350
.save = addrtype_save_v1,
351
.extra_opts = addrtype_opts_v1,
319
{.name = "src-type", .has_arg = true, .val = '1'},
320
{.name = "dst-type", .has_arg = true, .val = '2'},
321
{.name = "limit-iface-in", .has_arg = false, .val = '3'},
322
{.name = "limit-iface-out", .has_arg = false, .val = '4'},
326
static struct xtables_match addrtype_mt_reg[] = {
329
.version = XTABLES_VERSION,
330
.family = NFPROTO_IPV4,
331
.size = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
332
.userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info)),
333
.help = addrtype_help_v0,
334
.parse = addrtype_parse_v0,
335
.final_check = addrtype_check_v0,
336
.print = addrtype_print_v0,
337
.save = addrtype_save_v0,
338
.extra_opts = addrtype_opts_v0,
343
.version = XTABLES_VERSION,
344
.family = NFPROTO_IPV4,
345
.size = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
346
.userspacesize = XT_ALIGN(sizeof(struct ipt_addrtype_info_v1)),
347
.help = addrtype_help_v1,
348
.parse = addrtype_parse_v1,
349
.final_check = addrtype_check_v1,
350
.print = addrtype_print_v1,
351
.save = addrtype_save_v1,
352
.extra_opts = addrtype_opts_v1,
358
xtables_register_match(&addrtype_mt_reg_v0);
359
xtables_register_match(&addrtype_mt_reg_v1);
359
xtables_register_matches(addrtype_mt_reg, ARRAY_SIZE(addrtype_mt_reg));