Lines Matching full:ch

60 #define	CHAIN_TO_II(ch)		((struct namedobj_instance *)ch->ifcfg)  argument
64 static void handle_ifdetach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
66 static void handle_ifattach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
68 static int list_ifaces(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
94 struct ip_fw_chain *ch; in ipfw_kifhandler() local
102 ch = &V_layer3_chain; in ipfw_kifhandler()
105 IPFW_UH_WLOCK(ch); in ipfw_kifhandler()
106 ii = CHAIN_TO_II(ch); in ipfw_kifhandler()
108 IPFW_UH_WUNLOCK(ch); in ipfw_kifhandler()
115 handle_ifattach(ch, iif, ifp->if_index); in ipfw_kifhandler()
117 handle_ifdetach(ch, iif, ifp->if_index); in ipfw_kifhandler()
119 IPFW_UH_WUNLOCK(ch); in ipfw_kifhandler()
230 vnet_ipfw_iface_init(struct ip_fw_chain *ch) in vnet_ipfw_iface_init() argument
235 IPFW_UH_WLOCK(ch); in vnet_ipfw_iface_init()
236 if (ch->ifcfg == NULL) { in vnet_ipfw_iface_init()
237 ch->ifcfg = ii; in vnet_ipfw_iface_init()
240 IPFW_UH_WUNLOCK(ch); in vnet_ipfw_iface_init()
266 vnet_ipfw_iface_destroy(struct ip_fw_chain *ch) in vnet_ipfw_iface_destroy() argument
270 IPFW_UH_WLOCK(ch); in vnet_ipfw_iface_destroy()
271 ii = CHAIN_TO_II(ch); in vnet_ipfw_iface_destroy()
272 ch->ifcfg = NULL; in vnet_ipfw_iface_destroy()
273 IPFW_UH_WUNLOCK(ch); in vnet_ipfw_iface_destroy()
276 ipfw_objhash_foreach(ii, destroy_iface, ch); in vnet_ipfw_iface_destroy()
291 ipfw_iface_ref(struct ip_fw_chain *ch, char *name, in ipfw_iface_ref() argument
300 IPFW_UH_WLOCK(ch); in ipfw_iface_ref()
302 ii = CHAIN_TO_II(ch); in ipfw_iface_ref()
308 IPFW_UH_WUNLOCK(ch); in ipfw_iface_ref()
309 vnet_ipfw_iface_init(ch); in ipfw_iface_ref()
310 IPFW_UH_WLOCK(ch); in ipfw_iface_ref()
311 ii = CHAIN_TO_II(ch); in ipfw_iface_ref()
319 IPFW_UH_WUNLOCK(ch); in ipfw_iface_ref()
323 IPFW_UH_WUNLOCK(ch); in ipfw_iface_ref()
338 IPFW_UH_WLOCK(ch); in ipfw_iface_ref()
345 IPFW_UH_WUNLOCK(ch); in ipfw_iface_ref()
357 IPFW_UH_WUNLOCK(ch); in ipfw_iface_ref()
368 ipfw_iface_add_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic) in ipfw_iface_add_notify() argument
372 IPFW_UH_WLOCK_ASSERT(ch); in ipfw_iface_add_notify()
373 IPFW_WLOCK_ASSERT(ch); in ipfw_iface_add_notify()
379 ic->cb(ch, ic->cbdata, iif->ifindex); in ipfw_iface_add_notify()
387 ipfw_iface_del_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic) in ipfw_iface_del_notify() argument
391 IPFW_UH_WLOCK_ASSERT(ch); in ipfw_iface_del_notify()
402 ipfw_iface_unref(struct ip_fw_chain *ch, struct ipfw_ifc *ic) in ipfw_iface_unref() argument
406 IPFW_UH_WLOCK_ASSERT(ch); in ipfw_iface_unref()
419 handle_ifattach(struct ip_fw_chain *ch, struct ipfw_iface *iif, in handle_ifattach() argument
424 IPFW_UH_WLOCK_ASSERT(ch); in handle_ifattach()
430 IPFW_WLOCK(ch); in handle_ifattach()
432 ic->cb(ch, ic->cbdata, iif->ifindex); in handle_ifattach()
433 IPFW_WUNLOCK(ch); in handle_ifattach()
440 handle_ifdetach(struct ip_fw_chain *ch, struct ipfw_iface *iif, in handle_ifdetach() argument
445 IPFW_UH_WLOCK_ASSERT(ch); in handle_ifdetach()
447 IPFW_WLOCK(ch); in handle_ifdetach()
449 ic->cb(ch, ic->cbdata, 0); in handle_ifdetach()
450 IPFW_WUNLOCK(ch); in handle_ifdetach()
458 struct ip_fw_chain *ch; member
495 list_ifaces(struct ip_fw_chain *ch, ip_fw3_opheader *op3, in list_ifaces() argument
509 IPFW_UH_RLOCK(ch); in list_ifaces()
510 ii = CHAIN_TO_II(ch); in list_ifaces()
523 IPFW_UH_RUNLOCK(ch); in list_ifaces()
528 da.ch = ch; in list_ifaces()
533 IPFW_UH_RUNLOCK(ch); in list_ifaces()