Lines Matching refs:cs

1214 static void command_jump(struct iptables_command_state *cs)  in command_jump()  argument
1218 set_option(&cs->options, OPT_JUMP, &cs->fw6.ipv6.invflags, cs->invert); in command_jump()
1219 cs->jumpto = parse_target(optarg); in command_jump()
1221 cs->target = xtables_find_target(cs->jumpto, XTF_TRY_LOAD); in command_jump()
1223 if (cs->target == NULL) in command_jump()
1226 size = XT_ALIGN(sizeof(struct xt_entry_target)) + cs->target->size; in command_jump()
1228 cs->target->t = xtables_calloc(1, size); in command_jump()
1229 cs->target->t->u.target_size = size; in command_jump()
1230 if (cs->target->real_name == NULL) { in command_jump()
1231 strcpy(cs->target->t->u.user.name, cs->jumpto); in command_jump()
1233 strcpy(cs->target->t->u.user.name, cs->target->real_name); in command_jump()
1234 if (!(cs->target->ext_flags & XTABLES_EXT_ALIAS)) in command_jump()
1237 cs->jumpto, cs->target->real_name); in command_jump()
1239 cs->target->t->u.user.revision = cs->target->revision; in command_jump()
1241 xs_init_target(cs->target); in command_jump()
1242 if (cs->target->x6_options != NULL) in command_jump()
1244 cs->target->x6_options, in command_jump()
1245 &cs->target->option_offset); in command_jump()
1248 cs->target->extra_opts, in command_jump()
1249 &cs->target->option_offset); in command_jump()
1254 static void command_match(struct iptables_command_state *cs) in command_match() argument
1259 if (cs->invert) in command_match()
1263 m = xtables_find_match(optarg, XTF_LOAD_MUST_SUCCEED, &cs->matches); in command_match()
1292 struct iptables_command_state cs; in do_command6() local
1311 memset(&cs, 0, sizeof(cs)); in do_command6()
1312 cs.jumpto = ""; in do_command6()
1313 cs.argv = argv; in do_command6()
1334 while ((cs.c = getopt_long(argc, argv, in do_command6()
1337 switch (cs.c) { in do_command6()
1343 cs.invert); in do_command6()
1349 cs.invert); in do_command6()
1355 cs.invert); in do_command6()
1366 cs.invert); in do_command6()
1379 cs.invert); in do_command6()
1389 CMD_ZERO | CMD_ZERO_NUM, cs.invert); in do_command6()
1401 CMD_ZERO | CMD_ZERO_NUM, cs.invert); in do_command6()
1413 cs.invert); in do_command6()
1422 cs.invert); in do_command6()
1444 cs.invert); in do_command6()
1450 cs.invert); in do_command6()
1459 cs.invert); in do_command6()
1473 cs.invert); in do_command6()
1489 if (!cs.matches && cs.protocol) in do_command6()
1490 xtables_find_match(cs.protocol, XTF_TRY_LOAD, in do_command6()
1491 &cs.matches); in do_command6()
1493 exit_printhelp(cs.matches); in do_command6()
1499 set_option(&cs.options, OPT_PROTOCOL, &cs.fw6.ipv6.invflags, in do_command6()
1500 cs.invert); in do_command6()
1503 for (cs.protocol = optarg; *cs.protocol; cs.protocol++) in do_command6()
1504 *cs.protocol = tolower(*cs.protocol); in do_command6()
1506 cs.protocol = optarg; in do_command6()
1507 cs.fw6.ipv6.proto = xtables_parse_protocol(cs.protocol); in do_command6()
1508 cs.fw6.ipv6.flags |= IP6T_F_PROTO; in do_command6()
1510 if (cs.fw6.ipv6.proto == 0 in do_command6()
1511 && (cs.fw6.ipv6.invflags & XT_INV_PROTO)) in do_command6()
1515 if (is_exthdr(cs.fw6.ipv6.proto) in do_command6()
1516 && (cs.fw6.ipv6.invflags & XT_INV_PROTO) == 0) in do_command6()
1520 cs.protocol); in do_command6()
1524 set_option(&cs.options, OPT_SOURCE, &cs.fw6.ipv6.invflags, in do_command6()
1525 cs.invert); in do_command6()
1530 set_option(&cs.options, OPT_DESTINATION, &cs.fw6.ipv6.invflags, in do_command6()
1531 cs.invert); in do_command6()
1537 set_option(&cs.options, OPT_JUMP, &cs.fw6.ipv6.invflags, in do_command6()
1538 cs.invert); in do_command6()
1539 cs.fw6.ipv6.flags |= IP6T_F_GOTO; in do_command6()
1540 cs.jumpto = parse_target(optarg); in do_command6()
1545 command_jump(&cs); in do_command6()
1554 set_option(&cs.options, OPT_VIANAMEIN, &cs.fw6.ipv6.invflags, in do_command6()
1555 cs.invert); in do_command6()
1557 cs.fw6.ipv6.iniface, in do_command6()
1558 cs.fw6.ipv6.iniface_mask); in do_command6()
1566 set_option(&cs.options, OPT_VIANAMEOUT, &cs.fw6.ipv6.invflags, in do_command6()
1567 cs.invert); in do_command6()
1569 cs.fw6.ipv6.outiface, in do_command6()
1570 cs.fw6.ipv6.outiface_mask); in do_command6()
1575 set_option(&cs.options, OPT_VERBOSE, in do_command6()
1576 &cs.fw6.ipv6.invflags, cs.invert); in do_command6()
1590 command_match(&cs); in do_command6()
1594 set_option(&cs.options, OPT_NUMERIC, &cs.fw6.ipv6.invflags, in do_command6()
1595 cs.invert); in do_command6()
1599 if (cs.invert) in do_command6()
1606 set_option(&cs.options, OPT_EXPANDED, &cs.fw6.ipv6.invflags, in do_command6()
1607 cs.invert); in do_command6()
1611 if (cs.invert) in do_command6()
1619 set_option(&cs.options, OPT_LINENUMBERS, &cs.fw6.ipv6.invflags, in do_command6()
1620 cs.invert); in do_command6()
1629 set_option(&cs.options, OPT_COUNTERS, &cs.fw6.ipv6.invflags, in do_command6()
1630 cs.invert); in do_command6()
1647 cs.fw6.counters.pcnt = cnt; in do_command6()
1653 cs.fw6.counters.bcnt = cnt; in do_command6()
1669 if (cs.invert) in do_command6()
1673 cs.invert = TRUE; in do_command6()
1681 if (command_default(&cs, &ip6tables_globals) == 1) in do_command6()
1690 cs.invert = FALSE; in do_command6()
1693 for (matchp = cs.matches; matchp; matchp = matchp->next) in do_command6()
1695 if (cs.target != NULL) in do_command6()
1696 xtables_option_tfcall(cs.target); in do_command6()
1705 if (cs.invert) in do_command6()
1710 if (!(cs.options & OPT_DESTINATION)) in do_command6()
1712 if (!(cs.options & OPT_SOURCE)) in do_command6()
1725 (cs.fw6.ipv6.invflags & (IP6T_INV_SRCIP | IP6T_INV_DSTIP))) in do_command6()
1733 generic_opt_check(command, cs.options); in do_command6()
1769 if (cs.options & OPT_VIANAMEOUT) in do_command6()
1779 if (cs.options & OPT_VIANAMEIN) in do_command6()
1786 if (cs.target && ip6tc_is_chain(cs.jumpto, *handle)) { in do_command6()
1789 cs.jumpto); in do_command6()
1791 if (cs.target->t) in do_command6()
1792 free(cs.target->t); in do_command6()
1794 cs.target = NULL; in do_command6()
1799 if (!cs.target in do_command6()
1800 && (strlen(cs.jumpto) == 0 in do_command6()
1801 || ip6tc_is_chain(cs.jumpto, *handle))) { in do_command6()
1804 cs.target = xtables_find_target(XT_STANDARD_TARGET, in do_command6()
1808 + cs.target->size; in do_command6()
1809 cs.target->t = xtables_calloc(1, size); in do_command6()
1810 cs.target->t->u.target_size = size; in do_command6()
1811 strcpy(cs.target->t->u.user.name, cs.jumpto); in do_command6()
1812 xs_init_target(cs.target); in do_command6()
1815 if (!cs.target) { in do_command6()
1821 if (cs.fw6.ipv6.flags & IP6T_F_GOTO) in do_command6()
1824 cs.jumpto); in do_command6()
1826 xtables_find_target(cs.jumpto, XTF_LOAD_MUST_SUCCEED); in do_command6()
1828 e = generate_entry(&cs.fw6, cs.matches, cs.target->t); in do_command6()
1829 free(cs.target->t); in do_command6()
1838 cs.options&OPT_VERBOSE, in do_command6()
1845 cs.options&OPT_VERBOSE, in do_command6()
1846 *handle, cs.matches, cs.target); in do_command6()
1855 cs.options&OPT_VERBOSE, in do_command6()
1856 *handle, cs.matches, cs.target); in do_command6()
1861 cs.options&OPT_VERBOSE, *handle); in do_command6()
1867 cs.options&OPT_VERBOSE, in do_command6()
1871 ret = flush_entries6(chain, cs.options&OPT_VERBOSE, *handle); in do_command6()
1874 ret = zero_entries(chain, cs.options&OPT_VERBOSE, *handle); in do_command6()
1884 cs.options&OPT_VERBOSE, in do_command6()
1885 cs.options&OPT_NUMERIC, in do_command6()
1886 cs.options&OPT_EXPANDED, in do_command6()
1887 cs.options&OPT_LINENUMBERS, in do_command6()
1891 cs.options&OPT_VERBOSE, *handle); in do_command6()
1900 cs.options&OPT_VERBOSE, in do_command6()
1904 cs.options&OPT_VERBOSE, *handle); in do_command6()
1912 ret = delete_chain6(chain, cs.options&OPT_VERBOSE, *handle); in do_command6()
1918 ret = ip6tc_set_policy(chain, policy, cs.options&OPT_COUNTERS ? &cs.fw6.counters : NULL, *handle); in do_command6()
1928 xtables_rule_matches_free(&cs.matches); in do_command6()