interfaces.h

来自「samba最新软件」· C头文件 代码 · 共 2,736 行 · 第 1/4 页

H
2,736
字号
	struct {		enum smb_lpq_level level;	} generic;	/* SMBsplretq interface */	struct {		enum smb_lpq_level level;		struct {			uint16_t maxcount;			uint16_t startidx;		} in;		struct {			uint16_t count;			uint16_t restart_idx;			struct {				time_t time;				uint8_t status;				uint16_t job;				uint32_t size;				char *user;			} *queue;		} out;	} retq;};enum smb_ioctl_level {	RAW_IOCTL_IOCTL,	RAW_IOCTL_NTIOCTL,	RAW_IOCTL_SMB2,	RAW_IOCTL_SMB2_NO_HANDLE};/*  union for ioctl() backend*/union smb_ioctl {	/* generic interface */	struct {		enum smb_ioctl_level level;		struct {			union smb_handle file;		} in;	} generic;	/* struct for SMBioctl */	struct {		enum smb_ioctl_level level;		struct {			union smb_handle file;			uint32_t request;		} in;		struct {			DATA_BLOB blob;		} out;	} ioctl;	/* struct for NT ioctl call */	struct {		enum smb_ioctl_level level;		struct {			union smb_handle file;			uint32_t function;			bool fsctl;			uint8_t filter;			uint32_t max_data;			DATA_BLOB blob;		} in;		struct {			DATA_BLOB blob;		} out;	} ntioctl;	/* SMB2 Ioctl */	struct smb2_ioctl {		enum smb_ioctl_level level;		struct {			union smb_handle file;			/* static body buffer 56 (0x38) bytes */			/* uint16_t buffer_code;  0x39 = 0x38 + 1 */			uint16_t _pad;			uint32_t function;			/*struct smb2_handle handle;*/			/* uint32_t out_ofs; */			/* uint32_t out_size; */			uint32_t unknown2;			/* uint32_t in_ofs; */			/* uint32_t in_size; */			uint32_t max_response_size;			uint64_t flags;			/* dynamic body */			DATA_BLOB out;			DATA_BLOB in;		} in;		struct {			union smb_handle file;			/* static body buffer 48 (0x30) bytes */			/* uint16_t buffer_code;  0x31 = 0x30 + 1 */			uint16_t _pad;			uint32_t function;			/* struct smb2_handle handle; */			/* uint32_t in_ofs; */			/* uint32_t in_size; */			/* uint32_t out_ofs; */			/* uint32_t out_size; */			uint32_t unknown2;			uint32_t unknown3;			/* dynamic body */			DATA_BLOB in;			DATA_BLOB out;		} out;	} smb2;};enum smb_flush_level {	RAW_FLUSH_FLUSH,	RAW_FLUSH_ALL,	RAW_FLUSH_SMB2};union smb_flush {	/* struct for SMBflush */	struct {		enum smb_flush_level level;		struct {			union smb_handle file;		} in;	} flush, generic;	/* SMBflush with 0xFFFF wildcard fnum */	struct {		enum smb_flush_level level;	} flush_all;	/* SMB2 Flush */	struct smb2_flush {		enum smb_flush_level level;		struct {			union smb_handle file;			uint16_t reserved1;			uint32_t reserved2;		} in;		struct {			uint16_t reserved;		} out;	} smb2;};/* struct for SMBcopy */struct smb_copy {	struct {		uint16_t tid2;		uint16_t ofun;		uint16_t flags;		const char *path1;		const char *path2;	} in;	struct {		uint16_t count;	} out;};/* struct for transact/transact2 call */struct smb_trans2 {	struct {		uint16_t max_param;		uint16_t max_data;		uint8_t  max_setup;		uint16_t flags;		uint32_t timeout;		uint8_t  setup_count;		uint16_t *setup;		const char *trans_name; /* SMBtrans only */		DATA_BLOB params;		DATA_BLOB data;	} in;	struct {		uint8_t  setup_count;		uint16_t *setup;		DATA_BLOB params;		DATA_BLOB data;	} out;};/* struct for nttransact2 call */struct smb_nttrans {	struct {		uint8_t  max_setup;		uint32_t max_param;		uint32_t max_data;		uint32_t setup_count;		uint16_t function;		uint8_t  *setup;		DATA_BLOB params;		DATA_BLOB data;	} in;	struct {		uint8_t  setup_count; /* in units of 16 bit words */		uint8_t  *setup;		DATA_BLOB params;		DATA_BLOB data;	} out;};enum smb_notify_level {	RAW_NOTIFY_NTTRANS,	RAW_NOTIFY_SMB2};union smb_notify {	/* struct for nttrans change notify call */	struct {		enum smb_notify_level level;		struct {			union smb_handle file;			uint32_t buffer_size;			uint32_t completion_filter;			bool recursive;		} in;		struct {			uint32_t num_changes;			struct notify_changes {				uint32_t action;				struct smb_wire_string name;			} *changes;		} out;	} nttrans;	struct smb2_notify {		enum smb_notify_level level;				struct {			union smb_handle file;			/* static body buffer 32 (0x20) bytes */			/* uint16_t buffer_code;  0x32 */			uint16_t recursive;			uint32_t buffer_size;			/*struct  smb2_handle file;*/			uint32_t completion_filter;			uint32_t unknown;		} in;		struct {			/* static body buffer 8 (0x08) bytes */			/* uint16_t buffer_code; 0x09 = 0x08 + 1 */			/* uint16_t blob_ofs; */			/* uint16_t blob_size; */			/* dynamic body */			/*DATA_BLOB blob;*/			/* DATA_BLOB content */			uint32_t num_changes;			struct notify_changes *changes;		} out;	} smb2;};enum smb_search_level {	RAW_SEARCH_SEARCH,	/* SMBsearch */ 	RAW_SEARCH_FFIRST,	/* SMBffirst */ 	RAW_SEARCH_FUNIQUE,	/* SMBfunique */	RAW_SEARCH_TRANS2,	/* SMBtrans2 */	RAW_SEARCH_SMB2		/* SMB2 Find */};enum smb_search_data_level {	RAW_SEARCH_DATA_GENERIC			= 0x10000, /* only used in the smbcli_ code */	RAW_SEARCH_DATA_SEARCH,	RAW_SEARCH_DATA_STANDARD		= SMB_FIND_STANDARD,	RAW_SEARCH_DATA_EA_SIZE			= SMB_FIND_EA_SIZE,	RAW_SEARCH_DATA_EA_LIST			= SMB_FIND_EA_LIST,	RAW_SEARCH_DATA_DIRECTORY_INFO		= SMB_FIND_DIRECTORY_INFO,	RAW_SEARCH_DATA_FULL_DIRECTORY_INFO	= SMB_FIND_FULL_DIRECTORY_INFO,	RAW_SEARCH_DATA_NAME_INFO		= SMB_FIND_NAME_INFO,	RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO	= SMB_FIND_BOTH_DIRECTORY_INFO,	RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO	= SMB_FIND_ID_FULL_DIRECTORY_INFO,	RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO	= SMB_FIND_ID_BOTH_DIRECTORY_INFO,	RAW_SEARCH_DATA_UNIX_INFO		= SMB_FIND_UNIX_INFO,	RAW_SEARCH_DATA_UNIX_INFO2		= SMB_FIND_UNIX_INFO2};	/* union for file search */union smb_search_first {	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;	} generic;		/* search (old) findfirst interface. 	   Also used for ffirst and funique. */	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;			struct {			uint16_t max_count;			uint16_t search_attrib;			const char *pattern;		} in;		struct {			int16_t count;		} out;	} search_first;	/* trans2 findfirst interface */	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;				struct {			uint16_t search_attrib;			uint16_t max_count;			uint16_t flags;			uint32_t storage_type;			const char *pattern;			/* the ea names are only used for RAW_SEARCH_EA_LIST */			uint_t num_names;			struct ea_name *ea_names;		} in;		struct {			uint16_t handle;			uint16_t count;			uint16_t end_of_search;		} out;	} t2ffirst;/*  SMB2 uses different level numbers for the same old SMB trans2 search levels*/#define SMB2_FIND_DIRECTORY_INFO         0x01#define SMB2_FIND_FULL_DIRECTORY_INFO    0x02#define SMB2_FIND_BOTH_DIRECTORY_INFO    0x03#define SMB2_FIND_NAME_INFO              0x0C#define SMB2_FIND_ID_BOTH_DIRECTORY_INFO 0x25#define SMB2_FIND_ID_FULL_DIRECTORY_INFO 0x26/* flags for SMB2 find */#define SMB2_CONTINUE_FLAG_RESTART    0x01#define SMB2_CONTINUE_FLAG_SINGLE     0x02#define SMB2_CONTINUE_FLAG_INDEX      0x04#define SMB2_CONTINUE_FLAG_REOPEN     0x10	/* SMB2 Find */	struct smb2_find {		enum smb_search_level level;		enum smb_search_data_level data_level;		struct {			union smb_handle file;			/* static body buffer 32 (0x20) bytes */			/* uint16_t buffer_code;  0x21 = 0x20 + 1 */			uint8_t level;			uint8_t continue_flags; /* SMB2_CONTINUE_FLAG_* */			uint32_t file_index; 			/* struct smb2_handle handle; */			/* uint16_t pattern_ofs; */			/* uint16_t pattern_size; */			uint32_t max_response_size;				/* dynamic body */			const char *pattern;		} in;		struct {			/* static body buffer 8 (0x08) bytes */			/* uint16_t buffer_code;  0x08 */			/* uint16_t blob_ofs; */			/* uint32_t blob_size; */			/* dynamic body */			DATA_BLOB blob;		} out;	} smb2;};/* union for file search continue */union smb_search_next {	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;	} generic;	/* search (old) findnext interface. Also used	   for ffirst when continuing */	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;			struct {			uint16_t max_count;			uint16_t search_attrib;			struct smb_search_id {				uint8_t reserved;				char name[11];				uint8_t handle;				uint32_t server_cookie;				uint32_t client_cookie;			} id;		} in;		struct {			uint16_t count;		} out;	} search_next;		/* trans2 findnext interface */	struct {		enum smb_search_level level;		enum smb_search_data_level data_level;				struct {			uint16_t handle;			uint16_t max_count;			uint32_t resume_key;			uint16_t flags;			const char *last_name;			/* the ea names are only used for RAW_SEARCH_EA_LIST */			uint_t num_names;			struct ea_name *ea_names;		} in;		struct {			uint16_t count;			uint16_t end_of_search;		} out;	} t2fnext;	/* SMB2 Find */	struct smb2_find smb2;};/* union for search reply file data */union smb_search_data {	/*	 * search (old) findfirst 	 * RAW_SEARCH_DATA_SEARCH	 */	struct {		uint16_t attrib;		time_t write_time;		uint32_t size;		struct smb_search_id id;		const char *name;	} search;	/* trans2 findfirst RAW_SEARCH_DATA_STANDARD level */	struct {		uint32_t resume_key;		time_t create_time;		time_t access_time;		time_t write_time;		uint32_t size;		uint32_t alloc_size;		uint16_t attrib;		struct smb_wire_string name;	} standard;	/* trans2 findfirst RAW_SEARCH_DATA_EA_SIZE level */	struct {		uint32_t resume_key;		time_t create_time;		time_t access_time;		time_t write_time;		uint32_t size;		uint32_t alloc_size;		uint16_t attrib;		uint32_t ea_size;		struct smb_wire_string name;	} ea_size;	/* trans2 findfirst RAW_SEARCH_DATA_EA_LIST level */	struct {		uint32_t resume_key;		time_t create_time;		time_t access_time;		time_t write_time;		uint32_t size;		uint32_t alloc_size;		uint16_t attrib;		struct smb_ea_list eas;		struct smb_wire_string name;	} ea_list;	/* RAW_SEARCH_DATA_DIRECTORY_INFO interface */	struct {		uint32_t file_index;		NTTIME create_time;		NTTIME access_time;		NTTIME write_time;		NTTIME change_time;		uint64_t  size;		uint64_t  alloc_size;		uint32_t   attrib;		struct smb_wire_string name;	} directory_info;	/* RAW_SEARCH_DATA_FULL_DIRECTORY_INFO interface */	struct {		uint32_t file_index;		NTTIME create_time;		NTTIME access_time;		NTTIME write_time;		NTTIME change_time;		uint64_t  size;		uint64_t  alloc_size;		uint32_t   attrib;		uint32_t   ea_size;		struct smb_wire_string name;	} full_directory_info;	/* RAW_SEARCH_DATA_NAME_INFO interface */	struct {		uint32_t file_index;		struct smb_wire_string name;	} name_info;	/* RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO interface */	struct {		uint32_t file_index;		NTTIME create_time;		NTTIME access_time;		NTTIME write_time;		NTTIME change_time;		uint64_t  size;		uint64_t  alloc_size;		uint32_t   attrib;		uint32_t   ea_size;		struct smb_wire_string short_name;		struct smb_wire_string name;	} both_directory_info;	/* RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO interface */	struct {		uint32_t file_index;		NTTIME create_time;		NTTIME access_time;		NTTIME write_time;		NTTIME change_time;		uint64_t size;		uint64_t alloc_size;		uint32_t attrib;		uint32_t ea_size;		uint64_t file_id;		struct smb_wire_string name;	} id_full_directory_info;	/* RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO interface */	struct {		uint32_t file_index;		NTTIME create_time;		NTTIME access_time;		NTTIME write_time;		NTTIME change_time;		uint64_t size;		uint64_t alloc_size;		uint32_t  attrib;		uint32_t  ea_size;		uint64_t file_id;		struct smb_wire_string short_name;		struct smb_wire_string name;	} id_both_directory_info;	/* RAW_SEARCH_DATA_UNIX_INFO interface */	struct {		uint32_t file_index;		uint64_t size;		uint64_t alloc_size;		NTTIME status_change_time;		NTTIME access_time;		NTTIME change_time;		uint64_t uid;		uint64_t gid;		uint32_t file_type;		uint64_t dev_major;		uint64_t dev_minor;		uint64_t unique_id;		uint64_t permissions;		uint64_t nlink;				const char *name;	} unix_info;	/* RAW_SEARCH_DATA_UNIX_INFO2 interface */	struct {		uint32_t file_index;		uint64_t end_of_file;		uint64_t num_bytes;		NTTIME status_change_time;		NTTIME access_time;		NTTIME change_time;		uint64_t uid;		uint64_t gid;		uint32_t file_type;		uint64_t dev_major;		uint64_t dev_minor;		uint64_t unique_id;		uint64_t permissions;		uint64_t nlink;		NTTIME create_time;		uint32_t file_flags;		uint32_t flags_mask;		struct smb_wire_string name;	} unix_info2;};/* Callback function passed to the raw search interface. */typedef bool (*smbcli_search_callback)(void *private, const union smb_search_data *file);enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};/* union for file search close */union smb_search_close {	struct {		enum smb_search_close_level level;	} generic;	/* SMBfclose (old search) interface */	struct {		enum smb_search_close_level level;			struct {			/* max_count and search_attrib are not used, but are present */			uint16_t max_count;			uint16_t search_attrib;			struct smb_search_id id;		} in;	} fclose;		/* SMBfindclose interface */	struct {		enum smb_search_close_level level;				struct {			uint16_t handle;		} in;	} findclose;};/*  struct for SMBecho call*/struct smb_echo {	struct {		uint16_t repeat_count;		uint16_t size;		uint8_t *data;	} in;	struct {		uint16_t count;		uint16_t sequence_number;		uint16_t size;		uint8_t *data;	} out;};/*  struct for shadow copy volumes */struct smb_shadow_copy {	struct {		union smb_handle file;		uint32_t max_data;	} in;	struct {		uint32_t num_volumes;		uint32_t num_names;		const char **names;	} out;};#endif /* __LIBCLI_RAW_INTERFACES_H__ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?