FreeBSD/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
/*
 * Register a function to receive unsolicited messages
 */
Register a function to receive unsolicited messages
Register a function to receive unsolicited messages
void *
ng_register_cookie(const struct lmodule *mod, u_int32_t cookie, ng_ID_t id,
    ng_cookie_f *func, void *arg)
{
	struct msgreg *d;
	if ((d = malloc(sizeof(*d))) == NULL)
		return (NULL);
	d->cookie = cookie;
	d->id = id;
	d->func = func;
	d->arg = arg;
	d->mod = mod;
	SLIST_INSERT_HEAD(&msgreg_list, d, link);
	return (d);
}
void * ng_register_cookie ( const struct lmodule * mod , u_int32_t cookie , ng_ID_t id , ng_cookie_f * func , void * arg ) { struct msgreg * d ; if ( ( d = malloc ( sizeof ( * d ) ) ) == NULL ) return ( NULL ) ; d -> cookie = cookie ; d -> id = id ; d -> func = func ; d -> arg = arg ; d -> mod = mod ; SLIST_INSERT_HEAD ( & msgreg_list , d , link ) ; return ( d ) ; }
Register a function to receive unsolicited messages
Register a function to receive unsolicited messages