diff options
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r-- | usr.sbin/ppp/defs.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c index 9766802..b61b7de 100644 --- a/usr.sbin/ppp/defs.c +++ b/usr.sbin/ppp/defs.c @@ -27,7 +27,7 @@ */ -#include <sys/types.h> +#include <sys/param.h> #include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -35,15 +35,24 @@ #include <ctype.h> #include <errno.h> +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#if defined(__FreeBSD__) && !defined(NOKLDLOAD) +#include <sys/linker.h> +#include <sys/module.h> +#endif #include <termios.h> #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include <time.h> #endif #include <unistd.h> +#if defined(__FreeBSD__) && !defined(NOKLDLOAD) +#include "id.h" +#include "log.h" +#endif #include "defs.h" #define issep(c) ((c) == '\t' || (c) == ' ') @@ -410,3 +419,20 @@ Concatinate(char *buf, size_t sz, int argc, const char *const *argv) break; } } + +void +loadmodules(int how, const char *module, ...) +{ +#if defined(__FreeBSD__) && !defined(NOKLDLOAD) + va_list ap; + + va_start(ap, module); + while (module != NULL) { + if (modfind(module) == -1 && ID0kldload(module) == -1 && + how == LOAD_VERBOSLY) + log_Printf(LogWARN, "%s: Cannot load module\n", module); + module = va_arg(ap, const char *); + } + va_end(ap); +#endif +} |