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 2 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, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef __LIBCLI_RAW_INTERFACES_H__
24 #define __LIBCLI_RAW_INTERFACES_H__
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 */
263 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
264 uint16_t unknown1; /* 0x0000 */
265 /* uint16_t path_ofs */
266 /* uint16_t path_size */
269 const char *path; /* as non-terminated UTF-16 on the wire */
272 /* static body buffer 16 (0x10) bytes */
273 /* uint16_t buffer_code; 0x10 */
274 uint16_t unknown1; /* 0x02 */
275 uint32_t unknown2; /* 0x00 */
276 uint32_t unknown3; /* 0x00 */
277 uint32_t access_mask;
279 /* extracted from the SMB2 header */
286 enum smb_sesssetup_level {
289 RAW_SESSSETUP_SPNEGO,
293 /* union used in session_setup call */
294 union smb_sesssetup {
295 /* the pre-NT1 interface */
297 enum smb_sesssetup_level level;
319 /* the NT1 interface */
321 enum smb_sesssetup_level level;
328 uint32_t capabilities;
346 /* the SPNEGO interface */
348 enum smb_sesssetup_level level;
355 uint32_t capabilities;
359 const char *workgroup;
371 /* SMB2 SessionSetup */
372 struct smb2_session_setup {
373 enum smb_sesssetup_level level;
376 /* NOTE: this was 0x11 = 0x10 + 1 in vista-CTP
377 * and changed in vista-beta2, but both server's
378 * can handle the 0x18 clients
380 /* static body buffer 24 (0x18) bytes */
381 /* uint16_t buffer_code; 0x19 = 0x18 + 1 */
383 uint32_t unknown2; /* 0x0000000F(vista-CTP) 0x00000007(vista-beta2) */
384 uint32_t unknown3; /* 0x0000000 */
385 /* uint16_t secblob_ofs */
386 /* uint16_t secblob_size */
387 uint64_t unknown4; /* 0x0000000000000000 only present in vista-beta2 */
393 /* static body buffer 8 (0x08) bytes */
394 /* uint16_t buffer_code; 0x09 = 0x08 +1 */
396 /* uint16_t secblob_ofs */
397 /* uint16_t secblob_size */
402 /* extracted from the SMB2 header */
408 /* Note that the specified enum values are identical to the actual info-levels used
411 enum smb_fileinfo_level {
412 RAW_FILEINFO_GENERIC = 0xF000,
413 RAW_FILEINFO_GETATTR, /* SMBgetatr */
414 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
415 RAW_FILEINFO_SEC_DESC, /* NT_TRANSACT_QUERY_SECURITY_DESC */
416 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
417 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
418 RAW_FILEINFO_EA_LIST = SMB_QFILEINFO_EA_LIST,
419 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
420 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
421 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
422 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
423 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
424 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
425 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
426 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
427 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
428 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
429 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
430 RAW_FILEINFO_UNIX_INFO2 = SMB_QFILEINFO_UNIX_INFO2,
431 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
432 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
433 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
434 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
435 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
436 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
437 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
438 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
439 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
440 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
441 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
442 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
443 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
444 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
445 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
446 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION,
447 /* SMB2 specific levels */
448 RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01,
449 RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
452 /* union used in qfileinfo() and qpathinfo() backend calls */
454 /* generic interface:
455 * matches RAW_FILEINFO_GENERIC */
457 enum smb_fileinfo_level level;
459 union smb_handle_or_path file;
467 struct smb_wire_string name;
477 struct smb_wire_string fname;
478 struct smb_wire_string alt_fname;
479 uint8_t delete_pending;
481 uint64_t compressed_size;
485 uint8_t cluster_shift;
487 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
490 uint32_t alignment_requirement;
491 uint32_t reparse_tag;
493 struct stream_struct {
496 struct smb_wire_string stream_name;
502 /* SMBgetatr interface:
503 * matches RAW_FILEINFO_GETATTR */
505 enum smb_fileinfo_level level;
507 union smb_handle_or_path file;
516 /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
518 enum smb_fileinfo_level level;
520 union smb_handle_or_path file;
530 } getattre, standard;
532 /* trans2 RAW_FILEINFO_EA_SIZE interface */
534 enum smb_fileinfo_level level;
536 union smb_handle_or_path file;
549 /* trans2 RAW_FILEINFO_EA_LIST interface */
551 enum smb_fileinfo_level level;
553 union smb_handle_or_path file;
556 struct smb_wire_string name;
562 struct ea_struct *eas;
566 /* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */
568 enum smb_fileinfo_level level;
570 union smb_handle_or_path file;
571 /* SMB2 only - SMB2_CONTINUE_FLAG_* */
572 uint8_t continue_flags;
574 struct smb_ea_list out;
577 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
578 only valid for a QPATHNAME call - no returned data */
580 enum smb_fileinfo_level level;
582 union smb_handle_or_path file;
586 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
588 enum smb_fileinfo_level level;
590 union smb_handle_or_path file;
602 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
604 enum smb_fileinfo_level level;
606 union smb_handle_or_path file;
617 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
619 enum smb_fileinfo_level level;
621 union smb_handle_or_path file;
628 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
630 enum smb_fileinfo_level level;
632 union smb_handle_or_path file;
635 struct smb_wire_string fname;
639 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
641 enum smb_fileinfo_level level;
643 union smb_handle_or_path file;
654 uint8_t delete_pending;
657 struct smb_wire_string fname;
661 /* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */
663 enum smb_fileinfo_level level;
665 union smb_handle_or_path file;
677 uint8_t delete_pending;
682 uint32_t access_mask;
685 struct smb_wire_string fname;
689 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
691 enum smb_fileinfo_level level;
693 union smb_handle_or_path file;
696 struct smb_wire_string fname;
700 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
702 enum smb_fileinfo_level level;
704 union smb_handle_or_path file;
706 struct stream_information {
708 struct stream_struct *streams;
712 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
714 enum smb_fileinfo_level level;
716 union smb_handle_or_path file;
719 uint64_t compressed_size;
723 uint8_t cluster_shift;
727 /* RAW_FILEINFO_UNIX_BASIC interface */
729 enum smb_fileinfo_level level;
731 union smb_handle_or_path file;
734 uint64_t end_of_file;
736 NTTIME status_change_time;
745 uint64_t permissions;
750 /* RAW_FILEINFO_UNIX_INFO2 interface */
752 enum smb_fileinfo_level level;
754 union smb_handle_or_path file;
757 uint64_t end_of_file;
759 NTTIME status_change_time;
768 uint64_t permissions;
776 /* RAW_FILEINFO_UNIX_LINK interface */
778 enum smb_fileinfo_level level;
780 union smb_handle_or_path file;
783 struct smb_wire_string link_dest;
787 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
789 enum smb_fileinfo_level level;
791 union smb_handle_or_path file;
796 } internal_information;
798 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
800 enum smb_fileinfo_level level;
802 union smb_handle_or_path file;
805 uint32_t access_flags;
807 } access_information;
809 /* RAW_FILEINFO_POSITION_INFORMATION interface */
811 enum smb_fileinfo_level level;
813 union smb_handle_or_path file;
818 } position_information;
820 /* RAW_FILEINFO_MODE_INFORMATION interface */
822 enum smb_fileinfo_level level;
824 union smb_handle_or_path file;
831 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
833 enum smb_fileinfo_level level;
835 union smb_handle_or_path file;
838 uint32_t alignment_requirement;
840 } alignment_information;
842 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
844 enum smb_fileinfo_level level;
846 union smb_handle_or_path file;
857 } network_open_information;
860 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
862 enum smb_fileinfo_level level;
864 union smb_handle_or_path file;
868 uint32_t reparse_tag;
870 } attribute_tag_information;
872 /* RAW_FILEINFO_SEC_DESC */
874 enum smb_fileinfo_level level;
876 union smb_handle_or_path file;
877 uint32_t secinfo_flags;
880 struct security_descriptor *sd;
886 enum smb_setfileinfo_level {
887 RAW_SFILEINFO_GENERIC = 0xF000,
888 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
889 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
890 RAW_SFILEINFO_SEC_DESC, /* NT_TRANSACT_SET_SECURITY_DESC */
891 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
892 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
893 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
894 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
895 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
896 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
897 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
898 RAW_SFILEINFO_UNIX_INFO2 = SMB_SFILEINFO_UNIX_INFO2,
899 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
900 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
901 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
902 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
903 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
904 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
905 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
906 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
907 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
908 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
909 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
910 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
911 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
912 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
913 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040
916 /* union used in setfileinfo() and setpathinfo() calls */
917 union smb_setfileinfo {
918 /* generic interface */
920 enum smb_setfileinfo_level level;
922 union smb_handle_or_path file;
926 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
928 enum smb_setfileinfo_level level;
930 union smb_handle_or_path file;
936 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo()
937 also RAW_SFILEINFO_STANDARD */
939 enum smb_setfileinfo_level level;
941 union smb_handle_or_path file;
945 /* notice that size, alloc_size and attrib are not settable,
946 unlike the corresponding qfileinfo level */
948 } setattre, standard;
950 /* RAW_SFILEINFO_EA_SET interface */
952 enum smb_setfileinfo_level level;
954 union smb_handle_or_path file;
956 struct ea_struct *eas;
960 /* RAW_SFILEINFO_BASIC_INFO and
961 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
963 enum smb_setfileinfo_level level;
965 union smb_handle_or_path file;
974 /* RAW_SFILEINFO_DISPOSITION_INFO and
975 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
977 enum smb_setfileinfo_level level;
979 union smb_handle_or_path file;
980 BOOL delete_on_close;
984 /* RAW_SFILEINFO_ALLOCATION_INFO and
985 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
987 enum smb_setfileinfo_level level;
989 union smb_handle_or_path file;
990 /* w2k3 rounds this up to nearest 4096 */
995 /* RAW_SFILEINFO_END_OF_FILE_INFO and
996 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
998 enum smb_setfileinfo_level level;
1000 union smb_handle_or_path file;
1005 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
1007 enum smb_setfileinfo_level level;
1009 union smb_handle_or_path file;
1012 const char *new_name;
1014 } rename_information;
1016 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
1018 enum smb_setfileinfo_level level;
1020 union smb_handle_or_path file;
1023 } position_information;
1025 /* RAW_SFILEINFO_MODE_INFORMATION interface */
1027 enum smb_setfileinfo_level level;
1029 union smb_handle_or_path file;
1030 /* valid values seem to be 0, 2, 4 and 6 */
1035 /* RAW_SFILEINFO_UNIX_BASIC interface */
1037 enum smb_setfileinfo_level level;
1039 union smb_handle_or_path file;
1040 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
1041 uint64_t end_of_file;
1043 NTTIME status_change_time;
1052 uint64_t permissions;
1057 /* RAW_SFILEINFO_UNIX_INFO2 interface */
1059 enum smb_setfileinfo_level level;
1061 union smb_handle_or_path file;
1062 uint64_t end_of_file;
1064 NTTIME status_change_time;
1073 uint64_t permissions;
1076 uint32_t file_flags;
1077 uint32_t flags_mask;
1081 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
1083 enum smb_setfileinfo_level level;
1085 union smb_handle_or_path file;
1086 const char *link_dest;
1088 } unix_link, unix_hlink;
1090 /* RAW_FILEINFO_SET_SEC_DESC */
1092 enum smb_setfileinfo_level level;
1094 union smb_handle_or_path file;
1095 uint32_t secinfo_flags;
1096 struct security_descriptor *sd;
1102 enum smb_fsinfo_level {
1103 RAW_QFS_GENERIC = 0xF000,
1104 RAW_QFS_DSKATTR, /* SMBdskattr */
1105 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
1106 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
1107 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
1108 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
1109 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
1110 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
1111 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
1112 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
1113 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
1114 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
1115 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
1116 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
1117 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
1118 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
1121 /* union for fsinfo() backend call. Note that there are no in
1122 structures, as this call only contains out parameters */
1124 /* generic interface */
1126 enum smb_fsinfo_level level;
1127 struct smb2_handle handle; /* only for smb2 */
1130 uint32_t block_size;
1131 uint64_t blocks_total;
1132 uint64_t blocks_free;
1135 uint32_t serial_number;
1137 uint32_t max_file_component_length;
1138 uint32_t device_type;
1139 uint32_t device_characteristics;
1140 uint64_t quota_soft;
1141 uint64_t quota_hard;
1142 uint64_t quota_flags;
1149 /* SMBdskattr interface */
1151 enum smb_fsinfo_level level;
1154 uint16_t units_total;
1155 uint16_t blocks_per_unit;
1156 uint16_t block_size;
1157 uint16_t units_free;
1161 /* trans2 RAW_QFS_ALLOCATION interface */
1163 enum smb_fsinfo_level level;
1167 uint32_t sectors_per_unit;
1168 uint32_t total_alloc_units;
1169 uint32_t avail_alloc_units;
1170 uint16_t bytes_per_sector;
1174 /* TRANS2 RAW_QFS_VOLUME interface */
1176 enum smb_fsinfo_level level;
1179 uint32_t serial_number;
1180 struct smb_wire_string volume_name;
1184 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
1186 enum smb_fsinfo_level level;
1187 struct smb2_handle handle; /* only for smb2 */
1191 uint32_t serial_number;
1192 struct smb_wire_string volume_name;
1196 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
1198 enum smb_fsinfo_level level;
1199 struct smb2_handle handle; /* only for smb2 */
1202 uint64_t total_alloc_units;
1203 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
1204 uint32_t sectors_per_unit;
1205 uint32_t bytes_per_sector;
1209 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
1211 enum smb_fsinfo_level level;
1212 struct smb2_handle handle; /* only for smb2 */
1215 uint32_t device_type;
1216 uint32_t characteristics;
1221 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
1223 enum smb_fsinfo_level level;
1224 struct smb2_handle handle; /* only for smb2 */
1228 uint32_t max_file_component_length;
1229 struct smb_wire_string fs_type;
1234 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1236 enum smb_fsinfo_level level;
1239 uint16_t major_version;
1240 uint16_t minor_version;
1241 uint64_t capability;
1245 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1247 enum smb_fsinfo_level level;
1248 struct smb2_handle handle; /* only for smb2 */
1251 uint64_t unknown[3];
1252 uint64_t quota_soft;
1253 uint64_t quota_hard;
1254 uint64_t quota_flags;
1256 } quota_information;
1258 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1260 enum smb_fsinfo_level level;
1261 struct smb2_handle handle; /* only for smb2 */
1264 uint64_t total_alloc_units;
1265 uint64_t call_avail_alloc_units;
1266 uint64_t actual_avail_alloc_units;
1267 uint32_t sectors_per_unit;
1268 uint32_t bytes_per_sector;
1270 } full_size_information;
1272 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1274 enum smb_fsinfo_level level;
1275 struct smb2_handle handle; /* only for smb2 */
1279 uint64_t unknown[6];
1281 } objectid_information;
1286 enum smb_open_level {
1295 RAW_OPEN_NTTRANS_CREATE,
1296 RAW_OPEN_OPENX_READX,
1300 /* the generic interface is defined to be equal to the NTCREATEX interface */
1301 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1303 /* union for open() backend call */
1306 * because the *.out.file structs are not aligned to the same offset for each level
1307 * we provide a hepler macro that should be used to find the current smb_handle structure
1309 #define SMB_OPEN_OUT_FILE(op, file) do { \
1310 switch (op->generic.level) { \
1311 case RAW_OPEN_OPEN: \
1312 file = &op->openold.out.file; \
1314 case RAW_OPEN_OPENX: \
1315 file = &op->openx.out.file; \
1317 case RAW_OPEN_MKNEW: \
1318 file = &op->mknew.out.file; \
1320 case RAW_OPEN_CREATE: \
1321 file = &op->create.out.file; \
1323 case RAW_OPEN_CTEMP: \
1324 file = &op->ctemp.out.file; \
1326 case RAW_OPEN_SPLOPEN: \
1327 file = &op->splopen.out.file; \
1329 case RAW_OPEN_NTCREATEX: \
1330 file = &op->ntcreatex.out.file; \
1332 case RAW_OPEN_T2OPEN: \
1333 file = &op->t2open.out.file; \
1335 case RAW_OPEN_NTTRANS_CREATE: \
1336 file = &op->nttrans.out.file; \
1338 case RAW_OPEN_OPENX_READX: \
1339 file = &op->openxreadx.out.file; \
1341 case RAW_OPEN_SMB2: \
1342 file = &op->smb2.out.file; \
1345 /* this must be a programmer error */ \
1350 /* SMBNTCreateX interface */
1352 enum smb_open_level level;
1356 uint32_t access_mask;
1357 uint64_t alloc_size;
1359 uint32_t share_access;
1360 uint32_t open_disposition;
1361 uint32_t create_options;
1362 uint32_t impersonation;
1363 uint8_t security_flags;
1364 /* NOTE: fname can also be a pointer to a
1365 uint64_t file_id if create_options has the
1366 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1369 /* these last 2 elements are only used in the
1370 NTTRANS varient of the call */
1371 struct security_descriptor *sec_desc;
1372 struct smb_ea_list *ea_list;
1375 union smb_handle file;
1376 uint8_t oplock_level;
1377 uint32_t create_action;
1383 uint64_t alloc_size;
1387 uint8_t is_directory;
1389 } ntcreatex, nttrans, generic;
1391 /* TRANS2_OPEN interface */
1393 enum smb_open_level level;
1397 uint16_t search_attrs;
1398 uint16_t file_attrs;
1405 struct ea_struct *eas;
1408 union smb_handle file;
1420 /* SMBopen interface */
1422 enum smb_open_level level;
1425 uint16_t search_attrs;
1429 union smb_handle file;
1437 /* SMBopenX interface */
1439 enum smb_open_level level;
1443 uint16_t search_attrs; /* not honoured by win2003 */
1444 uint16_t file_attrs;
1445 time_t write_time; /* not honoured by win2003 */
1447 uint32_t size; /* note that this sets the
1448 initial file size, not
1449 just allocation size */
1450 uint32_t timeout; /* not honoured by win2003 */
1454 union smb_handle file;
1462 uint32_t unique_fid;
1463 uint32_t access_mask;
1468 /* SMBmknew interface */
1470 enum smb_open_level level;
1477 union smb_handle file;
1481 /* SMBctemp interface */
1483 enum smb_open_level level;
1487 const char *directory;
1490 union smb_handle file;
1491 /* temp name, relative to directory */
1496 /* SMBsplopen interface */
1498 enum smb_open_level level;
1500 uint16_t setup_length;
1505 union smb_handle file;
1510 /* chained OpenX/ReadX interface */
1512 enum smb_open_level level;
1516 uint16_t search_attrs; /* not honoured by win2003 */
1517 uint16_t file_attrs;
1518 time_t write_time; /* not honoured by win2003 */
1520 uint32_t size; /* note that this sets the
1521 initial file size, not
1522 just allocation size */
1523 uint32_t timeout; /* not honoured by win2003 */
1533 union smb_handle file;
1541 uint32_t unique_fid;
1542 uint32_t access_mask;
1548 uint16_t compaction_mode;
1553 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100
1554 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800
1555 #define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001
1556 #define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080
1559 struct smb2_create {
1560 enum smb_open_level level;
1562 /* static body buffer 56 (0x38) bytes */
1563 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
1564 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
1565 uint32_t impersonation;
1566 uint32_t unknown3[4];
1567 uint32_t access_mask;
1570 uint32_t share_access;
1571 uint32_t open_disposition;
1572 uint32_t create_options;
1574 /* uint16_t fname_ofs */
1575 /* uint16_t fname_size */
1576 /* uint32_t blob_ofs; */
1577 /* uint32_t blob_size; */
1582 /* optional list of extended attributes */
1583 struct smb_ea_list eas;
1586 union smb_handle file;
1588 /* static body buffer 88 (0x58) bytes */
1589 /* uint16_t buffer_code; 0x59 = 0x58 + 1 */
1590 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
1591 uint32_t create_action;
1596 uint64_t alloc_size;
1600 /* struct smb2_handle handle;*/
1601 /* uint32_t blob_ofs; */
1602 /* uint32_t blob_size; */
1612 enum smb_read_level {
1620 #define RAW_READ_GENERIC RAW_READ_READX
1622 /* union for read() backend call
1624 note that .infoX.out.data will be allocated before the backend is
1625 called. It will be big enough to hold the maximum size asked for
1628 /* SMBreadX (and generic) interface */
1630 enum smb_read_level level;
1632 union smb_handle file;
1637 BOOL read_for_execute;
1642 uint16_t compaction_mode;
1647 /* SMBreadbraw interface */
1649 enum smb_read_level level;
1651 union smb_handle file;
1664 /* SMBlockandread interface */
1666 enum smb_read_level level;
1668 union smb_handle file;
1679 /* SMBread interface */
1681 enum smb_read_level level;
1683 union smb_handle file;
1696 enum smb_read_level level;
1698 union smb_handle file;
1700 /* static body buffer 48 (0x30) bytes */
1701 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1705 /* struct smb2_handle handle; */
1706 uint64_t unknown1; /* 0x0000000000000000 */
1707 uint64_t unknown2; /* 0x0000000000000000 */
1710 /* static body buffer 16 (0x10) bytes */
1711 /* uint16_t buffer_code; 0x11 = 0x10 + 1 */
1712 /* uint16_t data_ofs; */
1713 /* uint32_t data_size; */
1714 uint64_t unknown1; /* 0x0000000000000000 */
1723 enum smb_write_level {
1724 RAW_WRITE_WRITEUNLOCK,
1727 RAW_WRITE_WRITECLOSE,
1732 #define RAW_WRITE_GENERIC RAW_WRITE_WRITEX
1734 /* union for write() backend call
1737 /* SMBwriteX interface */
1739 enum smb_write_level level;
1741 union smb_handle file;
1746 const uint8_t *data;
1754 /* SMBwriteunlock interface */
1756 enum smb_write_level level;
1758 union smb_handle file;
1762 const uint8_t *data;
1769 /* SMBwrite interface */
1771 enum smb_write_level level;
1773 union smb_handle file;
1777 const uint8_t *data;
1784 /* SMBwriteclose interface */
1786 enum smb_write_level level;
1788 union smb_handle file;
1792 const uint8_t *data;
1799 /* SMBsplwrite interface */
1801 enum smb_write_level level;
1803 union smb_handle file;
1805 const uint8_t *data;
1811 enum smb_write_level level;
1813 union smb_handle file;
1815 /* static body buffer 48 (0x30) bytes */
1816 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1817 /* uint16_t data_ofs; */
1818 /* uint32_t data_size; */
1820 /* struct smb2_handle handle; */
1821 uint64_t unknown1; /* 0xFFFFFFFFFFFFFFFF */
1822 uint64_t unknown2; /* 0xFFFFFFFFFFFFFFFF */
1828 /* static body buffer 17 (0x11) bytes */
1829 /* uint16_t buffer_code; 0x11 = 0x10 + 1*/
1832 uint64_t unknown1; /* 0x0000000000000000 */
1838 enum smb_lock_level {
1845 /* the generic interface is defined to be equal to the lockingX interface */
1846 #define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
1848 /* union for lock() backend call
1851 /* SMBlockingX (and generic) interface */
1853 enum smb_lock_level level;
1855 union smb_handle file;
1860 struct smb_lock_entry {
1864 } *locks; /* unlocks are first in the arrray */
1868 /* SMBlock and SMBunlock interface */
1870 enum smb_lock_level level;
1872 union smb_handle file;
1880 enum smb_lock_level level;
1882 union smb_handle file;
1884 /* static body buffer 48 (0x30) bytes */
1885 /* uint16_t buffer_code; 0x30 */
1886 uint16_t unknown1; /* must be 0x0001 */
1888 /* struct smb2_handle handle; */
1892 #define SMB2_LOCK_FLAG_NONE 0x00000000
1893 #define SMB2_LOCK_FLAG_SHARED 0x00000001
1894 #define SMB2_LOCK_FLAG_EXCLUSIV 0x00000002
1895 #define SMB2_LOCK_FLAG_UNLOCK 0x00000004
1896 #define SMB2_LOCK_FLAG_NO_PENDING 0x00000010
1900 /* static body buffer 4 (0x04) bytes */
1901 /* uint16_t buffer_code; 0x04 */
1908 enum smb_close_level {
1914 #define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
1917 union for close() backend call
1920 /* SMBclose (and generic) interface */
1922 enum smb_close_level level;
1924 union smb_handle file;
1929 /* SMBsplclose interface - empty! */
1931 enum smb_close_level level;
1933 union smb_handle file;
1939 enum smb_close_level level;
1941 union smb_handle file;
1943 /* static body buffer 24 (0x18) bytes */
1944 /* uint16_t buffer_code; 0x18 */
1945 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
1946 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
1950 /* static body buffer 60 (0x3C) bytes */
1951 /* uint16_t buffer_code; 0x3C */
1958 uint64_t alloc_size;
1966 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1969 union for lpq() backend
1972 /* generic interface */
1974 enum smb_lpq_level level;
1979 /* SMBsplretq interface */
1981 enum smb_lpq_level level;
1989 uint16_t restart_idx;
2001 enum smb_ioctl_level {
2005 RAW_IOCTL_SMB2_NO_HANDLE
2009 union for ioctl() backend
2012 /* generic interface */
2014 enum smb_ioctl_level level;
2016 union smb_handle file;
2020 /* struct for SMBioctl */
2022 enum smb_ioctl_level level;
2024 union smb_handle file;
2033 /* struct for NT ioctl call */
2035 enum smb_ioctl_level level;
2037 union smb_handle file;
2051 enum smb_ioctl_level level;
2053 union smb_handle file;
2055 /* static body buffer 56 (0x38) bytes */
2056 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
2059 /*struct smb2_handle handle;*/
2060 /* uint32_t out_ofs; */
2061 /* uint32_t out_size; */
2063 /* uint32_t in_ofs; */
2064 /* uint32_t in_size; */
2065 uint32_t max_response_size;
2073 union smb_handle file;
2075 /* static body buffer 48 (0x30) bytes */
2076 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
2079 /* struct smb2_handle handle; */
2080 /* uint32_t in_ofs; */
2081 /* uint32_t in_size; */
2082 /* uint32_t out_ofs; */
2083 /* uint32_t out_size; */
2094 enum smb_flush_level {
2101 /* struct for SMBflush */
2103 enum smb_flush_level level;
2105 union smb_handle file;
2109 /* SMBflush with 0xFFFF wildcard fnum */
2111 enum smb_flush_level level;
2116 enum smb_flush_level level;
2118 union smb_handle file;
2124 /* struct for SMBcopy */
2139 /* struct for transact/transact2 call */
2147 uint8_t setup_count;
2149 const char *trans_name; /* SMBtrans only */
2155 uint8_t setup_count;
2162 /* struct for nttransact2 call */
2163 struct smb_nttrans {
2168 uint32_t setup_count;
2176 uint8_t setup_count; /* in units of 16 bit words */
2183 enum smb_notify_level {
2189 /* struct for nttrans change notify call */
2191 enum smb_notify_level level;
2194 union smb_handle file;
2195 uint32_t buffer_size;
2196 uint32_t completion_filter;
2201 uint32_t num_changes;
2202 struct notify_changes {
2204 struct smb_wire_string name;
2209 struct smb2_notify {
2210 enum smb_notify_level level;
2213 union smb_handle file;
2214 /* static body buffer 32 (0x20) bytes */
2215 /* uint16_t buffer_code; 0x32 */
2217 uint32_t buffer_size;
2218 /*struct smb2_handle file;*/
2219 uint32_t completion_filter;
2224 /* static body buffer 8 (0x08) bytes */
2225 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
2226 /* uint16_t blob_ofs; */
2227 /* uint16_t blob_size; */
2232 /* DATA_BLOB content */
2233 uint32_t num_changes;
2234 struct notify_changes *changes;
2239 enum smb_search_level {
2240 RAW_SEARCH_SEARCH, /* SMBsearch */
2241 RAW_SEARCH_FFIRST, /* SMBffirst */
2242 RAW_SEARCH_FUNIQUE, /* SMBfunique */
2243 RAW_SEARCH_TRANS2, /* SMBtrans2 */
2244 RAW_SEARCH_SMB2 /* SMB2 Find */
2247 enum smb_search_data_level {
2248 RAW_SEARCH_DATA_GENERIC = 0x10000, /* only used in the smbcli_ code */
2249 RAW_SEARCH_DATA_SEARCH,
2250 RAW_SEARCH_DATA_STANDARD = SMB_FIND_STANDARD,
2251 RAW_SEARCH_DATA_EA_SIZE = SMB_FIND_EA_SIZE,
2252 RAW_SEARCH_DATA_EA_LIST = SMB_FIND_EA_LIST,
2253 RAW_SEARCH_DATA_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
2254 RAW_SEARCH_DATA_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
2255 RAW_SEARCH_DATA_NAME_INFO = SMB_FIND_NAME_INFO,
2256 RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
2257 RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
2258 RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
2259 RAW_SEARCH_DATA_UNIX_INFO = SMB_FIND_UNIX_INFO,
2260 RAW_SEARCH_DATA_UNIX_INFO2 = SMB_FIND_UNIX_INFO2
2263 /* union for file search */
2264 union smb_search_first {
2266 enum smb_search_level level;
2267 enum smb_search_data_level data_level;
2270 /* search (old) findfirst interface.
2271 Also used for ffirst and funique. */
2273 enum smb_search_level level;
2274 enum smb_search_data_level data_level;
2278 uint16_t search_attrib;
2279 const char *pattern;
2286 /* trans2 findfirst interface */
2288 enum smb_search_level level;
2289 enum smb_search_data_level data_level;
2292 uint16_t search_attrib;
2295 uint32_t storage_type;
2296 const char *pattern;
2298 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2300 struct ea_name *ea_names;
2305 uint16_t end_of_search;
2310 SMB2 uses different level numbers for the same old SMB trans2 search levels
2312 #define SMB2_FIND_DIRECTORY_INFO 0x01
2313 #define SMB2_FIND_FULL_DIRECTORY_INFO 0x02
2314 #define SMB2_FIND_BOTH_DIRECTORY_INFO 0x03
2315 #define SMB2_FIND_NAME_INFO 0x0C
2316 #define SMB2_FIND_ID_BOTH_DIRECTORY_INFO 0x25
2317 #define SMB2_FIND_ID_FULL_DIRECTORY_INFO 0x26
2319 /* flags for RAW_FILEINFO_SMB2_ALL_EAS */
2320 #define SMB2_CONTINUE_FLAG_RESTART 0x01
2321 #define SMB2_CONTINUE_FLAG_SINGLE 0x02
2322 #define SMB2_CONTINUE_FLAG_NEW 0x10
2326 enum smb_search_level level;
2327 enum smb_search_data_level data_level;
2329 union smb_handle file;
2331 /* static body buffer 32 (0x20) bytes */
2332 /* uint16_t buffer_code; 0x21 = 0x20 + 1 */
2334 uint8_t continue_flags; /* SMB2_CONTINUE_FLAG_* */
2335 uint32_t unknown; /* perhaps a continue token? */
2336 /* struct smb2_handle handle; */
2337 /* uint16_t pattern_ofs; */
2338 /* uint16_t pattern_size; */
2339 uint32_t max_response_size;
2342 const char *pattern;
2345 /* static body buffer 8 (0x08) bytes */
2346 /* uint16_t buffer_code; 0x08 */
2347 /* uint16_t blob_ofs; */
2348 /* uint32_t blob_size; */
2356 /* union for file search continue */
2357 union smb_search_next {
2359 enum smb_search_level level;
2360 enum smb_search_data_level data_level;
2363 /* search (old) findnext interface. Also used
2364 for ffirst when continuing */
2366 enum smb_search_level level;
2367 enum smb_search_data_level data_level;
2371 uint16_t search_attrib;
2372 struct smb_search_id {
2376 uint32_t server_cookie;
2377 uint32_t client_cookie;
2385 /* trans2 findnext interface */
2387 enum smb_search_level level;
2388 enum smb_search_data_level data_level;
2393 uint32_t resume_key;
2395 const char *last_name;
2397 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2399 struct ea_name *ea_names;
2403 uint16_t end_of_search;
2408 struct smb2_find smb2;
2411 /* union for search reply file data */
2412 union smb_search_data {
2414 * search (old) findfirst
2415 * RAW_SEARCH_DATA_SEARCH
2421 struct smb_search_id id;
2425 /* trans2 findfirst RAW_SEARCH_DATA_STANDARD level */
2427 uint32_t resume_key;
2432 uint32_t alloc_size;
2434 struct smb_wire_string name;
2437 /* trans2 findfirst RAW_SEARCH_DATA_EA_SIZE level */
2439 uint32_t resume_key;
2444 uint32_t alloc_size;
2447 struct smb_wire_string name;
2450 /* trans2 findfirst RAW_SEARCH_DATA_EA_LIST level */
2452 uint32_t resume_key;
2457 uint32_t alloc_size;
2459 struct smb_ea_list eas;
2460 struct smb_wire_string name;
2463 /* RAW_SEARCH_DATA_DIRECTORY_INFO interface */
2465 uint32_t file_index;
2471 uint64_t alloc_size;
2473 struct smb_wire_string name;
2476 /* RAW_SEARCH_DATA_FULL_DIRECTORY_INFO interface */
2478 uint32_t file_index;
2484 uint64_t alloc_size;
2487 struct smb_wire_string name;
2488 } full_directory_info;
2490 /* RAW_SEARCH_DATA_NAME_INFO interface */
2492 uint32_t file_index;
2493 struct smb_wire_string name;
2496 /* RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO interface */
2498 uint32_t file_index;
2504 uint64_t alloc_size;
2507 struct smb_wire_string short_name;
2508 struct smb_wire_string name;
2509 } both_directory_info;
2511 /* RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO interface */
2513 uint32_t file_index;
2519 uint64_t alloc_size;
2523 struct smb_wire_string name;
2524 } id_full_directory_info;
2526 /* RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO interface */
2528 uint32_t file_index;
2534 uint64_t alloc_size;
2538 struct smb_wire_string short_name;
2539 struct smb_wire_string name;
2540 } id_both_directory_info;
2542 /* RAW_SEARCH_DATA_UNIX_INFO interface */
2544 uint32_t file_index;
2546 uint64_t alloc_size;
2547 NTTIME status_change_time;
2556 uint64_t permissions;
2561 /* RAW_SEARCH_DATA_UNIX_INFO2 interface */
2563 uint32_t file_index;
2564 uint64_t end_of_file;
2566 NTTIME status_change_time;
2575 uint64_t permissions;
2578 uint32_t file_flags;
2579 uint32_t flags_mask;
2580 struct smb_wire_string name;
2584 /* Callback function passed to the raw search interface. */
2585 typedef BOOL (*smbcli_search_callback)(void *private, const union smb_search_data *file);
2587 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
2589 /* union for file search close */
2590 union smb_search_close {
2592 enum smb_search_close_level level;
2595 /* SMBfclose (old search) interface */
2597 enum smb_search_close_level level;
2600 /* max_count and search_attrib are not used, but are present */
2602 uint16_t search_attrib;
2603 struct smb_search_id id;
2607 /* SMBfindclose interface */
2609 enum smb_search_close_level level;
2619 struct for SMBecho call
2623 uint16_t repeat_count;
2629 uint16_t sequence_number;
2636 struct for shadow copy volumes
2638 struct smb_shadow_copy {
2640 union smb_handle file;
2644 uint32_t num_volumes;
2650 #endif /* __LIBCLI_RAW_INTERFACES_H__ */