Lines Matching refs:hook

47  * It has a 'downstream' hook that goes to the line, and a
48 * hook for each DLCI (eg, 'dlci16').
67 struct ctxinfo { /* one per active hook */
72 hook_p hook; /* if there's a hook assigned.. */
225 * Add a new hook
228 * The hook's private info points to our stash of info about that
232 ngfrm_newhook(node_p node, hook_p hook, const char *name)
240 /* Check if it's our friend the control hook */
242 NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */
249 * hook.
258 if (sc->downstream.hook)
262 NG_HOOK_SET_PRIVATE(hook, &sc->downstream);
263 sc->downstream.hook = hook;
270 /* Must be a dlci hook at this point */
288 * Be paranoid: if it's got a hook already, that dlci is in use .
292 if (sc->channel[ctxnum].hook != NULL)
299 NG_HOOK_SET_PRIVATE(hook, sc->channel + ctxnum);
300 sc->channel[ctxnum].hook = hook;
326 ngfrm_rcvdata(hook_p hook, item_p item)
328 struct ctxinfo *const ctxp = NG_HOOK_PRIVATE(hook);
336 /* Data doesn't come in from just anywhere (e.g debug hook) */
343 return (ngfrm_decode(NG_HOOK_NODE(hook), item));
347 sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
350 if ((sc->downstream.hook == NULL)
394 NG_FWD_NEW_DATA(error, item, sc->downstream.hook, m);
447 if ((ctxnum & CTX_VALID) && sc->channel[ctxnum &= CTX_VALUE].hook) {
450 NG_FWD_NEW_DATA(error, item, sc->channel[ctxnum].hook, m);
482 ngfrm_disconnect(hook_p hook)
484 const sc_p sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
485 struct ctxinfo *const cp = NG_HOOK_PRIVATE(hook);
488 /* If it's a regular dlci hook, then free resources etc.. */
490 cp->hook = NULL;
497 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
498 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook))))
499 ng_rmnode_self(NG_HOOK_NODE(hook));