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>
6 Copyright (C) James Peach 2007
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef __LIBCLI_RAW_INTERFACES_H__
23 #define __LIBCLI_RAW_INTERFACES_H__
26 #include "librpc/gen_ndr/misc.h" /* for struct GUID */
28 /* this structure is just a wrapper for a string, the only reason we
29 bother with this is that it allows us to check the length provided
30 on the wire in testsuite test code to ensure that we are
31 terminating names in the same way that win2003 is. The *ONLY* time
32 you should ever look at the 'private_length' field in this
33 structure is inside compliance test code, in all other cases just
34 use the null terminated char* as the definitive definition of the
37 also note that this structure is only used in packets where there
38 is an explicit length provided on the wire (hence the name). That
39 length is placed in 'private_length'. For packets where the length
40 is always determined by NULL or packet termination a normal char*
41 is used in the structure definition.
43 struct smb_wire_string {
44 uint32_t private_length;
49 * SMB2 uses a 16Byte handle,
50 * (we can maybe use struct GUID later)
59 * a generic container for file handles or file pathes
60 * for qfileinfo/setfileinfo and qpathinfo/setpathinfo
62 union smb_handle_or_path {
65 * the qpathinfo and setpathinfo
70 * this is used as file handle in SMB
75 * this is used as file handle in SMB2
77 struct smb2_handle handle;
80 * this is used as generic file handle for the NTVFS layer
82 struct ntvfs_handle *ntvfs;
86 a generic container for file handles
90 * this is used as file handle in SMB
95 * this is used as file handle in SMB2
97 struct smb2_handle handle;
100 * this is used as generic file handle for the NTVFS layer
102 struct ntvfs_handle *ntvfs;
106 this header defines the structures and unions used between the SMB
107 parser and the backends.
110 /* struct used for SMBlseek call */
114 union smb_handle file;
116 int32_t offset; /* signed */
124 /* struct used in unlink() call */
135 /* struct used in chkpath() call */
144 enum smb_mkdir_level {RAW_MKDIR_GENERIC, RAW_MKDIR_MKDIR, RAW_MKDIR_T2MKDIR};
146 /* union used in mkdir() call */
150 enum smb_mkdir_level level;
154 enum smb_mkdir_level level;
161 enum smb_mkdir_level level;
165 struct ea_struct *eas;
170 /* struct used in rmdir() call */
177 /* struct used in rename() call */
178 enum smb_rename_level {RAW_RENAME_RENAME, RAW_RENAME_NTRENAME};
182 enum smb_rename_level level;
185 /* SMBrename interface */
187 enum smb_rename_level level;
190 const char *pattern1;
191 const char *pattern2;
197 /* SMBntrename interface */
199 enum smb_rename_level level;
203 uint16_t flags; /* see RENAME_FLAG_* */
204 uint32_t cluster_size;
205 const char *old_name;
206 const char *new_name;
211 enum smb_tcon_level {
217 /* union used in tree connect call */
219 /* generic interface */
221 enum smb_tcon_level level;
224 /* SMBtcon interface */
226 enum smb_tcon_level level;
230 const char *password;
239 /* SMBtconX interface */
241 enum smb_tcon_level level;
257 /* SMB2 TreeConnect */
258 struct smb2_tree_connect {
259 enum smb_tcon_level level;
262 /* static body buffer 8 (0x08) bytes */
264 /* uint16_t path_ofs */
265 /* uint16_t path_size */
267 const char *path; /* as non-terminated UTF-16 on the wire */
270 /* static body buffer 16 (0x10) bytes */
271 /* uint16_t buffer_code; 0x10 */
275 uint32_t capabilities;
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 /* static body 24 (0x18) bytes */
377 uint8_t security_mode;
378 uint32_t capabilities;
380 /* uint16_t secblob_ofs */
381 /* uint16_t secblob_size */
382 uint64_t previous_sessionid;
387 /* body buffer 8 (0x08) bytes */
388 uint16_t session_flags;
389 /* uint16_t secblob_ofs */
390 /* uint16_t secblob_size */
394 /* extracted from the SMB2 header */
400 /* Note that the specified enum values are identical to the actual info-levels used
403 enum smb_fileinfo_level {
404 RAW_FILEINFO_GENERIC = 0xF000,
405 RAW_FILEINFO_GETATTR, /* SMBgetatr */
406 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
407 RAW_FILEINFO_SEC_DESC, /* NT_TRANSACT_QUERY_SECURITY_DESC */
408 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
409 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
410 RAW_FILEINFO_EA_LIST = SMB_QFILEINFO_EA_LIST,
411 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
412 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
413 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
414 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
415 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
416 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
417 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
418 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
419 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
420 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
421 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
422 RAW_FILEINFO_UNIX_INFO2 = SMB_QFILEINFO_UNIX_INFO2,
423 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
424 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
425 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
426 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
427 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
428 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
429 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
430 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
431 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
432 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
433 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
434 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
435 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
436 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
437 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
438 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION,
439 /* SMB2 specific levels */
440 RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01,
441 RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
444 /* union used in qfileinfo() and qpathinfo() backend calls */
446 /* generic interface:
447 * matches RAW_FILEINFO_GENERIC */
449 enum smb_fileinfo_level level;
451 union smb_handle_or_path file;
459 struct smb_wire_string name;
469 struct smb_wire_string fname;
470 struct smb_wire_string alt_fname;
471 uint8_t delete_pending;
473 uint64_t compressed_size;
477 uint8_t cluster_shift;
479 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
482 uint32_t alignment_requirement;
483 uint32_t reparse_tag;
485 struct stream_struct {
488 struct smb_wire_string stream_name;
494 /* SMBgetatr interface:
495 * matches RAW_FILEINFO_GETATTR */
497 enum smb_fileinfo_level level;
499 union smb_handle_or_path file;
508 /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
510 enum smb_fileinfo_level level;
512 union smb_handle_or_path file;
522 } getattre, standard;
524 /* trans2 RAW_FILEINFO_EA_SIZE interface */
526 enum smb_fileinfo_level level;
528 union smb_handle_or_path file;
541 /* trans2 RAW_FILEINFO_EA_LIST interface */
543 enum smb_fileinfo_level level;
545 union smb_handle_or_path file;
548 struct smb_wire_string name;
554 struct ea_struct *eas;
558 /* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */
560 enum smb_fileinfo_level level;
562 union smb_handle_or_path file;
563 /* SMB2 only - SMB2_CONTINUE_FLAG_* */
564 uint8_t continue_flags;
566 struct smb_ea_list out;
569 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
570 only valid for a QPATHNAME call - no returned data */
572 enum smb_fileinfo_level level;
574 union smb_handle_or_path file;
578 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
580 enum smb_fileinfo_level level;
582 union smb_handle_or_path file;
594 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
596 enum smb_fileinfo_level level;
598 union smb_handle_or_path file;
609 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
611 enum smb_fileinfo_level level;
613 union smb_handle_or_path file;
620 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
622 enum smb_fileinfo_level level;
624 union smb_handle_or_path file;
627 struct smb_wire_string fname;
631 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
633 enum smb_fileinfo_level level;
635 union smb_handle_or_path file;
646 uint8_t delete_pending;
649 struct smb_wire_string fname;
653 /* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */
655 enum smb_fileinfo_level level;
657 union smb_handle_or_path file;
669 uint8_t delete_pending;
674 uint32_t access_mask;
677 struct smb_wire_string fname;
681 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
683 enum smb_fileinfo_level level;
685 union smb_handle_or_path file;
688 struct smb_wire_string fname;
692 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
694 enum smb_fileinfo_level level;
696 union smb_handle_or_path file;
698 struct stream_information {
700 struct stream_struct *streams;
704 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
706 enum smb_fileinfo_level level;
708 union smb_handle_or_path file;
711 uint64_t compressed_size;
715 uint8_t cluster_shift;
719 /* RAW_FILEINFO_UNIX_BASIC interface */
721 enum smb_fileinfo_level level;
723 union smb_handle_or_path file;
726 uint64_t end_of_file;
728 NTTIME status_change_time;
737 uint64_t permissions;
742 /* RAW_FILEINFO_UNIX_INFO2 interface */
744 enum smb_fileinfo_level level;
746 union smb_handle_or_path file;
749 uint64_t end_of_file;
751 NTTIME status_change_time;
760 uint64_t permissions;
768 /* RAW_FILEINFO_UNIX_LINK interface */
770 enum smb_fileinfo_level level;
772 union smb_handle_or_path file;
775 struct smb_wire_string link_dest;
779 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
781 enum smb_fileinfo_level level;
783 union smb_handle_or_path file;
788 } internal_information;
790 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
792 enum smb_fileinfo_level level;
794 union smb_handle_or_path file;
797 uint32_t access_flags;
799 } access_information;
801 /* RAW_FILEINFO_POSITION_INFORMATION interface */
803 enum smb_fileinfo_level level;
805 union smb_handle_or_path file;
810 } position_information;
812 /* RAW_FILEINFO_MODE_INFORMATION interface */
814 enum smb_fileinfo_level level;
816 union smb_handle_or_path file;
823 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
825 enum smb_fileinfo_level level;
827 union smb_handle_or_path file;
830 uint32_t alignment_requirement;
832 } alignment_information;
834 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
836 enum smb_fileinfo_level level;
838 union smb_handle_or_path file;
849 } network_open_information;
852 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
854 enum smb_fileinfo_level level;
856 union smb_handle_or_path file;
860 uint32_t reparse_tag;
862 } attribute_tag_information;
864 /* RAW_FILEINFO_SEC_DESC */
866 enum smb_fileinfo_level level;
868 union smb_handle_or_path file;
869 uint32_t secinfo_flags;
872 struct security_descriptor *sd;
878 enum smb_setfileinfo_level {
879 RAW_SFILEINFO_GENERIC = 0xF000,
880 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
881 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
882 RAW_SFILEINFO_SEC_DESC, /* NT_TRANSACT_SET_SECURITY_DESC */
883 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
884 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
885 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
886 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
887 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
888 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
889 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
890 RAW_SFILEINFO_UNIX_INFO2 = SMB_SFILEINFO_UNIX_INFO2,
891 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
892 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
893 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
894 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
895 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
896 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
897 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
898 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
899 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
900 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
901 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
902 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
903 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
904 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
905 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040,
907 /* cope with breakage in SMB2 */
908 RAW_SFILEINFO_RENAME_INFORMATION_SMB2 = SMB_SFILEINFO_RENAME_INFORMATION|0x80000000,
911 /* union used in setfileinfo() and setpathinfo() calls */
912 union smb_setfileinfo {
913 /* generic interface */
915 enum smb_setfileinfo_level level;
917 union smb_handle_or_path file;
921 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
923 enum smb_setfileinfo_level level;
925 union smb_handle_or_path file;
931 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo()
932 also RAW_SFILEINFO_STANDARD */
934 enum smb_setfileinfo_level level;
936 union smb_handle_or_path file;
940 /* notice that size, alloc_size and attrib are not settable,
941 unlike the corresponding qfileinfo level */
943 } setattre, standard;
945 /* RAW_SFILEINFO_EA_SET interface */
947 enum smb_setfileinfo_level level;
949 union smb_handle_or_path file;
951 struct ea_struct *eas;
955 /* RAW_SFILEINFO_BASIC_INFO and
956 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
958 enum smb_setfileinfo_level level;
960 union smb_handle_or_path file;
969 /* RAW_SFILEINFO_DISPOSITION_INFO and
970 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
972 enum smb_setfileinfo_level level;
974 union smb_handle_or_path file;
975 bool delete_on_close;
979 /* RAW_SFILEINFO_ALLOCATION_INFO and
980 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
982 enum smb_setfileinfo_level level;
984 union smb_handle_or_path file;
985 /* w2k3 rounds this up to nearest 4096 */
990 /* RAW_SFILEINFO_END_OF_FILE_INFO and
991 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
993 enum smb_setfileinfo_level level;
995 union smb_handle_or_path file;
1000 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
1002 enum smb_setfileinfo_level level;
1004 union smb_handle_or_path file;
1007 const char *new_name;
1009 } rename_information;
1011 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
1013 enum smb_setfileinfo_level level;
1015 union smb_handle_or_path file;
1018 } position_information;
1020 /* RAW_SFILEINFO_MODE_INFORMATION interface */
1022 enum smb_setfileinfo_level level;
1024 union smb_handle_or_path file;
1025 /* valid values seem to be 0, 2, 4 and 6 */
1030 /* RAW_SFILEINFO_UNIX_BASIC interface */
1032 enum smb_setfileinfo_level level;
1034 union smb_handle_or_path file;
1035 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
1036 uint64_t end_of_file;
1038 NTTIME status_change_time;
1047 uint64_t permissions;
1052 /* RAW_SFILEINFO_UNIX_INFO2 interface */
1054 enum smb_setfileinfo_level level;
1056 union smb_handle_or_path file;
1057 uint64_t end_of_file;
1059 NTTIME status_change_time;
1068 uint64_t permissions;
1071 uint32_t file_flags;
1072 uint32_t flags_mask;
1076 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
1078 enum smb_setfileinfo_level level;
1080 union smb_handle_or_path file;
1081 const char *link_dest;
1083 } unix_link, unix_hlink;
1085 /* RAW_FILEINFO_SET_SEC_DESC */
1087 enum smb_setfileinfo_level level;
1089 union smb_handle_or_path file;
1090 uint32_t secinfo_flags;
1091 struct security_descriptor *sd;
1097 enum smb_fsinfo_level {
1098 RAW_QFS_GENERIC = 0xF000,
1099 RAW_QFS_DSKATTR, /* SMBdskattr */
1100 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
1101 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
1102 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
1103 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
1104 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
1105 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
1106 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
1107 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
1108 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
1109 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
1110 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
1111 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
1112 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
1113 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
1116 /* union for fsinfo() backend call. Note that there are no in
1117 structures, as this call only contains out parameters */
1119 /* generic interface */
1121 enum smb_fsinfo_level level;
1122 struct smb2_handle handle; /* only for smb2 */
1125 uint32_t block_size;
1126 uint64_t blocks_total;
1127 uint64_t blocks_free;
1130 uint32_t serial_number;
1132 uint32_t max_file_component_length;
1133 uint32_t device_type;
1134 uint32_t device_characteristics;
1135 uint64_t quota_soft;
1136 uint64_t quota_hard;
1137 uint64_t quota_flags;
1144 /* SMBdskattr interface */
1146 enum smb_fsinfo_level level;
1149 uint16_t units_total;
1150 uint16_t blocks_per_unit;
1151 uint16_t block_size;
1152 uint16_t units_free;
1156 /* trans2 RAW_QFS_ALLOCATION interface */
1158 enum smb_fsinfo_level level;
1162 uint32_t sectors_per_unit;
1163 uint32_t total_alloc_units;
1164 uint32_t avail_alloc_units;
1165 uint16_t bytes_per_sector;
1169 /* TRANS2 RAW_QFS_VOLUME interface */
1171 enum smb_fsinfo_level level;
1174 uint32_t serial_number;
1175 struct smb_wire_string volume_name;
1179 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
1181 enum smb_fsinfo_level level;
1182 struct smb2_handle handle; /* only for smb2 */
1186 uint32_t serial_number;
1187 struct smb_wire_string volume_name;
1191 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
1193 enum smb_fsinfo_level level;
1194 struct smb2_handle handle; /* only for smb2 */
1197 uint64_t total_alloc_units;
1198 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
1199 uint32_t sectors_per_unit;
1200 uint32_t bytes_per_sector;
1204 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
1206 enum smb_fsinfo_level level;
1207 struct smb2_handle handle; /* only for smb2 */
1210 uint32_t device_type;
1211 uint32_t characteristics;
1216 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
1218 enum smb_fsinfo_level level;
1219 struct smb2_handle handle; /* only for smb2 */
1223 uint32_t max_file_component_length;
1224 struct smb_wire_string fs_type;
1229 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1231 enum smb_fsinfo_level level;
1234 uint16_t major_version;
1235 uint16_t minor_version;
1236 uint64_t capability;
1240 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1242 enum smb_fsinfo_level level;
1243 struct smb2_handle handle; /* only for smb2 */
1246 uint64_t unknown[3];
1247 uint64_t quota_soft;
1248 uint64_t quota_hard;
1249 uint64_t quota_flags;
1251 } quota_information;
1253 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1255 enum smb_fsinfo_level level;
1256 struct smb2_handle handle; /* only for smb2 */
1259 uint64_t total_alloc_units;
1260 uint64_t call_avail_alloc_units;
1261 uint64_t actual_avail_alloc_units;
1262 uint32_t sectors_per_unit;
1263 uint32_t bytes_per_sector;
1265 } full_size_information;
1267 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1269 enum smb_fsinfo_level level;
1270 struct smb2_handle handle; /* only for smb2 */
1274 uint64_t unknown[6];
1276 } objectid_information;
1281 enum smb_open_level {
1290 RAW_OPEN_NTTRANS_CREATE,
1291 RAW_OPEN_OPENX_READX,
1295 /* the generic interface is defined to be equal to the NTCREATEX interface */
1296 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1298 /* union for open() backend call */
1301 * because the *.out.file structs are not aligned to the same offset for each level
1302 * we provide a hepler macro that should be used to find the current smb_handle structure
1304 #define SMB_OPEN_OUT_FILE(op, file) do { \
1305 switch (op->generic.level) { \
1306 case RAW_OPEN_OPEN: \
1307 file = &op->openold.out.file; \
1309 case RAW_OPEN_OPENX: \
1310 file = &op->openx.out.file; \
1312 case RAW_OPEN_MKNEW: \
1313 file = &op->mknew.out.file; \
1315 case RAW_OPEN_CREATE: \
1316 file = &op->create.out.file; \
1318 case RAW_OPEN_CTEMP: \
1319 file = &op->ctemp.out.file; \
1321 case RAW_OPEN_SPLOPEN: \
1322 file = &op->splopen.out.file; \
1324 case RAW_OPEN_NTCREATEX: \
1325 file = &op->ntcreatex.out.file; \
1327 case RAW_OPEN_T2OPEN: \
1328 file = &op->t2open.out.file; \
1330 case RAW_OPEN_NTTRANS_CREATE: \
1331 file = &op->nttrans.out.file; \
1333 case RAW_OPEN_OPENX_READX: \
1334 file = &op->openxreadx.out.file; \
1336 case RAW_OPEN_SMB2: \
1337 file = &op->smb2.out.file; \
1340 /* this must be a programmer error */ \
1345 /* SMBNTCreateX interface */
1347 enum smb_open_level level;
1351 uint32_t access_mask;
1352 uint64_t alloc_size;
1354 uint32_t share_access;
1355 uint32_t open_disposition;
1356 uint32_t create_options;
1357 uint32_t impersonation;
1358 uint8_t security_flags;
1359 /* NOTE: fname can also be a pointer to a
1360 uint64_t file_id if create_options has the
1361 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1364 /* these last 2 elements are only used in the
1365 NTTRANS varient of the call */
1366 struct security_descriptor *sec_desc;
1367 struct smb_ea_list *ea_list;
1370 union smb_handle file;
1371 uint8_t oplock_level;
1372 uint32_t create_action;
1378 uint64_t alloc_size;
1382 uint8_t is_directory;
1384 } ntcreatex, nttrans, generic;
1386 /* TRANS2_OPEN interface */
1388 enum smb_open_level level;
1392 uint16_t search_attrs;
1393 uint16_t file_attrs;
1400 struct ea_struct *eas;
1403 union smb_handle file;
1415 /* SMBopen interface */
1417 enum smb_open_level level;
1420 uint16_t search_attrs;
1424 union smb_handle file;
1432 /* SMBopenX interface */
1434 enum smb_open_level level;
1438 uint16_t search_attrs; /* not honoured by win2003 */
1439 uint16_t file_attrs;
1440 time_t write_time; /* not honoured by win2003 */
1442 uint32_t size; /* note that this sets the
1443 initial file size, not
1444 just allocation size */
1445 uint32_t timeout; /* not honoured by win2003 */
1449 union smb_handle file;
1457 uint32_t unique_fid;
1458 uint32_t access_mask;
1463 /* SMBmknew interface */
1465 enum smb_open_level level;
1472 union smb_handle file;
1476 /* SMBctemp interface */
1478 enum smb_open_level level;
1482 const char *directory;
1485 union smb_handle file;
1486 /* temp name, relative to directory */
1491 /* SMBsplopen interface */
1493 enum smb_open_level level;
1495 uint16_t setup_length;
1500 union smb_handle file;
1505 /* chained OpenX/ReadX interface */
1507 enum smb_open_level level;
1511 uint16_t search_attrs; /* not honoured by win2003 */
1512 uint16_t file_attrs;
1513 time_t write_time; /* not honoured by win2003 */
1515 uint32_t size; /* note that this sets the
1516 initial file size, not
1517 just allocation size */
1518 uint32_t timeout; /* not honoured by win2003 */
1528 union smb_handle file;
1536 uint32_t unique_fid;
1537 uint32_t access_mask;
1543 uint16_t compaction_mode;
1548 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100
1549 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800
1550 #define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001
1551 #define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080
1554 struct smb2_create {
1555 enum smb_open_level level;
1557 /* static body buffer 56 (0x38) bytes */
1558 uint8_t security_flags; /* SMB2_SECURITY_* */
1559 uint8_t oplock_level; /* SMB2_OPLOCK_LEVEL_* */
1560 uint32_t impersonation_level; /* SMB2_IMPERSONATION_* */
1561 uint64_t create_flags;
1563 uint32_t desired_access;
1564 uint32_t file_attributes;
1565 uint32_t share_access; /* NTCREATEX_SHARE_ACCESS_* */
1566 uint32_t create_disposition; /* NTCREATEX_DISP_* */
1567 uint32_t create_options; /* NTCREATEX_OPTIONS_* */
1569 /* uint16_t fname_ofs */
1570 /* uint16_t fname_size */
1571 /* uint32_t blob_ofs; */
1572 /* uint32_t blob_size; */
1577 /* optional list of extended attributes */
1578 struct smb_ea_list eas;
1581 union smb_handle file;
1583 /* static body buffer 88 (0x58) bytes */
1584 /* uint16_t buffer_code; 0x59 = 0x58 + 1 */
1585 uint8_t oplock_level;
1587 uint32_t create_action;
1592 uint64_t alloc_size;
1596 /* struct smb2_handle handle;*/
1597 /* uint32_t blob_ofs; */
1598 /* uint32_t blob_size; */
1608 enum smb_read_level {
1616 #define RAW_READ_GENERIC RAW_READ_READX
1618 /* union for read() backend call
1620 note that .infoX.out.data will be allocated before the backend is
1621 called. It will be big enough to hold the maximum size asked for
1624 /* SMBreadX (and generic) interface */
1626 enum smb_read_level level;
1628 union smb_handle file;
1633 bool read_for_execute;
1638 uint16_t compaction_mode;
1643 /* SMBreadbraw interface */
1645 enum smb_read_level level;
1647 union smb_handle file;
1660 /* SMBlockandread interface */
1662 enum smb_read_level level;
1664 union smb_handle file;
1675 /* SMBread interface */
1677 enum smb_read_level level;
1679 union smb_handle file;
1692 enum smb_read_level level;
1694 union smb_handle file;
1696 /* static body buffer 48 (0x30) bytes */
1697 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1701 /* struct smb2_handle handle; */
1702 uint64_t unknown1; /* 0x0000000000000000 */
1703 uint64_t unknown2; /* 0x0000000000000000 */
1706 /* static body buffer 16 (0x10) bytes */
1707 /* uint16_t buffer_code; 0x11 = 0x10 + 1 */
1708 /* uint16_t data_ofs; */
1709 /* uint32_t data_size; */
1710 uint64_t unknown1; /* 0x0000000000000000 */
1719 enum smb_write_level {
1720 RAW_WRITE_WRITEUNLOCK,
1723 RAW_WRITE_WRITECLOSE,
1728 #define RAW_WRITE_GENERIC RAW_WRITE_WRITEX
1730 /* union for write() backend call
1733 /* SMBwriteX interface */
1735 enum smb_write_level level;
1737 union smb_handle file;
1742 const uint8_t *data;
1750 /* SMBwriteunlock interface */
1752 enum smb_write_level level;
1754 union smb_handle file;
1758 const uint8_t *data;
1765 /* SMBwrite interface */
1767 enum smb_write_level level;
1769 union smb_handle file;
1773 const uint8_t *data;
1780 /* SMBwriteclose interface */
1782 enum smb_write_level level;
1784 union smb_handle file;
1788 const uint8_t *data;
1795 /* SMBsplwrite interface */
1797 enum smb_write_level level;
1799 union smb_handle file;
1801 const uint8_t *data;
1807 enum smb_write_level level;
1809 union smb_handle file;
1811 /* static body buffer 48 (0x30) bytes */
1812 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1813 /* uint16_t data_ofs; */
1814 /* uint32_t data_size; */
1816 /* struct smb2_handle handle; */
1817 uint64_t unknown1; /* 0xFFFFFFFFFFFFFFFF */
1818 uint64_t unknown2; /* 0xFFFFFFFFFFFFFFFF */
1824 /* static body buffer 17 (0x11) bytes */
1825 /* uint16_t buffer_code; 0x11 = 0x10 + 1*/
1828 uint64_t unknown1; /* 0x0000000000000000 */
1834 enum smb_lock_level {
1841 /* the generic interface is defined to be equal to the lockingX interface */
1842 #define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
1844 /* union for lock() backend call
1847 /* SMBlockingX (and generic) interface */
1849 enum smb_lock_level level;
1851 union smb_handle file;
1856 struct smb_lock_entry {
1860 } *locks; /* unlocks are first in the arrray */
1864 /* SMBlock and SMBunlock interface */
1866 enum smb_lock_level level;
1868 union smb_handle file;
1876 enum smb_lock_level level;
1878 union smb_handle file;
1880 /* static body buffer 48 (0x30) bytes */
1881 /* uint16_t buffer_code; 0x30 */
1882 uint16_t unknown1; /* must be 0x0001 */
1884 /* struct smb2_handle handle; */
1888 #define SMB2_LOCK_FLAG_NONE 0x00000000
1889 #define SMB2_LOCK_FLAG_SHARED 0x00000001
1890 #define SMB2_LOCK_FLAG_EXCLUSIV 0x00000002
1891 #define SMB2_LOCK_FLAG_UNLOCK 0x00000004
1892 #define SMB2_LOCK_FLAG_NO_PENDING 0x00000010
1896 /* static body buffer 4 (0x04) bytes */
1897 /* uint16_t buffer_code; 0x04 */
1904 enum smb_close_level {
1910 #define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
1913 union for close() backend call
1916 /* SMBclose (and generic) interface */
1918 enum smb_close_level level;
1920 union smb_handle file;
1925 /* SMBsplclose interface - empty! */
1927 enum smb_close_level level;
1929 union smb_handle file;
1935 enum smb_close_level level;
1937 union smb_handle file;
1939 /* static body buffer 24 (0x18) bytes */
1940 /* uint16_t buffer_code; 0x18 */
1941 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
1942 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
1946 /* static body buffer 60 (0x3C) bytes */
1947 /* uint16_t buffer_code; 0x3C */
1954 uint64_t alloc_size;
1962 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1965 union for lpq() backend
1968 /* generic interface */
1970 enum smb_lpq_level level;
1975 /* SMBsplretq interface */
1977 enum smb_lpq_level level;
1985 uint16_t restart_idx;
1997 enum smb_ioctl_level {
2001 RAW_IOCTL_SMB2_NO_HANDLE
2005 union for ioctl() backend
2008 /* generic interface */
2010 enum smb_ioctl_level level;
2012 union smb_handle file;
2016 /* struct for SMBioctl */
2018 enum smb_ioctl_level level;
2020 union smb_handle file;
2029 /* struct for NT ioctl call */
2031 enum smb_ioctl_level level;
2033 union smb_handle file;
2047 enum smb_ioctl_level level;
2049 union smb_handle file;
2051 /* static body buffer 56 (0x38) bytes */
2052 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
2055 /*struct smb2_handle handle;*/
2056 /* uint32_t out_ofs; */
2057 /* uint32_t out_size; */
2059 /* uint32_t in_ofs; */
2060 /* uint32_t in_size; */
2061 uint32_t max_response_size;
2069 union smb_handle file;
2071 /* static body buffer 48 (0x30) bytes */
2072 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
2075 /* struct smb2_handle handle; */
2076 /* uint32_t in_ofs; */
2077 /* uint32_t in_size; */
2078 /* uint32_t out_ofs; */
2079 /* uint32_t out_size; */
2090 enum smb_flush_level {
2097 /* struct for SMBflush */
2099 enum smb_flush_level level;
2101 union smb_handle file;
2105 /* SMBflush with 0xFFFF wildcard fnum */
2107 enum smb_flush_level level;
2112 enum smb_flush_level level;
2114 union smb_handle file;
2120 /* struct for SMBcopy */
2135 /* struct for transact/transact2 call */
2143 uint8_t setup_count;
2145 const char *trans_name; /* SMBtrans only */
2151 uint8_t setup_count;
2158 /* struct for nttransact2 call */
2159 struct smb_nttrans {
2164 uint32_t setup_count;
2172 uint8_t setup_count; /* in units of 16 bit words */
2179 enum smb_notify_level {
2185 /* struct for nttrans change notify call */
2187 enum smb_notify_level level;
2190 union smb_handle file;
2191 uint32_t buffer_size;
2192 uint32_t completion_filter;
2197 uint32_t num_changes;
2198 struct notify_changes {
2200 struct smb_wire_string name;
2205 struct smb2_notify {
2206 enum smb_notify_level level;
2209 union smb_handle file;
2210 /* static body buffer 32 (0x20) bytes */
2211 /* uint16_t buffer_code; 0x32 */
2213 uint32_t buffer_size;
2214 /*struct smb2_handle file;*/
2215 uint32_t completion_filter;
2220 /* static body buffer 8 (0x08) bytes */
2221 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
2222 /* uint16_t blob_ofs; */
2223 /* uint16_t blob_size; */
2228 /* DATA_BLOB content */
2229 uint32_t num_changes;
2230 struct notify_changes *changes;
2235 enum smb_search_level {
2236 RAW_SEARCH_SEARCH, /* SMBsearch */
2237 RAW_SEARCH_FFIRST, /* SMBffirst */
2238 RAW_SEARCH_FUNIQUE, /* SMBfunique */
2239 RAW_SEARCH_TRANS2, /* SMBtrans2 */
2240 RAW_SEARCH_SMB2 /* SMB2 Find */
2243 enum smb_search_data_level {
2244 RAW_SEARCH_DATA_GENERIC = 0x10000, /* only used in the smbcli_ code */
2245 RAW_SEARCH_DATA_SEARCH,
2246 RAW_SEARCH_DATA_STANDARD = SMB_FIND_STANDARD,
2247 RAW_SEARCH_DATA_EA_SIZE = SMB_FIND_EA_SIZE,
2248 RAW_SEARCH_DATA_EA_LIST = SMB_FIND_EA_LIST,
2249 RAW_SEARCH_DATA_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
2250 RAW_SEARCH_DATA_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
2251 RAW_SEARCH_DATA_NAME_INFO = SMB_FIND_NAME_INFO,
2252 RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
2253 RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
2254 RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
2255 RAW_SEARCH_DATA_UNIX_INFO = SMB_FIND_UNIX_INFO,
2256 RAW_SEARCH_DATA_UNIX_INFO2 = SMB_FIND_UNIX_INFO2
2259 /* union for file search */
2260 union smb_search_first {
2262 enum smb_search_level level;
2263 enum smb_search_data_level data_level;
2266 /* search (old) findfirst interface.
2267 Also used for ffirst and funique. */
2269 enum smb_search_level level;
2270 enum smb_search_data_level data_level;
2274 uint16_t search_attrib;
2275 const char *pattern;
2282 /* trans2 findfirst interface */
2284 enum smb_search_level level;
2285 enum smb_search_data_level data_level;
2288 uint16_t search_attrib;
2291 uint32_t storage_type;
2292 const char *pattern;
2294 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2296 struct ea_name *ea_names;
2301 uint16_t end_of_search;
2306 SMB2 uses different level numbers for the same old SMB trans2 search levels
2308 #define SMB2_FIND_DIRECTORY_INFO 0x01
2309 #define SMB2_FIND_FULL_DIRECTORY_INFO 0x02
2310 #define SMB2_FIND_BOTH_DIRECTORY_INFO 0x03
2311 #define SMB2_FIND_NAME_INFO 0x0C
2312 #define SMB2_FIND_ID_BOTH_DIRECTORY_INFO 0x25
2313 #define SMB2_FIND_ID_FULL_DIRECTORY_INFO 0x26
2315 /* flags for RAW_FILEINFO_SMB2_ALL_EAS */
2316 #define SMB2_CONTINUE_FLAG_RESTART 0x01
2317 #define SMB2_CONTINUE_FLAG_SINGLE 0x02
2318 #define SMB2_CONTINUE_FLAG_NEW 0x10
2322 enum smb_search_level level;
2323 enum smb_search_data_level data_level;
2325 union smb_handle file;
2327 /* static body buffer 32 (0x20) bytes */
2328 /* uint16_t buffer_code; 0x21 = 0x20 + 1 */
2330 uint8_t continue_flags; /* SMB2_CONTINUE_FLAG_* */
2331 uint32_t unknown; /* perhaps a continue token? */
2332 /* struct smb2_handle handle; */
2333 /* uint16_t pattern_ofs; */
2334 /* uint16_t pattern_size; */
2335 uint32_t max_response_size;
2338 const char *pattern;
2341 /* static body buffer 8 (0x08) bytes */
2342 /* uint16_t buffer_code; 0x08 */
2343 /* uint16_t blob_ofs; */
2344 /* uint32_t blob_size; */
2352 /* union for file search continue */
2353 union smb_search_next {
2355 enum smb_search_level level;
2356 enum smb_search_data_level data_level;
2359 /* search (old) findnext interface. Also used
2360 for ffirst when continuing */
2362 enum smb_search_level level;
2363 enum smb_search_data_level data_level;
2367 uint16_t search_attrib;
2368 struct smb_search_id {
2372 uint32_t server_cookie;
2373 uint32_t client_cookie;
2381 /* trans2 findnext interface */
2383 enum smb_search_level level;
2384 enum smb_search_data_level data_level;
2389 uint32_t resume_key;
2391 const char *last_name;
2393 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2395 struct ea_name *ea_names;
2399 uint16_t end_of_search;
2404 struct smb2_find smb2;
2407 /* union for search reply file data */
2408 union smb_search_data {
2410 * search (old) findfirst
2411 * RAW_SEARCH_DATA_SEARCH
2417 struct smb_search_id id;
2421 /* trans2 findfirst RAW_SEARCH_DATA_STANDARD level */
2423 uint32_t resume_key;
2428 uint32_t alloc_size;
2430 struct smb_wire_string name;
2433 /* trans2 findfirst RAW_SEARCH_DATA_EA_SIZE level */
2435 uint32_t resume_key;
2440 uint32_t alloc_size;
2443 struct smb_wire_string name;
2446 /* trans2 findfirst RAW_SEARCH_DATA_EA_LIST level */
2448 uint32_t resume_key;
2453 uint32_t alloc_size;
2455 struct smb_ea_list eas;
2456 struct smb_wire_string name;
2459 /* RAW_SEARCH_DATA_DIRECTORY_INFO interface */
2461 uint32_t file_index;
2467 uint64_t alloc_size;
2469 struct smb_wire_string name;
2472 /* RAW_SEARCH_DATA_FULL_DIRECTORY_INFO interface */
2474 uint32_t file_index;
2480 uint64_t alloc_size;
2483 struct smb_wire_string name;
2484 } full_directory_info;
2486 /* RAW_SEARCH_DATA_NAME_INFO interface */
2488 uint32_t file_index;
2489 struct smb_wire_string name;
2492 /* RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO interface */
2494 uint32_t file_index;
2500 uint64_t alloc_size;
2503 struct smb_wire_string short_name;
2504 struct smb_wire_string name;
2505 } both_directory_info;
2507 /* RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO interface */
2509 uint32_t file_index;
2515 uint64_t alloc_size;
2519 struct smb_wire_string name;
2520 } id_full_directory_info;
2522 /* RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO interface */
2524 uint32_t file_index;
2530 uint64_t alloc_size;
2534 struct smb_wire_string short_name;
2535 struct smb_wire_string name;
2536 } id_both_directory_info;
2538 /* RAW_SEARCH_DATA_UNIX_INFO interface */
2540 uint32_t file_index;
2542 uint64_t alloc_size;
2543 NTTIME status_change_time;
2552 uint64_t permissions;
2557 /* RAW_SEARCH_DATA_UNIX_INFO2 interface */
2559 uint32_t file_index;
2560 uint64_t end_of_file;
2562 NTTIME status_change_time;
2571 uint64_t permissions;
2574 uint32_t file_flags;
2575 uint32_t flags_mask;
2576 struct smb_wire_string name;
2580 /* Callback function passed to the raw search interface. */
2581 typedef bool (*smbcli_search_callback)(void *private, const union smb_search_data *file);
2583 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
2585 /* union for file search close */
2586 union smb_search_close {
2588 enum smb_search_close_level level;
2591 /* SMBfclose (old search) interface */
2593 enum smb_search_close_level level;
2596 /* max_count and search_attrib are not used, but are present */
2598 uint16_t search_attrib;
2599 struct smb_search_id id;
2603 /* SMBfindclose interface */
2605 enum smb_search_close_level level;
2615 struct for SMBecho call
2619 uint16_t repeat_count;
2625 uint16_t sequence_number;
2632 struct for shadow copy volumes
2634 struct smb_shadow_copy {
2636 union smb_handle file;
2640 uint32_t num_volumes;
2646 #endif /* __LIBCLI_RAW_INTERFACES_H__ */