Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/dev/lib/libnpf Add files needed to build npf as a R...



details:   https://anonhg.NetBSD.org/src/rev/13cb77c6bb13
branches:  trunk
changeset: 758035:13cb77c6bb13
user:      haad <haad%NetBSD.org@localhost>
date:      Thu Oct 14 22:39:30 2010 +0000

description:
Add files needed to build npf as a RUMP library, original code bu rmind
some modifications done by me.

Oked by @rmind.

diffstat:

 sys/rump/dev/lib/libnpf/Makefile      |  17 +++++++++++++++++
 sys/rump/dev/lib/libnpf/component.c   |  35 +++++++++++++++++++++++++++++++++++
 sys/rump/dev/lib/libnpf/shlib_version |   4 ++++
 3 files changed, 56 insertions(+), 0 deletions(-)

diffs (68 lines):

diff -r 6862316dd4a9 -r 13cb77c6bb13 sys/rump/dev/lib/libnpf/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnpf/Makefile  Thu Oct 14 22:39:30 2010 +0000
@@ -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>
diff -r 6862316dd4a9 -r 13cb77c6bb13 sys/rump/dev/lib/libnpf/component.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnpf/component.c       Thu Oct 14 22:39:30 2010 +0000
@@ -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);
+       }
+}
diff -r 6862316dd4a9 -r 13cb77c6bb13 sys/rump/dev/lib/libnpf/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnpf/shlib_version     Thu Oct 14 22:39:30 2010 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2010/10/14 22:39:30 haad Exp $
+#
+major=0
+minor=0



Home | Main Index | Thread Index | Old Index