smb_conn.h revision 9c9af2590af49bb395bc8d2eace0f2d4ea16d165
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Copyright (c) 2000-2001 Boris Popov
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * All rights reserved.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow *
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Redistribution and use in source and binary forms, with or without
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * modification, are permitted provided that the following conditions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * are met:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * 1. Redistributions of source code must retain the above copyright
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * notice, this list of conditions and the following disclaimer.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * 2. Redistributions in binary form must reproduce the above copyright
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * notice, this list of conditions and the following disclaimer in the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * documentation and/or other materials provided with the distribution.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * 3. All advertising materials mentioning features or use of this software
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * must display the following acknowledgement:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This product includes software developed by Boris Popov.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * 4. Neither the name of the author nor the names of any co-contributors
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * may be used to endorse or promote products derived from this software
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * without specific prior written permission.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow *
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * SUCH DAMAGE.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow *
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * $Id: smb_conn.h,v 1.32.42.1 2005/05/27 02:35:29 lindak Exp $
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
1b34bc4aa5ecbd590d45845d21c8478049df6dcfbs * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Use is subject to license terms.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#ifndef _SMB_CONN_H
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define _SMB_CONN_H
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#include <sys/t_lock.h>
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#include <sys/queue.h> /* for SLIST below */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#include <sys/uio.h>
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#include <netsmb/smb_dev.h>
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#ifndef _KERNEL
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#error "Not _KERNEL?"
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Credentials of user/process for processing in the connection procedures
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_cred {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow pid_t vc_pid;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cred_t *vc_ucred;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow} smb_cred_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Common object flags
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBO_GONE 0x1000000
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Bits in vc_flags (a.k.a. vc_co.co_flags)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Many of these were duplicates of SMBVOPT_ flags
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * and we now keep those too instead of merging
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * them into vc_flags.
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross *
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross * Careful here: In smb_smb_negotiate, we clear ALL OF
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross * vc_flags except: SMBV_GONE, SMBV_RECONNECTING
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross#define SMBV_RECONNECTING 0x0002 /* conn in process of reconnection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBV_LONGNAMES 0x0004 /* conn configured to use long names */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBV_ENCRYPT 0x0008 /* server demands encrypted password */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBV_WIN95 0x0010 /* used to apply bugfixes for this OS */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBV_NT4 0x0020 /* used when NT4 issues invalid resp */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross#define SMBV_UNICODE 0x0040 /* conn configured to use Unicode */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross#define SMBV_EXT_SEC 0x0080 /* conn to use extended security */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross#define SMBV_WILL_SIGN 0x0100 /* negotiated signing */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Note: the common "obj" level uses this GONE flag by
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * the name SMBO_GONE. Keep this alias as a reminder.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBV_GONE SMBO_GONE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * bits in smb_share ss_flags (a.k.a. ss_co.co_flags)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_RECONNECTING 0x0002
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_CONNECTED 0x0004
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_TCON_WAIT 0x0008
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_1980 0x0010
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * ^ This partition can't handle dates before 1980. It's probably a FAT
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * partition but could be some other ancient FS type
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_RESUMEKEYS 0x0010 /* must use resume keys */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Note: the common "obj" level uses this GONE flag by
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * the name SMBO_GONE. Keep this alias as a reminder.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBS_GONE SMBO_GONE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Negotiated protocol parameters
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_sopt {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int sv_proto;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int16_t sv_tz; /* offset in min relative to UTC */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint32_t sv_maxtx; /* maximum transmit buf size */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uchar_t sv_sm; /* security mode */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t sv_maxmux; /* max number of outstanding rq's */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t sv_maxvcs; /* max number of VCs */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t sv_rawmode;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint32_t sv_maxraw; /* maximum raw-buffer size */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint32_t sv_skey; /* session key */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint32_t sv_caps; /* capabilites SMB_CAP_ */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_sopt smb_sopt_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * network IO daemon states
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * really connection states.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowenum smbiod_state {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_NOTCONN, /* no connect request was made */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_RECONNECT, /* a [re]connect attempt is in progress */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_TRANACTIVE, /* transport level is up */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_NEGOACTIVE, /* completed negotiation */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_SSNSETUP, /* started (a) session setup */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_VCACTIVE, /* session established */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SMBIOD_ST_DEAD /* connection broken, transport is down */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Info structures
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_INFO_NONE 0
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_INFO_VC 2
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_INFO_SHARE 3
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_vc_info {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int itype;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int usecount;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uid_t uid; /* user id of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gid_t gid; /* group of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t mode; /* access mode */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int flags;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow enum smbiod_state iodstate;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_sopt sopt;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char srvname[SMB_MAXSRVNAMELEN+1];
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char vcname[128];
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_vc_info smb_vc_info_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_share_info {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int itype;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int usecount;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ushort_t tid; /* TID */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int type; /* share type */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uid_t uid; /* user id of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gid_t gid; /* group of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t mode; /* access mode */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int flags;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char sname[128];
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_share_info smb_share_info_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_rq;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* This declares struct smb_rqhead */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowTAILQ_HEAD(smb_rqhead, smb_rq);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_NBTIMO 15
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_DEFRQTIMO 30 /* 30 for oplock revoke/writeback */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBWRTTIMO 60
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBSSNSETUPTIMO 60
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBNOREPLYWAIT (0)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_DIALECT(vcp) ((vcp)->vc_sopt.sv_proto)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Connection object
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_CO_LOCK(cp) mutex_enter(&(cp)->co_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_CO_UNLOCK(cp) mutex_exit(&(cp)->co_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Common part of smb_vc, smb_share
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Locking: co_lock protects most
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * fields in this struct, except
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * as noted below:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_connobj {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow kmutex_t co_lock;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int co_level; /* SMBL_ */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int co_flags;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int co_usecount;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* Note: must lock co_parent before child. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_connobj *co_parent;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* this.co_lock protects the co_children list */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SLIST_HEAD(, smb_connobj) co_children;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Linkage in parent's list of children.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Must hold parent.co_lock to traverse.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow SLIST_ENTRY(smb_connobj) co_next;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* These two are set only at creation. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void (*co_gone)(struct smb_connobj *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void (*co_free)(struct smb_connobj *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_connobj smb_connobj_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Virtual Circuit (session) to a server.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This is the most (over)complicated part of SMB protocol.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * For the user security level (usl), each session with different remote
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * user name has its own VC.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * It is unclear however, should share security level (ssl) allow additional
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * VCs, because user name is not used and can be the same. On other hand,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * multiple VCs allows us to create separate sessions to server on a per
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * user basis.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_vc {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_connobj vc_co;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow enum smbiod_state vc_state;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow kcondvar_t vc_statechg;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ksema_t vc_sendlock;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow zoneid_t vc_zoneid;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *vc_srvname;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct sockaddr *vc_paddr; /* server addr */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct sockaddr *vc_laddr; /* local addr, if any */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *vc_domain; /* domain that defines username */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *vc_username;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *vc_pass; /* password for usl case */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uchar_t vc_lmhash[SMB_PWH_MAX];
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uchar_t vc_nthash[SMB_PWH_MAX];
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross uint8_t *vc_mackey; /* MAC key */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross int vc_mackeylen; /* length of MAC key */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross uint32_t vc_seqno; /* my next sequence number - */
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross /* - serialized by iod_rqlock */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint_t vc_timo; /* default request timeout */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_maxvcs; /* maximum number of VC per conn */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *vc_tolower; /* local charset */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *vc_toupper; /* local charset */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *vc_toserver; /* local charset to server one */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *vc_tolocal; /* server charset to local one */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_number; /* number of this VC from client side */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_genid; /* "generation ID" of this VC */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uid_t vc_uid; /* user id of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gid_t vc_grp; /* group of connection */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t vc_mode; /* access mode */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t vc_smbuid; /* auth. session ID from server */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint8_t vc_hflags; /* or'ed with flags in the smb header */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t vc_hflags2; /* or'ed with flags in the smb header */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *vc_tdata; /* transport control block */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_tran_desc *vc_tdesc;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_chlen; /* actual challenge length */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uchar_t vc_challenge[SMB_MAXCHALLENGELEN];
9c9af2590af49bb395bc8d2eace0f2d4ea16d165Gordon Ross uint16_t vc_mid; /* multiplex id */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_vopt; /* local options SMBVOPT_ */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_sopt vc_sopt; /* server options */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred vc_scred; /* used in reconnect procedure */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_txmax; /* max tx/rx packet size */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_rxmax; /* max readx data size */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int vc_wxmax; /* max writex data size */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* Authentication tokens */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow size_t vc_intoklen;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow caddr_t vc_intok;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow size_t vc_outtoklen;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow caddr_t vc_outtok;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow size_t vc_negtoklen;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow caddr_t vc_negtok;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * These members used to be in struct smbiod,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * which has been eliminated.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krwlock_t iod_rqlock; /* iod_rqlist */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_rqhead iod_rqlist; /* list of outstanding reqs */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct _kthread *iod_thr; /* the IOD (reader) thread */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow kcondvar_t iod_exit; /* IOD thread termination */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int iod_flags; /* see SMBIOD_* below */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int iod_newrq; /* send needed (iod_rqlock) */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int iod_muxfull; /* maxmux limit reached */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint_t iod_rqwaiting; /* count of waiting requests */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow} smb_vc_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define vc_lock vc_co.co_lock
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define vc_flags vc_co.co_flags
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define vc_maxmux vc_sopt.sv_maxmux
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_VC_LOCK(vcp) mutex_enter(&(vcp)->vc_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_VC_UNLOCK(vcp) mutex_exit(&(vcp)->vc_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_UNICODE_STRINGS(vcp) ((vcp)->vc_hflags2 & SMB_FLAGS2_UNICODE)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* Bits in iod_flags */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBIOD_RUNNING 0x0001
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMBIOD_SHUTDOWN 0x0002
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * smb_share structure describes connection to the given SMB share (tree).
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Connection to share is always built on top of the VC.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_share {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_connobj ss_co;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow kcondvar_t ss_conn_done; /* wait for reconnect */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int ss_conn_waiters;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *ss_name;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *ss_pass; /* share password, can be null */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *ss_fsname;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void *ss_mount; /* used for smb up/down */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint16_t ss_tid; /* TID */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int ss_type; /* share type */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t ss_mode; /* access mode */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int ss_vcgenid; /* check VC generation ID */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uint32_t ss_maxfilenamelen;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int ss_sopt; /* local options SMBSOPT_ */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow} smb_share_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define ss_lock ss_co.co_lock
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define ss_flags ss_co.co_flags
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_SS_LOCK(ssp) mutex_enter(&(ssp)->ss_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SMB_SS_UNLOCK(ssp) mutex_exit(&(ssp)->ss_lock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define CPTOVC(cp) ((struct smb_vc *)(cp))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define VCTOCP(vcp) (&(vcp)->vc_co)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define CPTOSS(cp) ((struct smb_share *)(cp))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SSTOVC(ssp) CPTOVC(((ssp)->ss_co.co_parent))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define SSTOCP(ssp) (&(ssp)->ss_co)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This is used internally to pass all the info about
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * some VC that an ioctl caller is looking for.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_vcspec {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *srvname;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct sockaddr *sap;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct sockaddr *lap;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int optflags;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *domain;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *username;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *pass;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uid_t owner;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gid_t group;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t mode;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t rights;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *localcs;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *servercs;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow size_t toklen;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow caddr_t tok;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_vcspec smb_vcspec_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This is used internally to pass all the info about
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * some share that an ioctl caller is looking for.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstruct smb_sharespec {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *name;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *pass;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t mode;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow mode_t rights;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uid_t owner;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gid_t group;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int stype;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow int optflags;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow};
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_sharespec smb_sharespec_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Call-back operations vector, so the netsmb module
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * can notify smbfs about events affecting mounts.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Installed in netsmb after smbfs loads.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* #define NEED_SMBFS_CALLBACKS 1 */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#ifdef NEED_SMBFS_CALLBACKS
4bff34e37def8a90f9194d81bc345c52ba20086athurlowtypedef struct smb_fscb {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void (*fscb_dead)(smb_share_t *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void (*fscb_down)(smb_share_t *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow void (*fscb_up)(smb_share_t *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow} smb_fscb_t;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* Install the above vector, or pass NULL to clear it. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_fscb_set(smb_fscb_t *);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* NEED_SMBFS_CALLBACKS */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * IOD functions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_create(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_destroy(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_connect(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_disconnect(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_addrq(struct smb_rq *rqp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_multirq(struct smb_rq *rqp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_waitrq(struct smb_rq *rqp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_iod_removerq(struct smb_rq *rqp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_iod_shutdown_share(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_iod_notify_down(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_iod_notify_up(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Session level functions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_sm_init(void);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_sm_idle(void);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_sm_done(void);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
1b34bc4aa5ecbd590d45845d21c8478049df6dcfbsint smb_sm_findvc(struct smb_vcspec *vcspec,
1b34bc4aa5ecbd590d45845d21c8478049df6dcfbs struct smb_cred *scred, struct smb_vc **vcpp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_sm_negotiate(struct smb_vcspec *vcspec,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred *scred, struct smb_vc **vcpp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_sm_ssnsetup(struct smb_vcspec *vcspec,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred *scred, struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_sm_tcon(struct smb_sharespec *shspec, struct smb_cred *scred,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_vc *vcp, struct smb_share **sspp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * VC level functions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_vc_setup(struct smb_vcspec *vcspec, struct smb_cred *scred,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_vc *vcp, int is_ss);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_vc_create(struct smb_vcspec *vcspec,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred *scred, struct smb_vc **vcpp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_vc_negotiate(struct smb_vc *vcp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_vc_ssnsetup(struct smb_vc *vcp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_vc_hold(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_vc_rele(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_vc_kill(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred *scred, struct smb_share **sspp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowconst char *smb_vc_getpass(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowuint16_t smb_vc_nextmid(struct smb_vc *vcp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid *smb_vc_getipaddr(struct smb_vc *vcp, int *ipvers);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * share level functions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct smb_cred *scred, struct smb_share **sspp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_share_hold(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_share_rele(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_share_kill(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowvoid smb_share_invalidate(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_share_tcon(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_share_valid(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowconst char *smb_share_getpass(struct smb_share *ssp);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_share_count(void);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * SMB protocol level functions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_negotiate(struct smb_vc *vcp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_ssnsetup(struct smb_vc *vcp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_ssnclose(struct smb_vc *vcp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_treeconnect(struct smb_share *ssp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_treedisconnect(struct smb_share *ssp, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_echo(struct smb_vc *vcp, struct smb_cred *scred, int timo);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#ifdef APPLE
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_smb_checkdir(struct smb_share *ssp, void *dnp,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow char *name, int nmlen, struct smb_cred *scred);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint smb_rwuio(struct smb_share *ssp, uint16_t fid, uio_rw_t rw,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow uio_t *uiop, struct smb_cred *scred, int timo);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* _SMB_CONN_H */