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 {
2006-07-11 22:01:26 +04:00
struct cli_state * cli ;
2002-11-04 05:01:48 +03:00
dev_t dev ;
2007-10-19 04:40:25 +04:00
bool no_pathinfo ;
bool no_pathinfo2 ;
bool no_nt_session ;
2008-01-17 19:49:17 +03:00
POLICY_HND pol ;
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 ;
2007-10-19 04:40:25 +04:00
bool file ;
2002-11-04 05:01:48 +03:00
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
*/
2007-10-19 04:40:25 +04: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
*/
2007-10-19 04:40:25 +04:00
bool _debug_stderr ;
2006-03-23 01:05:19 +03:00
r18009: Fixes bug 4026.
This completes the work Jeremy began last week, disambiguating the meaning of
c_time. (In POSIX terminology, c_time means "status Change time", not "create
time".) All uses of c_time, a_time and m_time have now been replaced with
change_time, access_time, and write_time, and when creation time is intended,
create_time is used.
Additionally, the capability of setting and retrieving the create time have
been added to the smbc_setxattr() and smbc_getxattr() functions. An example
of setting all four times can be seen with the program
examples/libsmbclient/testacl
with the following command line similar to:
testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt'
The -f option turns on the new mode which uses full time names in the
attribute specification (e.g. ACCESS_TIME vs A_TIME).
(This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
2006-09-03 01:47:56 +04:00
/*
* Support " Create Time " in get / set with the * xattr ( ) functions , if
* true . This replaces the dos attribute strings C_TIME , A_TIME and
* M_TIME with CHANGE_TIME , ACCESS_TIME and WRITE_TIME , and adds
* CREATE_TIME . Default is FALSE , i . e . to use the old - style shorter
* names and to not support CREATE time , for backward compatibility .
*/
2007-10-19 04:40:25 +04:00
bool _full_time_names ;
r18009: Fixes bug 4026.
This completes the work Jeremy began last week, disambiguating the meaning of
c_time. (In POSIX terminology, c_time means "status Change time", not "create
time".) All uses of c_time, a_time and m_time have now been replaced with
change_time, access_time, and write_time, and when creation time is intended,
create_time is used.
Additionally, the capability of setting and retrieving the create time have
been added to the smbc_setxattr() and smbc_getxattr() functions. An example
of setting all four times can be seen with the program
examples/libsmbclient/testacl
with the following command line similar to:
testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt'
The -f option turns on the new mode which uses full time names in the
attribute specification (e.g. ACCESS_TIME vs A_TIME).
(This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
2006-09-03 01:47:56 +04:00
2006-09-03 06:10:24 +04:00
/*
* The share mode of a file being opened . To match POSIX semantics
* ( and maintain backward compatibility ) , DENY_NONE is the default .
*/
smbc_share_mode _share_mode ;
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 ;
2008-01-05 11:51:18 +03:00
/*
* Should we attempt UNIX smb encryption ?
* Set to 0 if we should never attempt , set to 1 if
* encryption requested , set to 2 if encryption required .
*/
int _smb_encryption_level ;
2002-11-04 05:01:48 +03:00
} ;
# endif