summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavide Italiano <davide@FreeBSD.org>2013-06-28 21:00:08 +0000
committerDavide Italiano <davide@FreeBSD.org>2013-06-28 21:00:08 +0000
commit237abf0c56afd2f4846230b70b42b4c3d02d2d19 (patch)
treee1591b3e71dfbd12dfea7bc7669be4a10541da31 /sys
parentbbc6d2c1af692549bb62ab4ce214c9b97c2fb040 (diff)
downloadsrc-test-237abf0c56afd2f4846230b70b42b4c3d02d2d19.tar.gz
src-test-237abf0c56afd2f4846230b70b42b4c3d02d2d19.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/NOTES7
-rw-r--r--sys/conf/files20
-rw-r--r--sys/conf/files.amd642
-rw-r--r--sys/conf/files.arm2
-rw-r--r--sys/conf/files.i3862
-rw-r--r--sys/conf/files.ia642
-rw-r--r--sys/conf/files.mips2
-rw-r--r--sys/conf/files.pc982
-rw-r--r--sys/conf/files.powerpc2
-rw-r--r--sys/conf/files.sparc642
-rw-r--r--sys/conf/options4
-rw-r--r--sys/kern/Make.tags.inc1
-rw-r--r--sys/kern/sys_generic.c55
-rw-r--r--sys/modules/Makefile6
-rw-r--r--sys/sys/socketvar.h2
15 files changed, 101 insertions, 10 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 3961e0f138933..dce216800a325 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -602,6 +602,12 @@ options IPX #IPX/SPX communications protocols
options NETATALK #Appletalk communications protocols
options NETATALKDEBUG #Appletalk debugging
+#
+# SMB/CIFS requester
+# NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV
+# options.
+options NETSMB #SMB/CIFS requester
+
# mchain library. It can be either loaded as KLD or compiled into kernel
options LIBMCHAIN
@@ -1038,6 +1044,7 @@ options NULLFS #NULL filesystem
options PROCFS #Process filesystem (requires PSEUDOFS)
options PSEUDOFS #Pseudo-filesystem framework
options PSEUDOFS_TRACE #Debugging support for PSEUDOFS
+options SMBFS #SMB/CIFS filesystem
options TMPFS #Efficient memory filesystem
options UDF #Universal Disk Format
options UNIONFS #Union filesystem
diff --git a/sys/conf/files b/sys/conf/files
index 4dc89148f04e7..385a4eb1c6669 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -536,8 +536,8 @@ crypto/blowfish/bf_ecb.c optional ipsec
crypto/blowfish/bf_skey.c optional crypto | ipsec
crypto/camellia/camellia.c optional crypto | ipsec
crypto/camellia/camellia-api.c optional crypto | ipsec
-crypto/des/des_ecb.c optional crypto | ipsec
-crypto/des/des_setkey.c optional crypto | ipsec
+crypto/des/des_ecb.c optional crypto | ipsec | netsmb
+crypto/des/des_setkey.c optional crypto | ipsec | netsmb
crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi
crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \
ipsec | random | wlan_ccmp
@@ -2509,6 +2509,12 @@ fs/pseudofs/pseudofs.c optional pseudofs
fs/pseudofs/pseudofs_fileno.c optional pseudofs
fs/pseudofs/pseudofs_vncache.c optional pseudofs
fs/pseudofs/pseudofs_vnops.c optional pseudofs
+fs/smbfs/smbfs_io.c optional smbfs
+fs/smbfs/smbfs_node.c optional smbfs
+fs/smbfs/smbfs_smb.c optional smbfs
+fs/smbfs/smbfs_subr.c optional smbfs
+fs/smbfs/smbfs_vfsops.c optional smbfs
+fs/smbfs/smbfs_vnops.c optional smbfs
fs/udf/osta.c optional udf
fs/udf/udf_iconv.c optional udf_iconv
fs/udf/udf_vfsops.c optional udf
@@ -2746,6 +2752,7 @@ kern/kern_uuid.c standard
kern/kern_xxx.c standard
kern/link_elf.c standard
kern/linker_if.m standard
+kern/md4c.c optional netsmb
kern/md5c.c standard
kern/p1003_1b.c standard
kern/posix4_mib.c standard
@@ -3279,6 +3286,15 @@ netpfil/pf/pf_osfp.c optional pf inet
netpfil/pf/pf_ruleset.c optional pf inet
netpfil/pf/pf_table.c optional pf inet
netpfil/pf/in4_cksum.c optional pf inet
+netsmb/smb_conn.c optional netsmb
+netsmb/smb_crypt.c optional netsmb
+netsmb/smb_dev.c optional netsmb
+netsmb/smb_iod.c optional netsmb
+netsmb/smb_rq.c optional netsmb
+netsmb/smb_smb.c optional netsmb
+netsmb/smb_subr.c optional netsmb
+netsmb/smb_trantcp.c optional netsmb
+netsmb/smb_usr.c optional netsmb
nfs/bootp_subr.c optional bootp nfsclient | bootp nfscl
nfs/krpc_subr.c optional bootp nfsclient | bootp nfscl
nfs/nfs_common.c optional nfsclient | nfsserver
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 7a41a269c8f10..2cb1981cf3f3a 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -136,7 +136,7 @@ crypto/aesni/aeskeys_amd64.S optional aesni
crypto/aesni/aesni.c optional aesni
crypto/aesni/aesni_wrap.c optional aesni
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
crypto/via/padlock.c optional padlock
crypto/via/padlock_cipher.c optional padlock
crypto/via/padlock_hash.c optional padlock
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index 938386d70bff9..ac487041f6f40 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -61,7 +61,7 @@ board_id.h standard \
clean "board_id.h"
cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs compile-with "${ZFS_C}"
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/fb/fb.c optional sc
dev/hwpmc/hwpmc_arm.c optional hwpmc
dev/kbd/kbd.c optional sc
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 218472b71c528..0f65d3b8a3ddf 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -122,7 +122,7 @@ crypto/aesni/aesencdec_i386.S optional aesni
crypto/aesni/aeskeys_i386.S optional aesni
crypto/aesni/aesni.c optional aesni
crypto/aesni/aesni_wrap.c optional aesni
-crypto/des/arch/i386/des_enc.S optional crypto | ipsec
+crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb
crypto/via/padlock.c optional padlock
crypto/via/padlock_cipher.c optional padlock
crypto/via/padlock_hash.c optional padlock
diff --git a/sys/conf/files.ia64 b/sys/conf/files.ia64
index 474ba1b8132e8..6719c98706588 100644
--- a/sys/conf/files.ia64
+++ b/sys/conf/files.ia64
@@ -41,7 +41,7 @@ contrib/ia64/libuwx/src/uwx_trace.c standard
contrib/ia64/libuwx/src/uwx_uinfo.c standard
contrib/ia64/libuwx/src/uwx_utable.c standard
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/atkbdc/atkbd.c optional atkbd atkbdc
dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc
dev/atkbdc/atkbdc.c optional atkbdc
diff --git a/sys/conf/files.mips b/sys/conf/files.mips
index 79676b992887f..ca8dee27a415c 100644
--- a/sys/conf/files.mips
+++ b/sys/conf/files.mips
@@ -77,7 +77,7 @@ dev/uart/uart_cpu_fdt.c optional uart fdt
# crypto support -- use generic
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
# AP common nvram interface MIPS specific, but maybe should be more generic
dev/nvram2env/nvram2env.c optional nvram2env
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index 252ecdddeac9e..a8e60b6f72903 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -77,7 +77,7 @@ bf_enc.o optional crypto | ipsec \
dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \
compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
no-implicit-rule
-crypto/des/arch/i386/des_enc.S optional crypto | ipsec
+crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb
dev/agp/agp_ali.c optional agp
dev/agp/agp_amd.c optional agp
dev/agp/agp_i810.c optional agp
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 96331f7ad0aa5..5808d856838f7 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -18,7 +18,7 @@ font.h optional sc \
cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc compile-with "${ZFS_C}"
cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S optional zfs powerpc64 compile-with "${ZFS_S}"
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/bm/if_bm.c optional bm powermac
dev/adb/adb_bus.c optional adb
dev/adb/adb_kbd.c optional adb
diff --git a/sys/conf/files.sparc64 b/sys/conf/files.sparc64
index 5019dabeab869..a0fad9b5477db 100644
--- a/sys/conf/files.sparc64
+++ b/sys/conf/files.sparc64
@@ -24,7 +24,7 @@ ukbdmap.h optional ukbd_dflt_keymap \
#
cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
crypto/blowfish/bf_enc.c optional crypto | ipsec
-crypto/des/des_enc.c optional crypto | ipsec
+crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/atkbdc/atkbd.c optional atkbd atkbdc
dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc
dev/atkbdc/atkbdc.c optional atkbdc
diff --git a/sys/conf/options b/sys/conf/options
index 03936fd94b40e..752893d32e6fc 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -222,6 +222,7 @@ NULLFS opt_dontuse.h
PROCFS opt_dontuse.h
PSEUDOFS opt_dontuse.h
REISERFS opt_dontuse.h
+SMBFS opt_dontuse.h
TMPFS opt_dontuse.h
UDF opt_dontuse.h
UNIONFS opt_dontuse.h
@@ -287,6 +288,9 @@ UFS_GJOURNAL opt_ufs.h
# they won't make any difference yet).
NFS_ROOT opt_nfsroot.h
+# SMB/CIFS requester
+NETSMB opt_netsmb.h
+
# Options used only in subr_param.c.
HZ opt_param.h
MAXFILES opt_param.h
diff --git a/sys/kern/Make.tags.inc b/sys/kern/Make.tags.inc
index 81205a6b429bb..cb8a3ff993e7f 100644
--- a/sys/kern/Make.tags.inc
+++ b/sys/kern/Make.tags.inc
@@ -30,6 +30,7 @@ COMM= ${SYS}/dev/advansys/*.[ch] \
${SYS}/fs/msdosfs/*.[ch] \
${SYS}/fs/nullfs/*.[ch] \
${SYS}/fs/procfs/*.[ch] \
+ ${SYS}/fs/smbfs/*.[ch] \
${SYS}/fs/udf/*.[ch] \
${SYS}/fs/unionfs/*.[ch] \
${SYS}/geom/*.[ch] \
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 45b9327683dd4..a12773be5316c 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1498,6 +1498,61 @@ sys_openbsd_poll(td, uap)
}
/*
+ * XXX This was created specifically to support netncp and netsmb. This
+ * allows the caller to specify a socket to wait for events on. It returns
+ * 0 if any events matched and an error otherwise. There is no way to
+ * determine which events fired.
+ */
+int
+selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td)
+{
+ struct timeval rtv;
+ sbintime_t asbt, precision, rsbt;
+ int error;
+
+ if (tvp != NULL) {
+ rtv = *tvp;
+ if (rtv.tv_sec < 0 || rtv.tv_usec < 0 ||
+ rtv.tv_usec >= 1000000)
+ return (EINVAL);
+ if (!timevalisset(&rtv))
+ asbt = 0;
+ else if (rtv.tv_sec <= INT32_MAX) {
+ rsbt = tvtosbt(rtv);
+ precision = rsbt;
+ precision >>= tc_precexp;
+ if (TIMESEL(&asbt, rsbt))
+ asbt += tc_tick_sbt;
+ if (asbt <= INT64_MAX - rsbt)
+ asbt += rsbt;
+ else
+ asbt = -1;
+ } else
+ asbt = -1;
+ } else
+ asbt = -1;
+ seltdinit(td);
+ /*
+ * Iterate until the timeout expires or the socket becomes ready.
+ */
+ for (;;) {
+ selfdalloc(td, NULL);
+ error = sopoll(so, events, NULL, td);
+ /* error here is actually the ready events. */
+ if (error)
+ return (0);
+ error = seltdwait(td, asbt, precision);
+ if (error)
+ break;
+ }
+ seltdclear(td);
+ /* XXX Duplicates ncp/smb behavior. */
+ if (error == ERESTART)
+ error = 0;
+ return (error);
+}
+
+/*
* Preallocate two selfds associated with 'cookie'. Some fo_poll routines
* have two select sets, one for read and another for write.
*/
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 75cc5bd5bf575..e43d561cf1c13 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -301,6 +301,7 @@ SUBDIR= \
siis \
sis \
sk \
+ ${_smbfs} \
${_sn} \
${_snc} \
snp \
@@ -520,6 +521,7 @@ _rdma= rdma
_safe= safe
_sbni= sbni
_scsi_low= scsi_low
+_smbfs= smbfs
_sound= sound
_speaker= speaker
_splash= splash
@@ -722,6 +724,7 @@ _s3= s3
_safe= safe
_scsi_low= scsi_low
_sfxge= sfxge
+_smbfs= smbfs
_sound= sound
_speaker= speaker
_splash= splash
@@ -779,6 +782,7 @@ _ips= ips
_mly= mly
_pccard= pccard
_scsi_low= scsi_low
+_smbfs= smbfs
_sound= sound
_splash= splash
_sppp= sppp
@@ -801,6 +805,7 @@ _drm= drm
_exca= exca
_nvram= powermac_nvram
_pccard= pccard
+_smbfs= smbfs
_sound= sound
_cyclic= cyclic
_dtrace= dtrace
@@ -827,6 +832,7 @@ _igb= igb
.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
_opensolaris= opensolaris
.endif
+_smbfs= smbfs
_sound= sound
.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
_zfs= zfs
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 77f31df336a78..89dec187cc913 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -371,6 +371,8 @@ void soupcall_clear(struct socket *so, int which);
void soupcall_set(struct socket *so, int which,
int (*func)(struct socket *, void *, int), void *arg);
void sowakeup(struct socket *so, struct sockbuf *sb);
+int selsocket(struct socket *so, int events, struct timeval *tv,
+ struct thread *td);
/*
* Accept filter functions (duh).