MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_ppp_disconnect

Function ng_ppp_disconnect

freebsd/netgraph/ng_ppp.c:756–776  ·  view source on GitHub ↗

* Hook disconnection */

Source from the content-addressed store, hash-verified

754 * Hook disconnection
755 */
756static int
757ng_ppp_disconnect(hook_p hook)
758{
759 const node_p node = NG_HOOK_NODE(hook);
760 const priv_p priv = NG_NODE_PRIVATE(node);
761 const int index = (intptr_t)NG_HOOK_PRIVATE(hook);
762
763 /* Zero out hook pointer */
764 if (index < 0)
765 priv->links[~index].hook = NULL;
766 else
767 priv->hooks[index] = NULL;
768
769 /* Update derived info (or go away if no hooks left). */
770 if (NG_NODE_NUMHOOKS(node) > 0)
771 ng_ppp_update(node, 0);
772 else if (NG_NODE_IS_VALID(node))
773 ng_rmnode_self(node);
774
775 return (0);
776}
777
778/*
779 * Proto layer

Callers

nothing calls this directly

Calls 2

ng_ppp_updateFunction · 0.85
ng_rmnode_selfFunction · 0.70

Tested by

no test coverage detected