FreeBSD/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
/*
 * Try to load the netgraph type with the given name. We assume, that
 * type 'type' is implemented in the kernel module 'ng_type'.
 */
Try to load the netgraph type with the given name. We assume, that
type 'type' is implemented in the kernel module 'ng_type'.
Try to load the netgraph type with the given name . We assume that type ' type ' is implemented in the kernel module ' ng_type ' .
static int
ngtype_load(const u_char *name, size_t namelen)
{
	char *mod;
	int ret;
	if ((mod = malloc(namelen + 4)) == NULL)
		return (-1);
	strcpy(mod, "ng_");
	strncpy(mod + 3, name, namelen);
	mod[namelen + 3] = '\0';
	ret = kldload(mod);
	free(mod);
	return (ret);
}
static int ngtype_load ( const u_char * name , size_t namelen ) { char * mod ; int ret ; if ( ( mod = malloc ( namelen + 4 ) ) == NULL ) return ( -1 ) ; strcpy ( mod , " " ) ; strncpy ( mod + 3 , name , namelen ) ; mod [ namelen + 3 ] = ' \0 ' ; ret = kldload ( mod ) ; free ( mod ) ; return ( ret ) ; }
Try to load the netgraph type with the given name.
Try to load the netgraph type with the given name .