2002-11-04 05:01:48 +03:00
# ifndef _LIBSMB_INTERNAL_H_
# define _LIBSMB_INTERNAL_H_
# define SMBC_MAX_NAME 1023
# define SMBC_FILE_MODE (S_IFREG | 0444)
# define SMBC_DIR_MODE (S_IFDIR | 0555)
2004-10-07 08:01:18 +04:00
# include "include/libsmbclient.h"
2002-11-04 05:01:48 +03:00
struct _SMBCSRV {
struct cli_state cli ;
dev_t dev ;
2005-06-02 00:17:16 +04:00
BOOL no_pathinfo ;
2002-11-04 05:01:48 +03:00
BOOL no_pathinfo2 ;
2005-03-11 02:41:19 +03:00
BOOL no_nt_session ;
2002-11-04 05:01:48 +03:00
SMBCSRV * next , * prev ;
} ;
/*
* Keep directory entries in a list
*/
struct smbc_dir_list {
struct smbc_dir_list * next ;
struct smbc_dirent * dirent ;
} ;
/*
* Structure for open file management
*/
struct _SMBCFILE {
int cli_fd ;
char * fname ;
2005-03-23 00:17:01 +03:00
SMB_OFF_T offset ;
2002-11-04 05:01:48 +03:00
struct _SMBCSRV * srv ;
BOOL file ;
struct smbc_dir_list * dir_list , * dir_end , * dir_next ;
int dir_type , dir_error ;
SMBCFILE * next , * prev ;
} ;
struct smbc_internal_data {
2005-12-29 19:26:06 +03:00
/*
* Is this handle initialized ?
2002-11-04 05:01:48 +03:00
*/
2005-12-29 19:26:06 +03:00
BOOL _initialized ;
2002-11-04 05:01:48 +03:00
2005-12-29 19:26:06 +03:00
/* dirent pointer location
2005-03-11 02:41:19 +03:00
*
* Leave room for any urlencoded filename and the comment field .
*
* We really should use sizeof ( struct smbc_dirent ) plus ( NAME_MAX * 3 )
* plus whatever the max length of a comment is , plus a couple of null
* terminators ( one after the filename , one after the comment ) .
*
* According to < linux / limits . h > , NAME_MAX is 255. Is it longer
* anyplace else ?
*/
char _dirent [ 1024 ] ;
2002-11-04 05:01:48 +03:00
2005-12-29 19:26:06 +03:00
/*
* server connection list
2002-11-04 05:01:48 +03:00
*/
SMBCSRV * _servers ;
2005-12-29 19:26:06 +03:00
/*
* open file / dir list
2002-11-04 05:01:48 +03:00
*/
SMBCFILE * _files ;
2005-12-29 19:26:06 +03:00
/*
* Log to standard error instead of the more typical standard output
*/
BOOL _debug_stderr ;
2006-03-23 01:05:19 +03:00
/*
* Authentication function which includes the context . This will be
* used if set ; otherwise context - > callbacks . auth_fn ( ) will be used .
*/
smbc_get_auth_data_with_context_fn _auth_fn_with_context ;
/*
* An opaque ( to this library ) user data handle which can be set
* and retrieved with smbc_option_set ( ) and smbc_option_get ( ) .
*/
void * _user_data ;
2002-11-04 05:01:48 +03:00
} ;
# endif