Module Name: src
Committed By: haad
Date: Thu Oct 14 22:39:30 UTC 2010
Added Files:
src/sys/rump/dev/lib/libnpf: Makefile component.c shlib_version
Log Message:
Add files needed to build npf as a RUMP library, original code bu rmind
some modifications done by me.
Oked by @rmind.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libnpf/Makefile \
src/sys/rump/dev/lib/libnpf/component.c \
src/sys/rump/dev/lib/libnpf/shlib_version
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: src/sys/rump/dev/lib/libnpf/Makefile
diff -u /dev/null src/sys/rump/dev/lib/libnpf/Makefile:1.1
--- /dev/null Thu Oct 14 22:39:30 2010
+++ src/sys/rump/dev/lib/libnpf/Makefile Thu Oct 14 22:39:30 2010
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2010/10/14 22:39:30 haad Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../net/npf
+
+LIB= rumpdev_npf
+
+SRCS= npf.c npf_ctl.c npf_handler.c npf_instr.c npf_mbuf.c
+SRCS+= npf_processor.c npf_ruleset.c npf_tableset.c npf_inet.c
+SRCS+= npf_session.c npf_nat.c npf_alg.c
+
+SRCS+= component.c
+
+CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
Index: src/sys/rump/dev/lib/libnpf/component.c
diff -u /dev/null src/sys/rump/dev/lib/libnpf/component.c:1.1
--- /dev/null Thu Oct 14 22:39:30 2010
+++ src/sys/rump/dev/lib/libnpf/component.c Thu Oct 14 22:39:30 2010
@@ -0,0 +1,35 @@
+/* $NetBSD: component.c,v 1.1 2010/10/14 22:39:30 haad Exp $ */
+
+/*
+ * Public Domain.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.1 2010/10/14 22:39:30 haad Exp $");
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/stat.h>
+
+#include "rump_private.h"
+#include "rump_dev_private.h"
+#include "rump_vfs_private.h"
+
+extern const struct cdevsw npf_cdevsw;
+
+RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+{
+ devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR;
+ int error;
+
+ error = devsw_attach("npf", NULL, &bmajor, &npf_cdevsw, &cmajor);
+ if (error) {
+ panic("npf attaching failed: %d", error);
+ }
+
+ error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/npf", cmajor, 0);
+ if (error) {
+ panic("npf device node creation failed: %d", error);
+ }
+}
Index: src/sys/rump/dev/lib/libnpf/shlib_version
diff -u /dev/null src/sys/rump/dev/lib/libnpf/shlib_version:1.1
--- /dev/null Thu Oct 14 22:39:30 2010
+++ src/sys/rump/dev/lib/libnpf/shlib_version Thu Oct 14 22:39:30 2010
@@ -0,0 +1,4 @@
+# $NetBSD: shlib_version,v 1.1 2010/10/14 22:39:30 haad Exp $
+#
+major=0
+minor=0