Lines Matching full: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.. */ member
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) in ngfrm_newhook() argument
240 /* Check if it's our friend the control hook */ in ngfrm_newhook()
242 NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */ in ngfrm_newhook()
249 * hook. in ngfrm_newhook()
258 if (sc->downstream.hook) in ngfrm_newhook()
262 NG_HOOK_SET_PRIVATE(hook, &sc->downstream); in ngfrm_newhook()
263 sc->downstream.hook = hook; in ngfrm_newhook()
270 /* Must be a dlci hook at this point */ in ngfrm_newhook()
288 * Be paranoid: if it's got a hook already, that dlci is in use . in ngfrm_newhook()
292 if (sc->channel[ctxnum].hook != NULL) in ngfrm_newhook()
299 NG_HOOK_SET_PRIVATE(hook, sc->channel + ctxnum); in ngfrm_newhook()
300 sc->channel[ctxnum].hook = hook; in ngfrm_newhook()
326 ngfrm_rcvdata(hook_p hook, item_p item) in ngfrm_rcvdata() argument
328 struct ctxinfo *const ctxp = NG_HOOK_PRIVATE(hook); in ngfrm_rcvdata()
336 /* Data doesn't come in from just anywhere (e.g debug hook) */ in ngfrm_rcvdata()
343 return (ngfrm_decode(NG_HOOK_NODE(hook), item)); in ngfrm_rcvdata()
347 sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ngfrm_rcvdata()
350 if ((sc->downstream.hook == NULL) in ngfrm_rcvdata()
394 NG_FWD_NEW_DATA(error, item, sc->downstream.hook, m); in ngfrm_rcvdata()
447 if ((ctxnum & CTX_VALID) && sc->channel[ctxnum &= CTX_VALUE].hook) { in ngfrm_decode()
450 NG_FWD_NEW_DATA(error, item, sc->channel[ctxnum].hook, m); in ngfrm_decode()
476 * Hook disconnection
482 ngfrm_disconnect(hook_p hook) in ngfrm_disconnect() argument
484 const sc_p sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ngfrm_disconnect()
485 struct ctxinfo *const cp = NG_HOOK_PRIVATE(hook); in ngfrm_disconnect()
488 /* If it's a regular dlci hook, then free resources etc.. */ in ngfrm_disconnect()
490 cp->hook = NULL; in ngfrm_disconnect()
497 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) in ngfrm_disconnect()
498 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) in ngfrm_disconnect()
499 ng_rmnode_self(NG_HOOK_NODE(hook)); in ngfrm_disconnect()