📄 smb.h
字号:
time_t last_write_time; int oplock_type; int sent_oplock_break; struct timed_event *oplock_timeout; struct share_mode_entry *pending_break_messages; int num_pending_break_messages; unsigned long file_id; BOOL can_lock; BOOL can_read; BOOL can_write; BOOL print_file; BOOL modified; BOOL is_directory; BOOL is_stat; BOOL aio_write_behind; char *fsp_name; FAKE_FILE_HANDLE *fake_file_handle;} files_struct;#include "ntquotas.h"#include "sysquotas.h"/* used to hold an arbitrary blob of data */typedef struct data_blob_ { uint8 *data; size_t length; void (*free)(struct data_blob_ *data_blob);} DATA_BLOB;/* * Structure used to keep directory state information around. * Used in NT change-notify code. */typedef struct{ time_t modify_time; time_t status_time;} dir_status_struct;struct vuid_cache_entry{ uint16 vuid; BOOL read_only; BOOL admin_user;};struct vuid_cache{ unsigned int entries; struct vuid_cache_entry array[VUID_CACHE_SIZE];};typedef struct{ char *name; BOOL is_wild;} name_compare_entry;/* Include VFS stuff */#include "smb_acls.h"#include "vfs.h"struct dfree_cached_info { time_t last_dfree_time; SMB_BIG_UINT dfree_ret; SMB_BIG_UINT bsize; SMB_BIG_UINT dfree; SMB_BIG_UINT dsize;};struct dptr_struct;typedef struct connection_struct{ struct connection_struct *next, *prev; TALLOC_CTX *mem_ctx; unsigned cnum; /* an index passed over the wire */ int service; BOOL force_user; BOOL force_group; struct vuid_cache vuid_cache; struct dptr_struct *dirptr; BOOL printer; BOOL ipc; BOOL read_only; /* Attributes for the current user of the share. */ BOOL admin_user; /* Attributes for the current user of the share. */ char *dirpath; char *connectpath; char *origpath; struct vfs_ops vfs; /* Filesystem operations */ struct vfs_ops vfs_opaque; /* OPAQUE Filesystem operations */ struct vfs_handle_struct *vfs_handles; /* for the new plugins */ char *user; /* name of user who *opened* this connection */ uid_t uid; /* uid of user who *opened* this connection */ gid_t gid; /* gid of user who *opened* this connection */ char client_address[18]; /* String version of client IP address. */ uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ /* following groups stuff added by ih */ /* This groups info is valid for the user that *opened* the connection */ size_t ngroups; gid_t *groups; NT_USER_TOKEN *nt_user_token; time_t lastused; BOOL used; int num_files_open; unsigned int num_smb_operations; /* Count of smb operations on this tree. */ BOOL case_sensitive; BOOL case_preserve; BOOL short_case_preserve; name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ struct dfree_cached_info *dfree_info;} connection_struct;struct current_user{ connection_struct *conn; uint16 vuid; uid_t uid; gid_t gid; int ngroups; gid_t *groups; NT_USER_TOKEN *nt_user_token;};/* Defines for the sent_oplock_break field above. */#define NO_BREAK_SENT 0#define BREAK_TO_NONE_SENT 1#define LEVEL_II_BREAK_SENT 2typedef struct { fstring smb_name; /* user name from the client */ fstring unix_name; /* unix user name of a validated user */ fstring full_name; /* to store full name (such as "Joe Bloggs") from gecos field of password file */ fstring domain; /* domain that the client specified */} userdom_struct;/* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */enum {LPQ_QUEUED=0,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING,LPQ_ERROR,LPQ_DELETING, LPQ_OFFLINE,LPQ_PAPEROUT,LPQ_PRINTED,LPQ_DELETED,LPQ_BLOCKED,LPQ_USER_INTERVENTION};typedef struct _print_queue_struct{ int job; /* normally the UNIX jobid -- see note in printing.c:traverse_fn_delete() */ int size; int page_count; int status; int priority; time_t time; fstring fs_user; fstring fs_file;} print_queue_struct;enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};typedef struct{ fstring message; int qcount; int status;} print_status_struct;/* used for server information: client, nameserv and ipc */struct server_info_struct{ fstring name; uint32 type; fstring comment; fstring domain; /* used ONLY in ipc.c NOT namework.c */ BOOL server_added; /* used ONLY in ipc.c NOT namework.c */};/* used for network interfaces */struct interface{ struct interface *next, *prev; struct in_addr ip; struct in_addr bcast; struct in_addr nmask;};/* Internal message queue for deferred opens. */struct pending_message_list { struct pending_message_list *next, *prev; struct timeval request_time; /* When was this first issued? */ struct timeval end_time; /* When does this time out? */ DATA_BLOB buf; DATA_BLOB private_data;};/* struct returned by get_share_modes */struct share_mode_entry { struct process_id pid; uint16 op_mid; uint16 op_type; uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */ uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */ uint32 private_options; /* NT Create options, but we only look at * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB for * smbstatus and swat */ struct timeval time; SMB_DEV_T dev; SMB_INO_T inode; unsigned long share_file_id;};/* oplock break message definition - linearization of share_mode_entry.Offset Data length.0 struct process_id pid 44 uint16 op_mid 26 uint16 op_type 28 uint32 access_mask 412 uint32 share_access 416 uint32 private_options 420 uint32 time sec 424 uint32 time usec 428 SMB_DEV_T dev 8 bytes.36 SMB_INO_T inode 8 bytes44 unsigned long file_id 4 bytes48*/#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 48struct share_mode_lock { const char *servicepath; /* canonicalized. */ const char *filename; SMB_DEV_T dev; SMB_INO_T ino; int num_share_modes; struct share_mode_entry *share_modes; BOOL delete_on_close; BOOL fresh; BOOL modified;};#define NT_HASH_LEN 16#define LM_HASH_LEN 16/* Password history contants. */#define PW_HISTORY_SALT_LEN 16#define SALTED_MD5_HASH_LEN 16#define PW_HISTORY_ENTRY_LEN (PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN)/* * Flags for account policy. */#define AP_MIN_PASSWORD_LEN 1#define AP_PASSWORD_HISTORY 2#define AP_USER_MUST_LOGON_TO_CHG_PASS 3#define AP_MAX_PASSWORD_AGE 4#define AP_MIN_PASSWORD_AGE 5#define AP_LOCK_ACCOUNT_DURATION 6#define AP_RESET_COUNT_TIME 7#define AP_BAD_ATTEMPT_LOCKOUT 8#define AP_TIME_TO_LOGOUT 9#define AP_REFUSE_MACHINE_PW_CHANGE 10/* * Flags for local user manipulation. */#define LOCAL_ADD_USER 0x1#define LOCAL_DELETE_USER 0x2#define LOCAL_DISABLE_USER 0x4#define LOCAL_ENABLE_USER 0x8#define LOCAL_TRUST_ACCOUNT 0x10#define LOCAL_SET_NO_PASSWORD 0x20#define LOCAL_SET_PASSWORD 0x40#define LOCAL_SET_LDAP_ADMIN_PW 0x80#define LOCAL_INTERDOM_ACCOUNT 0x100#define LOCAL_AM_ROOT 0x200 /* Act as root *//* key and data in the connections database - used in smbstatus and smbd */struct connections_key { struct process_id pid; int cnum; fstring name;};struct connections_data { int magic; struct process_id pid; int cnum; uid_t uid; gid_t gid; char name[24]; char addr[24]; char machine[FSTRING_LEN]; time_t start; uint32 bcast_msg_flags;};/* the following are used by loadparm for option lists */typedef enum { P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST, P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM,P_SEP} parm_type;typedef enum { P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE} parm_class;/* passed to br lock code */enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_LOCK};struct enum_list { int value; const char *name;};#define BRLOCK_FN_CAST() \ void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ enum brl_type lock_type, \ br_off start, br_off size)#define BRLOCK_FN(fn) \ void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ enum brl_type lock_type, \ br_off start, br_off size)struct parm_struct{ const char *label; parm_type type; parm_class p_class; void *ptr; BOOL (*special)(int snum, const char *, char **); const struct enum_list *enum_list; unsigned flags; union { BOOL bvalue; int ivalue; char *svalue; char cvalue; char **lvalue; } def;};struct bitmap { uint32 *b; unsigned int n;};/* The following flags are used in SWAT */#define FLAG_BASIC 0x0001 /* Display only in BASIC view */#define FLAG_SHARE 0x0002 /* file sharing options */#define FLAG_PRINT 0x0004 /* printing options */#define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */#define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */#define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */#define FLAG_DEVELOPER 0x0040 /* No longer used */#define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */#define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */#define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */#ifndef LOCKING_VERSION#define LOCKING_VERSION 4#endif /* LOCKING_VERSION *//* the basic packet size, assuming no words or bytes */#define smb_size 39/* offsets into message for common items */#define smb_com 8#define smb_rcls 9#define smb_reh 10#define smb_err 11#define smb_flg 13#define smb_flg2 14#define smb_pidhigh 16#define smb_ss_field 18#define smb_tid 28#define smb_pid 30#define smb_uid 32#define smb_mid 34#define smb_wct 36#define smb_vwv 37#define smb_vwv0 37#define smb_vwv1 39#define smb_vwv2 41#define smb_vwv3 43#define smb_vwv4 45#define smb_vwv5 47#define smb_vwv6 49#define smb_vwv7 51#define smb_vwv8 53#define smb_vwv9 55#define smb_vwv10 57#define smb_vwv11 59#define smb_vwv12 61#define smb_vwv13 63#define smb_vwv14 65#define smb_vwv15 67#define smb_vwv16 69#define smb_vwv17 71/* flag defines. CIFS spec 3.1.1 */#define FLAG_SUPPORT_LOCKREAD 0x01#define FLAG_CLIENT_BUF_AVAIL 0x02#define FLAG_RESERVED 0x04#define FLAG_CASELESS_PATHNAMES 0x08#define FLAG_CANONICAL_PATHNAMES 0x10#define FLAG_REQUEST_OPLOCK 0x20#define FLAG_REQUEST_BATCH_OPLOCK 0x40#define FLAG_REPLY 0x80/* the complete */#define SMBmkdir 0x00 /* create directory */#define SMBrmdir 0x01 /* delete directory */#define SMBopen 0x02 /* open file */#define SMBcreate 0x03 /* create file */#define SMBclose 0x04 /* close file */#define SMBflush 0x05 /* flush file */#define SMBunlink 0x06 /* delete file */#define SMBmv 0x07 /* rename file */#define SMBgetatr 0x08 /* get file attributes */#define SMBsetatr 0x09 /* set file attributes */#define SMBread 0x0A /* read from file */#define SMBwrite 0x0B /* write to file */#define SMBlock 0x0C /* lock byte range */#define SMBunlock 0x0D /* unlock byte range */#define SMBctemp 0x0E /* create temporary file */#define SMBmknew 0x0F /* make new file */#define SMBchkpth 0x10 /* check directory path */#define SMBexit 0x11 /* process exit */#define SMBlseek 0x12 /* seek */#define SMBtcon 0x70 /* tree connect */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -