Lines Matching refs:hook

49  * It has a 'downstream' hook that goes to the line, and a
50 * hook for each DLCI (eg, 'dlci16').
69 struct ctxinfo { /* one per active hook */
74 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.
259 if (sc->downstream.hook)
263 NG_HOOK_SET_PRIVATE(hook, &sc->downstream);
264 sc->downstream.hook = hook;
271 /* Must be a dlci hook at this point */
289 * Be paranoid: if it's got a hook already, that dlci is in use .
293 if (sc->channel[ctxnum].hook != NULL)
300 NG_HOOK_SET_PRIVATE(hook, sc->channel + ctxnum);
301 sc->channel[ctxnum].hook = hook;
327 ngfrm_rcvdata(hook_p hook, item_p item)
329 struct ctxinfo *const ctxp = NG_HOOK_PRIVATE(hook);
337 /* Data doesn't come in from just anywhere (e.g debug hook) */
346 return (ngfrm_decode(NG_HOOK_NODE(hook), item));
350 sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
353 if ((sc->downstream.hook == NULL)
401 NG_FWD_NEW_DATA(error, item, sc->downstream.hook, m);
459 if ((ctxnum & CTX_VALID) && sc->channel[ctxnum &= CTX_VALUE].hook) {
462 NG_FWD_NEW_DATA(error, item, sc->channel[ctxnum].hook, m);
494 ngfrm_disconnect(hook_p hook)
496 const sc_p sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
497 struct ctxinfo *const cp = NG_HOOK_PRIVATE(hook);
500 /* If it's a regular dlci hook, then free resources etc.. */
502 cp->hook = NULL;
509 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
510 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook))))
511 ng_rmnode_self(NG_HOOK_NODE(hook));