/*
* Copyright (c) 2000-2001 Boris Popov
* All rights reserved.
*
* 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
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Boris Popov.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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.
*
* $Id: smb_lib.h,v 1.21.82.2 2005/06/02 00:55:39 lindak Exp $
*/
/*
*/
#ifndef _NETSMB_SMB_LIB_H_
#define _NETSMB_SMB_LIB_H_
/*
* Internal interface exported to our commands in:
*/
#include <sys/byteorder.h>
#include <paths.h>
#include <libnvpair.h>
#include <netsmb/libsmbfs.h>
/*
* bits to indicate the source of error
*/
/*
* The driver needs to know this, so it's
* defined by smb_dev.h
*/
/*
* This is what goes across the door call to the IOD
* when asking for a new connection.
*
* iod_ntstatus can be set to either NT_STATUS_UNSUCCESSFUL (for
* internal errors) or NT status returned by remote server upon
* SmbSessionSetup failure.
* Other fields are used for encoding the SmbSessionSetup request.
*/
struct smb_iod_ssn {
/* Kerberos cred. cache res. name? */
};
/*
* This is the return values of the door call to the IOD
* when asking for a new connection.
*/
typedef struct smb_iod_ssn_retval
{
/*
* SMB work context. Used to store all values which are necessary
* to establish connection to an SMB server.
*/
struct smb_ctx {
int ct_parsedlevel;
int ct_minlevel;
int ct_maxlevel;
/* smbioc_oshare_t ct_sh; XXX */
char *ct_origshare;
/* Connection setup SMB stuff. */
/* Strings from the SMB negotiate response. */
char *ct_srv_OS;
char *ct_srv_LM;
/* NTLM auth. stuff */
/* See ssp.c */
void *ct_ssp_ctx;
};
/*
* Short-hand for some of the substruct fields above
*/
/*
* Bits in smb_ctx_t.ct_flags
*/
typedef struct smbfs_passwd {
/*
* Context management
*/
int smbfs_ctx_init(struct smb_ctx *);
void smbfs_ctx_done(struct smb_ctx *);
int smbfs_open_driver(void);
int smbfs_ctx_gethandle(struct smb_ctx *);
int smbfs_ctx_findvc(struct smb_ctx *);
int smbfs_ctx_newvc(struct smb_ctx *);
/*
* I/O daemon stuff
*/
char *smbfs_iod_door_path(void);
int smbfs_iod_open_door(int *);
int smbfs_iod_connect(struct smb_ctx *);
int smbfs_iod_work(struct smb_ctx *);
int smbfs_iod_start(void);
int smbfs_iod_pwdadd(smbfs_passwd_t *);
int smbfs_iod_pwddel(smbfs_passwd_t *);
int smbfs_pwd_add(smbfs_passwd_t *);
int smbfs_pwd_loadkeychain(void);
/* SMBFS client credential cache functions */
typedef enum {
typedef enum {
/*
* Other stuff
*/
char *smbfs_nls_str_upper(char *, const char *);
#endif /* _NETSMB_SMB_LIB_H_ */