Lines Matching refs:tcp
1 /* Shared library add-on to iptables to add TCP support. */
16 "TCP v%s options:\n"
17 " --tcp-flags [!] mask comp match when TCP flags & mask == comp\n"
20 " (equivalent to --tcp-flags SYN,RST,ACK SYN)\n"
27 " --tcp-option [!] number match if TCP option set\n\n",
37 { "tcp-flags", 1, 0, '4' },
38 { "tcp-option", 1, 0, '5' },
50 ports[0] = ports[1] = parse_port(buffer, "tcp");
55 ports[0] = buffer[0] ? parse_port(buffer, "tcp") : 0;
56 ports[1] = cp[0] ? parse_port(cp, "tcp") : 0xFFFF;
102 "Unknown TCP flag `%s'", ptr);
128 exit_error(PARAMETER_PROBLEM, "Bad TCP option `%s'", option);
183 "Only one of `--syn' or `--tcp-flags' "
192 "Only one of `--syn' or `--tcp-flags' "
199 "--tcp-flags requires two args.");
210 "Only one `--tcp-option' allowed");
236 if ((service = getservbyport(htons(port), "tcp")))
324 const struct ipt_tcp *tcp = (struct ipt_tcp *)match->data;
326 printf("tcp ");
327 print_ports("spt", tcp->spts[0], tcp->spts[1],
328 tcp->invflags & IPT_TCP_INV_SRCPT,
330 print_ports("dpt", tcp->dpts[0], tcp->dpts[1],
331 tcp->invflags & IPT_TCP_INV_DSTPT,
333 print_option(tcp->option,
334 tcp->invflags & IPT_TCP_INV_OPTION,
336 print_flags(tcp->flg_mask, tcp->flg_cmp,
337 tcp->invflags & IPT_TCP_INV_FLAGS,
339 if (tcp->invflags & ~IPT_TCP_INV_MASK)
341 tcp->invflags & ~IPT_TCP_INV_MASK);
381 printf("--tcp-option %u ", tcpinfo->option);
388 printf("--tcp-flags ");
398 static struct iptables_match tcp = {
400 .name = "tcp",
416 register_match(&tcp);