diff options
author | peter <peter@FreeBSD.org> | 1999-04-17 11:09:08 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-17 11:09:08 +0000 |
commit | 8dc2affd00864d25873b83cbcce034d1886c4b98 (patch) | |
tree | 5d178a749f69399a7da69d53a6eeb32223b1e287 | |
parent | efa86a9261bef693f4822d42e4f0ac7ac3e712b0 (diff) | |
download | FreeBSD-src-8dc2affd00864d25873b83cbcce034d1886c4b98.zip FreeBSD-src-8dc2affd00864d25873b83cbcce034d1886c4b98.tar.gz |
Convert the dummynet lkm code to be kld aware (this isn't actually used
anywhere that I can see).
-rw-r--r-- | sys/netinet/ip_dummynet.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 8bc2f4a..21e1c72 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -10,7 +10,7 @@ * * This software is provided ``AS IS'' without any warranties of any kind. * - * $Id: ip_dummynet.c,v 1.9 1999/03/24 12:43:39 luigi Exp $ + * $Id: ip_dummynet.c,v 1.10 1999/03/26 14:15:59 luigi Exp $ */ /* @@ -598,38 +598,39 @@ ip_dn_init(void) #ifdef DUMMYNET_MODULE -#include <sys/exec.h> -#include <sys/sysent.h> -#include <sys/lkm.h> - -MOD_MISC(dummynet); +#include <sys/module.h> static ip_dn_ctl_t *old_dn_ctl_ptr ; static int -dummynet_load(struct lkm_table *lkmtp, int cmd) +dummynet_modevent(module_t mod, int type, void *data) { - int s=splnet(); - old_dn_ctl_ptr = ip_dn_ctl_ptr; - ip_dn_init(); - splx(s); - return 0; -} + int s; -static int -dummynet_unload(struct lkm_table *lkmtp, int cmd) -{ - int s=splnet(); - ip_dn_ctl_ptr = old_dn_ctl_ptr; - splx(s); - dummynet_flush(); - printf("DUMMYNET unloaded\n"); + switch (type) { + case MOD_LOAD: + s = splnet(); + old_dn_ctl_ptr = ip_dn_ctl_ptr; + ip_dn_init(); + splx(s); + break; + case MOD_UNLOAD: + s = splnet(); + ip_dn_ctl_ptr = old_dn_ctl_ptr; + splx(s); + dummynet_flush(); + printf("DUMMYNET unloaded\n"); + break; + default: + break; + } return 0; } -int -dummynet_mod(struct lkm_table *lkmtp, int cmd, int ver) -{ - DISPATCH(lkmtp, cmd, ver, dummynet_load, dummynet_unload, lkm_nullcmd); -} +static moduledata_t dummynet_mod = { + "dummynet", + dummynet_modevent, + NULL +}; +DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PSEUDO, SI_ORDER_ANY) #endif |