2 Unix SMB/CIFS implementation.
3 SMB request interface structures
4 Copyright (C) Andrew Tridgell 2003
5 Copyright (C) James J Myers 2003 <myersjj@samba.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __LIBCLI_RAW_INTERFACES_H__
23 #define __LIBCLI_RAW_INTERFACES_H__
27 /* this structure is just a wrapper for a string, the only reason we
28 bother with this is that it allows us to check the length provided
29 on the wire in testsuite test code to ensure that we are
30 terminating names in the same way that win2003 is. The *ONLY* time
31 you should ever look at the 'private_length' field in this
32 structure is inside compliance test code, in all other cases just
33 use the null terminated char* as the definitive definition of the
36 also note that this structure is only used in packets where there
37 is an explicit length provided on the wire (hence the name). That
38 length is placed in 'private_length'. For packets where the length
39 is always determined by NULL or packet termination a normal char*
40 is used in the structure definition.
42 struct smb_wire_string {
43 uint32_t private_length;
48 * SMB2 uses a 16Byte handle,
49 * (we can maybe use struct GUID later)
58 * a generic container for file handles or file pathes
59 * for qfileinfo/setfileinfo and qpathinfo/setpathinfo
61 union smb_handle_or_path {
64 * the qpathinfo and setpathinfo
69 * this is used as file handle in SMB
74 * this is used as file handle in SMB2
76 struct smb2_handle handle;
79 * this is used as generic file handle for the NTVFS layer
81 struct ntvfs_handle *ntvfs;
85 a generic container for file handles
89 * this is used as file handle in SMB
94 * this is used as file handle in SMB2
96 struct smb2_handle handle;
99 * this is used as generic file handle for the NTVFS layer
101 struct ntvfs_handle *ntvfs;
105 this header defines the structures and unions used between the SMB
106 parser and the backends.
109 /* struct used for SMBlseek call */
113 union smb_handle file;
115 int32_t offset; /* signed */
123 /* struct used in unlink() call */
134 /* struct used in chkpath() call */
143 enum smb_mkdir_level {RAW_MKDIR_GENERIC, RAW_MKDIR_MKDIR, RAW_MKDIR_T2MKDIR};
145 /* union used in mkdir() call */
149 enum smb_mkdir_level level;
153 enum smb_mkdir_level level;
160 enum smb_mkdir_level level;
164 struct ea_struct *eas;
169 /* struct used in rmdir() call */
176 /* struct used in rename() call */
177 enum smb_rename_level {RAW_RENAME_RENAME, RAW_RENAME_NTRENAME};
181 enum smb_rename_level level;
184 /* SMBrename interface */
186 enum smb_rename_level level;
189 const char *pattern1;
190 const char *pattern2;
196 /* SMBntrename interface */
198 enum smb_rename_level level;
202 uint16_t flags; /* see RENAME_FLAG_* */
203 uint32_t cluster_size;
204 const char *old_name;
205 const char *new_name;
210 enum smb_tcon_level {
216 /* union used in tree connect call */
218 /* generic interface */
220 enum smb_tcon_level level;
223 /* SMBtcon interface */
225 enum smb_tcon_level level;
229 const char *password;
238 /* SMBtconX interface */
240 enum smb_tcon_level level;
256 /* SMB2 TreeConnect */
257 struct smb2_tree_connect {
258 enum smb_tcon_level level;
261 /* static body buffer 8 (0x08) bytes */
262 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
263 uint16_t unknown1; /* 0x0000 */
264 /* uint16_t path_ofs */
265 /* uint16_t path_size */
268 const char *path; /* as non-terminated UTF-16 on the wire */
271 /* static body buffer 16 (0x10) bytes */
272 /* uint16_t buffer_code; 0x10 */
273 uint16_t unknown1; /* 0x02 */
274 uint32_t unknown2; /* 0x00 */
275 uint32_t unknown3; /* 0x00 */
276 uint32_t access_mask;
278 /* extracted from the SMB2 header */
285 enum smb_sesssetup_level {
288 RAW_SESSSETUP_SPNEGO,
292 /* union used in session_setup call */
293 union smb_sesssetup {
294 /* the pre-NT1 interface */
296 enum smb_sesssetup_level level;
318 /* the NT1 interface */
320 enum smb_sesssetup_level level;
327 uint32_t capabilities;
345 /* the SPNEGO interface */
347 enum smb_sesssetup_level level;
354 uint32_t capabilities;
358 const char *workgroup;
370 /* SMB2 SessionSetup */
371 struct smb2_session_setup {
372 enum smb_sesssetup_level level;
375 /* NOTE: this was 0x11 = 0x10 + 1 in vista-CTP
376 * and changed in vista-beta2, but both server's
377 * can handle the 0x18 clients
379 /* static body buffer 24 (0x18) bytes */
380 /* uint16_t buffer_code; 0x19 = 0x18 + 1 */
382 uint32_t unknown2; /* 0x0000000F(vista-CTP) 0x00000007(vista-beta2) */
383 uint32_t unknown3; /* 0x0000000 */
384 /* uint16_t secblob_ofs */
385 /* uint16_t secblob_size */
386 uint64_t unknown4; /* 0x0000000000000000 only present in vista-beta2 */
392 /* static body buffer 8 (0x08) bytes */
393 /* uint16_t buffer_code; 0x09 = 0x08 +1 */
395 /* uint16_t secblob_ofs */
396 /* uint16_t secblob_size */
401 /* extracted from the SMB2 header */
407 /* Note that the specified enum values are identical to the actual info-levels used
410 enum smb_fileinfo_level {
411 RAW_FILEINFO_GENERIC = 0xF000,
412 RAW_FILEINFO_GETATTR, /* SMBgetatr */
413 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
414 RAW_FILEINFO_SEC_DESC, /* NT_TRANSACT_QUERY_SECURITY_DESC */
415 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
416 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
417 RAW_FILEINFO_EA_LIST = SMB_QFILEINFO_EA_LIST,
418 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
419 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
420 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
421 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
422 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
423 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
424 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
425 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
426 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
427 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
428 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
429 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
430 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
431 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
432 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
433 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
434 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
435 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
436 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
437 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
438 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
439 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
440 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
441 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
442 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
443 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
444 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION,
445 /* SMB2 specific levels */
446 RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01,
447 RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
450 /* union used in qfileinfo() and qpathinfo() backend calls */
452 /* generic interface:
453 * matches RAW_FILEINFO_GENERIC */
455 enum smb_fileinfo_level level;
457 union smb_handle_or_path file;
465 struct smb_wire_string name;
475 struct smb_wire_string fname;
476 struct smb_wire_string alt_fname;
477 uint8_t delete_pending;
479 uint64_t compressed_size;
483 uint8_t cluster_shift;
485 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
488 uint32_t alignment_requirement;
489 uint32_t reparse_tag;
491 struct stream_struct {
494 struct smb_wire_string stream_name;
500 /* SMBgetatr interface:
501 * matches RAW_FILEINFO_GETATTR */
503 enum smb_fileinfo_level level;
505 union smb_handle_or_path file;
514 /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
516 enum smb_fileinfo_level level;
518 union smb_handle_or_path file;
528 } getattre, standard;
530 /* trans2 RAW_FILEINFO_EA_SIZE interface */
532 enum smb_fileinfo_level level;
534 union smb_handle_or_path file;
547 /* trans2 RAW_FILEINFO_EA_LIST interface */
549 enum smb_fileinfo_level level;
551 union smb_handle_or_path file;
554 struct smb_wire_string name;
560 struct ea_struct *eas;
564 /* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */
566 enum smb_fileinfo_level level;
568 union smb_handle_or_path file;
569 /* SMB2 only - SMB2_CONTINUE_FLAG_* */
570 uint8_t continue_flags;
572 struct smb_ea_list out;
575 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
576 only valid for a QPATHNAME call - no returned data */
578 enum smb_fileinfo_level level;
580 union smb_handle_or_path file;
584 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
586 enum smb_fileinfo_level level;
588 union smb_handle_or_path file;
600 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
602 enum smb_fileinfo_level level;
604 union smb_handle_or_path file;
615 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
617 enum smb_fileinfo_level level;
619 union smb_handle_or_path file;
626 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
628 enum smb_fileinfo_level level;
630 union smb_handle_or_path file;
633 struct smb_wire_string fname;
637 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
639 enum smb_fileinfo_level level;
641 union smb_handle_or_path file;
652 uint8_t delete_pending;
655 struct smb_wire_string fname;
659 /* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */
661 enum smb_fileinfo_level level;
663 union smb_handle_or_path file;
675 uint8_t delete_pending;
680 uint32_t access_mask;
683 struct smb_wire_string fname;
687 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
689 enum smb_fileinfo_level level;
691 union smb_handle_or_path file;
694 struct smb_wire_string fname;
698 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
700 enum smb_fileinfo_level level;
702 union smb_handle_or_path file;
704 struct stream_information {
706 struct stream_struct *streams;
710 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
712 enum smb_fileinfo_level level;
714 union smb_handle_or_path file;
717 uint64_t compressed_size;
721 uint8_t cluster_shift;
725 /* RAW_FILEINFO_UNIX_BASIC interface */
727 enum smb_fileinfo_level level;
729 union smb_handle_or_path file;
732 uint64_t end_of_file;
734 NTTIME status_change_time;
743 uint64_t permissions;
748 /* RAW_FILEINFO_UNIX_LINK interface */
750 enum smb_fileinfo_level level;
752 union smb_handle_or_path file;
755 struct smb_wire_string link_dest;
759 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
761 enum smb_fileinfo_level level;
763 union smb_handle_or_path file;
768 } internal_information;
770 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
772 enum smb_fileinfo_level level;
774 union smb_handle_or_path file;
777 uint32_t access_flags;
779 } access_information;
781 /* RAW_FILEINFO_POSITION_INFORMATION interface */
783 enum smb_fileinfo_level level;
785 union smb_handle_or_path file;
790 } position_information;
792 /* RAW_FILEINFO_MODE_INFORMATION interface */
794 enum smb_fileinfo_level level;
796 union smb_handle_or_path file;
803 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
805 enum smb_fileinfo_level level;
807 union smb_handle_or_path file;
810 uint32_t alignment_requirement;
812 } alignment_information;
814 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
816 enum smb_fileinfo_level level;
818 union smb_handle_or_path file;
829 } network_open_information;
832 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
834 enum smb_fileinfo_level level;
836 union smb_handle_or_path file;
840 uint32_t reparse_tag;
842 } attribute_tag_information;
844 /* RAW_FILEINFO_SEC_DESC */
846 enum smb_fileinfo_level level;
848 union smb_handle_or_path file;
849 uint32_t secinfo_flags;
852 struct security_descriptor *sd;
858 enum smb_setfileinfo_level {
859 RAW_SFILEINFO_GENERIC = 0xF000,
860 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
861 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
862 RAW_SFILEINFO_SEC_DESC, /* NT_TRANSACT_SET_SECURITY_DESC */
863 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
864 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
865 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
866 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
867 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
868 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
869 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
870 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
871 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
872 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
873 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
874 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
875 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
876 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
877 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
878 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
879 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
880 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
881 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
882 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
883 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
884 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040
887 /* union used in setfileinfo() and setpathinfo() calls */
888 union smb_setfileinfo {
889 /* generic interface */
891 enum smb_setfileinfo_level level;
893 union smb_handle_or_path file;
897 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
899 enum smb_setfileinfo_level level;
901 union smb_handle_or_path file;
907 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo()
908 also RAW_SFILEINFO_STANDARD */
910 enum smb_setfileinfo_level level;
912 union smb_handle_or_path file;
916 /* notice that size, alloc_size and attrib are not settable,
917 unlike the corresponding qfileinfo level */
919 } setattre, standard;
921 /* RAW_SFILEINFO_EA_SET interface */
923 enum smb_setfileinfo_level level;
925 union smb_handle_or_path file;
927 struct ea_struct *eas;
931 /* RAW_SFILEINFO_BASIC_INFO and
932 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
934 enum smb_setfileinfo_level level;
936 union smb_handle_or_path file;
945 /* RAW_SFILEINFO_DISPOSITION_INFO and
946 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
948 enum smb_setfileinfo_level level;
950 union smb_handle_or_path file;
951 BOOL delete_on_close;
955 /* RAW_SFILEINFO_ALLOCATION_INFO and
956 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
958 enum smb_setfileinfo_level level;
960 union smb_handle_or_path file;
961 /* w2k3 rounds this up to nearest 4096 */
966 /* RAW_SFILEINFO_END_OF_FILE_INFO and
967 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
969 enum smb_setfileinfo_level level;
971 union smb_handle_or_path file;
976 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
978 enum smb_setfileinfo_level level;
980 union smb_handle_or_path file;
983 const char *new_name;
985 } rename_information;
987 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
989 enum smb_setfileinfo_level level;
991 union smb_handle_or_path file;
994 } position_information;
996 /* RAW_SFILEINFO_MODE_INFORMATION interface */
998 enum smb_setfileinfo_level level;
1000 union smb_handle_or_path file;
1001 /* valid values seem to be 0, 2, 4 and 6 */
1008 /* RAW_SFILEINFO_UNIX_BASIC interface */
1010 enum smb_setfileinfo_level level;
1012 union smb_handle_or_path file;
1013 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
1014 uint64_t end_of_file;
1016 NTTIME status_change_time;
1025 uint64_t permissions;
1030 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
1032 enum smb_setfileinfo_level level;
1034 union smb_handle_or_path file;
1035 const char *link_dest;
1037 } unix_link, unix_hlink;
1039 /* RAW_FILEINFO_SET_SEC_DESC */
1041 enum smb_setfileinfo_level level;
1043 union smb_handle_or_path file;
1044 uint32_t secinfo_flags;
1045 struct security_descriptor *sd;
1051 enum smb_fsinfo_level {
1052 RAW_QFS_GENERIC = 0xF000,
1053 RAW_QFS_DSKATTR, /* SMBdskattr */
1054 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
1055 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
1056 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
1057 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
1058 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
1059 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
1060 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
1061 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
1062 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
1063 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
1064 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
1065 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
1066 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
1067 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
1070 /* union for fsinfo() backend call. Note that there are no in
1071 structures, as this call only contains out parameters */
1073 /* generic interface */
1075 enum smb_fsinfo_level level;
1076 struct smb2_handle handle; /* only for smb2 */
1079 uint32_t block_size;
1080 uint64_t blocks_total;
1081 uint64_t blocks_free;
1084 uint32_t serial_number;
1086 uint32_t max_file_component_length;
1087 uint32_t device_type;
1088 uint32_t device_characteristics;
1089 uint64_t quota_soft;
1090 uint64_t quota_hard;
1091 uint64_t quota_flags;
1098 /* SMBdskattr interface */
1100 enum smb_fsinfo_level level;
1103 uint16_t units_total;
1104 uint16_t blocks_per_unit;
1105 uint16_t block_size;
1106 uint16_t units_free;
1110 /* trans2 RAW_QFS_ALLOCATION interface */
1112 enum smb_fsinfo_level level;
1116 uint32_t sectors_per_unit;
1117 uint32_t total_alloc_units;
1118 uint32_t avail_alloc_units;
1119 uint16_t bytes_per_sector;
1123 /* TRANS2 RAW_QFS_VOLUME interface */
1125 enum smb_fsinfo_level level;
1128 uint32_t serial_number;
1129 struct smb_wire_string volume_name;
1133 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
1135 enum smb_fsinfo_level level;
1136 struct smb2_handle handle; /* only for smb2 */
1140 uint32_t serial_number;
1141 struct smb_wire_string volume_name;
1145 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
1147 enum smb_fsinfo_level level;
1148 struct smb2_handle handle; /* only for smb2 */
1151 uint64_t total_alloc_units;
1152 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
1153 uint32_t sectors_per_unit;
1154 uint32_t bytes_per_sector;
1158 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
1160 enum smb_fsinfo_level level;
1161 struct smb2_handle handle; /* only for smb2 */
1164 uint32_t device_type;
1165 uint32_t characteristics;
1170 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
1172 enum smb_fsinfo_level level;
1173 struct smb2_handle handle; /* only for smb2 */
1177 uint32_t max_file_component_length;
1178 struct smb_wire_string fs_type;
1183 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1185 enum smb_fsinfo_level level;
1188 uint16_t major_version;
1189 uint16_t minor_version;
1190 uint64_t capability;
1194 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1196 enum smb_fsinfo_level level;
1197 struct smb2_handle handle; /* only for smb2 */
1200 uint64_t unknown[3];
1201 uint64_t quota_soft;
1202 uint64_t quota_hard;
1203 uint64_t quota_flags;
1205 } quota_information;
1207 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1209 enum smb_fsinfo_level level;
1210 struct smb2_handle handle; /* only for smb2 */
1213 uint64_t total_alloc_units;
1214 uint64_t call_avail_alloc_units;
1215 uint64_t actual_avail_alloc_units;
1216 uint32_t sectors_per_unit;
1217 uint32_t bytes_per_sector;
1219 } full_size_information;
1221 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1223 enum smb_fsinfo_level level;
1224 struct smb2_handle handle; /* only for smb2 */
1228 uint64_t unknown[6];
1230 } objectid_information;
1235 enum smb_open_level {
1244 RAW_OPEN_NTTRANS_CREATE,
1245 RAW_OPEN_OPENX_READX,
1249 /* the generic interface is defined to be equal to the NTCREATEX interface */
1250 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1252 /* union for open() backend call */
1255 * because the *.out.file structs are not aligned to the same offset for each level
1256 * we provide a hepler macro that should be used to find the current smb_handle structure
1258 #define SMB_OPEN_OUT_FILE(op, file) do { \
1259 switch (op->generic.level) { \
1260 case RAW_OPEN_OPEN: \
1261 file = &op->openold.out.file; \
1263 case RAW_OPEN_OPENX: \
1264 file = &op->openx.out.file; \
1266 case RAW_OPEN_MKNEW: \
1267 file = &op->mknew.out.file; \
1269 case RAW_OPEN_CREATE: \
1270 file = &op->create.out.file; \
1272 case RAW_OPEN_CTEMP: \
1273 file = &op->ctemp.out.file; \
1275 case RAW_OPEN_SPLOPEN: \
1276 file = &op->splopen.out.file; \
1278 case RAW_OPEN_NTCREATEX: \
1279 file = &op->ntcreatex.out.file; \
1281 case RAW_OPEN_T2OPEN: \
1282 file = &op->t2open.out.file; \
1284 case RAW_OPEN_NTTRANS_CREATE: \
1285 file = &op->nttrans.out.file; \
1287 case RAW_OPEN_OPENX_READX: \
1288 file = &op->openxreadx.out.file; \
1290 case RAW_OPEN_SMB2: \
1291 file = &op->smb2.out.file; \
1294 /* this must be a programmer error */ \
1299 /* SMBNTCreateX interface */
1301 enum smb_open_level level;
1305 uint32_t access_mask;
1306 uint64_t alloc_size;
1308 uint32_t share_access;
1309 uint32_t open_disposition;
1310 uint32_t create_options;
1311 uint32_t impersonation;
1312 uint8_t security_flags;
1313 /* NOTE: fname can also be a pointer to a
1314 uint64_t file_id if create_options has the
1315 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1318 /* these last 2 elements are only used in the
1319 NTTRANS varient of the call */
1320 struct security_descriptor *sec_desc;
1321 struct smb_ea_list *ea_list;
1324 union smb_handle file;
1325 uint8_t oplock_level;
1326 uint32_t create_action;
1332 uint64_t alloc_size;
1336 uint8_t is_directory;
1338 } ntcreatex, nttrans, generic;
1340 /* TRANS2_OPEN interface */
1342 enum smb_open_level level;
1346 uint16_t search_attrs;
1347 uint16_t file_attrs;
1354 struct ea_struct *eas;
1357 union smb_handle file;
1369 /* SMBopen interface */
1371 enum smb_open_level level;
1374 uint16_t search_attrs;
1378 union smb_handle file;
1386 /* SMBopenX interface */
1388 enum smb_open_level level;
1392 uint16_t search_attrs; /* not honoured by win2003 */
1393 uint16_t file_attrs;
1394 time_t write_time; /* not honoured by win2003 */
1396 uint32_t size; /* note that this sets the
1397 initial file size, not
1398 just allocation size */
1399 uint32_t timeout; /* not honoured by win2003 */
1403 union smb_handle file;
1411 uint32_t unique_fid;
1412 uint32_t access_mask;
1417 /* SMBmknew interface */
1419 enum smb_open_level level;
1426 union smb_handle file;
1430 /* SMBctemp interface */
1432 enum smb_open_level level;
1436 const char *directory;
1439 union smb_handle file;
1440 /* temp name, relative to directory */
1445 /* SMBsplopen interface */
1447 enum smb_open_level level;
1449 uint16_t setup_length;
1454 union smb_handle file;
1459 /* chained OpenX/ReadX interface */
1461 enum smb_open_level level;
1465 uint16_t search_attrs; /* not honoured by win2003 */
1466 uint16_t file_attrs;
1467 time_t write_time; /* not honoured by win2003 */
1469 uint32_t size; /* note that this sets the
1470 initial file size, not
1471 just allocation size */
1472 uint32_t timeout; /* not honoured by win2003 */
1482 union smb_handle file;
1490 uint32_t unique_fid;
1491 uint32_t access_mask;
1497 uint16_t compaction_mode;
1502 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100
1503 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800
1504 #define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001
1505 #define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080
1508 struct smb2_create {
1509 enum smb_open_level level;
1511 /* static body buffer 56 (0x38) bytes */
1512 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
1513 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
1514 uint32_t impersonation;
1515 uint32_t unknown3[4];
1516 uint32_t access_mask;
1519 uint32_t share_access;
1520 uint32_t open_disposition;
1521 uint32_t create_options;
1523 /* uint16_t fname_ofs */
1524 /* uint16_t fname_size */
1525 /* uint32_t blob_ofs; */
1526 /* uint32_t blob_size; */
1531 /* optional list of extended attributes */
1532 struct smb_ea_list eas;
1535 union smb_handle file;
1537 /* static body buffer 88 (0x58) bytes */
1538 /* uint16_t buffer_code; 0x59 = 0x58 + 1 */
1539 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
1540 uint32_t create_action;
1545 uint64_t alloc_size;
1549 /* struct smb2_handle handle;*/
1550 /* uint32_t blob_ofs; */
1551 /* uint32_t blob_size; */
1561 enum smb_read_level {
1569 #define RAW_READ_GENERIC RAW_READ_READX
1571 /* union for read() backend call
1573 note that .infoX.out.data will be allocated before the backend is
1574 called. It will be big enough to hold the maximum size asked for
1577 /* SMBreadX (and generic) interface */
1579 enum smb_read_level level;
1581 union smb_handle file;
1586 BOOL read_for_execute;
1591 uint16_t compaction_mode;
1596 /* SMBreadbraw interface */
1598 enum smb_read_level level;
1600 union smb_handle file;
1613 /* SMBlockandread interface */
1615 enum smb_read_level level;
1617 union smb_handle file;
1628 /* SMBread interface */
1630 enum smb_read_level level;
1632 union smb_handle file;
1645 enum smb_read_level level;
1647 union smb_handle file;
1649 /* static body buffer 48 (0x30) bytes */
1650 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1654 /* struct smb2_handle handle; */
1655 uint64_t unknown1; /* 0x0000000000000000 */
1656 uint64_t unknown2; /* 0x0000000000000000 */
1659 /* static body buffer 16 (0x10) bytes */
1660 /* uint16_t buffer_code; 0x11 = 0x10 + 1 */
1661 /* uint16_t data_ofs; */
1662 /* uint32_t data_size; */
1663 uint64_t unknown1; /* 0x0000000000000000 */
1672 enum smb_write_level {
1673 RAW_WRITE_WRITEUNLOCK,
1676 RAW_WRITE_WRITECLOSE,
1681 #define RAW_WRITE_GENERIC RAW_WRITE_WRITEX
1683 /* union for write() backend call
1686 /* SMBwriteX interface */
1688 enum smb_write_level level;
1690 union smb_handle file;
1695 const uint8_t *data;
1703 /* SMBwriteunlock interface */
1705 enum smb_write_level level;
1707 union smb_handle file;
1711 const uint8_t *data;
1718 /* SMBwrite interface */
1720 enum smb_write_level level;
1722 union smb_handle file;
1726 const uint8_t *data;
1733 /* SMBwriteclose interface */
1735 enum smb_write_level level;
1737 union smb_handle file;
1741 const uint8_t *data;
1748 /* SMBsplwrite interface */
1750 enum smb_write_level level;
1752 union smb_handle file;
1754 const uint8_t *data;
1760 enum smb_write_level level;
1762 union smb_handle file;
1764 /* static body buffer 48 (0x30) bytes */
1765 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1766 /* uint16_t data_ofs; */
1767 /* uint32_t data_size; */
1769 /* struct smb2_handle handle; */
1770 uint64_t unknown1; /* 0xFFFFFFFFFFFFFFFF */
1771 uint64_t unknown2; /* 0xFFFFFFFFFFFFFFFF */
1777 /* static body buffer 17 (0x11) bytes */
1778 /* uint16_t buffer_code; 0x11 = 0x10 + 1*/
1781 uint64_t unknown1; /* 0x0000000000000000 */
1787 enum smb_lock_level {
1794 /* the generic interface is defined to be equal to the lockingX interface */
1795 #define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
1797 /* union for lock() backend call
1800 /* SMBlockingX (and generic) interface */
1802 enum smb_lock_level level;
1804 union smb_handle file;
1809 struct smb_lock_entry {
1813 } *locks; /* unlocks are first in the arrray */
1817 /* SMBlock and SMBunlock interface */
1819 enum smb_lock_level level;
1821 union smb_handle file;
1829 enum smb_lock_level level;
1831 union smb_handle file;
1833 /* static body buffer 48 (0x30) bytes */
1834 /* uint16_t buffer_code; 0x30 */
1835 uint16_t unknown1; /* must be 0x0001 */
1837 /* struct smb2_handle handle; */
1841 #define SMB2_LOCK_FLAG_NONE 0x00000000
1842 #define SMB2_LOCK_FLAG_EXCLUSIV 0x00000002
1843 #define SMB2_LOCK_FLAG_UNLOCK 0x00000004
1844 #define SMB2_LOCK_FLAGS_MASK 0x00000006
1848 /* static body buffer 4 (0x04) bytes */
1849 /* uint16_t buffer_code; 0x04 */
1856 enum smb_close_level {
1862 #define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
1865 union for close() backend call
1868 /* SMBclose (and generic) interface */
1870 enum smb_close_level level;
1872 union smb_handle file;
1877 /* SMBsplclose interface - empty! */
1879 enum smb_close_level level;
1881 union smb_handle file;
1887 enum smb_close_level level;
1889 union smb_handle file;
1891 /* static body buffer 24 (0x18) bytes */
1892 /* uint16_t buffer_code; 0x18 */
1893 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
1894 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
1898 /* static body buffer 60 (0x3C) bytes */
1899 /* uint16_t buffer_code; 0x3C */
1906 uint64_t alloc_size;
1914 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1917 union for lpq() backend
1920 /* generic interface */
1922 enum smb_lpq_level level;
1927 /* SMBsplretq interface */
1929 enum smb_lpq_level level;
1937 uint16_t restart_idx;
1949 enum smb_ioctl_level {
1953 RAW_IOCTL_SMB2_NO_HANDLE
1957 union for ioctl() backend
1960 /* generic interface */
1962 enum smb_ioctl_level level;
1964 union smb_handle file;
1968 /* struct for SMBioctl */
1970 enum smb_ioctl_level level;
1972 union smb_handle file;
1981 /* struct for NT ioctl call */
1983 enum smb_ioctl_level level;
1985 union smb_handle file;
1999 enum smb_ioctl_level level;
2001 union smb_handle file;
2003 /* static body buffer 56 (0x38) bytes */
2004 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
2007 /*struct smb2_handle handle;*/
2008 /* uint32_t out_ofs; */
2009 /* uint32_t out_size; */
2011 /* uint32_t in_ofs; */
2012 /* uint32_t in_size; */
2013 uint32_t max_response_size;
2021 union smb_handle file;
2023 /* static body buffer 48 (0x30) bytes */
2024 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
2027 /* struct smb2_handle handle; */
2028 /* uint32_t in_ofs; */
2029 /* uint32_t in_size; */
2030 /* uint32_t out_ofs; */
2031 /* uint32_t out_size; */
2042 enum smb_flush_level {
2049 /* struct for SMBflush */
2051 enum smb_flush_level level;
2053 union smb_handle file;
2057 /* SMBflush with 0xFFFF wildcard fnum */
2059 enum smb_flush_level level;
2064 enum smb_flush_level level;
2066 union smb_handle file;
2072 /* struct for SMBcopy */
2087 /* struct for transact/transact2 call */
2095 uint8_t setup_count;
2097 const char *trans_name; /* SMBtrans only */
2103 uint8_t setup_count;
2110 /* struct for nttransact2 call */
2111 struct smb_nttrans {
2116 uint32_t setup_count;
2124 uint8_t setup_count; /* in units of 16 bit words */
2131 enum smb_notify_level {
2137 /* struct for nttrans change notify call */
2139 enum smb_notify_level level;
2142 union smb_handle file;
2143 uint32_t buffer_size;
2144 uint32_t completion_filter;
2149 uint32_t num_changes;
2150 struct notify_changes {
2152 struct smb_wire_string name;
2157 struct smb2_notify {
2158 enum smb_notify_level level;
2161 union smb_handle file;
2162 /* static body buffer 32 (0x20) bytes */
2163 /* uint16_t buffer_code; 0x32 */
2165 uint32_t buffer_size;
2166 /*struct smb2_handle file;*/
2167 uint32_t completion_filter;
2172 /* static body buffer 8 (0x08) bytes */
2173 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
2174 /* uint16_t blob_ofs; */
2175 /* uint16_t blob_size; */
2180 /* DATA_BLOB content */
2181 uint32_t num_changes;
2182 struct notify_changes *changes;
2187 enum smb_search_level {
2188 RAW_SEARCH_SEARCH, /* SMBsearch */
2189 RAW_SEARCH_FFIRST, /* SMBffirst */
2190 RAW_SEARCH_FUNIQUE, /* SMBfunique */
2191 RAW_SEARCH_TRANS2, /* SMBtrans2 */
2192 RAW_SEARCH_SMB2 /* SMB2 Find */
2195 enum smb_search_data_level {
2196 RAW_SEARCH_DATA_GENERIC = 0x10000, /* only used in the smbcli_ code */
2197 RAW_SEARCH_DATA_SEARCH,
2198 RAW_SEARCH_DATA_STANDARD = SMB_FIND_STANDARD,
2199 RAW_SEARCH_DATA_EA_SIZE = SMB_FIND_EA_SIZE,
2200 RAW_SEARCH_DATA_EA_LIST = SMB_FIND_EA_LIST,
2201 RAW_SEARCH_DATA_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
2202 RAW_SEARCH_DATA_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
2203 RAW_SEARCH_DATA_NAME_INFO = SMB_FIND_NAME_INFO,
2204 RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
2205 RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
2206 RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
2207 RAW_SEARCH_DATA_UNIX_INFO = SMB_FIND_UNIX_INFO
2210 /* union for file search */
2211 union smb_search_first {
2213 enum smb_search_level level;
2214 enum smb_search_data_level data_level;
2217 /* search (old) findfirst interface.
2218 Also used for ffirst and funique. */
2220 enum smb_search_level level;
2221 enum smb_search_data_level data_level;
2225 uint16_t search_attrib;
2226 const char *pattern;
2233 /* trans2 findfirst interface */
2235 enum smb_search_level level;
2236 enum smb_search_data_level data_level;
2239 uint16_t search_attrib;
2242 uint32_t storage_type;
2243 const char *pattern;
2245 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2247 struct ea_name *ea_names;
2252 uint16_t end_of_search;
2257 SMB2 uses different level numbers for the same old SMB trans2 search levels
2259 #define SMB2_FIND_DIRECTORY_INFO 0x01
2260 #define SMB2_FIND_FULL_DIRECTORY_INFO 0x02
2261 #define SMB2_FIND_BOTH_DIRECTORY_INFO 0x03
2262 #define SMB2_FIND_NAME_INFO 0x0C
2263 #define SMB2_FIND_ID_BOTH_DIRECTORY_INFO 0x25
2264 #define SMB2_FIND_ID_FULL_DIRECTORY_INFO 0x26
2266 /* flags for RAW_FILEINFO_SMB2_ALL_EAS */
2267 #define SMB2_CONTINUE_FLAG_RESTART 0x01
2268 #define SMB2_CONTINUE_FLAG_SINGLE 0x02
2269 #define SMB2_CONTINUE_FLAG_NEW 0x10
2273 enum smb_search_level level;
2274 enum smb_search_data_level data_level;
2276 union smb_handle file;
2278 /* static body buffer 32 (0x20) bytes */
2279 /* uint16_t buffer_code; 0x21 = 0x20 + 1 */
2281 uint8_t continue_flags; /* SMB2_CONTINUE_FLAG_* */
2282 uint32_t unknown; /* perhaps a continue token? */
2283 /* struct smb2_handle handle; */
2284 /* uint16_t pattern_ofs; */
2285 /* uint16_t pattern_size; */
2286 uint32_t max_response_size;
2289 const char *pattern;
2292 /* static body buffer 8 (0x08) bytes */
2293 /* uint16_t buffer_code; 0x08 */
2294 /* uint16_t blob_ofs; */
2295 /* uint32_t blob_size; */
2303 /* union for file search continue */
2304 union smb_search_next {
2306 enum smb_search_level level;
2307 enum smb_search_data_level data_level;
2310 /* search (old) findnext interface. Also used
2311 for ffirst when continuing */
2313 enum smb_search_level level;
2314 enum smb_search_data_level data_level;
2318 uint16_t search_attrib;
2319 struct smb_search_id {
2323 uint32_t server_cookie;
2324 uint32_t client_cookie;
2332 /* trans2 findnext interface */
2334 enum smb_search_level level;
2335 enum smb_search_data_level data_level;
2340 uint32_t resume_key;
2342 const char *last_name;
2344 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2346 struct ea_name *ea_names;
2350 uint16_t end_of_search;
2355 struct smb2_find smb2;
2358 /* union for search reply file data */
2359 union smb_search_data {
2361 * search (old) findfirst
2362 * RAW_SEARCH_DATA_SEARCH
2368 struct smb_search_id id;
2372 /* trans2 findfirst RAW_SEARCH_DATA_STANDARD level */
2374 uint32_t resume_key;
2379 uint32_t alloc_size;
2381 struct smb_wire_string name;
2384 /* trans2 findfirst RAW_SEARCH_DATA_EA_SIZE level */
2386 uint32_t resume_key;
2391 uint32_t alloc_size;
2394 struct smb_wire_string name;
2397 /* trans2 findfirst RAW_SEARCH_DATA_EA_LIST level */
2399 uint32_t resume_key;
2404 uint32_t alloc_size;
2406 struct smb_ea_list eas;
2407 struct smb_wire_string name;
2410 /* RAW_SEARCH_DATA_DIRECTORY_INFO interface */
2412 uint32_t file_index;
2418 uint64_t alloc_size;
2420 struct smb_wire_string name;
2423 /* RAW_SEARCH_DATA_FULL_DIRECTORY_INFO interface */
2425 uint32_t file_index;
2431 uint64_t alloc_size;
2434 struct smb_wire_string name;
2435 } full_directory_info;
2437 /* RAW_SEARCH_DATA_NAME_INFO interface */
2439 uint32_t file_index;
2440 struct smb_wire_string name;
2443 /* RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO interface */
2445 uint32_t file_index;
2451 uint64_t alloc_size;
2454 struct smb_wire_string short_name;
2455 struct smb_wire_string name;
2456 } both_directory_info;
2458 /* RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO interface */
2460 uint32_t file_index;
2466 uint64_t alloc_size;
2470 struct smb_wire_string name;
2471 } id_full_directory_info;
2473 /* RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO interface */
2475 uint32_t file_index;
2481 uint64_t alloc_size;
2485 struct smb_wire_string short_name;
2486 struct smb_wire_string name;
2487 } id_both_directory_info;
2489 /* RAW_SEARCH_DATA_UNIX_INFO interface */
2491 uint32_t file_index;
2493 uint64_t alloc_size;
2494 NTTIME status_change_time;
2503 uint64_t permissions;
2510 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
2512 /* union for file search close */
2513 union smb_search_close {
2515 enum smb_search_close_level level;
2518 /* SMBfclose (old search) interface */
2520 enum smb_search_close_level level;
2523 /* max_count and search_attrib are not used, but are present */
2525 uint16_t search_attrib;
2526 struct smb_search_id id;
2530 /* SMBfindclose interface */
2532 enum smb_search_close_level level;
2540 #endif /* __LIBCLI_RAW_INTERFACES_H__ */