00001 #ifndef _LIBSMB_INTERNAL_H_ 00002 #define _LIBSMB_INTERNAL_H_ 00003 00004 #define SMBC_MAX_NAME 1023 00005 #define SMBC_FILE_MODE (S_IFREG | 0444) 00006 #define SMBC_DIR_MODE (S_IFDIR | 0555) 00007 00008 00009 #include "include/libsmbclient.h" 00010 00011 00012 struct _SMBCSRV { 00013 struct cli_state *cli; 00014 dev_t dev; 00015 BOOL no_pathinfo; 00016 BOOL no_pathinfo2; 00017 BOOL no_nt_session; 00018 00019 SMBCSRV *next, *prev; 00020 00021 }; 00022 00023 /* 00024 * Keep directory entries in a list 00025 */ 00026 struct smbc_dir_list { 00027 struct smbc_dir_list *next; 00028 struct smbc_dirent *dirent; 00029 }; 00030 00031 00032 /* 00033 * Structure for open file management 00034 */ 00035 struct _SMBCFILE { 00036 int cli_fd; 00037 char *fname; 00038 SMB_OFF_T offset; 00039 struct _SMBCSRV *srv; 00040 BOOL file; 00041 struct smbc_dir_list *dir_list, *dir_end, *dir_next; 00042 int dir_type, dir_error; 00043 00044 SMBCFILE *next, *prev; 00045 }; 00046 00047 00048 struct smbc_internal_data { 00049 00050 /* 00051 * Is this handle initialized ? 00052 */ 00053 BOOL _initialized; 00054 00055 /* dirent pointer location 00056 * 00057 * Leave room for any urlencoded filename and the comment field. 00058 * 00059 * We really should use sizeof(struct smbc_dirent) plus (NAME_MAX * 3) 00060 * plus whatever the max length of a comment is, plus a couple of null 00061 * terminators (one after the filename, one after the comment). 00062 * 00063 * According to <linux/limits.h>, NAME_MAX is 255. Is it longer 00064 * anyplace else? 00065 */ 00066 char _dirent[1024]; 00067 00068 /* 00069 * server connection list 00070 */ 00071 SMBCSRV * _servers; 00072 00073 /* 00074 * open file/dir list 00075 */ 00076 SMBCFILE * _files; 00077 00078 /* 00079 * Log to standard error instead of the more typical standard output 00080 */ 00081 BOOL _debug_stderr; 00082 00083 /* 00084 * Support "Create Time" in get/set with the *xattr() functions, if 00085 * true. This replaces the dos attribute strings C_TIME, A_TIME and 00086 * M_TIME with CHANGE_TIME, ACCESS_TIME and WRITE_TIME, and adds 00087 * CREATE_TIME. Default is FALSE, i.e. to use the old-style shorter 00088 * names and to not support CREATE time, for backward compatibility. 00089 */ 00090 BOOL _full_time_names; 00091 00092 /* 00093 * The share mode of a file being opened. To match POSIX semantics 00094 * (and maintain backward compatibility), DENY_NONE is the default. 00095 */ 00096 smbc_share_mode _share_mode; 00097 00098 /* 00099 * Authentication function which includes the context. This will be 00100 * used if set; otherwise context->callbacks.auth_fn() will be used. 00101 */ 00102 smbc_get_auth_data_with_context_fn _auth_fn_with_context; 00103 00104 /* 00105 * An opaque (to this library) user data handle which can be set 00106 * and retrieved with smbc_option_set() and smbc_option_get(). 00107 */ 00108 void * _user_data; 00109 }; 00110 00111 00112 #endif