FreeBSD/sys/netgraph/ng_mppc.c
/*
 * Give our OK for a hook to be added
 */
Give our OK for a hook to be added
Give our OK for a hook to be added
static int
ng_mppc_newhook(node_p node, hook_p hook, const char *name)
{
	const priv_p priv = NG_NODE_PRIVATE(node);
	hook_p *hookPtr;
	if (strcmp(name, NG_MPPC_HOOK_COMP) == 0)
		hookPtr = &priv->xmit.hook;
	else if (strcmp(name, NG_MPPC_HOOK_DECOMP) == 0)
		hookPtr = &priv->recv.hook;
	else
		return (EINVAL);
	if (*hookPtr != NULL)
		return (EISCONN);
	*hookPtr = hook;
	return (0);
}
static int ng_mppc_newhook ( node_p node , hook_p hook , const char * name ) { const priv_p priv = NG_NODE_PRIVATE ( node ) ; hook_p * hookPtr ; if ( strcmp ( name , NG_MPPC_HOOK_COMP ) == 0 ) hookPtr = & priv -> xmit . hook ; else if ( strcmp ( name , NG_MPPC_HOOK_DECOMP ) == 0 ) hookPtr = & priv -> recv . hook ; else return ( EINVAL ) ; if ( * hookPtr != NULL ) return ( EISCONN ) ; * hookPtr = hook ; return ( 0 ) ; }
Give our OK for a hook to be added
Give our OK for a hook to be added
/* Check hook name */ /* See if already connected */ /* OK */