Source-Changes-HG archive

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

[src/trunk]: src/sys/rump add netsmb rump component



details:   https://anonhg.NetBSD.org/src/rev/7ae104f172fa
branches:  trunk
changeset: 747150:7ae104f172fa
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Sep 04 12:20:42 2009 +0000

description:
add netsmb rump component
(yes, it's functionally a device instead of a networking domain,
since it provides and is accessed through /dev/nsmb instead of
being accessed through sockets)

diffstat:

 sys/rump/dev/lib/libnetsmb/Makefile         |  18 +++++++++
 sys/rump/dev/lib/libnetsmb/component.c      |  56 +++++++++++++++++++++++++++++
 sys/rump/dev/lib/libnetsmb/shlib_version    |   4 ++
 sys/rump/librump/rumpdev/rump_dev.c         |   6 ++-
 sys/rump/librump/rumpdev/rump_dev_private.h |   3 +-
 5 files changed, 84 insertions(+), 3 deletions(-)

diffs (140 lines):

diff -r 495f10aef337 -r 7ae104f172fa sys/rump/dev/lib/libnetsmb/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnetsmb/Makefile       Fri Sep 04 12:20:42 2009 +0000
@@ -0,0 +1,18 @@
+#      $NetBSD: Makefile,v 1.1 2009/09/04 12:20:42 pooka Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../netsmb
+
+LIB=   rumpdev_netsmb
+
+SRCS=  iconv.c smb_conn.c smb_crypt.c smb_dev.c smb_iod.c smb_rq.c     \
+       smb_smb.c smb_subr.c smb_trantcp.c smb_usr.c subr_mchain.c
+
+SRCS+= component.c
+
+#CPPFLAGS+=    -DSMB_SOCKET_DEBUG -DSMB_IOD_DEBUG
+
+CFLAGS+=       -Wno-pointer-sign
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 495f10aef337 -r 7ae104f172fa sys/rump/dev/lib/libnetsmb/component.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnetsmb/component.c    Fri Sep 04 12:20:42 2009 +0000
@@ -0,0 +1,56 @@
+/*     $NetBSD: component.c,v 1.1 2009/09/04 12:20:42 pooka Exp $      */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.1 2009/09/04 12:20:42 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/stat.h>
+
+#include "rump_dev_private.h"
+
+void nsmbattach(int); /* XXX */
+
+void
+rump_dev_netsmb_init()
+{
+       extern const struct cdevsw nsmb_cdevsw;
+       devmajor_t bmaj, cmaj;
+       int error;
+
+       bmaj = cmaj = NODEVMAJOR;
+       if ((error = devsw_attach("nsmb", NULL, &bmaj, &nsmb_cdevsw, &cmaj))!=0)
+               panic("nsmb devsw attach failed: %d", error);
+       if ((error = rump_dev_makenodes(S_IFCHR, "nsmb", '0', cmaj, 0, 4)) != 0)
+               panic("cannot create nsmb device nodes: %d", error);
+
+       rump_pdev_add(nsmbattach, 4);
+}
diff -r 495f10aef337 -r 7ae104f172fa sys/rump/dev/lib/libnetsmb/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libnetsmb/shlib_version  Fri Sep 04 12:20:42 2009 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2009/09/04 12:20:42 pooka Exp $
+#
+major=0
+minor=0
diff -r 495f10aef337 -r 7ae104f172fa sys/rump/librump/rumpdev/rump_dev.c
--- a/sys/rump/librump/rumpdev/rump_dev.c       Fri Sep 04 12:16:54 2009 +0000
+++ b/sys/rump/librump/rumpdev/rump_dev.c       Fri Sep 04 12:20:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_dev.c,v 1.1 2009/07/20 18:04:14 pooka Exp $       */
+/*     $NetBSD: rump_dev.c,v 1.2 2009/09/04 12:20:42 pooka Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.1 2009/07/20 18:04:14 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.2 2009/09/04 12:20:42 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -37,6 +37,7 @@
 void nocomponent() {}
 __weak_alias(rump_dev_cgd_init,nocomponent);
 __weak_alias(rump_dev_raidframe_init,nocomponent);
+__weak_alias(rump_dev_netsmb_init,nocomponent);
 
 void
 rump_dev_init(void)
@@ -46,6 +47,7 @@
 
        rump_dev_cgd_init();
        rump_dev_raidframe_init();
+       rump_dev_netsmb_init();
 
        rump_pdev_finalize();
 
diff -r 495f10aef337 -r 7ae104f172fa sys/rump/librump/rumpdev/rump_dev_private.h
--- a/sys/rump/librump/rumpdev/rump_dev_private.h       Fri Sep 04 12:16:54 2009 +0000
+++ b/sys/rump/librump/rumpdev/rump_dev_private.h       Fri Sep 04 12:20:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_dev_private.h,v 1.1 2009/07/20 18:04:14 pooka Exp $       */
+/*     $NetBSD: rump_dev_private.h,v 1.2 2009/09/04 12:20:42 pooka Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -39,5 +39,6 @@
 
 void   rump_dev_cgd_init(void);
 void   rump_dev_raidframe_init(void);
+void   rump_dev_netsmb_init(void);
 
 #endif /* _SYS_RUMP_DEV_PRIVATE_H_ */



Home | Main Index | Thread Index | Old Index