• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iptables-1.4.12.1/extensions/

Lines Matching defs:*

0 #include <stdio.h>
2 #include <xtables.h>
3 #include <linux/netfilter/xt_tcpmss.h>
5 enum {
6 O_TCPMSS = 0,
9 static void tcpmss_help(void)
11 printf(
12 "tcpmss match options:\n"
13 "[!] --mss value[:value] Match TCP MSS range.\n"
14 " (only valid for TCP SYN or SYN/ACK packets)\n");
17 static const struct xt_option_entry tcpmss_opts[] = {
18 {.name = "mss", .id = O_TCPMSS, .type = XTTYPE_UINT16RC,
19 .flags = XTOPT_MAND | XTOPT_INVERT},
20 XTOPT_TABLEEND,
23 static void tcpmss_parse(struct xt_option_call *cb)
25 struct xt_tcpmss_match_info *mssinfo = cb->data;
27 xtables_option_parse(cb);
28 mssinfo->mss_min = cb->val.u16_range[0];
29 mssinfo->mss_max = mssinfo->mss_min;
30 if (cb->nvals == 2)
31 mssinfo->mss_max = cb->val.u16_range[1];
32 if (cb->invert)
33 mssinfo->invert = 1;
36 static void
37 tcpmss_print(const void *ip, const struct xt_entry_match *match, int numeric)
39 const struct xt_tcpmss_match_info *info = (void *)match->data;
41 printf(" tcpmss match %s", info->invert ? "!" : "");
42 if (info->mss_min == info->mss_max)
43 printf("%u", info->mss_min);
44 else
45 printf("%u:%u", info->mss_min, info->mss_max);
48 static void tcpmss_save(const void *ip, const struct xt_entry_match *match)
50 const struct xt_tcpmss_match_info *info = (void *)match->data;
52 printf("%s --mss ", info->invert ? " !" : "");
53 if (info->mss_min == info->mss_max)
54 printf("%u", info->mss_min);
55 else
56 printf("%u:%u", info->mss_min, info->mss_max);
59 static struct xtables_match tcpmss_match = {
60 .family = NFPROTO_UNSPEC,
61 .name = "tcpmss",
62 .version = XTABLES_VERSION,
63 .size = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
64 .userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
65 .help = tcpmss_help,
66 .print = tcpmss_print,
67 .save = tcpmss_save,
68 .x6_parse = tcpmss_parse,
69 .x6_options = tcpmss_opts,
72 void _init(void)
74 xtables_register_match(&tcpmss_match);