diff options
author | peter <peter@FreeBSD.org> | 2001-01-31 07:58:58 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-01-31 07:58:58 +0000 |
commit | 6be84866ea66a3d9041f0400dda21d05913d219d (patch) | |
tree | 126edfdf3ed82891788fa9edc2df5bada88d2592 /sys/net/if_tun.c | |
parent | 2c2377c37d343b47ad9d996ea324576e1977647d (diff) | |
download | FreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.zip FreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.tar.gz |
Exterminate the use of PSEUDO_SET() with extreme prejudice.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index c7047a7..feef9c9 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -22,6 +22,7 @@ #include <sys/proc.h> #include <sys/systm.h> #include <sys/mbuf.h> +#include <sys/module.h> #include <sys/socket.h> #include <sys/filio.h> #include <sys/sockio.h> @@ -52,9 +53,6 @@ static MALLOC_DEFINE(M_TUN, "tun", "Tunnel Interface"); -static void tunattach __P((void *)); -PSEUDO_SET(tunattach, if_tun); - static void tuncreate __P((dev_t dev)); #define TUNDEBUG if (tundebug) printf @@ -113,14 +111,28 @@ tun_clone(arg, name, namelen, dev) } -static void -tunattach(dummy) - void *dummy; -{ - - EVENTHANDLER_REGISTER(dev_clone, tun_clone, 0, 1000); - cdevsw_add(&tun_cdevsw); -} +static int +tun_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + EVENTHANDLER_REGISTER(dev_clone, tun_clone, 0, 1000); + cdevsw_add(&tun_cdevsw); + break; + case MOD_UNLOAD: + printf("if_tun module unload - not possible for this module type\n"); + return EINVAL; + } + return 0; +} + +static moduledata_t tun_mod = { + "if_tun", + tun_modevent, + 0 +}; + +DECLARE_MODULE(if_tun, tun_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); static void tunstart(ifp) |