interfaces.h
来自「samba最新软件」· C头文件 代码 · 共 2,736 行 · 第 1/4 页
H
2,736 行
uint32_t impersonation; uint8_t security_flags; /* NOTE: fname can also be a pointer to a uint64_t file_id if create_options has the NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */ const char *fname; /* these last 2 elements are only used in the NTTRANS varient of the call */ struct security_descriptor *sec_desc; struct smb_ea_list *ea_list; /* some optional parameters from the SMB2 varient */ bool query_maximal_access; } in; struct { union smb_handle file; uint8_t oplock_level; uint32_t create_action; NTTIME create_time; NTTIME access_time; NTTIME write_time; NTTIME change_time; uint32_t attrib; uint64_t alloc_size; uint64_t size; uint16_t file_type; uint16_t ipc_state; uint8_t is_directory; /* optional return values matching SMB2 tagged values in the call */ uint32_t maximal_access; } out; } ntcreatex, nttrans, generic; /* TRANS2_OPEN interface */ struct { enum smb_open_level level; struct { uint16_t flags; uint16_t open_mode; uint16_t search_attrs; uint16_t file_attrs; time_t write_time; uint16_t open_func; uint32_t size; uint32_t timeout; const char *fname; uint_t num_eas; struct ea_struct *eas; } in; struct { union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; uint16_t access; uint16_t ftype; uint16_t devstate; uint16_t action; uint32_t file_id; } out; } t2open; /* SMBopen interface */ struct { enum smb_open_level level; struct { uint16_t open_mode; uint16_t search_attrs; const char *fname; } in; struct { union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; uint16_t rmode; } out; } openold; /* SMBopenX interface */ struct { enum smb_open_level level; struct { uint16_t flags; uint16_t open_mode; uint16_t search_attrs; /* not honoured by win2003 */ uint16_t file_attrs; time_t write_time; /* not honoured by win2003 */ uint16_t open_func; uint32_t size; /* note that this sets the initial file size, not just allocation size */ uint32_t timeout; /* not honoured by win2003 */ const char *fname; } in; struct { union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; uint16_t access; uint16_t ftype; uint16_t devstate; uint16_t action; uint32_t unique_fid; uint32_t access_mask; uint32_t unknown; } out; } openx; /* SMBmknew interface */ struct { enum smb_open_level level; struct { uint16_t attrib; time_t write_time; const char *fname; } in; struct { union smb_handle file; } out; } mknew, create; /* SMBctemp interface */ struct { enum smb_open_level level; struct { uint16_t attrib; time_t write_time; const char *directory; } in; struct { union smb_handle file; /* temp name, relative to directory */ char *name; } out; } ctemp; /* SMBsplopen interface */ struct { enum smb_open_level level; struct { uint16_t setup_length; uint16_t mode; const char *ident; } in; struct { union smb_handle file; } out; } splopen; /* chained OpenX/ReadX interface */ struct { enum smb_open_level level; struct { uint16_t flags; uint16_t open_mode; uint16_t search_attrs; /* not honoured by win2003 */ uint16_t file_attrs; time_t write_time; /* not honoured by win2003 */ uint16_t open_func; uint32_t size; /* note that this sets the initial file size, not just allocation size */ uint32_t timeout; /* not honoured by win2003 */ const char *fname; /* readx part */ uint64_t offset; uint16_t mincnt; uint32_t maxcnt; uint16_t remaining; } in; struct { union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; uint16_t access; uint16_t ftype; uint16_t devstate; uint16_t action; uint32_t unique_fid; uint32_t access_mask; uint32_t unknown; /* readx part */ uint8_t *data; uint16_t remaining; uint16_t compaction_mode; uint16_t nread; } out; } openxreadx;#define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100#define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800#define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001#define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080 /* SMB2 Create */ struct smb2_create { enum smb_open_level level; struct { /* static body buffer 56 (0x38) bytes */ uint8_t security_flags; /* SMB2_SECURITY_* */ uint8_t oplock_level; /* SMB2_OPLOCK_LEVEL_* */ uint32_t impersonation_level; /* SMB2_IMPERSONATION_* */ uint64_t create_flags; uint64_t reserved; uint32_t desired_access; uint32_t file_attributes; uint32_t share_access; /* NTCREATEX_SHARE_ACCESS_* */ uint32_t create_disposition; /* NTCREATEX_DISP_* */ uint32_t create_options; /* NTCREATEX_OPTIONS_* */ /* uint16_t fname_ofs */ /* uint16_t fname_size */ /* uint32_t blob_ofs; */ /* uint32_t blob_size; */ /* dynamic body */ const char *fname; /* now some optional parameters - encoded as tagged blobs */ struct smb_ea_list eas; uint64_t alloc_size; struct security_descriptor *sec_desc; bool durable_open; struct smb2_handle *durable_handle; bool query_maximal_access; NTTIME timewarp; bool query_on_disk_id; /* and any additional blobs the caller wants */ struct smb2_create_blobs { uint32_t num_blobs; struct smb2_create_blob { const char *tag; DATA_BLOB data; } *blobs; } blobs; } in; struct { union smb_handle file; /* static body buffer 88 (0x58) bytes */ /* uint16_t buffer_code; 0x59 = 0x58 + 1 */ uint8_t oplock_level; uint8_t reserved; uint32_t create_action; NTTIME create_time; NTTIME access_time; NTTIME write_time; NTTIME change_time; uint64_t alloc_size; uint64_t size; uint32_t file_attr; uint32_t reserved2; /* struct smb2_handle handle;*/ /* uint32_t blob_ofs; */ /* uint32_t blob_size; */ /* optional return values matching tagged values in the call */ uint32_t maximal_access; uint8_t on_disk_id[32]; /* tagged blobs in the reply */ struct smb2_create_blobs blobs; } out; } smb2;};enum smb_read_level { RAW_READ_READBRAW, RAW_READ_LOCKREAD, RAW_READ_READ, RAW_READ_READX, RAW_READ_SMB2};#define RAW_READ_GENERIC RAW_READ_READX/* union for read() backend call note that .infoX.out.data will be allocated before the backend is called. It will be big enough to hold the maximum size asked for*/union smb_read { /* SMBreadX (and generic) interface */ struct { enum smb_read_level level; struct { union smb_handle file; uint64_t offset; uint32_t mincnt; /* enforced on SMB2, 16 bit on SMB */ uint32_t maxcnt; uint16_t remaining; bool read_for_execute; } in; struct { uint8_t *data; uint16_t remaining; uint16_t compaction_mode; uint32_t nread; } out; } readx, generic; /* SMBreadbraw interface */ struct { enum smb_read_level level; struct { union smb_handle file; uint64_t offset; uint16_t maxcnt; uint16_t mincnt; uint32_t timeout; } in; struct { uint8_t *data; uint32_t nread; } out; } readbraw; /* SMBlockandread interface */ struct { enum smb_read_level level; struct { union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; } in; struct { uint8_t *data; uint16_t nread; } out; } lockread; /* SMBread interface */ struct { enum smb_read_level level; struct { union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; } in; struct { uint8_t *data; uint16_t nread; } out; } read; /* SMB2 Read */ struct smb2_read { enum smb_read_level level; struct { union smb_handle file; /* static body buffer 48 (0x30) bytes */ /* uint16_t buffer_code; 0x31 = 0x30 + 1 */ uint8_t _pad; uint8_t reserved; uint32_t length; uint64_t offset; /* struct smb2_handle handle; */ uint32_t min_count; uint32_t channel; uint32_t remaining; /* the docs give no indication of what these channel variables are for */ uint16_t channel_offset; uint16_t channel_length; } in; struct { /* static body buffer 16 (0x10) bytes */ /* uint16_t buffer_code; 0x11 = 0x10 + 1 */ /* uint8_t data_ofs; */ /* uint8_t reserved; */ /* uint32_t data_size; */ uint32_t remaining; uint32_t reserved; /* dynamic body */ DATA_BLOB data; } out; } smb2;};enum smb_write_level { RAW_WRITE_WRITEUNLOCK, RAW_WRITE_WRITE, RAW_WRITE_WRITEX, RAW_WRITE_WRITECLOSE, RAW_WRITE_SPLWRITE, RAW_WRITE_SMB2};#define RAW_WRITE_GENERIC RAW_WRITE_WRITEX/* union for write() backend call */union smb_write { /* SMBwriteX interface */ struct { enum smb_write_level level; struct { union smb_handle file; uint64_t offset; uint16_t wmode; uint16_t remaining; uint32_t count; const uint8_t *data; } in; struct { uint32_t nwritten; uint16_t remaining; } out; } writex, generic; /* SMBwriteunlock interface */ struct { enum smb_write_level level; struct { union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; const uint8_t *data; } in; struct { uint32_t nwritten; } out; } writeunlock; /* SMBwrite interface */ struct { enum smb_write_level level; struct { union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; const uint8_t *data; } in; struct { uint16_t nwritten; } out; } write; /* SMBwriteclose interface */ struct { enum smb_write_level level; struct { union smb_handle file; uint16_t count; uint32_t offset; time_t mtime; const uint8_t *data; } in; struct { uint16_t nwritten; } out; } writeclose; /* SMBsplwrite interface */ struct { enum smb_write_level level; struct { union smb_handle file; uint16_t count; const uint8_t *data; } in; } splwrite; /* SMB2 Write */ struct smb2_write { enum smb_write_level level; struct { union smb_handle file; /* static body buffer 48 (0x30) bytes */ /* uint16_t buffer_code; 0x31 = 0x30 + 1 */ /* uint16_t data_ofs; */ /* uint32_t data_size; */ uint64_t offset; /* struct smb2_handle handle; */ uint64_t unknown1; /* 0xFFFFFFFFFFFFFFFF */ uint64_t unknown2; /* 0xFFFFFFFFFFFFFFFF */ /* dynamic body */ DATA_BLOB data; } in; struct { /* static body buffer 17 (0x11) bytes */ /* uint16_t buffer_code; 0x11 = 0x10 + 1*/ uint16_t _pad; uint32_t nwritten; uint64_t unknown1; /* 0x0000000000000000 */ } out; } smb2;};enum smb_lock_level { RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX, RAW_LOCK_SMB2, RAW_LOCK_SMB2_BREAK};#define RAW_LOCK_GENERIC RAW_LOCK_LOCKX/* union for lock() backend call */union smb_lock { /* SMBlockingX and generic interface */ struct { enum smb_lock_level level; struct { union smb_handle file; uint16_t mode; uint32_t timeout; uint16_t ulock_cnt; uint16_t lock_cnt; struct smb_lock_entry { uint16_t pid; uint64_t offset; uint64_t count; } *locks; /* unlocks are first in the arrray */ } in; } generic, lockx; /* SMBlock and SMBunlock interface */ struct { enum smb_lock_level level; struct { union smb_handle file; uint32_t count; uint32_t offset; } in; } lock, unlock; /* SMB2 Lock */ struct smb2_lock { enum smb_lock_level level; struct { union smb_handle file; /* static body buffer 48 (0x30) bytes */ /* uint16_t buffer_code; 0x30 */ uint16_t lock_count; uint32_t reserved; /* struct smb2_handle handle; */ struct smb2_lock_element { uint64_t offset; uint64_t length;/* these flags are the same as the SMB2 lock flags */#define SMB2_LOCK_FLAG_NONE 0x00000000#define SMB2_LOCK_FLAG_SHARED 0x00000001#define SMB2_LOCK_FLAG_EXCLUSIVE 0x00000002#define SMB2_LOCK_FLAG_UNLOCK 0x00000004#define SMB2_LOCK_FLAG_FAIL_IMMEDIATELY 0x00000010#define SMB2_LOCK_FLAG_ALL_MASK 0x00000017 uint32_t flags; uint32_t reserved; } *locks; } in; struct { /* static body buffer 4 (0x04) bytes */ /* uint16_t buffer_code; 0x04 */ uint16_t reserved; } out; } smb2; /* SMB2 Break */ struct smb2_break { enum smb_lock_level level; struct { union smb_handle file; /* static body buffer 24 (0x18) bytes */ uint8_t oplock_level; uint8_t reserved; uint32_t reserved2; /* struct smb2_handle handle; */ } in, out; } smb2_break;};enum smb_close_level { RAW_CLOSE_CLOSE, RAW_CLOSE_SPLCLOSE, RAW_CLOSE_SMB2, RAW_CLOSE_GENERIC,};/* union for close() backend call*/union smb_close { /* generic interface */ struct { enum smb_close_level level; struct { union smb_handle file; time_t write_time;#define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0) uint16_t flags; /* SMB2_CLOSE_FLAGS_* */ } in; struct { uint16_t flags; NTTIME create_time; NTTIME access_time; NTTIME write_time; NTTIME change_time; uint64_t alloc_size; uint64_t size; uint32_t file_attr; } out; } generic; /* SMBclose interface */ struct { enum smb_close_level level; struct { union smb_handle file; time_t write_time; } in; } close; /* SMBsplclose interface - empty! */ struct { enum smb_close_level level; struct { union smb_handle file; } in; } splclose; /* SMB2 Close */ struct smb2_close { enum smb_close_level level; struct { union smb_handle file; /* static body buffer 24 (0x18) bytes */ /* uint16_t buffer_code; 0x18 */ uint16_t flags; /* SMB2_CLOSE_FLAGS_* */ uint32_t _pad; } in; struct { /* static body buffer 60 (0x3C) bytes */ /* uint16_t buffer_code; 0x3C */ uint16_t flags; uint32_t _pad; NTTIME create_time; NTTIME access_time; NTTIME write_time; NTTIME change_time; uint64_t alloc_size; uint64_t size; uint32_t file_attr; } out; } smb2;};enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};/* union for lpq() backend*/union smb_lpq { /* generic interface */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?