2 Unix SMB/CIFS implementation.
3 SMB request interface structures
4 Copyright (C) Andrew Tridgell 2003
5 Copyright (C) James J Myers 2003 <myersjj@samba.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 /* Globally Unique ID */
26 /* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
27 typedef uint64_t NTTIME;
29 /* 8 byte aligned 'hyper' type from MS IDL */
30 typedef uint64_t HYPER_T;
34 /* this structure is just a wrapper for a string, the only reason we
35 bother with this is that it allows us to check the length provided
36 on the wire in testsuite test code to ensure that we are
37 terminating names in the same way that win2003 is. The *ONLY* time
38 you should ever look at the 'private_length' field in this
39 structure is inside compliance test code, in all other cases just
40 use the null terminated char* as the definitive definition of the
43 also note that this structure is only used in packets where there
44 is an explicit length provided on the wire (hence the name). That
45 length is placed in 'private_length'. For packets where the length
46 is always determined by NULL or packet termination a normal char*
47 is used in the structure definition.
50 uint32_t private_length;
56 this header defines the structures and unions used between the SMB
57 parser and the backends.
60 /* struct used for SMBlseek call */
65 int32_t offset; /* signed */
73 /* struct used in unlink() call */
82 /* struct used in chkpath() call */
89 enum smb_mkdir_level {RAW_MKDIR_GENERIC, RAW_MKDIR_MKDIR, RAW_MKDIR_T2MKDIR};
91 /* union used in mkdir() call */
95 enum smb_mkdir_level level;
99 enum smb_mkdir_level level;
106 enum smb_mkdir_level level;
110 struct ea_struct *eas;
115 /* struct used in rmdir() call */
122 /* struct used in rename() call */
123 enum smb_rename_level {RAW_RENAME_RENAME, RAW_RENAME_NTRENAME};
127 enum smb_rename_level level;
130 /* SMBrename interface */
132 enum smb_rename_level level;
135 const char *pattern1;
136 const char *pattern2;
142 /* SMBntrename interface */
144 enum smb_rename_level level;
148 uint16_t flags; /* see RENAME_FLAG_* */
149 uint32_t cluster_size;
150 const char *old_name;
151 const char *new_name;
156 enum smb_tcon_level {RAW_TCON_TCON, RAW_TCON_TCONX};
158 /* union used in tree connect call */
160 /* generic interface */
162 enum smb_tcon_level level;
165 /* SMBtcon interface */
167 enum smb_tcon_level level;
171 const char *password;
180 /* SMBtconX interface */
182 enum smb_tcon_level level;
200 enum smb_sesssetup_level {RAW_SESSSETUP_GENERIC, RAW_SESSSETUP_OLD, RAW_SESSSETUP_NT1, RAW_SESSSETUP_SPNEGO};
202 /* union used in session_setup call */
203 union smb_sesssetup {
205 /* generic interface - used for auto selecting based on negotiated
208 enum smb_sesssetup_level level;
212 uint32_t capabilities;
213 const char *password;
225 /* the pre-NT1 interface */
227 enum smb_sesssetup_level level;
249 /* the NT1 interface */
251 enum smb_sesssetup_level level;
258 uint32_t capabilities;
276 /* the SPNEGO interface */
278 enum smb_sesssetup_level level;
285 uint32_t capabilities;
302 /* Note that the specified enum values are identical to the actual info-levels used
305 enum smb_fileinfo_level {
306 RAW_FILEINFO_GENERIC = 0xF000,
307 RAW_FILEINFO_GETATTR, /* SMBgetatr */
308 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
309 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
310 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
311 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
312 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
313 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
314 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
315 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
316 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
317 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
318 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
319 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
320 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
321 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
322 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
323 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
324 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
325 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
326 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
327 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
328 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
329 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
330 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
331 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
332 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
333 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
334 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
335 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
336 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
337 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION
341 /* union used in qfileinfo() and qpathinfo() backend calls */
343 /* generic interface:
344 * matches RAW_FILEINFO_GENERIC */
346 enum smb_fileinfo_level level;
348 /* each level can be called on either a pathname or a
349 * filename, in either case the return format is
351 union smb_fileinfo_in {
374 WIRE_STRING alt_fname;
375 uint8_t delete_pending;
377 uint64_t compressed_size;
381 uint8_t cluster_shift;
383 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
386 uint32_t alignment_requirement;
387 uint32_t reparse_tag;
389 struct stream_struct {
392 WIRE_STRING stream_name;
398 /* SMBgetatr interface:
399 * matches RAW_FILEINFO_GETATTR */
401 enum smb_fileinfo_level level;
402 union smb_fileinfo_in in;
411 /* SMBgetattrE interface */
413 enum smb_fileinfo_level level;
414 union smb_fileinfo_in in;
426 /* trans2 RAW_FILEINFO_STANDARD interface */
428 enum smb_fileinfo_level level;
429 union smb_fileinfo_in in;
441 /* trans2 RAW_FILEINFO_EA_SIZE interface */
443 enum smb_fileinfo_level level;
444 union smb_fileinfo_in in;
457 /* trans2 RAW_FILEINFO_ALL_EAS interface */
459 enum smb_fileinfo_level level;
460 union smb_fileinfo_in in;
463 /* the ea_size is implied by the list */
465 struct ea_struct *eas;
469 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
470 only valid for a QPATHNAME call - no returned data */
472 enum smb_fileinfo_level level;
473 union smb_fileinfo_in in;
476 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
478 enum smb_fileinfo_level level;
479 union smb_fileinfo_in in;
491 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
493 enum smb_fileinfo_level level;
494 union smb_fileinfo_in in;
505 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
507 enum smb_fileinfo_level level;
508 union smb_fileinfo_in in;
515 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
517 enum smb_fileinfo_level level;
518 union smb_fileinfo_in in;
525 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
527 enum smb_fileinfo_level level;
528 union smb_fileinfo_in in;
539 uint8_t delete_pending;
546 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
548 enum smb_fileinfo_level level;
549 union smb_fileinfo_in in;
556 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
558 enum smb_fileinfo_level level;
559 union smb_fileinfo_in in;
563 struct stream_struct *streams;
567 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
569 enum smb_fileinfo_level level;
570 union smb_fileinfo_in in;
573 uint64_t compressed_size;
577 uint8_t cluster_shift;
581 /* RAW_FILEINFO_UNIX_BASIC interface */
583 enum smb_fileinfo_level level;
584 union smb_fileinfo_in in;
587 uint64_t end_of_file;
589 NTTIME status_change_time;
598 uint64_t permissions;
603 /* RAW_FILEINFO_UNIX_LINK interface */
605 enum smb_fileinfo_level level;
606 union smb_fileinfo_in in;
609 WIRE_STRING link_dest;
613 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
615 enum smb_fileinfo_level level;
616 union smb_fileinfo_in in;
621 } internal_information;
623 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
625 enum smb_fileinfo_level level;
626 union smb_fileinfo_in in;
629 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
631 } access_information;
633 /* RAW_FILEINFO_POSITION_INFORMATION interface */
635 enum smb_fileinfo_level level;
636 union smb_fileinfo_in in;
641 } position_information;
643 /* RAW_FILEINFO_MODE_INFORMATION interface */
645 enum smb_fileinfo_level level;
646 union smb_fileinfo_in in;
653 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
655 enum smb_fileinfo_level level;
656 union smb_fileinfo_in in;
659 uint32_t alignment_requirement;
661 } alignment_information;
663 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
665 enum smb_fileinfo_level level;
666 union smb_fileinfo_in in;
677 } network_open_information;
680 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
682 enum smb_fileinfo_level level;
683 union smb_fileinfo_in in;
687 uint32_t reparse_tag;
689 } attribute_tag_information;
693 enum smb_setfileinfo_level {
694 RAW_SFILEINFO_GENERIC = 0xF000,
695 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
696 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
697 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
698 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
699 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
700 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
701 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
702 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
703 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
704 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
705 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
706 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
707 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
708 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
709 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
710 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
711 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
712 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
713 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
714 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
715 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
716 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
717 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
718 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040
721 /* union used in setfileinfo() and setpathinfo() calls */
722 union smb_setfileinfo {
723 /* generic interface */
725 enum smb_setfileinfo_level level;
727 /* we are combining setfileinfo and setpathinfo into one
729 union setfileinfo_file {
735 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
737 enum smb_setfileinfo_level level;
738 union setfileinfo_file file;
745 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo() */
747 enum smb_setfileinfo_level level;
748 union setfileinfo_file file;
758 /* RAW_SFILEINFO_STANDARD interface */
760 enum smb_setfileinfo_level level;
761 union setfileinfo_file file;
766 /* notice that size, alloc_size and attrib are not settable,
767 unlike the corresponding qfileinfo level */
771 /* RAW_SFILEINFO_EA_SET interface */
773 enum smb_setfileinfo_level level;
774 union setfileinfo_file file;
780 /* RAW_SFILEINFO_BASIC_INFO and
781 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
783 enum smb_setfileinfo_level level;
784 union setfileinfo_file file;
795 /* RAW_SFILEINFO_DISPOSITION_INFO and
796 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
798 enum smb_setfileinfo_level level;
799 union setfileinfo_file file;
802 BOOL delete_on_close;
806 /* RAW_SFILEINFO_ALLOCATION_INFO and
807 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
809 enum smb_setfileinfo_level level;
810 union setfileinfo_file file;
813 /* w2k3 rounds this up to nearest 4096 */
818 /* RAW_SFILEINFO_END_OF_FILE_INFO and
819 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
821 enum smb_setfileinfo_level level;
822 union setfileinfo_file file;
829 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
831 enum smb_setfileinfo_level level;
832 union setfileinfo_file file;
837 const char *new_name;
839 } rename_information;
841 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
843 enum smb_setfileinfo_level level;
844 union setfileinfo_file file;
849 } position_information;
851 /* RAW_SFILEINFO_MODE_INFORMATION interface */
853 enum smb_setfileinfo_level level;
854 union setfileinfo_file file;
857 /* valid values seem to be 0, 2, 4 and 6 */
864 /* RAW_SFILEINFO_UNIX_BASIC interface */
866 enum smb_setfileinfo_level level;
867 union setfileinfo_file file;
869 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
870 uint64_t end_of_file;
872 NTTIME status_change_time;
881 uint64_t permissions;
886 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
888 enum smb_setfileinfo_level level;
889 union setfileinfo_file file;
891 const char *link_dest;
893 } unix_link, unix_hlink;
897 enum smb_fsinfo_level {
898 RAW_QFS_GENERIC = 0xF000,
899 RAW_QFS_DSKATTR, /* SMBdskattr */
900 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
901 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
902 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
903 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
904 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
905 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
906 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
907 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
908 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
909 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
910 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
911 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
912 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
913 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
916 /* union for fsinfo() backend call. Note that there are no in
917 structures, as this call only contains out parameters */
919 /* generic interface */
921 enum smb_fsinfo_level level;
925 uint64_t blocks_total;
926 uint64_t blocks_free;
929 uint32_t serial_number;
931 uint32_t max_file_component_length;
932 uint32_t device_type;
933 uint32_t device_characteristics;
936 uint64_t quota_flags;
943 /* SMBdskattr interface */
945 enum smb_fsinfo_level level;
948 uint16_t units_total;
949 uint16_t blocks_per_unit;
955 /* trans2 RAW_QFS_ALLOCATION interface */
957 enum smb_fsinfo_level level;
961 uint32_t sectors_per_unit;
962 uint32_t total_alloc_units;
963 uint32_t avail_alloc_units;
964 uint16_t bytes_per_sector;
968 /* TRANS2 RAW_QFS_VOLUME interface */
970 enum smb_fsinfo_level level;
973 uint32_t serial_number;
974 WIRE_STRING volume_name;
978 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
980 enum smb_fsinfo_level level;
984 uint32_t serial_number;
985 WIRE_STRING volume_name;
989 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
991 enum smb_fsinfo_level level;
994 uint64_t total_alloc_units;
995 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
996 uint32_t sectors_per_unit;
997 uint32_t bytes_per_sector;
1001 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
1003 enum smb_fsinfo_level level;
1006 uint32_t device_type;
1007 uint32_t characteristics;
1012 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
1014 enum smb_fsinfo_level level;
1018 uint32_t max_file_component_length;
1019 WIRE_STRING fs_type;
1024 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1026 enum smb_fsinfo_level level;
1029 uint16_t major_version;
1030 uint16_t minor_version;
1031 uint64_t capability;
1035 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1037 enum smb_fsinfo_level level;
1040 uint64_t unknown[3];
1041 uint64_t quota_soft;
1042 uint64_t quota_hard;
1043 uint64_t quota_flags;
1045 } quota_information;
1047 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1049 enum smb_fsinfo_level level;
1052 uint64_t total_alloc_units;
1053 uint64_t call_avail_alloc_units;
1054 uint64_t actual_avail_alloc_units;
1055 uint32_t sectors_per_unit;
1056 uint32_t bytes_per_sector;
1058 } full_size_information;
1060 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1062 enum smb_fsinfo_level level;
1066 uint64_t unknown[6];
1068 } objectid_information;
1073 enum smb_open_level {
1074 RAW_OPEN_OPEN, RAW_OPEN_OPENX,
1075 RAW_OPEN_MKNEW, RAW_OPEN_CREATE,
1076 RAW_OPEN_CTEMP, RAW_OPEN_SPLOPEN,
1077 RAW_OPEN_NTCREATEX, RAW_OPEN_T2OPEN};
1079 /* the generic interface is defined to be equal to the NTCREATEX interface */
1080 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1082 /* union for open() backend call */
1084 /* SMBNTCreateX interface */
1086 enum smb_open_level level;
1091 uint32_t access_mask;
1092 uint64_t alloc_size;
1094 uint32_t share_access;
1095 uint32_t open_disposition;
1096 uint32_t create_options;
1097 uint32_t impersonation;
1098 uint8_t security_flags;
1099 /* NOTE: fname can also be a pointer to a
1100 uint64_t file_id if create_options has the
1101 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1106 uint8_t oplock_level;
1108 uint32_t create_action;
1114 uint64_t alloc_size;
1118 uint8_t is_directory;
1120 } ntcreatex, generic;
1122 /* TRANS2_OPEN interface */
1124 enum smb_open_level level;
1129 uint16_t file_attrs;
1136 struct ea_struct *eas;
1152 /* SMBopen interface */
1154 enum smb_open_level level;
1158 uint16_t search_attrs;
1170 /* SMBopenX interface */
1172 enum smb_open_level level;
1177 uint16_t search_attrs; /* not honoured by win2003 */
1178 uint16_t file_attrs;
1179 time_t write_time; /* not honoured by win2003 */
1181 uint32_t size; /* note that this sets the
1182 initial file size, not
1183 just allocation size */
1184 uint32_t timeout; /* not honoured by win2003 */
1196 uint32_t unique_fid;
1197 uint32_t access_mask;
1202 /* SMBmknew interface */
1204 enum smb_open_level level;
1216 /* SMBctemp interface */
1218 enum smb_open_level level;
1223 const char *directory;
1227 /* temp name, relative to directory */
1232 /* SMBsplopen interface */
1234 enum smb_open_level level;
1237 uint16_t setup_length;
1249 enum smb_read_level {RAW_READ_GENERIC, RAW_READ_READBRAW, RAW_READ_LOCKREAD, RAW_READ_READ, RAW_READ_READX};
1251 /* union for read() backend call
1253 note that .infoX.out.data will be allocated before the backend is
1254 called. It will be big enough to hold the maximum size asked for
1257 /* generic interface */
1259 enum smb_read_level level;
1273 /* SMBreadbraw interface */
1275 enum smb_read_level level;
1291 /* SMBlockandread interface */
1293 enum smb_read_level level;
1307 /* SMBread interface */
1309 enum smb_read_level level;
1323 /* SMBreadX interface */
1325 enum smb_read_level level;
1337 uint16_t compaction_mode;
1344 enum smb_write_level {
1345 RAW_WRITE_GENERIC, RAW_WRITE_WRITEUNLOCK, RAW_WRITE_WRITE,
1346 RAW_WRITE_WRITEX, RAW_WRITE_WRITECLOSE, RAW_WRITE_SPLWRITE};
1348 /* union for write() backend call
1351 /* generic interface */
1353 enum smb_write_level level;
1367 /* SMBwriteunlock interface */
1369 enum smb_write_level level;
1383 /* SMBwrite interface */
1385 enum smb_write_level level;
1399 /* SMBwriteX interface */
1401 enum smb_write_level level;
1417 /* SMBwriteclose interface */
1419 enum smb_write_level level;
1433 /* SMBsplwrite interface */
1435 enum smb_write_level level;
1446 enum smb_lock_level {RAW_LOCK_GENERIC, RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX};
1448 /* union for lock() backend call
1451 /* generic interface */
1453 enum smb_lock_level level;
1457 /* SMBlock interface */
1459 enum smb_lock_level level;
1468 /* SMBunlock interface */
1470 enum smb_lock_level level;
1479 /* SMBlockingX interface */
1481 enum smb_lock_level level;
1489 struct smb_lock_entry {
1493 } *locks; /* unlocks are first in the arrray */
1499 enum smb_close_level {RAW_CLOSE_GENERIC, RAW_CLOSE_CLOSE, RAW_CLOSE_SPLCLOSE};
1502 union for close() backend call
1505 /* generic interface */
1507 enum smb_close_level level;
1514 /* SMBclose interface */
1516 enum smb_close_level level;
1524 /* SMBsplclose interface - empty! */
1526 enum smb_close_level level;
1535 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1538 union for lpq() backend
1541 /* generic interface */
1543 enum smb_lpq_level level;
1548 /* SMBsplretq interface */
1550 enum smb_lpq_level level;
1558 uint16_t restart_idx;
1570 enum smb_ioctl_level {RAW_IOCTL_IOCTL, RAW_IOCTL_NTIOCTL};
1573 union for ioctl() backend
1576 /* generic interface */
1578 enum smb_ioctl_level level;
1582 /* struct for SMBioctl */
1584 enum smb_ioctl_level level;
1595 /* struct for NT ioctl call */
1597 enum smb_ioctl_level level;
1610 /* struct for SMBflush */
1618 /* struct for SMBcopy */
1633 /* struct for transact/transact2 call */
1641 uint8_t setup_count;
1643 const char *trans_name; /* SMBtrans only */
1649 uint8_t setup_count;
1656 /* struct for nttransact2 call */
1657 struct smb_nttrans {
1662 uint32_t setup_count;
1670 uint8_t setup_count;
1678 /* struct for nttrans change notify call */
1681 uint32_t buffer_size;
1682 uint32_t completion_filter;
1688 uint32_t num_changes;
1697 enum smb_search_level {RAW_SEARCH_GENERIC = 0xF000,
1698 RAW_SEARCH_SEARCH, /* SMBsearch */
1699 RAW_SEARCH_FCLOSE, /* SMBfclose */
1700 RAW_SEARCH_STANDARD = SMB_FIND_STANDARD,
1701 RAW_SEARCH_EA_SIZE = SMB_FIND_EA_SIZE,
1702 RAW_SEARCH_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
1703 RAW_SEARCH_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
1704 RAW_SEARCH_NAME_INFO = SMB_FIND_NAME_INFO,
1705 RAW_SEARCH_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
1706 RAW_SEARCH_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
1707 RAW_SEARCH_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
1708 RAW_SEARCH_UNIX_INFO = SMB_FIND_UNIX_INFO};
1711 /* union for file search */
1712 union smb_search_first {
1714 enum smb_search_level level;
1717 /* search (old) findfirst interface */
1719 enum smb_search_level level;
1723 uint16_t search_attrib;
1724 const char *pattern;
1731 /* trans2 findfirst interface */
1733 enum smb_search_level level;
1736 uint16_t search_attrib;
1739 uint32_t storage_type;
1740 const char *pattern;
1745 uint16_t end_of_search;
1750 /* union for file search continue */
1751 union smb_search_next {
1753 enum smb_search_level level;
1756 /* search (old) findnext interface */
1758 enum smb_search_level level;
1762 uint16_t search_attrib;
1763 DATA_BLOB search_id;
1770 /* trans2 findnext interface */
1772 enum smb_search_level level;
1777 uint32_t resume_key;
1779 const char *last_name;
1783 uint16_t end_of_search;
1788 /* union for search reply file data */
1789 union smb_search_data {
1790 /* search (old) findfirst */
1795 DATA_BLOB search_id; /* used to resume search from this point */
1799 /* trans2 findfirst RAW_SEARCH_STANDARD level */
1801 uint32_t resume_key;
1806 uint32_t alloc_size;
1811 /* trans2 findfirst RAW_SEARCH_EA_SIZE level */
1813 uint32_t resume_key;
1818 uint32_t alloc_size;
1824 /* RAW_SEARCH_DIRECTORY_INFO interface */
1826 uint32_t file_index;
1832 uint64_t alloc_size;
1837 /* RAW_SEARCH_FULL_DIRECTORY_INFO interface */
1839 uint32_t file_index;
1845 uint64_t alloc_size;
1849 } full_directory_info;
1851 /* RAW_SEARCH_NAME_INFO interface */
1853 uint32_t file_index;
1857 /* RAW_SEARCH_BOTH_DIRECTORY_INFO interface */
1859 uint32_t file_index;
1865 uint64_t alloc_size;
1868 WIRE_STRING short_name;
1870 } both_directory_info;
1872 /* RAW_SEARCH_ID_FULL_DIRECTORY_INFO interface */
1874 uint32_t file_index;
1880 uint64_t alloc_size;
1885 } id_full_directory_info;
1887 /* RAW_SEARCH_ID_BOTH_DIRECTORY_INFO interface */
1889 uint32_t file_index;
1895 uint64_t alloc_size;
1899 WIRE_STRING short_name;
1901 } id_both_directory_info;
1903 /* RAW_SEARCH_UNIX_INFO interface */
1905 uint32_t file_index;
1907 uint64_t alloc_size;
1908 NTTIME status_change_time;
1917 uint64_t permissions;
1924 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_CLOSE};
1926 /* union for file search close */
1927 union smb_search_close {
1929 enum smb_search_close_level level;
1932 /* SMBfclose (old search) interface */
1934 enum smb_search_close_level level;
1938 uint16_t search_attrib;
1939 DATA_BLOB search_id;
1946 /* SMBfindclose interface */
1948 enum smb_search_close_level level;