FreeBSD/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
/*
 * Register a function for hook data.
 */
Register a function for hook data.
Register a function for hook data .
void *
ng_register_hook(const struct lmodule *mod, const char *hook, 
    ng_hook_f *func, void *arg)
{
	struct datareg *d;
	if ((d = malloc(sizeof(*d))) == NULL)
		return (NULL);
	strcpy(d->hook, hook);
	d->func = func;
	d->arg = arg;
	d->mod = mod;
	SLIST_INSERT_HEAD(&datareg_list, d, link);
	return (d);
}
void * ng_register_hook ( const struct lmodule * mod , const char * hook , ng_hook_f * func , void * arg ) { struct datareg * d ; if ( ( d = malloc ( sizeof ( * d ) ) ) == NULL ) return ( NULL ) ; strcpy ( d -> hook , hook ) ; d -> func = func ; d -> arg = arg ; d -> mod = mod ; SLIST_INSERT_HEAD ( & datareg_list , d , link ) ; return ( d ) ; }
Register a function for hook data.
Register a function for hook data .