📄 smb.h
字号:
uint8 id_auth[6]; /* Identifier Authority */ /* * Note that the values in these uint32's are in *native* byteorder, * not neccessarily little-endian...... JRA. */ uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */} DOM_SID;/*** query a local group, get a list of these: shows who is in that group ***//* local group member info */typedef struct local_grp_member_info{ DOM_SID sid ; /* matches with name */ uint8 sid_use; /* usr=1 grp=2 dom=3 alias=4 wkng=5 del=6 inv=7 unk=8 */ fstring name ; /* matches with sid: must be of the form "DOMAIN\account" */} LOCAL_GRP_MEMBER;/* enumerate these to get list of local groups *//* local group info */typedef struct local_grp_info{ fstring name; fstring comment;} LOCAL_GRP;/*** enumerate these to get list of domain groups ***//* domain group member info */typedef struct domain_grp_info{ fstring name; fstring comment; uint32 rid; /* group rid */ uint8 attr; /* attributes forced to be set to 0x7: SE_GROUP_xxx */} DOMAIN_GRP;/*** query a domain group, get a list of these: shows who is in that group ***//* domain group info */typedef struct domain_grp_member_info{ fstring name; uint8 attr; /* attributes forced to be set to 0x7: SE_GROUP_xxx */} DOMAIN_GRP_MEMBER;/* DOM_CHAL - challenge info */typedef struct chal_info{ uchar data[8]; /* credentials */} DOM_CHAL;/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */typedef struct time_info{ uint32 time;} UTIME;/* DOM_CREDs - timestamped client or server credentials */typedef struct cred_info{ DOM_CHAL challenge; /* credentials */ UTIME timestamp; /* credential time-stamp */} DOM_CRED;/* Structure used when SMBwritebmpx is active */typedef struct{ size_t wr_total_written; /* So we know when to discard this */ int32 wr_timeout; int32 wr_errclass; int32 wr_error; /* Cached errors */ BOOL wr_mode; /* write through mode) */ BOOL wr_discard; /* discard all further data */} write_bmpx_struct;/* * Structure used to indirect fd's from the files_struct. * Needed as POSIX locking is based on file and process, not * file descriptor and process. */typedef struct file_fd_struct{ struct file_fd_struct *next, *prev; uint16 ref_count; uint16 uid_cache_count; uid_t uid_users_cache[10]; SMB_DEV_T dev; SMB_INO_T inode; int fd; int fd_readonly; int fd_writeonly; int real_open_flags; BOOL delete_on_close;} file_fd_struct;/* * 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 uid_cache { int entries; uid_t list[UID_CACHE_SIZE];};typedef struct{ char *name; BOOL is_wild;} name_compare_entry;typedef struct connection_struct{ struct connection_struct *next, *prev; unsigned cnum; /* an index passed over the wire */ int service; BOOL force_user; struct uid_cache uid_cache; void *dirptr; BOOL printer; BOOL ipc; BOOL read_only; BOOL admin_user; char *dirpath; char *connectpath; char *origpath; 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 */ 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 */ int ngroups; gid_t *groups; time_t lastused; BOOL used; int num_files_open; 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. */ } connection_struct;struct current_user{ connection_struct *conn; uint16 vuid; uid_t uid; gid_t gid; int ngroups; gid_t *groups;};typedef struct files_struct{ struct files_struct *next, *prev; int fnum; connection_struct *conn; file_fd_struct *fd_ptr; SMB_OFF_T pos; SMB_OFF_T size; mode_t mode; uint16 vuid; char *mmap_ptr; SMB_OFF_T mmap_size; write_bmpx_struct *wbmpx_ptr; struct timeval open_time; int share_mode; time_t pending_modtime; BOOL open; BOOL can_lock; BOOL can_read; BOOL can_write; BOOL print_file; BOOL modified; BOOL granted_oplock; BOOL sent_oplock_break; BOOL is_directory; BOOL directory_delete_on_close; BOOL stat_open; char *fsp_name;} files_struct;/* Domain controller authentication protocol info */struct dcinfo{ DOM_CHAL clnt_chal; /* Initial challenge received from client */ DOM_CHAL srv_chal; /* Initial server challenge */ DOM_CRED clnt_cred; /* Last client credential */ DOM_CRED srv_cred; /* Last server credential */ uchar sess_key[8]; /* Session key */ uchar md4pw[16]; /* md4(machine password) */};typedef struct{ uid_t uid; /* uid of a validated user */ gid_t gid; /* gid of a validated user */ fstring requested_name; /* user name from the client */ fstring name; /* unix user name of a validated user */ fstring real_name; /* to store real name from password file - simeon */ BOOL guest; /* following groups stuff added by ih */ /* This groups info is needed for when we become_user() for this uid */ int n_groups; gid_t *groups; int n_sids; int *sids; /* per-user authentication information on NT RPCs */ struct dcinfo dc;} user_struct;enum {LPQ_QUEUED,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING};typedef struct{ int job; int size; int status; int priority; time_t time; char user[30]; char file[100];} print_queue_struct;enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};typedef struct{ fstring message; 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; struct in_addr ip; struct in_addr bcast; struct in_addr nmask;};/* struct returned by get_share_modes */typedef struct{ int pid; uint16 op_port; uint16 op_type; int share_mode; struct timeval time;} share_mode_entry;/* each implementation of the share mode code needs to support the following operations */struct share_ops { BOOL (*stop_mgmt)(void); BOOL (*lock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int *); BOOL (*unlock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int ); int (*get_entries)(connection_struct *, int , SMB_DEV_T , SMB_INO_T , share_mode_entry **); void (*del_entry)(int , files_struct *); BOOL (*set_entry)(int, files_struct *, uint16 , uint16 ); BOOL (*mod_entry)(int, files_struct *, void (*)(share_mode_entry *, SMB_DEV_T, SMB_INO_T, void *), void *); int (*forall)(void (*)(share_mode_entry *, char *)); void (*status)(FILE *);};/* each implementation of the shared memory code needs to support the following operations */struct shmem_ops { BOOL (*shm_close)( void ); int (*shm_alloc)(int ); BOOL (*shm_free)(int ); int (*get_userdef_off)(void); void *(*offset2addr)(int ); int (*addr2offset)(void *addr); BOOL (*lock_hash_entry)(unsigned int); BOOL (*unlock_hash_entry)( unsigned int ); BOOL (*get_usage)(int *,int *,int *); unsigned (*hash_size)(void);};/* * Each implementation of the password database code needs * to support the following operations. */struct passdb_ops { /* * Password database ops. */ void *(*startsmbpwent)(BOOL); void (*endsmbpwent)(void *); SMB_BIG_UINT (*getsmbpwpos)(void *); BOOL (*setsmbpwpos)(void *, SMB_BIG_UINT); /* * smb password database query functions. */ struct smb_passwd *(*getsmbpwnam)(char *); struct smb_passwd *(*getsmbpwuid)(uid_t); struct smb_passwd *(*getsmbpwrid)(uint32); struct smb_passwd *(*getsmbpwent)(void *); /* * smb password database modification functions. */ BOOL (*add_smbpwd_entry)(struct smb_passwd *); BOOL (*mod_smbpwd_entry)(struct smb_passwd *, BOOL); /* * Functions that manupulate a struct sam_passwd. */ struct sam_passwd *(*getsam21pwent)(void *); /* * sam password database query functions. */ struct sam_passwd *(*getsam21pwnam)(char *); struct sam_passwd *(*getsam21pwuid)(uid_t); struct sam_passwd *(*getsam21pwrid)(uint32); /* * sam password database modification functions. */ BOOL (*add_sam21pwd_entry)(struct sam_passwd *); BOOL (*mod_sam21pwd_entry)(struct sam_passwd *, BOOL); /* * sam query display info functions. */ struct sam_disp_info *(*getsamdispnam)(char *); struct sam_disp_info *(*getsamdisprid)(uint32); struct sam_disp_info *(*getsamdispent)(void *);#if 0 /* * password checking functions */ struct smb_passwd *(*smb_password_chal )(char *username, char lm_pass[24], char nt_pass[24], char chal[8]); struct smb_passwd *(*smb_password_check )(char *username, char lm_hash[16], char nt_hash[16]); struct passwd *(*unix_password_check)(char *username, char *pass, int pass_len);#endif};/* this is used for smbstatus */struct connect_record{ int magic; int pid; int cnum; uid_t uid; gid_t gid; char name[24]; char addr[24]; char machine[128]; time_t start;};/* This is used by smbclient to send it to a smbfs mount point */struct connection_options { int protocol; /* Connection-Options */ uint32 max_xmit; uint16 server_vuid; uint16 tid; /* The following are LANMAN 1.0 options */ uint16 sec_mode; uint16 max_mux; uint16 max_vcs; uint16 rawmode; uint32 sesskey; /* The following are NT LM 0.12 options */ uint32 maxraw; uint32 capabilities; uint16 serverzone;};/* the following are used by loadparm for option lists */typedef enum{ P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, 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;struct enum_list { int value; char *name;};struct parm_struct{ char *label; parm_type type;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -