Lines Matching full:hook

128 /* Information we store for each hook on each node */
130 hook_p hook; member
136 hook_p match_hook; /* Hook to use on a match */
193 * Give our ok for a hook to be added...
197 ng_etf_newhook(node_p node, hook_p hook, const char *name) in ng_etf_newhook() argument
203 etfp->downstream_hook.hook = hook; in ng_etf_newhook()
204 NG_HOOK_SET_PRIVATE(hook, &etfp->downstream_hook); in ng_etf_newhook()
208 etfp->nomatch_hook.hook = hook; in ng_etf_newhook()
209 NG_HOOK_SET_PRIVATE(hook, &etfp->nomatch_hook); in ng_etf_newhook()
212 * Any other hook name is valid and can in ng_etf_newhook()
221 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_etf_newhook()
222 hpriv->hook = hook; in ng_etf_newhook()
282 hook_p hook; in ng_etf_rcvmsg() local
290 /* Make sure hook referenced exists */ in ng_etf_rcvmsg()
292 hook = ng_findhook(node, f->matchhook); in ng_etf_rcvmsg()
293 if (hook == NULL) { in ng_etf_rcvmsg()
298 /* and is not the downstream hook */ in ng_etf_rcvmsg()
299 if (hook == etfp->downstream_hook.hook) { in ng_etf_rcvmsg()
322 fil->match_hook = hook; in ng_etf_rcvmsg()
358 * We would do that by setting the HK_QUEUE flag on our hook. We would do that
362 ng_etf_rcvdata(hook_p hook, item_p item ) in ng_etf_rcvdata() argument
364 const etf_p etfp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_etf_rcvdata()
371 if (NG_HOOK_PRIVATE(hook) == NULL) { /* Shouldn't happen but.. */ in ng_etf_rcvdata()
376 * Everything not from the downstream hook goes to the in ng_etf_rcvdata()
377 * downstream hook. But only if it matches the ethertype in ng_etf_rcvdata()
378 * of the source hook. Un matching must go to/from 'nomatch'. in ng_etf_rcvdata()
396 * if from downstream, select between a match hook or in ng_etf_rcvdata()
397 * the nomatch hook in ng_etf_rcvdata()
399 if (hook == etfp->downstream_hook.hook) { in ng_etf_rcvdata()
404 NG_FWD_NEW_DATA(error, item,etfp->nomatch_hook.hook, m); in ng_etf_rcvdata()
410 * the filters for it's input hook. in ng_etf_rcvdata()
413 if ((fil && (fil->match_hook != hook)) in ng_etf_rcvdata()
414 || ((fil == NULL) && (hook != etfp->nomatch_hook.hook))) { in ng_etf_rcvdata()
419 NG_FWD_NEW_DATA( error, item, etfp->downstream_hook.hook, m); in ng_etf_rcvdata()
443 * Hook disconnection
448 ng_etf_disconnect(hook_p hook) in ng_etf_disconnect() argument
450 const etf_p etfp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_etf_disconnect()
459 if (fil1->match_hook == hook) { in ng_etf_disconnect()
468 if (hook == etfp->downstream_hook.hook) { in ng_etf_disconnect()
469 etfp->downstream_hook.hook = NULL; in ng_etf_disconnect()
470 } else if (hook == etfp->nomatch_hook.hook) { in ng_etf_disconnect()
471 etfp->nomatch_hook.hook = NULL; in ng_etf_disconnect()
473 if (NG_HOOK_PRIVATE(hook)) /* Paranoia */ in ng_etf_disconnect()
474 free(NG_HOOK_PRIVATE(hook), M_NETGRAPH_ETF); in ng_etf_disconnect()
477 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_etf_disconnect()
479 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) in ng_etf_disconnect()
480 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */ in ng_etf_disconnect()
481 ng_rmnode_self(NG_HOOK_NODE(hook)); in ng_etf_disconnect()