Lines Matching full:hook
232 ng_vlan_newhook(node_p node, hook_p hook, const char *name) in ng_vlan_newhook() argument
237 priv->downstream_hook = hook; in ng_vlan_newhook()
239 priv->nomatch_hook = hook; in ng_vlan_newhook()
242 * Any other hook name is valid and can in ng_vlan_newhook()
246 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_newhook()
256 hook_p hook; in ng_vlan_rcvmsg() local
291 /* Check that a referenced hook exists. */ in ng_vlan_rcvmsg()
292 hook = ng_findhook(node, vf->hook_name); in ng_vlan_rcvmsg()
293 if (hook == NULL) { in ng_vlan_rcvmsg()
298 if (hook == priv->downstream_hook || in ng_vlan_rcvmsg()
299 hook == priv->nomatch_hook) { in ng_vlan_rcvmsg()
304 if (IS_HOOK_VLAN_SET(NG_HOOK_PRIVATE(hook))) { in ng_vlan_rcvmsg()
313 /* Link vlan and hook together. */ in ng_vlan_rcvmsg()
314 NG_HOOK_SET_PRIVATE(hook, in ng_vlan_rcvmsg()
317 priv->vlan_hook[vf->vid] = hook; in ng_vlan_rcvmsg()
325 /* Check that hook exists and is active. */ in ng_vlan_rcvmsg()
326 hook = ng_findhook(node, (char *)msg->data); in ng_vlan_rcvmsg()
327 if (hook == NULL) { in ng_vlan_rcvmsg()
331 hook_data = (uintptr_t)NG_HOOK_PRIVATE(hook); in ng_vlan_rcvmsg()
337 KASSERT(priv->vlan_hook[EVL_VLANOFTAG(hook_data)] == hook, in ng_vlan_rcvmsg()
338 ("%s: NGM_VLAN_DEL_FILTER: Invalid VID for Hook = %s\n", in ng_vlan_rcvmsg()
341 /* Purge a rule that refers to this hook. */ in ng_vlan_rcvmsg()
343 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_rcvmsg()
357 /* Check that hook exists and is active. */ in ng_vlan_rcvmsg()
358 hook = priv->vlan_hook[vid]; in ng_vlan_rcvmsg()
359 if (hook == NULL) { in ng_vlan_rcvmsg()
363 hook_data = (uintptr_t)NG_HOOK_PRIVATE(hook); in ng_vlan_rcvmsg()
371 " Invalid VID Hook = %us, must be: %us\n", in ng_vlan_rcvmsg()
375 /* Purge a rule that refers to this hook. */ in ng_vlan_rcvmsg()
377 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_rcvmsg()
401 hook = priv->vlan_hook[i]; in ng_vlan_rcvmsg()
402 if (hook == NULL || NG_HOOK_NOT_VALID(hook)) in ng_vlan_rcvmsg()
404 hook_data = (uintptr_t)NG_HOOK_PRIVATE(hook); in ng_vlan_rcvmsg()
410 " hook %s VID = %us, must be: %i\n", in ng_vlan_rcvmsg()
411 __func__, NG_HOOK_NAME(hook), in ng_vlan_rcvmsg()
421 NG_HOOK_NAME(hook), NG_HOOKSIZ); in ng_vlan_rcvmsg()
512 ng_vlan_rcvdata(hook_p hook, item_p item) in ng_vlan_rcvdata() argument
514 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_vlan_rcvdata()
531 if (hook == priv->downstream_hook) { in ng_vlan_rcvdata()
533 * If from downstream, select between a match hook in ng_vlan_rcvdata()
534 * or the nomatch hook. in ng_vlan_rcvdata()
607 if (hook != priv->nomatch_hook) {/* Filter hook. */ in ng_vlan_rcvdata()
608 hook_data = (uintptr_t)NG_HOOK_PRIVATE(hook); in ng_vlan_rcvdata()
611 * Packet from hook not in filter in ng_vlan_rcvdata()
612 * call addfilter for this hook to fix. in ng_vlan_rcvdata()
687 ng_vlan_disconnect(hook_p hook) in ng_vlan_disconnect() argument
689 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_vlan_disconnect()
692 if (hook == priv->downstream_hook) in ng_vlan_disconnect()
694 else if (hook == priv->nomatch_hook) in ng_vlan_disconnect()
697 /* Purge a rule that refers to this hook. */ in ng_vlan_disconnect()
698 hook_data = (uintptr_t)NG_HOOK_PRIVATE(hook); in ng_vlan_disconnect()
702 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_disconnect()
703 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) && in ng_vlan_disconnect()
704 (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) in ng_vlan_disconnect()
705 ng_rmnode_self(NG_HOOK_NODE(hook)); in ng_vlan_disconnect()