Lines Matching refs:chains
5 * Chains go INPUT, FORWARD, OUTPUT then user chains.
7 * Every chain ends with an unconditional jump: a RETURN for user chains,
138 struct list_head chains;
143 unsigned int num_chains; /* number of user defined chains */
148 int sorted_offsets; /* if chains are received sorted from kernel,
311 * chains in chain list don't change the correctness of the chain
316 * CHAIN_INDEX_INSERT_MAX chains has been added.
344 list_pos=&handle->chains;
346 /* Check for empty array, e.g. no user defined chains */
363 return &handle->chains; /* Be safe, return orig start pos */
451 /* If chains were not received sorted from kernel, then the
455 pos = handle->chains.next;
473 list_pos = &handle->chains;
546 unsigned int chains = 0;
553 debug("Number of user defined chains:%d bucket_sz:%d array_sz:%d\n",
559 list_for_each_entry(c, &h->chains, list) {
562 * builtin chains, as they are not sorted */
564 cindex=chains / list_length;
567 * is useful if chains are added and array is
572 if ((chains % list_length)== 0) {
573 debug("\nIndex[%d] Chains:", cindex);
576 chains++;
603 * the simple approach behaves badly when all chains are deleted
693 if (list_empty(&handle->chains))
700 * chains, but this function is only used for finding jump
704 // list_for_each(pos, &handle->chains) {
726 if (list_empty(&handle->chains))
729 /* First look at builtin chains */
730 list_for_each(pos, &handle->chains) {
743 if (list_start_pos == &handle->chains) {
765 /* Initial/special case, no user defined chains */
784 if (pos == &handle->chains) {
862 list_start_pos = h->chains.next;
867 if (list_start_pos == &h->chains) {
868 list_start_pos = h->chains.next;
871 /* sort only user defined chains */
880 if (&tmp->list == &h->chains) {
888 list_add_tail(&c->list, &h->chains);
896 struct list_head *tail = h->chains.prev;
904 /* Chains from kernel are already sorted, as they are inserted
909 if (iptcc_is_builtin(c)) /* Only user defined chains are sorted*/
910 list_add_tail(&c->list, &h->chains);
916 list_add_tail(&c->list, &h->chains);/* Already sorted*/
920 /* Notice, if chains were not received sorted
1053 /* Assume that chains offsets are sorted, this verified during
1067 list_for_each_entry(c, &h->chains, list) {
1127 /* Jumps can only happen to builtin chains, so we
1150 /* only user-defined chains have heaer */
1233 list_for_each_entry(c, &h->chains, list) {
1255 list_for_each_entry(c, &h->chains, list) {
1289 INIT_LIST_HEAD(&h->chains);
1396 list_for_each_entry_safe(c, tmp, &h->chains, list) {
1458 if (c->list.next == &handle->chains)
1465 /* Iterator functions to run through the chains. */
1469 struct chain_head *c = list_entry(handle->chains.next,
1475 if (list_empty(&handle->chains)) {
1476 DEBUGP(": no chains\n");
1487 /* Iterator functions to run through the chains. Returns NULL at end. */
1496 DEBUGP(": no more chains\n");
2276 /* Inserting chains don't change the correctness of the chain
2280 * capacity is exceed with CHAIN_INDEX_INSERT_MAX chains.
2285 debug("Capacity(%d) exceeded(%d) rebuild (chains:%d)\n",
2615 list_for_each_entry(c, &handle->chains, list) {
2618 /* Builtin chains have their own counters */