Lines Matching full:ch
96 static struct table_config *alloc_table_config(struct ip_fw_chain *ch,
100 static int create_table_internal(struct ip_fw_chain *ch, struct tid_info *ti,
102 static void link_table(struct ip_fw_chain *ch, struct table_config *tc);
103 static void unlink_table(struct ip_fw_chain *ch, struct table_config *tc);
104 static int find_ref_table(struct ip_fw_chain *ch, struct tid_info *ti,
108 static int export_tables(struct ip_fw_chain *ch, ipfw_obj_lheader *olh,
110 static void export_table_info(struct ip_fw_chain *ch, struct table_config *tc,
115 static int swap_tables(struct ip_fw_chain *ch, struct tid_info *a,
119 static int check_table_space(struct ip_fw_chain *ch, struct tableop_state *ts,
121 static int destroy_table(struct ip_fw_chain *ch, struct tid_info *ti);
130 #define KIDX_TO_TI(ch, k) (&(((struct table_info *)(ch)->tablestate)[k])) argument
135 rollback_toperation_state(struct ip_fw_chain *ch, void *object) in rollback_toperation_state() argument
140 tcfg = CHAIN_TO_TCFG(ch); in rollback_toperation_state()
146 add_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts) in add_toperation_state() argument
150 tcfg = CHAIN_TO_TCFG(ch); in add_toperation_state()
155 del_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts) in del_toperation_state() argument
159 tcfg = CHAIN_TO_TCFG(ch); in del_toperation_state()
178 get_table_value(struct ip_fw_chain *ch, struct table_config *tc, uint32_t kidx) in get_table_value() argument
182 pval = (struct table_value *)ch->valuestate; in get_table_value()
259 create_table_compat(struct ip_fw_chain *ch, struct tid_info *ti, in create_table_compat() argument
269 error = create_table_internal(ch, ti, NULL, &xi, pkidx, 1); in create_table_compat()
286 find_ref_table(struct ip_fw_chain *ch, struct tid_info *ti, in find_ref_table() argument
295 IPFW_UH_WLOCK_ASSERT(ch); in find_ref_table()
297 ni = CHAIN_TO_NI(ch); in find_ref_table()
325 IPFW_UH_WUNLOCK(ch); in find_ref_table()
326 error = create_table_compat(ch, ti, &kidx); in find_ref_table()
327 IPFW_UH_WLOCK(ch); in find_ref_table()
348 rollback_added_entries(struct ip_fw_chain *ch, struct table_config *tc, in rollback_added_entries() argument
359 IPFW_UH_WLOCK_ASSERT(ch); in rollback_added_entries()
379 error = ta->prepare_del(ch, ptei, vv); in rollback_added_entries()
395 prepare_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in prepare_batch_buffer() argument
427 ta->prepare_add(ch, ptei, v) : ta->prepare_del(ch, ptei, v); in prepare_batch_buffer()
447 flush_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in flush_batch_buffer() argument
462 ta->flush_entry(ch, ptei, v); in flush_batch_buffer()
473 ta->flush_entry(ch, &tei[i], v); in flush_batch_buffer()
483 struct ip_fw_chain *ch __diagused; in rollback_add_entry()
488 if (ts->tc != object && ts->ch != object) in rollback_add_entry()
491 ch = ts->ch; in rollback_add_entry()
493 IPFW_UH_WLOCK_ASSERT(ch); in rollback_add_entry()
543 add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, in add_table_entry() argument
558 IPFW_UH_WLOCK(ch); in add_table_entry()
565 IPFW_UH_WUNLOCK(ch); in add_table_entry()
566 flush_batch_buffer(ch, ta, tei, count, rollback, in add_table_entry()
570 IPFW_UH_WLOCK(ch); in add_table_entry()
573 error = find_ref_table(ch, ti, tei, count, OP_ADD, &tc); in add_table_entry()
575 IPFW_UH_WUNLOCK(ch); in add_table_entry()
581 ts.ch = ch; in add_table_entry()
590 add_toperation_state(ch, &ts); in add_table_entry()
591 IPFW_UH_WUNLOCK(ch); in add_table_entry()
596 error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); in add_table_entry()
598 IPFW_UH_WLOCK(ch); in add_table_entry()
599 del_toperation_state(ch, &ts); in add_table_entry()
620 error = ipfw_link_table_values(ch, &ts, flags); in add_table_entry()
631 error = check_table_space(ch, &ts, tc, KIDX_TO_TI(ch, kidx), count); in add_table_entry()
643 IPFW_WLOCK(ch); in add_table_entry()
659 error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), in add_table_entry()
682 rollback_added_entries(ch, tc, KIDX_TO_TI(ch, kidx), in add_table_entry()
689 IPFW_WUNLOCK(ch); in add_table_entry()
691 ipfw_garbage_table_values(ch, tc, tei, count, rollback); in add_table_entry()
695 check_table_space(ch, NULL, tc, KIDX_TO_TI(ch, kidx), 0); in add_table_entry()
701 IPFW_UH_WUNLOCK(ch); in add_table_entry()
703 flush_batch_buffer(ch, ta, tei, count, rollback, ta_buf_m, ta_buf); in add_table_entry()
714 del_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, in del_table_entry() argument
729 IPFW_UH_WLOCK(ch); in del_table_entry()
730 error = find_ref_table(ch, ti, tei, count, OP_DEL, &tc); in del_table_entry()
732 IPFW_UH_WUNLOCK(ch); in del_table_entry()
736 IPFW_UH_WUNLOCK(ch); in del_table_entry()
741 error = prepare_batch_buffer(ch, ta, tei, count, OP_DEL, &ta_buf_m); in del_table_entry()
745 IPFW_UH_WLOCK(ch); in del_table_entry()
755 IPFW_UH_WUNLOCK(ch); in del_table_entry()
764 IPFW_WLOCK(ch); in del_table_entry()
769 error = ta->del(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, in del_table_entry()
778 IPFW_WUNLOCK(ch); in del_table_entry()
781 ipfw_garbage_table_values(ch, tc, tei, count, 0); in del_table_entry()
785 check_table_space(ch, NULL, tc, KIDX_TO_TI(ch, kidx), 0); in del_table_entry()
788 IPFW_UH_WUNLOCK(ch); in del_table_entry()
794 flush_batch_buffer(ch, ta, tei, count, 0, ta_buf_m, ta_buf); in del_table_entry()
814 check_table_space(struct ip_fw_chain *ch, struct tableop_state *ts, in check_table_space() argument
822 IPFW_UH_WLOCK_ASSERT(ch); in check_table_space()
846 add_toperation_state(ch, ts); in check_table_space()
847 IPFW_UH_WUNLOCK(ch); in check_table_space()
852 IPFW_UH_WLOCK(ch); in check_table_space()
854 del_toperation_state(ch, ts); in check_table_space()
870 ti = KIDX_TO_TI(ch, tc->no.kidx); in check_table_space()
872 IPFW_UH_WUNLOCK(ch); in check_table_space()
885 IPFW_WLOCK(ch); in check_table_space()
887 IPFW_WUNLOCK(ch); in check_table_space()
906 manage_table_ent_v0(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in manage_table_ent_v0() argument
947 add_table_entry(ch, &ti, &tei, 0, 1) : in manage_table_ent_v0()
948 del_table_entry(ch, &ti, &tei, 0, 1); in manage_table_ent_v0()
963 manage_table_ent_v1(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in manage_table_ent_v1() argument
1045 add_table_entry(ch, &ti, tei_buf, ctlv->flags, ctlv->count) : in manage_table_ent_v1()
1046 del_table_entry(ch, &ti, tei_buf, ctlv->flags, ctlv->count); in manage_table_ent_v1()
1084 find_table_entry(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in find_table_entry() argument
1114 IPFW_UH_RLOCK(ch); in find_table_entry()
1115 ni = CHAIN_TO_NI(ch); in find_table_entry()
1122 IPFW_UH_RUNLOCK(ch); in find_table_entry()
1128 IPFW_UH_RUNLOCK(ch); in find_table_entry()
1132 kti = KIDX_TO_TI(ch, tc->no.kidx); in find_table_entry()
1140 pval = get_table_value(ch, tc, tent->v.kidx); in find_table_entry()
1143 IPFW_UH_RUNLOCK(ch); in find_table_entry()
1156 flush_table_v0(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in flush_table_v0() argument
1170 error = destroy_table(ch, &ti); in flush_table_v0()
1172 error = flush_table(ch, &ti); in flush_table_v0()
1203 flush_table(struct ip_fw_chain *ch, struct tid_info *ti) in flush_table() argument
1220 IPFW_UH_WLOCK(ch); in flush_table()
1221 ni = CHAIN_TO_NI(ch); in flush_table()
1223 IPFW_UH_WUNLOCK(ch); in flush_table()
1238 IPFW_UH_WUNLOCK(ch); in flush_table()
1243 ta->print_config(tc->astate, KIDX_TO_TI(ch, tc->no.kidx), in flush_table()
1250 add_toperation_state(ch, &ts); in flush_table()
1251 IPFW_UH_WUNLOCK(ch); in flush_table()
1265 error = ta->init(ch, &astate_new, &ti_new, pstate, tflags); in flush_table()
1271 IPFW_UH_WLOCK(ch); in flush_table()
1273 del_toperation_state(ch, &ts); in flush_table()
1276 IPFW_UH_WUNLOCK(ch); in flush_table()
1292 ni = CHAIN_TO_NI(ch); in flush_table()
1294 tablestate = (struct table_info *)ch->tablestate; in flush_table()
1296 IPFW_WLOCK(ch); in flush_table()
1299 IPFW_WUNLOCK(ch); in flush_table()
1313 ipfw_unref_table_values(ch, tc, ta, astate_old, &ti_old); in flush_table()
1314 IPFW_UH_WUNLOCK(ch); in flush_table()
1332 swap_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in swap_table() argument
1346 error = swap_tables(ch, &ti_a, &ti_b); in swap_table()
1363 * runtime data @ti (ch->tablestate)
1381 swap_tables(struct ip_fw_chain *ch, struct tid_info *a, in swap_tables() argument
1395 IPFW_UH_WLOCK(ch); in swap_tables()
1396 ni = CHAIN_TO_NI(ch); in swap_tables()
1398 IPFW_UH_WUNLOCK(ch); in swap_tables()
1402 IPFW_UH_WUNLOCK(ch); in swap_tables()
1408 IPFW_UH_WUNLOCK(ch); in swap_tables()
1414 IPFW_UH_WUNLOCK(ch); in swap_tables()
1421 IPFW_UH_WUNLOCK(ch); in swap_tables()
1427 IPFW_UH_WUNLOCK(ch); in swap_tables()
1432 rollback_toperation_state(ch, tc_a); in swap_tables()
1433 rollback_toperation_state(ch, tc_b); in swap_tables()
1436 tablestate = (struct table_info *)ch->tablestate; in swap_tables()
1442 IPFW_WLOCK(ch); in swap_tables()
1453 IPFW_WUNLOCK(ch); in swap_tables()
1465 IPFW_UH_WUNLOCK(ch); in swap_tables()
1478 destroy_table(struct ip_fw_chain *ch, struct tid_info *ti) in destroy_table() argument
1483 IPFW_UH_WLOCK(ch); in destroy_table()
1485 ni = CHAIN_TO_NI(ch); in destroy_table()
1487 IPFW_UH_WUNLOCK(ch); in destroy_table()
1493 IPFW_UH_WUNLOCK(ch); in destroy_table()
1497 IPFW_WLOCK(ch); in destroy_table()
1498 unlink_table(ch, tc); in destroy_table()
1499 IPFW_WUNLOCK(ch); in destroy_table()
1507 ipfw_unref_table_values(ch, tc, tc->ta, tc->astate, &tc->ti_copy); in destroy_table()
1508 IPFW_UH_WUNLOCK(ch); in destroy_table()
1521 ipfw_resize_tables(struct ip_fw_chain *ch, unsigned int ntables) in ipfw_resize_tables() argument
1544 IPFW_UH_WLOCK(ch); in ipfw_resize_tables()
1547 ni = CHAIN_TO_NI(ch); in ipfw_resize_tables()
1554 IPFW_UH_WUNLOCK(ch); in ipfw_resize_tables()
1559 memcpy(tablestate, ch->tablestate, sizeof(struct table_info) * tbl); in ipfw_resize_tables()
1562 IPFW_WLOCK(ch); in ipfw_resize_tables()
1565 old_tablestate = ch->tablestate; in ipfw_resize_tables()
1566 ch->tablestate = tablestate; in ipfw_resize_tables()
1571 IPFW_WUNLOCK(ch); in ipfw_resize_tables()
1574 ti = (struct table_info *)ch->tablestate; in ipfw_resize_tables()
1585 IPFW_UH_WUNLOCK(ch); in ipfw_resize_tables()
1598 ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch, uint16_t kidx) in ipfw_objhash_lookup_table_kidx() argument
1601 return (ipfw_objhash_lookup_kidx(CHAIN_TO_NI(ch), kidx)); in ipfw_objhash_lookup_table_kidx()
1609 ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint16_t *kidx) in ipfw_ref_table() argument
1615 IPFW_UH_WLOCK_ASSERT(ch); in ipfw_ref_table()
1618 error = find_table_err(CHAIN_TO_NI(ch), &ti, &tc); in ipfw_ref_table()
1632 ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx) in ipfw_unref_table() argument
1638 IPFW_UH_WLOCK_ASSERT(ch); in ipfw_unref_table()
1639 ni = CHAIN_TO_NI(ch); in ipfw_unref_table()
1652 ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, uint16_t plen, in ipfw_lookup_table() argument
1657 ti = KIDX_TO_TI(ch, tbl); in ipfw_lookup_table()
1680 list_tables(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in list_tables() argument
1692 IPFW_UH_RLOCK(ch); in list_tables()
1693 error = export_tables(ch, olh, sd); in list_tables()
1694 IPFW_UH_RUNLOCK(ch); in list_tables()
1708 describe_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in describe_table() argument
1723 IPFW_UH_RLOCK(ch); in describe_table()
1724 if ((tc = find_table(CHAIN_TO_NI(ch), &ti)) == NULL) { in describe_table()
1725 IPFW_UH_RUNLOCK(ch); in describe_table()
1729 export_table_info(ch, tc, (ipfw_xtable_info *)(oh + 1)); in describe_table()
1730 IPFW_UH_RUNLOCK(ch); in describe_table()
1743 modify_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in modify_table() argument
1770 IPFW_UH_WLOCK(ch); in modify_table()
1771 ni = CHAIN_TO_NI(ch); in modify_table()
1773 IPFW_UH_WUNLOCK(ch); in modify_table()
1779 IPFW_UH_WUNLOCK(ch); in modify_table()
1787 IPFW_UH_WUNLOCK(ch); in modify_table()
1800 create_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in create_table() argument
1833 ni = CHAIN_TO_NI(ch); in create_table()
1835 IPFW_UH_RLOCK(ch); in create_table()
1837 IPFW_UH_RUNLOCK(ch); in create_table()
1840 IPFW_UH_RUNLOCK(ch); in create_table()
1842 return (create_table_internal(ch, &ti, aname, i, NULL, 0)); in create_table()
1855 create_table_internal(struct ip_fw_chain *ch, struct tid_info *ti, in create_table_internal() argument
1863 ni = CHAIN_TO_NI(ch); in create_table_internal()
1865 ta = find_table_algo(CHAIN_TO_TCFG(ch), ti, aname); in create_table_internal()
1869 tc = alloc_table_config(ch, ti, ta, aname, i->tflags); in create_table_internal()
1880 IPFW_UH_WLOCK(ch); in create_table_internal()
1891 IPFW_UH_WUNLOCK(ch); in create_table_internal()
1903 IPFW_UH_WUNLOCK(ch); in create_table_internal()
1912 link_table(ch, tc); in create_table_internal()
1920 IPFW_UH_WUNLOCK(ch); in create_table_internal()
1947 ipfw_get_table_objhash(struct ip_fw_chain *ch) in ipfw_get_table_objhash() argument
1950 return (CHAIN_TO_NI(ch)); in ipfw_get_table_objhash()
1961 ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint16_t kidx, in ipfw_export_table_ntlv() argument
1968 ni = CHAIN_TO_NI(ch); in ipfw_export_table_ntlv()
1986 struct ip_fw_chain *ch; member
2019 table_get_count(struct ip_fw_chain *ch, struct table_config *tc) in table_get_count() argument
2025 ti = KIDX_TO_TI(ch, tc->no.kidx); in table_get_count()
2047 export_table_info(struct ip_fw_chain *ch, struct table_config *tc, in export_table_info() argument
2059 i->count = table_get_count(ch, tc); in export_table_info()
2065 ti = KIDX_TO_TI(ch, tc->no.kidx); in export_table_info()
2081 struct ip_fw_chain *ch; member
2097 export_table_info(dta->ch, (struct table_config *)no, i); in export_table_internal()
2110 export_tables(struct ip_fw_chain *ch, ipfw_obj_lheader *olh, in export_tables() argument
2117 count = ipfw_objhash_count(CHAIN_TO_NI(ch)); in export_tables()
2131 dta.ch = ch; in export_tables()
2134 ipfw_objhash_foreach(CHAIN_TO_NI(ch), export_table_internal, &dta); in export_tables()
2148 dump_table_v1(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in dump_table_v1() argument
2167 IPFW_UH_RLOCK(ch); in dump_table_v1()
2168 if ((tc = find_table(CHAIN_TO_NI(ch), &ti)) == NULL) { in dump_table_v1()
2169 IPFW_UH_RUNLOCK(ch); in dump_table_v1()
2172 export_table_info(ch, tc, i); in dump_table_v1()
2181 IPFW_UH_RUNLOCK(ch); in dump_table_v1()
2189 da.ch = ch; in dump_table_v1()
2190 da.ti = KIDX_TO_TI(ch, tc->no.kidx); in dump_table_v1()
2197 IPFW_UH_RUNLOCK(ch); in dump_table_v1()
2211 dump_table_v0(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in dump_table_v0() argument
2228 IPFW_UH_RLOCK(ch); in dump_table_v0()
2229 if ((tc = find_table(CHAIN_TO_NI(ch), &ti)) == NULL) { in dump_table_v0()
2230 IPFW_UH_RUNLOCK(ch); in dump_table_v0()
2233 count = table_get_count(ch, tc); in dump_table_v0()
2248 IPFW_UH_RUNLOCK(ch); in dump_table_v0()
2254 da.ch = ch; in dump_table_v0()
2255 da.ti = KIDX_TO_TI(ch, tc->no.kidx); in dump_table_v0()
2262 IPFW_UH_RUNLOCK(ch); in dump_table_v0()
2271 get_table_size(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in get_table_size() argument
2287 IPFW_UH_RLOCK(ch); in get_table_size()
2288 error = ipfw_count_xtable(ch, &ti, tbl); in get_table_size()
2289 IPFW_UH_RUNLOCK(ch); in get_table_size()
2297 ipfw_count_table(struct ip_fw_chain *ch, struct tid_info *ti, uint32_t *cnt) in ipfw_count_table() argument
2301 if ((tc = find_table(CHAIN_TO_NI(ch), ti)) == NULL) in ipfw_count_table()
2303 *cnt = table_get_count(ch, tc); in ipfw_count_table()
2311 ipfw_count_xtable(struct ip_fw_chain *ch, struct tid_info *ti, uint32_t *cnt) in ipfw_count_xtable() argument
2316 if ((tc = find_table(CHAIN_TO_NI(ch), ti)) == NULL) { in ipfw_count_xtable()
2321 count = table_get_count(ch, tc); in ipfw_count_xtable()
2356 pval = get_table_value(da->ch, da->tc, da->tent.v.kidx); in dump_table_entry()
2366 ipfw_dump_table_legacy(struct ip_fw_chain *ch, struct tid_info *ti, in ipfw_dump_table_legacy() argument
2375 if ((tc = find_table(CHAIN_TO_NI(ch), ti)) == NULL) in ipfw_dump_table_legacy()
2385 da.ch = ch; in ipfw_dump_table_legacy()
2386 da.ti = KIDX_TO_TI(ch, tc->no.kidx); in ipfw_dump_table_legacy()
2429 pval = get_table_value(da->ch, da->tc, tent->v.kidx); in dump_table_tentry()
2469 pval = get_table_value(da->ch, da->tc, da->tent.v.kidx); in dump_table_xentry()
2513 ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint16_t kidx, in ipfw_foreach_table_tentry() argument
2521 ni = CHAIN_TO_NI(ch); in ipfw_foreach_table_tentry()
2530 da.ch = ch; in ipfw_foreach_table_tentry()
2531 da.ti = KIDX_TO_TI(ch, tc->no.kidx); in ipfw_foreach_table_tentry()
2605 ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta, size_t size, in ipfw_add_table_algo() argument
2626 tcfg = CHAIN_TO_TCFG(ch); in ipfw_add_table_algo()
2649 ipfw_del_table_algo(struct ip_fw_chain *ch, int idx) in ipfw_del_table_algo() argument
2654 tcfg = CHAIN_TO_TCFG(ch); in ipfw_del_table_algo()
2677 list_table_algo(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in list_table_algo() argument
2692 IPFW_UH_RLOCK(ch); in list_table_algo()
2693 tcfg = CHAIN_TO_TCFG(ch); in list_table_algo()
2703 IPFW_UH_RUNLOCK(ch); in list_table_algo()
2717 IPFW_UH_RUNLOCK(ch); in list_table_algo()
2810 table_findbyname(struct ip_fw_chain *ch, struct tid_info *ti, in table_findbyname() argument
2816 IPFW_UH_WLOCK_ASSERT(ch); in table_findbyname()
2818 error = find_table_err(CHAIN_TO_NI(ch), ti, &tc); in table_findbyname()
2828 table_findbykidx(struct ip_fw_chain *ch, uint16_t idx) in table_findbykidx() argument
2833 IPFW_UH_WLOCK_ASSERT(ch); in table_findbykidx()
2834 ni = CHAIN_TO_NI(ch); in table_findbykidx()
2842 table_manage_sets(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, in table_manage_sets() argument
2875 return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, in table_manage_sets()
2887 table_manage_sets_all(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, in table_manage_sets_all() argument
2905 return (table_manage_sets(ch, set, new_set, cmd)); in table_manage_sets_all()
2908 return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, in table_manage_sets_all()
3014 ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int sets) in ipfw_switch_tables_namespace() argument
3025 IPFW_UH_WLOCK(ch); in ipfw_switch_tables_namespace()
3028 IPFW_UH_WUNLOCK(ch); in ipfw_switch_tables_namespace()
3031 ni = CHAIN_TO_NI(ch); in ipfw_switch_tables_namespace()
3039 IPFW_UH_WUNLOCK(ch); in ipfw_switch_tables_namespace()
3046 for (i = 0; i < ch->n_rules; i++) { in ipfw_switch_tables_namespace()
3047 rule = ch->map[i]; in ipfw_switch_tables_namespace()
3067 IPFW_UH_WUNLOCK(ch); in ipfw_switch_tables_namespace()
3073 IPFW_UH_WUNLOCK(ch); in ipfw_switch_tables_namespace()
3160 alloc_table_config(struct ip_fw_chain *ch, struct tid_info *ti, in alloc_table_config() argument
3194 error = ta->init(ch, &tc->astate, &tc->ti_copy, aname, tflags); in alloc_table_config()
3226 link_table(struct ip_fw_chain *ch, struct table_config *tc) in link_table() argument
3232 IPFW_UH_WLOCK_ASSERT(ch); in link_table()
3234 ni = CHAIN_TO_NI(ch); in link_table()
3239 ti = KIDX_TO_TI(ch, kidx); in link_table()
3255 unlink_table(struct ip_fw_chain *ch, struct table_config *tc) in unlink_table() argument
3261 IPFW_UH_WLOCK_ASSERT(ch); in unlink_table()
3262 IPFW_WLOCK_ASSERT(ch); in unlink_table()
3264 ni = CHAIN_TO_NI(ch); in unlink_table()
3269 ti = KIDX_TO_TI(ch, kidx); in unlink_table()
3315 ipfw_destroy_tables(struct ip_fw_chain *ch, int last) in ipfw_destroy_tables() argument
3322 IPFW_UH_WLOCK(ch); in ipfw_destroy_tables()
3323 IPFW_WLOCK(ch); in ipfw_destroy_tables()
3324 ipfw_objhash_foreach(CHAIN_TO_NI(ch), destroy_table_locked, ch); in ipfw_destroy_tables()
3325 IPFW_WUNLOCK(ch); in ipfw_destroy_tables()
3326 IPFW_UH_WUNLOCK(ch); in ipfw_destroy_tables()
3329 free(ch->tablestate, M_IPFW); in ipfw_destroy_tables()
3331 ipfw_table_value_destroy(ch, last); in ipfw_destroy_tables()
3332 ipfw_table_algo_destroy(ch); in ipfw_destroy_tables()
3334 ipfw_objhash_destroy(CHAIN_TO_NI(ch)); in ipfw_destroy_tables()
3335 free(CHAIN_TO_TCFG(ch), M_IPFW); in ipfw_destroy_tables()
3342 ipfw_init_tables(struct ip_fw_chain *ch, int first) in ipfw_init_tables() argument
3347 ch->tablestate = malloc(V_fw_tables_max * sizeof(struct table_info), in ipfw_init_tables()
3352 ch->tblcfg = tcfg; in ipfw_init_tables()
3354 ipfw_table_value_init(ch, first); in ipfw_init_tables()
3355 ipfw_table_algo_init(ch); in ipfw_init_tables()