From 1f74260ee21c17a2a92b6e82137994d7e8403dbb Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 15 Jan 2003 19:55:17 +0000 Subject: [PATCH] make rc4 crypto support a module so other modules can depend on it Submitted by: imp Reviewed by: imp --- sys/crypto/rc4/rc4.c | 22 ++++++++++++++++++++++ sys/modules/rc4/Makefile | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 sys/modules/rc4/Makefile diff --git a/sys/crypto/rc4/rc4.c b/sys/crypto/rc4/rc4.c index 5cea08a45c49..ae8360a5bca9 100644 --- a/sys/crypto/rc4/rc4.c +++ b/sys/crypto/rc4/rc4.c @@ -37,6 +37,9 @@ * $FreeBSD$ */ +#include +#include +#include #include #include @@ -102,3 +105,22 @@ rc4_crypt(struct rc4_state *const state, } } +static int +rc4_modevent(module_t mod, int type, void *unused) +{ + switch (type) { + case MOD_LOAD: + return 0; + case MOD_UNLOAD: + return 0; + } + return EINVAL; +} + +static moduledata_t rc4_mod = { + "rc4", + rc4_modevent, + 0 +}; +DECLARE_MODULE(rc4, rc4_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); +MODULE_VERSION(rc4, 1); diff --git a/sys/modules/rc4/Makefile b/sys/modules/rc4/Makefile new file mode 100644 index 000000000000..95f609eac016 --- /dev/null +++ b/sys/modules/rc4/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../crypto/rc4 + +KMOD= rc4 +SRCS= rc4.c + +.include