FreeBSD/sys/netinet/siftr.c
/*
 * This is the function that is called to load and unload the module.
 * When the module is loaded, this function is called once with
 * "what" == MOD_LOAD
 * When the module is unloaded, this function is called twice with
 * "what" = MOD_QUIESCE first, followed by "what" = MOD_UNLOAD second
 * When the system is shut down e.g. CTRL-ALT-DEL or using the shutdown command,
 * this function is called once with "what" = MOD_SHUTDOWN
 * When the system is shut down, the handler isn't called until the very end
 * of the shutdown sequence i.e. after the disks have been synced.
 */
This is the function that is called to load and unload the module.
This is the function that is called to load and unload the module .
static int
siftr_load_handler(module_t mod, int what, void *arg)
{
	int ret;
	switch (what) {
	case MOD_LOAD:
		ret = init_siftr();
		break;
	case MOD_QUIESCE:
	case MOD_SHUTDOWN:
		ret = deinit_siftr();
		break;
	case MOD_UNLOAD:
		ret = 0;
		break;
	default:
		ret = EINVAL;
		break;
	}
	return (ret);
}
static int siftr_load_handler ( module_t mod , int what , void * arg ) { int ret ; switch ( what ) { case MOD_LOAD : ret = init_siftr ( ) ; break ; case MOD_QUIESCE : case MOD_SHUTDOWN : ret = deinit_siftr ( ) ; break ; case MOD_UNLOAD : ret = 0 ; break ; default : ret = EINVAL ; break ; } return ( ret ) ; }
This is the function that is called to load and unload the module.
This is the function that is called to load and unload the module .