summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2002-03-30 12:30:09 +0000
committerbrian <brian@FreeBSD.org>2002-03-30 12:30:09 +0000
commitee9763124d8cbeceba9f2194f3ea61c1f2c1d362 (patch)
treeb285f7b912098d74c02bd2a8b542e1472a52003a /usr.sbin/ppp/defs.c
parentef538de24ea069ff6846f7363f8a329a92cf1aa1 (diff)
downloadFreeBSD-src-ee9763124d8cbeceba9f2194f3ea61c1f2c1d362.zip
FreeBSD-src-ee9763124d8cbeceba9f2194f3ea61c1f2c1d362.tar.gz
Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's line
discipline to do the async escaping, but no other benefits are available yet. Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency. Make the Makefile a little more sane WRT RELEASE_CRUNCH.
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r--usr.sbin/ppp/defs.c28
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
+}
OpenPOWER on IntegriCloud