Lines Matching full:hook

120 /* Information we store for each hook on each node */
124 hook_p hook; member
168 * Give our ok for a hook to be added...
170 * Possibly decode information out of the hook name.
171 * Add the hook's private info to the hook structure.
175 * pointer of each hook points to the appropriate XXX_hookinfo struct
180 ng_xxx_newhook(node_p node, hook_p hook, const char *name) in ng_xxx_newhook() argument
221 if (xxxp->channel[chan].hook != NULL) in ng_xxx_newhook()
223 NG_HOOK_SET_PRIVATE(hook, xxxp->channel + chan); in ng_xxx_newhook()
224 xxxp->channel[chan].hook = hook; in ng_xxx_newhook()
229 xxxp->downstream_hook.hook = hook; in ng_xxx_newhook()
230 NG_HOOK_SET_PRIVATE(hook, &xxxp->downstream_hook); in ng_xxx_newhook()
233 xxxp->debughook = hook; in ng_xxx_newhook()
234 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_xxx_newhook()
236 return (EINVAL); /* not a hook we know about */ in ng_xxx_newhook()
319 * We would do that by setting the HK_QUEUE flag on our hook. We would do that
323 ng_xxx_rcvdata(hook_p hook, item_p item ) in ng_xxx_rcvdata() argument
325 const xxx_p xxxp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_xxx_rcvdata()
332 if (NG_HOOK_PRIVATE(hook)) { in ng_xxx_rcvdata()
333 dlci = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->dlci; in ng_xxx_rcvdata()
334 chan = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->channel; in ng_xxx_rcvdata()
336 /* If received on a DLCI hook process for this in ng_xxx_rcvdata()
343 xxxp->downstream_hook.hook, m); in ng_xxx_rcvdata()
360 xxxp->channel[chan].hook, m); in ng_xxx_rcvdata()
364 /* It's the debug hook, throw it away.. */ in ng_xxx_rcvdata()
365 if (hook == xxxp->downstream_hook.hook) { in ng_xxx_rcvdata()
386 NG_SEND_DATA_ONLY(error, xxxp->upstream_hook.hook, m);
432 * This is called once we've already connected a new hook to the other node.
436 ng_xxx_connect(hook_p hook) argument
444 if /*it is the upstream hook */
445 NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
451 * OUR hook. (maybe to allow unwinding of the stack)
454 if (NG_HOOK_PRIVATE(hook)) {
461 dlci = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->dlci;
463 NG_HOOK_FORCE_QUEUE(hook);
471 * Hook disconnection
476 ng_xxx_disconnect(hook_p hook) argument
478 if (NG_HOOK_PRIVATE(hook))
479 ((struct XXX_hookinfo *) (NG_HOOK_PRIVATE(hook)))->hook = NULL;
480 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
481 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */
482 ng_rmnode_self(NG_HOOK_NODE(hook));