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, RAW_RENAME_NTTRANS};
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;
210 /* NT TRANS rename interface */
212 enum smb_rename_level level;
215 union smb_handle file;
216 uint16_t flags;/* see RENAME_REPLACE_IF_EXISTS */
217 const char *new_name;
222 enum smb_tcon_level {
228 /* union used in tree connect call */
230 /* generic interface */
232 enum smb_tcon_level level;
235 /* SMBtcon interface */
237 enum smb_tcon_level level;
241 const char *password;
250 /* SMBtconX interface */
252 enum smb_tcon_level level;
268 /* SMB2 TreeConnect */
269 struct smb2_tree_connect {
270 enum smb_tcon_level level;
273 /* static body buffer 8 (0x08) bytes */
275 /* uint16_t path_ofs */
276 /* uint16_t path_size */
278 const char *path; /* as non-terminated UTF-16 on the wire */
281 /* static body buffer 16 (0x10) bytes */
282 /* uint16_t buffer_code; 0x10 */
286 uint32_t capabilities;
287 uint32_t access_mask;
289 /* extracted from the SMB2 header */
296 enum smb_sesssetup_level {
299 RAW_SESSSETUP_SPNEGO,
303 /* union used in session_setup call */
304 union smb_sesssetup {
305 /* the pre-NT1 interface */
307 enum smb_sesssetup_level level;
329 /* the NT1 interface */
331 enum smb_sesssetup_level level;
338 uint32_t capabilities;
356 /* the SPNEGO interface */
358 enum smb_sesssetup_level level;
365 uint32_t capabilities;
369 const char *workgroup;
381 /* SMB2 SessionSetup */
382 struct smb2_session_setup {
383 enum smb_sesssetup_level level;
386 /* static body 24 (0x18) bytes */
388 uint8_t security_mode;
389 uint32_t capabilities;
391 /* uint16_t secblob_ofs */
392 /* uint16_t secblob_size */
393 uint64_t previous_sessionid;
398 /* body buffer 8 (0x08) bytes */
399 uint16_t session_flags;
400 /* uint16_t secblob_ofs */
401 /* uint16_t secblob_size */
405 /* extracted from the SMB2 header */
411 /* Note that the specified enum values are identical to the actual info-levels used
414 enum smb_fileinfo_level {
415 RAW_FILEINFO_GENERIC = 0xF000,
416 RAW_FILEINFO_GETATTR, /* SMBgetatr */
417 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
418 RAW_FILEINFO_SEC_DESC, /* NT_TRANSACT_QUERY_SECURITY_DESC */
419 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
420 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
421 RAW_FILEINFO_EA_LIST = SMB_QFILEINFO_EA_LIST,
422 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
423 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
424 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
425 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
426 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
427 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
428 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
429 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
430 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
431 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
432 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
433 RAW_FILEINFO_UNIX_INFO2 = SMB_QFILEINFO_UNIX_INFO2,
434 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
435 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
436 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
437 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
438 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
439 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
440 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
441 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
442 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
443 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
444 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
445 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
446 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
447 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
448 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
449 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION,
450 /* SMB2 specific levels */
451 RAW_FILEINFO_SMB2_ALL_EAS = 0x0f01,
452 RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
455 /* union used in qfileinfo() and qpathinfo() backend calls */
457 /* generic interface:
458 * matches RAW_FILEINFO_GENERIC */
460 enum smb_fileinfo_level level;
462 union smb_handle_or_path file;
470 struct smb_wire_string name;
480 struct smb_wire_string fname;
481 struct smb_wire_string alt_fname;
482 uint8_t delete_pending;
484 uint64_t compressed_size;
488 uint8_t cluster_shift;
490 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
493 uint32_t alignment_requirement;
494 uint32_t reparse_tag;
496 struct stream_struct {
499 struct smb_wire_string stream_name;
505 /* SMBgetatr interface:
506 * matches RAW_FILEINFO_GETATTR */
508 enum smb_fileinfo_level level;
510 union smb_handle_or_path file;
519 /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
521 enum smb_fileinfo_level level;
523 union smb_handle_or_path file;
533 } getattre, standard;
535 /* trans2 RAW_FILEINFO_EA_SIZE interface */
537 enum smb_fileinfo_level level;
539 union smb_handle_or_path file;
552 /* trans2 RAW_FILEINFO_EA_LIST interface */
554 enum smb_fileinfo_level level;
556 union smb_handle_or_path file;
559 struct smb_wire_string name;
565 struct ea_struct *eas;
569 /* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */
571 enum smb_fileinfo_level level;
573 union smb_handle_or_path file;
574 /* SMB2 only - SMB2_CONTINUE_FLAG_* */
575 uint8_t continue_flags;
577 struct smb_ea_list out;
580 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
581 only valid for a QPATHNAME call - no returned data */
583 enum smb_fileinfo_level level;
585 union smb_handle_or_path file;
589 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
591 enum smb_fileinfo_level level;
593 union smb_handle_or_path file;
605 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
607 enum smb_fileinfo_level level;
609 union smb_handle_or_path file;
620 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
622 enum smb_fileinfo_level level;
624 union smb_handle_or_path file;
631 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
633 enum smb_fileinfo_level level;
635 union smb_handle_or_path file;
638 struct smb_wire_string fname;
642 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
644 enum smb_fileinfo_level level;
646 union smb_handle_or_path file;
657 uint8_t delete_pending;
660 struct smb_wire_string fname;
664 /* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */
666 enum smb_fileinfo_level level;
668 union smb_handle_or_path file;
680 uint8_t delete_pending;
685 uint32_t access_mask;
688 struct smb_wire_string fname;
692 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
694 enum smb_fileinfo_level level;
696 union smb_handle_or_path file;
699 struct smb_wire_string fname;
703 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
705 enum smb_fileinfo_level level;
707 union smb_handle_or_path file;
709 struct stream_information {
711 struct stream_struct *streams;
715 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
717 enum smb_fileinfo_level level;
719 union smb_handle_or_path file;
722 uint64_t compressed_size;
726 uint8_t cluster_shift;
730 /* RAW_FILEINFO_UNIX_BASIC interface */
732 enum smb_fileinfo_level level;
734 union smb_handle_or_path file;
737 uint64_t end_of_file;
739 NTTIME status_change_time;
748 uint64_t permissions;
753 /* RAW_FILEINFO_UNIX_INFO2 interface */
755 enum smb_fileinfo_level level;
757 union smb_handle_or_path file;
760 uint64_t end_of_file;
762 NTTIME status_change_time;
771 uint64_t permissions;
779 /* RAW_FILEINFO_UNIX_LINK interface */
781 enum smb_fileinfo_level level;
783 union smb_handle_or_path file;
786 struct smb_wire_string link_dest;
790 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
792 enum smb_fileinfo_level level;
794 union smb_handle_or_path file;
799 } internal_information;
801 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
803 enum smb_fileinfo_level level;
805 union smb_handle_or_path file;
808 uint32_t access_flags;
810 } access_information;
812 /* RAW_FILEINFO_POSITION_INFORMATION interface */
814 enum smb_fileinfo_level level;
816 union smb_handle_or_path file;
821 } position_information;
823 /* RAW_FILEINFO_MODE_INFORMATION interface */
825 enum smb_fileinfo_level level;
827 union smb_handle_or_path file;
834 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
836 enum smb_fileinfo_level level;
838 union smb_handle_or_path file;
841 uint32_t alignment_requirement;
843 } alignment_information;
845 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
847 enum smb_fileinfo_level level;
849 union smb_handle_or_path file;
860 } network_open_information;
863 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
865 enum smb_fileinfo_level level;
867 union smb_handle_or_path file;
871 uint32_t reparse_tag;
873 } attribute_tag_information;
875 /* RAW_FILEINFO_SEC_DESC */
877 enum smb_fileinfo_level level;
879 union smb_handle_or_path file;
880 uint32_t secinfo_flags;
883 struct security_descriptor *sd;
889 enum smb_setfileinfo_level {
890 RAW_SFILEINFO_GENERIC = 0xF000,
891 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
892 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
893 RAW_SFILEINFO_SEC_DESC, /* NT_TRANSACT_SET_SECURITY_DESC */
894 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
895 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
896 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
897 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
898 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
899 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
900 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
901 RAW_SFILEINFO_UNIX_INFO2 = SMB_SFILEINFO_UNIX_INFO2,
902 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
903 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
904 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
905 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
906 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
907 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
908 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
909 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
910 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
911 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
912 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
913 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
914 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
915 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
916 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040,
918 /* cope with breakage in SMB2 */
919 RAW_SFILEINFO_RENAME_INFORMATION_SMB2 = SMB_SFILEINFO_RENAME_INFORMATION|0x80000000,
922 /* union used in setfileinfo() and setpathinfo() calls */
923 union smb_setfileinfo {
924 /* generic interface */
926 enum smb_setfileinfo_level level;
928 union smb_handle_or_path file;
932 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
934 enum smb_setfileinfo_level level;
936 union smb_handle_or_path file;
942 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo()
943 also RAW_SFILEINFO_STANDARD */
945 enum smb_setfileinfo_level level;
947 union smb_handle_or_path file;
951 /* notice that size, alloc_size and attrib are not settable,
952 unlike the corresponding qfileinfo level */
954 } setattre, standard;
956 /* RAW_SFILEINFO_EA_SET interface */
958 enum smb_setfileinfo_level level;
960 union smb_handle_or_path file;
962 struct ea_struct *eas;
966 /* RAW_SFILEINFO_BASIC_INFO and
967 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
969 enum smb_setfileinfo_level level;
971 union smb_handle_or_path file;
980 /* RAW_SFILEINFO_DISPOSITION_INFO and
981 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
983 enum smb_setfileinfo_level level;
985 union smb_handle_or_path file;
986 bool delete_on_close;
990 /* RAW_SFILEINFO_ALLOCATION_INFO and
991 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
993 enum smb_setfileinfo_level level;
995 union smb_handle_or_path file;
996 /* w2k3 rounds this up to nearest 4096 */
1001 /* RAW_SFILEINFO_END_OF_FILE_INFO and
1002 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
1004 enum smb_setfileinfo_level level;
1006 union smb_handle_or_path file;
1011 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
1013 enum smb_setfileinfo_level level;
1015 union smb_handle_or_path file;
1018 const char *new_name;
1020 } rename_information;
1022 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
1024 enum smb_setfileinfo_level level;
1026 union smb_handle_or_path file;
1029 } position_information;
1031 /* RAW_SFILEINFO_MODE_INFORMATION interface */
1033 enum smb_setfileinfo_level level;
1035 union smb_handle_or_path file;
1036 /* valid values seem to be 0, 2, 4 and 6 */
1041 /* RAW_SFILEINFO_UNIX_BASIC interface */
1043 enum smb_setfileinfo_level level;
1045 union smb_handle_or_path file;
1046 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
1047 uint64_t end_of_file;
1049 NTTIME status_change_time;
1058 uint64_t permissions;
1063 /* RAW_SFILEINFO_UNIX_INFO2 interface */
1065 enum smb_setfileinfo_level level;
1067 union smb_handle_or_path file;
1068 uint64_t end_of_file;
1070 NTTIME status_change_time;
1079 uint64_t permissions;
1082 uint32_t file_flags;
1083 uint32_t flags_mask;
1087 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
1089 enum smb_setfileinfo_level level;
1091 union smb_handle_or_path file;
1092 const char *link_dest;
1094 } unix_link, unix_hlink;
1096 /* RAW_FILEINFO_SET_SEC_DESC */
1098 enum smb_setfileinfo_level level;
1100 union smb_handle_or_path file;
1101 uint32_t secinfo_flags;
1102 struct security_descriptor *sd;
1108 enum smb_fsinfo_level {
1109 RAW_QFS_GENERIC = 0xF000,
1110 RAW_QFS_DSKATTR, /* SMBdskattr */
1111 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
1112 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
1113 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
1114 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
1115 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
1116 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
1117 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
1118 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
1119 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
1120 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
1121 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
1122 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
1123 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
1124 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
1127 /* union for fsinfo() backend call. Note that there are no in
1128 structures, as this call only contains out parameters */
1130 /* generic interface */
1132 enum smb_fsinfo_level level;
1133 struct smb2_handle handle; /* only for smb2 */
1136 uint32_t block_size;
1137 uint64_t blocks_total;
1138 uint64_t blocks_free;
1141 uint32_t serial_number;
1143 uint32_t max_file_component_length;
1144 uint32_t device_type;
1145 uint32_t device_characteristics;
1146 uint64_t quota_soft;
1147 uint64_t quota_hard;
1148 uint64_t quota_flags;
1155 /* SMBdskattr interface */
1157 enum smb_fsinfo_level level;
1160 uint16_t units_total;
1161 uint16_t blocks_per_unit;
1162 uint16_t block_size;
1163 uint16_t units_free;
1167 /* trans2 RAW_QFS_ALLOCATION interface */
1169 enum smb_fsinfo_level level;
1173 uint32_t sectors_per_unit;
1174 uint32_t total_alloc_units;
1175 uint32_t avail_alloc_units;
1176 uint16_t bytes_per_sector;
1180 /* TRANS2 RAW_QFS_VOLUME interface */
1182 enum smb_fsinfo_level level;
1185 uint32_t serial_number;
1186 struct smb_wire_string volume_name;
1190 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
1192 enum smb_fsinfo_level level;
1193 struct smb2_handle handle; /* only for smb2 */
1197 uint32_t serial_number;
1198 struct smb_wire_string volume_name;
1202 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
1204 enum smb_fsinfo_level level;
1205 struct smb2_handle handle; /* only for smb2 */
1208 uint64_t total_alloc_units;
1209 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
1210 uint32_t sectors_per_unit;
1211 uint32_t bytes_per_sector;
1215 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
1217 enum smb_fsinfo_level level;
1218 struct smb2_handle handle; /* only for smb2 */
1221 uint32_t device_type;
1222 uint32_t characteristics;
1227 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
1229 enum smb_fsinfo_level level;
1230 struct smb2_handle handle; /* only for smb2 */
1234 uint32_t max_file_component_length;
1235 struct smb_wire_string fs_type;
1240 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1242 enum smb_fsinfo_level level;
1245 uint16_t major_version;
1246 uint16_t minor_version;
1247 uint64_t capability;
1251 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1253 enum smb_fsinfo_level level;
1254 struct smb2_handle handle; /* only for smb2 */
1257 uint64_t unknown[3];
1258 uint64_t quota_soft;
1259 uint64_t quota_hard;
1260 uint64_t quota_flags;
1262 } quota_information;
1264 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1266 enum smb_fsinfo_level level;
1267 struct smb2_handle handle; /* only for smb2 */
1270 uint64_t total_alloc_units;
1271 uint64_t call_avail_alloc_units;
1272 uint64_t actual_avail_alloc_units;
1273 uint32_t sectors_per_unit;
1274 uint32_t bytes_per_sector;
1276 } full_size_information;
1278 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1280 enum smb_fsinfo_level level;
1281 struct smb2_handle handle; /* only for smb2 */
1285 uint64_t unknown[6];
1287 } objectid_information;
1292 enum smb_open_level {
1301 RAW_OPEN_NTTRANS_CREATE,
1302 RAW_OPEN_OPENX_READX,
1306 /* the generic interface is defined to be equal to the NTCREATEX interface */
1307 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1309 /* union for open() backend call */
1312 * because the *.out.file structs are not aligned to the same offset for each level
1313 * we provide a hepler macro that should be used to find the current smb_handle structure
1315 #define SMB_OPEN_OUT_FILE(op, file) do { \
1316 switch (op->generic.level) { \
1317 case RAW_OPEN_OPEN: \
1318 file = &op->openold.out.file; \
1320 case RAW_OPEN_OPENX: \
1321 file = &op->openx.out.file; \
1323 case RAW_OPEN_MKNEW: \
1324 file = &op->mknew.out.file; \
1326 case RAW_OPEN_CREATE: \
1327 file = &op->create.out.file; \
1329 case RAW_OPEN_CTEMP: \
1330 file = &op->ctemp.out.file; \
1332 case RAW_OPEN_SPLOPEN: \
1333 file = &op->splopen.out.file; \
1335 case RAW_OPEN_NTCREATEX: \
1336 file = &op->ntcreatex.out.file; \
1338 case RAW_OPEN_T2OPEN: \
1339 file = &op->t2open.out.file; \
1341 case RAW_OPEN_NTTRANS_CREATE: \
1342 file = &op->nttrans.out.file; \
1344 case RAW_OPEN_OPENX_READX: \
1345 file = &op->openxreadx.out.file; \
1347 case RAW_OPEN_SMB2: \
1348 file = &op->smb2.out.file; \
1351 /* this must be a programmer error */ \
1356 /* SMBNTCreateX interface */
1358 enum smb_open_level level;
1362 uint32_t access_mask;
1363 uint64_t alloc_size;
1365 uint32_t share_access;
1366 uint32_t open_disposition;
1367 uint32_t create_options;
1368 uint32_t impersonation;
1369 uint8_t security_flags;
1370 /* NOTE: fname can also be a pointer to a
1371 uint64_t file_id if create_options has the
1372 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1375 /* these last 2 elements are only used in the
1376 NTTRANS varient of the call */
1377 struct security_descriptor *sec_desc;
1378 struct smb_ea_list *ea_list;
1381 union smb_handle file;
1382 uint8_t oplock_level;
1383 uint32_t create_action;
1389 uint64_t alloc_size;
1393 uint8_t is_directory;
1395 } ntcreatex, nttrans, generic;
1397 /* TRANS2_OPEN interface */
1399 enum smb_open_level level;
1403 uint16_t search_attrs;
1404 uint16_t file_attrs;
1411 struct ea_struct *eas;
1414 union smb_handle file;
1426 /* SMBopen interface */
1428 enum smb_open_level level;
1431 uint16_t search_attrs;
1435 union smb_handle file;
1443 /* SMBopenX interface */
1445 enum smb_open_level level;
1449 uint16_t search_attrs; /* not honoured by win2003 */
1450 uint16_t file_attrs;
1451 time_t write_time; /* not honoured by win2003 */
1453 uint32_t size; /* note that this sets the
1454 initial file size, not
1455 just allocation size */
1456 uint32_t timeout; /* not honoured by win2003 */
1460 union smb_handle file;
1468 uint32_t unique_fid;
1469 uint32_t access_mask;
1474 /* SMBmknew interface */
1476 enum smb_open_level level;
1483 union smb_handle file;
1487 /* SMBctemp interface */
1489 enum smb_open_level level;
1493 const char *directory;
1496 union smb_handle file;
1497 /* temp name, relative to directory */
1502 /* SMBsplopen interface */
1504 enum smb_open_level level;
1506 uint16_t setup_length;
1511 union smb_handle file;
1516 /* chained OpenX/ReadX interface */
1518 enum smb_open_level level;
1522 uint16_t search_attrs; /* not honoured by win2003 */
1523 uint16_t file_attrs;
1524 time_t write_time; /* not honoured by win2003 */
1526 uint32_t size; /* note that this sets the
1527 initial file size, not
1528 just allocation size */
1529 uint32_t timeout; /* not honoured by win2003 */
1539 union smb_handle file;
1547 uint32_t unique_fid;
1548 uint32_t access_mask;
1554 uint16_t compaction_mode;
1559 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100
1560 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800
1561 #define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001
1562 #define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080
1565 struct smb2_create {
1566 enum smb_open_level level;
1568 /* static body buffer 56 (0x38) bytes */
1569 uint8_t security_flags; /* SMB2_SECURITY_* */
1570 uint8_t oplock_level; /* SMB2_OPLOCK_LEVEL_* */
1571 uint32_t impersonation_level; /* SMB2_IMPERSONATION_* */
1572 uint64_t create_flags;
1574 uint32_t desired_access;
1575 uint32_t file_attributes;
1576 uint32_t share_access; /* NTCREATEX_SHARE_ACCESS_* */
1577 uint32_t create_disposition; /* NTCREATEX_DISP_* */
1578 uint32_t create_options; /* NTCREATEX_OPTIONS_* */
1580 /* uint16_t fname_ofs */
1581 /* uint16_t fname_size */
1582 /* uint32_t blob_ofs; */
1583 /* uint32_t blob_size; */
1588 /* optional list of extended attributes */
1589 struct smb_ea_list eas;
1591 struct smb2_create_blobs {
1593 struct smb2_create_blob {
1600 union smb_handle file;
1602 /* static body buffer 88 (0x58) bytes */
1603 /* uint16_t buffer_code; 0x59 = 0x58 + 1 */
1604 uint8_t oplock_level;
1606 uint32_t create_action;
1611 uint64_t alloc_size;
1615 /* struct smb2_handle handle;*/
1616 /* uint32_t blob_ofs; */
1617 /* uint32_t blob_size; */
1627 enum smb_read_level {
1635 #define RAW_READ_GENERIC RAW_READ_READX
1637 /* union for read() backend call
1639 note that .infoX.out.data will be allocated before the backend is
1640 called. It will be big enough to hold the maximum size asked for
1643 /* SMBreadX (and generic) interface */
1645 enum smb_read_level level;
1647 union smb_handle file;
1652 bool read_for_execute;
1657 uint16_t compaction_mode;
1662 /* SMBreadbraw interface */
1664 enum smb_read_level level;
1666 union smb_handle file;
1679 /* SMBlockandread interface */
1681 enum smb_read_level level;
1683 union smb_handle file;
1694 /* SMBread interface */
1696 enum smb_read_level level;
1698 union smb_handle file;
1711 enum smb_read_level level;
1713 union smb_handle file;
1715 /* static body buffer 48 (0x30) bytes */
1716 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1721 /* struct smb2_handle handle; */
1725 /* the docs give no indication of what
1726 these channel variables are for */
1727 uint16_t channel_offset;
1728 uint16_t channel_length;
1731 /* static body buffer 16 (0x10) bytes */
1732 /* uint16_t buffer_code; 0x11 = 0x10 + 1 */
1733 /* uint8_t data_ofs; */
1734 /* uint8_t reserved; */
1735 /* uint32_t data_size; */
1746 enum smb_write_level {
1747 RAW_WRITE_WRITEUNLOCK,
1750 RAW_WRITE_WRITECLOSE,
1755 #define RAW_WRITE_GENERIC RAW_WRITE_WRITEX
1757 /* union for write() backend call
1760 /* SMBwriteX interface */
1762 enum smb_write_level level;
1764 union smb_handle file;
1769 const uint8_t *data;
1777 /* SMBwriteunlock interface */
1779 enum smb_write_level level;
1781 union smb_handle file;
1785 const uint8_t *data;
1792 /* SMBwrite interface */
1794 enum smb_write_level level;
1796 union smb_handle file;
1800 const uint8_t *data;
1807 /* SMBwriteclose interface */
1809 enum smb_write_level level;
1811 union smb_handle file;
1815 const uint8_t *data;
1822 /* SMBsplwrite interface */
1824 enum smb_write_level level;
1826 union smb_handle file;
1828 const uint8_t *data;
1834 enum smb_write_level level;
1836 union smb_handle file;
1838 /* static body buffer 48 (0x30) bytes */
1839 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
1840 /* uint16_t data_ofs; */
1841 /* uint32_t data_size; */
1843 /* struct smb2_handle handle; */
1844 uint64_t unknown1; /* 0xFFFFFFFFFFFFFFFF */
1845 uint64_t unknown2; /* 0xFFFFFFFFFFFFFFFF */
1851 /* static body buffer 17 (0x11) bytes */
1852 /* uint16_t buffer_code; 0x11 = 0x10 + 1*/
1855 uint64_t unknown1; /* 0x0000000000000000 */
1861 enum smb_lock_level {
1869 #define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
1871 /* union for lock() backend call
1874 /* SMBlockingX and generic interface */
1876 enum smb_lock_level level;
1878 union smb_handle file;
1883 struct smb_lock_entry {
1887 } *locks; /* unlocks are first in the arrray */
1891 /* SMBlock and SMBunlock interface */
1893 enum smb_lock_level level;
1895 union smb_handle file;
1903 enum smb_lock_level level;
1905 union smb_handle file;
1907 /* static body buffer 48 (0x30) bytes */
1908 /* uint16_t buffer_code; 0x30 */
1909 uint16_t lock_count;
1911 /* struct smb2_handle handle; */
1912 struct smb2_lock_element {
1915 /* these flags are the same as the SMB2 lock flags */
1916 #define SMB2_LOCK_FLAG_NONE 0x00000000
1917 #define SMB2_LOCK_FLAG_SHARED 0x00000001
1918 #define SMB2_LOCK_FLAG_EXCLUSIVE 0x00000002
1919 #define SMB2_LOCK_FLAG_UNLOCK 0x00000004
1920 #define SMB2_LOCK_FLAG_FAIL_IMMEDIATELY 0x00000010
1926 /* static body buffer 4 (0x04) bytes */
1927 /* uint16_t buffer_code; 0x04 */
1934 enum smb_lock_level level;
1936 union smb_handle file;
1938 /* static body buffer 24 (0x18) bytes */
1939 uint8_t oplock_level;
1942 /* struct smb2_handle handle; */
1948 enum smb_close_level {
1954 #define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
1957 union for close() backend call
1960 /* SMBclose (and generic) interface */
1962 enum smb_close_level level;
1964 union smb_handle file;
1969 /* SMBsplclose interface - empty! */
1971 enum smb_close_level level;
1973 union smb_handle file;
1979 enum smb_close_level level;
1981 union smb_handle file;
1983 /* static body buffer 24 (0x18) bytes */
1984 /* uint16_t buffer_code; 0x18 */
1985 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
1986 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
1990 /* static body buffer 60 (0x3C) bytes */
1991 /* uint16_t buffer_code; 0x3C */
1998 uint64_t alloc_size;
2006 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
2009 union for lpq() backend
2012 /* generic interface */
2014 enum smb_lpq_level level;
2019 /* SMBsplretq interface */
2021 enum smb_lpq_level level;
2029 uint16_t restart_idx;
2041 enum smb_ioctl_level {
2045 RAW_IOCTL_SMB2_NO_HANDLE
2049 union for ioctl() backend
2052 /* generic interface */
2054 enum smb_ioctl_level level;
2056 union smb_handle file;
2060 /* struct for SMBioctl */
2062 enum smb_ioctl_level level;
2064 union smb_handle file;
2073 /* struct for NT ioctl call */
2075 enum smb_ioctl_level level;
2077 union smb_handle file;
2091 enum smb_ioctl_level level;
2093 union smb_handle file;
2095 /* static body buffer 56 (0x38) bytes */
2096 /* uint16_t buffer_code; 0x39 = 0x38 + 1 */
2099 /*struct smb2_handle handle;*/
2100 /* uint32_t out_ofs; */
2101 /* uint32_t out_size; */
2103 /* uint32_t in_ofs; */
2104 /* uint32_t in_size; */
2105 uint32_t max_response_size;
2113 union smb_handle file;
2115 /* static body buffer 48 (0x30) bytes */
2116 /* uint16_t buffer_code; 0x31 = 0x30 + 1 */
2119 /* struct smb2_handle handle; */
2120 /* uint32_t in_ofs; */
2121 /* uint32_t in_size; */
2122 /* uint32_t out_ofs; */
2123 /* uint32_t out_size; */
2134 enum smb_flush_level {
2141 /* struct for SMBflush */
2143 enum smb_flush_level level;
2145 union smb_handle file;
2149 /* SMBflush with 0xFFFF wildcard fnum */
2151 enum smb_flush_level level;
2156 enum smb_flush_level level;
2158 union smb_handle file;
2164 /* struct for SMBcopy */
2179 /* struct for transact/transact2 call */
2187 uint8_t setup_count;
2189 const char *trans_name; /* SMBtrans only */
2195 uint8_t setup_count;
2202 /* struct for nttransact2 call */
2203 struct smb_nttrans {
2208 uint32_t setup_count;
2216 uint8_t setup_count; /* in units of 16 bit words */
2223 enum smb_notify_level {
2229 /* struct for nttrans change notify call */
2231 enum smb_notify_level level;
2234 union smb_handle file;
2235 uint32_t buffer_size;
2236 uint32_t completion_filter;
2241 uint32_t num_changes;
2242 struct notify_changes {
2244 struct smb_wire_string name;
2249 struct smb2_notify {
2250 enum smb_notify_level level;
2253 union smb_handle file;
2254 /* static body buffer 32 (0x20) bytes */
2255 /* uint16_t buffer_code; 0x32 */
2257 uint32_t buffer_size;
2258 /*struct smb2_handle file;*/
2259 uint32_t completion_filter;
2264 /* static body buffer 8 (0x08) bytes */
2265 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
2266 /* uint16_t blob_ofs; */
2267 /* uint16_t blob_size; */
2272 /* DATA_BLOB content */
2273 uint32_t num_changes;
2274 struct notify_changes *changes;
2279 enum smb_search_level {
2280 RAW_SEARCH_SEARCH, /* SMBsearch */
2281 RAW_SEARCH_FFIRST, /* SMBffirst */
2282 RAW_SEARCH_FUNIQUE, /* SMBfunique */
2283 RAW_SEARCH_TRANS2, /* SMBtrans2 */
2284 RAW_SEARCH_SMB2 /* SMB2 Find */
2287 enum smb_search_data_level {
2288 RAW_SEARCH_DATA_GENERIC = 0x10000, /* only used in the smbcli_ code */
2289 RAW_SEARCH_DATA_SEARCH,
2290 RAW_SEARCH_DATA_STANDARD = SMB_FIND_STANDARD,
2291 RAW_SEARCH_DATA_EA_SIZE = SMB_FIND_EA_SIZE,
2292 RAW_SEARCH_DATA_EA_LIST = SMB_FIND_EA_LIST,
2293 RAW_SEARCH_DATA_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
2294 RAW_SEARCH_DATA_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
2295 RAW_SEARCH_DATA_NAME_INFO = SMB_FIND_NAME_INFO,
2296 RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
2297 RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
2298 RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
2299 RAW_SEARCH_DATA_UNIX_INFO = SMB_FIND_UNIX_INFO,
2300 RAW_SEARCH_DATA_UNIX_INFO2 = SMB_FIND_UNIX_INFO2
2303 /* union for file search */
2304 union smb_search_first {
2306 enum smb_search_level level;
2307 enum smb_search_data_level data_level;
2310 /* search (old) findfirst interface.
2311 Also used for ffirst and funique. */
2313 enum smb_search_level level;
2314 enum smb_search_data_level data_level;
2318 uint16_t search_attrib;
2319 const char *pattern;
2326 /* trans2 findfirst interface */
2328 enum smb_search_level level;
2329 enum smb_search_data_level data_level;
2332 uint16_t search_attrib;
2335 uint32_t storage_type;
2336 const char *pattern;
2338 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2340 struct ea_name *ea_names;
2345 uint16_t end_of_search;
2350 SMB2 uses different level numbers for the same old SMB trans2 search levels
2352 #define SMB2_FIND_DIRECTORY_INFO 0x01
2353 #define SMB2_FIND_FULL_DIRECTORY_INFO 0x02
2354 #define SMB2_FIND_BOTH_DIRECTORY_INFO 0x03
2355 #define SMB2_FIND_NAME_INFO 0x0C
2356 #define SMB2_FIND_ID_BOTH_DIRECTORY_INFO 0x25
2357 #define SMB2_FIND_ID_FULL_DIRECTORY_INFO 0x26
2359 /* flags for SMB2 find */
2360 #define SMB2_CONTINUE_FLAG_RESTART 0x01
2361 #define SMB2_CONTINUE_FLAG_SINGLE 0x02
2362 #define SMB2_CONTINUE_FLAG_INDEX 0x04
2363 #define SMB2_CONTINUE_FLAG_REOPEN 0x10
2367 enum smb_search_level level;
2368 enum smb_search_data_level data_level;
2370 union smb_handle file;
2372 /* static body buffer 32 (0x20) bytes */
2373 /* uint16_t buffer_code; 0x21 = 0x20 + 1 */
2375 uint8_t continue_flags; /* SMB2_CONTINUE_FLAG_* */
2376 uint32_t file_index;
2377 /* struct smb2_handle handle; */
2378 /* uint16_t pattern_ofs; */
2379 /* uint16_t pattern_size; */
2380 uint32_t max_response_size;
2383 const char *pattern;
2386 /* static body buffer 8 (0x08) bytes */
2387 /* uint16_t buffer_code; 0x08 */
2388 /* uint16_t blob_ofs; */
2389 /* uint32_t blob_size; */
2397 /* union for file search continue */
2398 union smb_search_next {
2400 enum smb_search_level level;
2401 enum smb_search_data_level data_level;
2404 /* search (old) findnext interface. Also used
2405 for ffirst when continuing */
2407 enum smb_search_level level;
2408 enum smb_search_data_level data_level;
2412 uint16_t search_attrib;
2413 struct smb_search_id {
2417 uint32_t server_cookie;
2418 uint32_t client_cookie;
2426 /* trans2 findnext interface */
2428 enum smb_search_level level;
2429 enum smb_search_data_level data_level;
2434 uint32_t resume_key;
2436 const char *last_name;
2438 /* the ea names are only used for RAW_SEARCH_EA_LIST */
2440 struct ea_name *ea_names;
2444 uint16_t end_of_search;
2449 struct smb2_find smb2;
2452 /* union for search reply file data */
2453 union smb_search_data {
2455 * search (old) findfirst
2456 * RAW_SEARCH_DATA_SEARCH
2462 struct smb_search_id id;
2466 /* trans2 findfirst RAW_SEARCH_DATA_STANDARD level */
2468 uint32_t resume_key;
2473 uint32_t alloc_size;
2475 struct smb_wire_string name;
2478 /* trans2 findfirst RAW_SEARCH_DATA_EA_SIZE level */
2480 uint32_t resume_key;
2485 uint32_t alloc_size;
2488 struct smb_wire_string name;
2491 /* trans2 findfirst RAW_SEARCH_DATA_EA_LIST level */
2493 uint32_t resume_key;
2498 uint32_t alloc_size;
2500 struct smb_ea_list eas;
2501 struct smb_wire_string name;
2504 /* RAW_SEARCH_DATA_DIRECTORY_INFO interface */
2506 uint32_t file_index;
2512 uint64_t alloc_size;
2514 struct smb_wire_string name;
2517 /* RAW_SEARCH_DATA_FULL_DIRECTORY_INFO interface */
2519 uint32_t file_index;
2525 uint64_t alloc_size;
2528 struct smb_wire_string name;
2529 } full_directory_info;
2531 /* RAW_SEARCH_DATA_NAME_INFO interface */
2533 uint32_t file_index;
2534 struct smb_wire_string name;
2537 /* RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO interface */
2539 uint32_t file_index;
2545 uint64_t alloc_size;
2548 struct smb_wire_string short_name;
2549 struct smb_wire_string name;
2550 } both_directory_info;
2552 /* RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO interface */
2554 uint32_t file_index;
2560 uint64_t alloc_size;
2564 struct smb_wire_string name;
2565 } id_full_directory_info;
2567 /* RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO interface */
2569 uint32_t file_index;
2575 uint64_t alloc_size;
2579 struct smb_wire_string short_name;
2580 struct smb_wire_string name;
2581 } id_both_directory_info;
2583 /* RAW_SEARCH_DATA_UNIX_INFO interface */
2585 uint32_t file_index;
2587 uint64_t alloc_size;
2588 NTTIME status_change_time;
2597 uint64_t permissions;
2602 /* RAW_SEARCH_DATA_UNIX_INFO2 interface */
2604 uint32_t file_index;
2605 uint64_t end_of_file;
2607 NTTIME status_change_time;
2616 uint64_t permissions;
2619 uint32_t file_flags;
2620 uint32_t flags_mask;
2621 struct smb_wire_string name;
2625 /* Callback function passed to the raw search interface. */
2626 typedef bool (*smbcli_search_callback)(void *private, const union smb_search_data *file);
2628 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
2630 /* union for file search close */
2631 union smb_search_close {
2633 enum smb_search_close_level level;
2636 /* SMBfclose (old search) interface */
2638 enum smb_search_close_level level;
2641 /* max_count and search_attrib are not used, but are present */
2643 uint16_t search_attrib;
2644 struct smb_search_id id;
2648 /* SMBfindclose interface */
2650 enum smb_search_close_level level;
2660 struct for SMBecho call
2664 uint16_t repeat_count;
2670 uint16_t sequence_number;
2677 struct for shadow copy volumes
2679 struct smb_shadow_copy {
2681 union smb_handle file;
2685 uint32_t num_volumes;
2691 #endif /* __LIBCLI_RAW_INTERFACES_H__ */