Lines Matching refs:chain

102 	{.name = "new-chain",     .has_arg = 1, .val = 'N'},
103 {.name = "delete-chain", .has_arg = 2, .val = 'X'},
104 {.name = "rename-chain", .has_arg = 1, .val = 'E'},
223 "Usage: %s -[ACD] chain rule-specification [options]\n"
224 " %s -I chain [rulenum] rule-specification [options]\n"
225 " %s -R chain rulenum rule-specification [options]\n"
226 " %s -D chain rulenum [options]\n"
227 " %s -[LS] [chain [rulenum]] [options]\n"
228 " %s -[FZ] [chain] [options]\n"
229 " %s -[NX] chain\n"
230 " %s -E old-chain-name new-chain-name\n"
231 " %s -P chain target [options]\n"
240 " --append -A chain Append to chain\n"
241 " --check -C chain Check for the existence of a rule\n"
242 " --delete -D chain Delete matching rule from chain\n"
243 " --delete -D chain rulenum\n"
244 " Delete rule rulenum (1 = first) from chain\n"
245 " --insert -I chain [rulenum]\n"
246 " Insert in chain as rulenum (default 1=first)\n"
247 " --replace -R chain rulenum\n"
248 " Replace rule rulenum (1 = first) in chain\n"
249 " --list -L [chain [rulenum]]\n"
250 " List the rules in a chain or all chains\n"
251 " --list-rules -S [chain [rulenum]]\n"
252 " Print the rules in a chain or all chains\n"
253 " --flush -F [chain] Delete all rules in chain or all chains\n"
254 " --zero -Z [chain [rulenum]]\n"
255 " Zero counters in chain or all chains\n"
256 " --new -N chain Create a new user-defined chain\n"
257 " --delete-chain\n"
258 " -X [chain] Delete a user-defined chain\n"
259 " --policy -P chain target\n"
260 " Change policy on chain to target\n"
261 " --rename-chain\n"
262 " -E old-chain new-chain\n"
263 " Change chain name, (moving any references)\n"
278 " --goto -g chain\n"
279 " jump to chain with no return\n"
477 print_header(unsigned int format, const char *chain, struct iptc_handle *handle)
480 const char *pol = iptc_get_policy(chain, &counters, handle);
481 printf("Chain %s", chain);
494 if (!iptc_get_references(&refs, chain, handle))
684 append_entry(const ipt_chainlabel chain,
706 ret &= iptc_append_entry(chain, fw, handle);
714 replace_entry(const ipt_chainlabel chain,
729 return iptc_replace_entry(chain, fw, rulenum, handle);
733 insert_entry(const ipt_chainlabel chain,
756 ret &= iptc_insert_entry(chain, fw, rulenum, handle);
798 delete_entry(const ipt_chainlabel chain,
824 ret &= iptc_delete_entry(chain, fw, mask, handle);
833 check_entry(const ipt_chainlabel chain, struct ipt_entry *fw,
854 ret &= iptc_check_entry(chain, fw, mask, handle);
867 const char *chain;
871 chain = iptc_first_chain(handle);
872 while (chain) {
874 chain = iptc_next_chain(handle);
879 chain = iptc_first_chain(handle);
880 while (chain) {
881 strcpy(chains + i*sizeof(ipt_chainlabel), chain);
883 chain = iptc_next_chain(handle);
899 flush_entries4(const ipt_chainlabel chain, int verbose,
902 if (!chain)
906 fprintf(stdout, "Flushing chain `%s'\n", chain);
907 return iptc_flush_entries(chain, handle);
911 zero_entries(const ipt_chainlabel chain, int verbose,
914 if (!chain)
918 fprintf(stdout, "Zeroing chain `%s'\n", chain);
919 return iptc_zero_entries(chain, handle);
923 delete_chain4(const ipt_chainlabel chain, int verbose,
926 if (!chain)
930 fprintf(stdout, "Deleting chain `%s'\n", chain);
931 return iptc_delete_chain(chain, handle);
935 list_entries(const ipt_chainlabel chain, int rulenum, int verbose, int numeric,
963 if (chain && strcmp(chain, this) != 0)
1103 struct iptc_handle *h, const char *chain, int counters)
1112 /* print chain name */
1113 printf("-A %s", chain);
1183 list_rules(const ipt_chainlabel chain, int rulenum, int counters,
1192 /* Dump out chain names first,
1197 if (chain && strcmp(this, chain) != 0)
1217 if (chain && strcmp(this, chain) != 0)
1305 /* TRY_LOAD (may be chain name) */
1371 const char *chain = NULL;
1415 chain = optarg;
1421 chain = optarg;
1427 chain = optarg;
1438 chain = optarg;
1451 chain = optarg;
1461 if (optarg) chain = optarg;
1464 chain = argv[optind++];
1473 if (optarg) chain = optarg;
1476 chain = argv[optind++];
1485 if (optarg) chain = optarg;
1488 chain = argv[optind++];
1494 if (optarg) chain = optarg;
1497 chain = argv[optind++];
1508 "chain name not allowed to start "
1512 "chain name may not clash "
1516 chain = optarg;
1522 if (optarg) chain = optarg;
1525 chain = argv[optind++];
1531 chain = optarg;
1537 "-%c requires old-chain-name and "
1538 "new-chain-name",
1545 chain = optarg;
1551 "-%c requires a chain and a policy",
1803 if (chain != NULL && strlen(chain) >= XT_EXTENSION_MAXNAMELEN)
1805 "chain name `%s' too long (must be under %u chars)",
1806 chain, XT_EXTENSION_MAXNAMELEN);
1826 if (strcmp(chain, "PREROUTING") == 0
1827 || strcmp(chain, "INPUT") == 0) {
1833 chain);
1836 if (strcmp(chain, "POSTROUTING") == 0
1837 || strcmp(chain, "OUTPUT") == 0) {
1843 chain);
1848 "Warning: using chain %s, not extension\n",
1857 /* If they didn't specify a target, or it's a chain
1879 /* it is no chain, and we can't load a plugin.
1882 * chain. */
1886 "goto '%s' is not a chain\n",
1898 ret = append_entry(chain, e,
1905 ret = delete_entry(chain, e,
1912 ret = iptc_delete_num_entry(chain, rulenum - 1, *handle);
1915 ret = check_entry(chain, e,
1922 ret = replace_entry(chain, e, rulenum - 1,
1927 ret = insert_entry(chain, e, rulenum - 1,
1934 ret = flush_entries4(chain, cs.options&OPT_VERBOSE, *handle);
1937 ret = zero_entries(chain, cs.options&OPT_VERBOSE, *handle);
1940 ret = iptc_zero_counter(chain, rulenum, *handle);
1945 ret = list_entries(chain,
1953 ret = zero_entries(chain,
1956 ret = iptc_zero_counter(chain, rulenum, *handle);
1961 ret = list_rules(chain,
1966 ret = zero_entries(chain,
1969 ret = iptc_zero_counter(chain, rulenum, *handle);
1972 ret = iptc_create_chain(chain, *handle);
1975 ret = delete_chain4(chain, cs.options&OPT_VERBOSE, *handle);
1978 ret = iptc_rename_chain(chain, newname, *handle);
1981 ret = iptc_set_policy(chain, policy, cs.options&OPT_COUNTERS ? &cs.fw.counters : NULL, *handle);