Lines Matching full:ch
95 nat64stl_export_config(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg, in nat64stl_export_config() argument
106 no = ipfw_objhash_lookup_table_kidx(ch, cfg->map64); in nat64stl_export_config()
108 no = ipfw_objhash_lookup_table_kidx(ch, cfg->map46); in nat64stl_export_config()
113 struct ip_fw_chain *ch; member
125 nat64stl_export_config(da->ch, (struct nat64stl_cfg *)no, uc); in export_config_cb()
141 nat64stl_create_internal(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg, in nat64stl_create_internal() argument
145 IPFW_UH_WLOCK_ASSERT(ch); in nat64stl_create_internal()
147 if (ipfw_objhash_alloc_idx(CHAIN_TO_SRV(ch), &cfg->no.kidx) != 0) in nat64stl_create_internal()
151 if (ipfw_ref_table(ch, &i->ntlv4, &cfg->map46) != 0) in nat64stl_create_internal()
155 if (ipfw_ref_table(ch, &i->ntlv6, &cfg->map64) != 0) in nat64stl_create_internal()
159 ipfw_objhash_add(CHAIN_TO_SRV(ch), &cfg->no); in nat64stl_create_internal()
172 nat64stl_create(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in nat64stl_create() argument
195 ni = CHAIN_TO_SRV(ch); in nat64stl_create()
198 IPFW_UH_RLOCK(ch); in nat64stl_create()
200 IPFW_UH_RUNLOCK(ch); in nat64stl_create()
203 IPFW_UH_RUNLOCK(ch); in nat64stl_create()
212 IPFW_UH_WLOCK(ch); in nat64stl_create()
215 IPFW_UH_WUNLOCK(ch); in nat64stl_create()
219 error = nat64stl_create_internal(ch, cfg, uc); in nat64stl_create()
222 SRV_OBJECT(ch, cfg->no.kidx) = cfg; in nat64stl_create()
223 IPFW_UH_WUNLOCK(ch); in nat64stl_create()
230 ipfw_unref_table(ch, cfg->map46); in nat64stl_create()
232 ipfw_unref_table(ch, cfg->map64); in nat64stl_create()
234 IPFW_UH_WUNLOCK(ch); in nat64stl_create()
248 nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheader *op, in nat64stl_config() argument
267 ni = CHAIN_TO_SRV(ch); in nat64stl_config()
269 IPFW_UH_RLOCK(ch); in nat64stl_config()
272 IPFW_UH_RUNLOCK(ch); in nat64stl_config()
275 nat64stl_export_config(ch, cfg, uc); in nat64stl_config()
276 IPFW_UH_RUNLOCK(ch); in nat64stl_config()
280 IPFW_UH_WLOCK(ch); in nat64stl_config()
283 IPFW_UH_WUNLOCK(ch); in nat64stl_config()
294 IPFW_UH_WUNLOCK(ch); in nat64stl_config()
299 nat64stl_detach_config(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg) in nat64stl_detach_config() argument
302 IPFW_UH_WLOCK_ASSERT(ch); in nat64stl_detach_config()
304 ipfw_objhash_del(CHAIN_TO_SRV(ch), &cfg->no); in nat64stl_detach_config()
305 ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), cfg->no.kidx); in nat64stl_detach_config()
306 ipfw_unref_table(ch, cfg->map46); in nat64stl_detach_config()
307 ipfw_unref_table(ch, cfg->map64); in nat64stl_detach_config()
318 nat64stl_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in nat64stl_destroy() argument
331 IPFW_UH_WLOCK(ch); in nat64stl_destroy()
332 cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set); in nat64stl_destroy()
334 IPFW_UH_WUNLOCK(ch); in nat64stl_destroy()
338 IPFW_UH_WUNLOCK(ch); in nat64stl_destroy()
342 ipfw_reset_eaction_instance(ch, V_nat64stl_eid, cfg->no.kidx); in nat64stl_destroy()
343 SRV_OBJECT(ch, cfg->no.kidx) = NULL; in nat64stl_destroy()
344 nat64stl_detach_config(ch, cfg); in nat64stl_destroy()
345 IPFW_UH_WUNLOCK(ch); in nat64stl_destroy()
360 nat64stl_list(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in nat64stl_list() argument
372 IPFW_UH_RLOCK(ch); in nat64stl_list()
373 olh->count = ipfw_objhash_count_type(CHAIN_TO_SRV(ch), in nat64stl_list()
379 IPFW_UH_RUNLOCK(ch); in nat64stl_list()
383 da.ch = ch; in nat64stl_list()
385 ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), export_config_cb, in nat64stl_list()
387 IPFW_UH_RUNLOCK(ch); in nat64stl_list()
395 export_stats(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg, in export_stats() argument
420 nat64stl_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op, in nat64stl_stats() argument
439 IPFW_UH_RLOCK(ch); in nat64stl_stats()
440 cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set); in nat64stl_stats()
442 IPFW_UH_RUNLOCK(ch); in nat64stl_stats()
445 export_stats(ch, cfg, &stats); in nat64stl_stats()
446 IPFW_UH_RUNLOCK(ch); in nat64stl_stats()
467 nat64stl_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op, in nat64stl_reset_stats() argument
480 IPFW_UH_WLOCK(ch); in nat64stl_reset_stats()
481 cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set); in nat64stl_reset_stats()
483 IPFW_UH_WUNLOCK(ch); in nat64stl_reset_stats()
487 IPFW_UH_WUNLOCK(ch); in nat64stl_reset_stats()
523 nat64stl_findbyname(struct ip_fw_chain *ch, struct tid_info *ti, in nat64stl_findbyname() argument
528 err = ipfw_objhash_find_type(CHAIN_TO_SRV(ch), ti, in nat64stl_findbyname()
534 nat64stl_findbykidx(struct ip_fw_chain *ch, uint16_t idx) in nat64stl_findbykidx() argument
539 IPFW_UH_WLOCK_ASSERT(ch); in nat64stl_findbykidx()
540 ni = CHAIN_TO_SRV(ch); in nat64stl_findbykidx()
548 nat64stl_manage_sets(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, in nat64stl_manage_sets() argument
552 return (ipfw_obj_manage_sets(CHAIN_TO_SRV(ch), IPFW_TLV_NAT64STL_NAME, in nat64stl_manage_sets()
573 struct ip_fw_chain *ch; in destroy_config_cb() local
575 ch = (struct ip_fw_chain *)arg; in destroy_config_cb()
576 cfg = (struct nat64stl_cfg *)SRV_OBJECT(ch, no->kidx); in destroy_config_cb()
577 SRV_OBJECT(ch, no->kidx) = NULL; in destroy_config_cb()
578 nat64stl_detach_config(ch, cfg); in destroy_config_cb()
584 nat64stl_init(struct ip_fw_chain *ch, int first) in nat64stl_init() argument
587 V_nat64stl_eid = ipfw_add_eaction(ch, ipfw_nat64stl, "nat64stl"); in nat64stl_init()
596 nat64stl_uninit(struct ip_fw_chain *ch, int last) in nat64stl_uninit() argument
601 ipfw_del_eaction(ch, V_nat64stl_eid); in nat64stl_uninit()
609 IPFW_UH_WLOCK(ch); in nat64stl_uninit()
610 ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), destroy_config_cb, ch, in nat64stl_uninit()
613 IPFW_UH_WUNLOCK(ch); in nat64stl_uninit()