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 {
373 WIRE_STRING alt_fname;
374 uint8_t delete_pending;
376 uint64_t compressed_size;
380 uint8_t cluster_shift;
382 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
385 uint32_t alignment_requirement;
386 uint32_t reparse_tag;
388 struct stream_struct {
391 WIRE_STRING stream_name;
397 /* SMBgetatr interface:
398 * matches RAW_FILEINFO_GETATTR */
400 enum smb_fileinfo_level level;
401 union smb_fileinfo_in in;
410 /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
412 enum smb_fileinfo_level level;
413 union smb_fileinfo_in in;
423 } getattre, standard;
425 /* trans2 RAW_FILEINFO_EA_SIZE interface */
427 enum smb_fileinfo_level level;
428 union smb_fileinfo_in in;
441 /* trans2 RAW_FILEINFO_ALL_EAS interface */
443 enum smb_fileinfo_level level;
444 union smb_fileinfo_in in;
447 /* the ea_size is implied by the list */
449 struct ea_struct *eas;
453 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
454 only valid for a QPATHNAME call - no returned data */
456 enum smb_fileinfo_level level;
457 union smb_fileinfo_in in;
460 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
462 enum smb_fileinfo_level level;
463 union smb_fileinfo_in in;
475 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
477 enum smb_fileinfo_level level;
478 union smb_fileinfo_in in;
489 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
491 enum smb_fileinfo_level level;
492 union smb_fileinfo_in in;
499 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
501 enum smb_fileinfo_level level;
502 union smb_fileinfo_in in;
509 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
511 enum smb_fileinfo_level level;
512 union smb_fileinfo_in in;
523 uint8_t delete_pending;
530 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
532 enum smb_fileinfo_level level;
533 union smb_fileinfo_in in;
540 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
542 enum smb_fileinfo_level level;
543 union smb_fileinfo_in in;
547 struct stream_struct *streams;
551 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
553 enum smb_fileinfo_level level;
554 union smb_fileinfo_in in;
557 uint64_t compressed_size;
561 uint8_t cluster_shift;
565 /* RAW_FILEINFO_UNIX_BASIC interface */
567 enum smb_fileinfo_level level;
568 union smb_fileinfo_in in;
571 uint64_t end_of_file;
573 NTTIME status_change_time;
582 uint64_t permissions;
587 /* RAW_FILEINFO_UNIX_LINK interface */
589 enum smb_fileinfo_level level;
590 union smb_fileinfo_in in;
593 WIRE_STRING link_dest;
597 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
599 enum smb_fileinfo_level level;
600 union smb_fileinfo_in in;
605 } internal_information;
607 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
609 enum smb_fileinfo_level level;
610 union smb_fileinfo_in in;
613 uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
615 } access_information;
617 /* RAW_FILEINFO_POSITION_INFORMATION interface */
619 enum smb_fileinfo_level level;
620 union smb_fileinfo_in in;
625 } position_information;
627 /* RAW_FILEINFO_MODE_INFORMATION interface */
629 enum smb_fileinfo_level level;
630 union smb_fileinfo_in in;
637 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
639 enum smb_fileinfo_level level;
640 union smb_fileinfo_in in;
643 uint32_t alignment_requirement;
645 } alignment_information;
647 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
649 enum smb_fileinfo_level level;
650 union smb_fileinfo_in in;
661 } network_open_information;
664 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
666 enum smb_fileinfo_level level;
667 union smb_fileinfo_in in;
671 uint32_t reparse_tag;
673 } attribute_tag_information;
677 enum smb_setfileinfo_level {
678 RAW_SFILEINFO_GENERIC = 0xF000,
679 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
680 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
681 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
682 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
683 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
684 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
685 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
686 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
687 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
688 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
689 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
690 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
691 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
692 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
693 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
694 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
695 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
696 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
697 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
698 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
699 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
700 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
701 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
702 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040
705 /* union used in setfileinfo() and setpathinfo() calls */
706 union smb_setfileinfo {
707 /* generic interface */
709 enum smb_setfileinfo_level level;
711 /* we are combining setfileinfo and setpathinfo into one
713 union setfileinfo_file {
719 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
721 enum smb_setfileinfo_level level;
722 union setfileinfo_file file;
729 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo()
730 also RAW_SFILEINFO_STANDARD */
732 enum smb_setfileinfo_level level;
733 union setfileinfo_file file;
739 /* notice that size, alloc_size and attrib are not settable,
740 unlike the corresponding qfileinfo level */
742 } setattre, standard;
744 /* RAW_SFILEINFO_EA_SET interface */
746 enum smb_setfileinfo_level level;
747 union setfileinfo_file file;
753 /* RAW_SFILEINFO_BASIC_INFO and
754 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
756 enum smb_setfileinfo_level level;
757 union setfileinfo_file file;
768 /* RAW_SFILEINFO_DISPOSITION_INFO and
769 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
771 enum smb_setfileinfo_level level;
772 union setfileinfo_file file;
775 BOOL delete_on_close;
779 /* RAW_SFILEINFO_ALLOCATION_INFO and
780 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
782 enum smb_setfileinfo_level level;
783 union setfileinfo_file file;
786 /* w2k3 rounds this up to nearest 4096 */
791 /* RAW_SFILEINFO_END_OF_FILE_INFO and
792 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
794 enum smb_setfileinfo_level level;
795 union setfileinfo_file file;
802 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
804 enum smb_setfileinfo_level level;
805 union setfileinfo_file file;
810 const char *new_name;
812 } rename_information;
814 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
816 enum smb_setfileinfo_level level;
817 union setfileinfo_file file;
822 } position_information;
824 /* RAW_SFILEINFO_MODE_INFORMATION interface */
826 enum smb_setfileinfo_level level;
827 union setfileinfo_file file;
830 /* valid values seem to be 0, 2, 4 and 6 */
837 /* RAW_SFILEINFO_UNIX_BASIC interface */
839 enum smb_setfileinfo_level level;
840 union setfileinfo_file file;
842 uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
843 uint64_t end_of_file;
845 NTTIME status_change_time;
854 uint64_t permissions;
859 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
861 enum smb_setfileinfo_level level;
862 union setfileinfo_file file;
864 const char *link_dest;
866 } unix_link, unix_hlink;
870 enum smb_fsinfo_level {
871 RAW_QFS_GENERIC = 0xF000,
872 RAW_QFS_DSKATTR, /* SMBdskattr */
873 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
874 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
875 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
876 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
877 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
878 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
879 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
880 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
881 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
882 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
883 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
884 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
885 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
886 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
889 /* union for fsinfo() backend call. Note that there are no in
890 structures, as this call only contains out parameters */
892 /* generic interface */
894 enum smb_fsinfo_level level;
898 uint64_t blocks_total;
899 uint64_t blocks_free;
902 uint32_t serial_number;
904 uint32_t max_file_component_length;
905 uint32_t device_type;
906 uint32_t device_characteristics;
909 uint64_t quota_flags;
916 /* SMBdskattr interface */
918 enum smb_fsinfo_level level;
921 uint16_t units_total;
922 uint16_t blocks_per_unit;
928 /* trans2 RAW_QFS_ALLOCATION interface */
930 enum smb_fsinfo_level level;
934 uint32_t sectors_per_unit;
935 uint32_t total_alloc_units;
936 uint32_t avail_alloc_units;
937 uint16_t bytes_per_sector;
941 /* TRANS2 RAW_QFS_VOLUME interface */
943 enum smb_fsinfo_level level;
946 uint32_t serial_number;
947 WIRE_STRING volume_name;
951 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
953 enum smb_fsinfo_level level;
957 uint32_t serial_number;
958 WIRE_STRING volume_name;
962 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
964 enum smb_fsinfo_level level;
967 uint64_t total_alloc_units;
968 uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
969 uint32_t sectors_per_unit;
970 uint32_t bytes_per_sector;
974 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
976 enum smb_fsinfo_level level;
979 uint32_t device_type;
980 uint32_t characteristics;
985 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
987 enum smb_fsinfo_level level;
991 uint32_t max_file_component_length;
997 /* TRANS2 RAW_QFS_UNIX_INFO interface */
999 enum smb_fsinfo_level level;
1002 uint16_t major_version;
1003 uint16_t minor_version;
1004 uint64_t capability;
1008 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1010 enum smb_fsinfo_level level;
1013 uint64_t unknown[3];
1014 uint64_t quota_soft;
1015 uint64_t quota_hard;
1016 uint64_t quota_flags;
1018 } quota_information;
1020 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1022 enum smb_fsinfo_level level;
1025 uint64_t total_alloc_units;
1026 uint64_t call_avail_alloc_units;
1027 uint64_t actual_avail_alloc_units;
1028 uint32_t sectors_per_unit;
1029 uint32_t bytes_per_sector;
1031 } full_size_information;
1033 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1035 enum smb_fsinfo_level level;
1039 uint64_t unknown[6];
1041 } objectid_information;
1046 enum smb_open_level {
1047 RAW_OPEN_OPEN, RAW_OPEN_OPENX,
1048 RAW_OPEN_MKNEW, RAW_OPEN_CREATE,
1049 RAW_OPEN_CTEMP, RAW_OPEN_SPLOPEN,
1050 RAW_OPEN_NTCREATEX, RAW_OPEN_T2OPEN};
1052 /* the generic interface is defined to be equal to the NTCREATEX interface */
1053 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1055 /* union for open() backend call */
1057 /* SMBNTCreateX interface */
1059 enum smb_open_level level;
1064 uint32_t access_mask;
1065 uint64_t alloc_size;
1067 uint32_t share_access;
1068 uint32_t open_disposition;
1069 uint32_t create_options;
1070 uint32_t impersonation;
1071 uint8_t security_flags;
1072 /* NOTE: fname can also be a pointer to a
1073 uint64_t file_id if create_options has the
1074 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */
1079 uint8_t oplock_level;
1081 uint32_t create_action;
1087 uint64_t alloc_size;
1091 uint8_t is_directory;
1093 } ntcreatex, generic;
1095 /* TRANS2_OPEN interface */
1097 enum smb_open_level level;
1102 uint16_t file_attrs;
1109 struct ea_struct *eas;
1125 /* SMBopen interface */
1127 enum smb_open_level level;
1131 uint16_t search_attrs;
1143 /* SMBopenX interface */
1145 enum smb_open_level level;
1150 uint16_t search_attrs; /* not honoured by win2003 */
1151 uint16_t file_attrs;
1152 time_t write_time; /* not honoured by win2003 */
1154 uint32_t size; /* note that this sets the
1155 initial file size, not
1156 just allocation size */
1157 uint32_t timeout; /* not honoured by win2003 */
1169 uint32_t unique_fid;
1170 uint32_t access_mask;
1175 /* SMBmknew interface */
1177 enum smb_open_level level;
1189 /* SMBctemp interface */
1191 enum smb_open_level level;
1196 const char *directory;
1200 /* temp name, relative to directory */
1205 /* SMBsplopen interface */
1207 enum smb_open_level level;
1210 uint16_t setup_length;
1222 enum smb_read_level {RAW_READ_READBRAW, RAW_READ_LOCKREAD, RAW_READ_READ, RAW_READ_READX};
1224 #define RAW_READ_GENERIC RAW_READ_READX
1226 /* union for read() backend call
1228 note that .infoX.out.data will be allocated before the backend is
1229 called. It will be big enough to hold the maximum size asked for
1232 /* SMBreadX (and generic) interface */
1234 enum smb_read_level level;
1246 uint16_t compaction_mode;
1251 /* SMBreadbraw interface */
1253 enum smb_read_level level;
1269 /* SMBlockandread interface */
1271 enum smb_read_level level;
1285 /* SMBread interface */
1287 enum smb_read_level level;
1303 enum smb_write_level {RAW_WRITE_WRITEUNLOCK, RAW_WRITE_WRITE,
1304 RAW_WRITE_WRITEX, RAW_WRITE_WRITECLOSE,
1305 RAW_WRITE_SPLWRITE};
1307 #define RAW_WRITE_GENERIC RAW_WRITE_WRITEX
1309 /* union for write() backend call
1312 /* SMBwriteX interface */
1314 enum smb_write_level level;
1330 /* SMBwriteunlock interface */
1332 enum smb_write_level level;
1346 /* SMBwrite interface */
1348 enum smb_write_level level;
1362 /* SMBwriteclose interface */
1364 enum smb_write_level level;
1378 /* SMBsplwrite interface */
1380 enum smb_write_level level;
1391 enum smb_lock_level {RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX};
1393 /* the generic interface is defined to be equal to the lockingX interface */
1394 #define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
1396 /* union for lock() backend call
1399 /* SMBlockingX (and generic) interface */
1401 enum smb_lock_level level;
1409 struct smb_lock_entry {
1413 } *locks; /* unlocks are first in the arrray */
1417 /* SMBlock and SMBunlock interface */
1419 enum smb_lock_level level;
1430 enum smb_close_level {RAW_CLOSE_CLOSE, RAW_CLOSE_SPLCLOSE};
1432 #define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
1435 union for close() backend call
1438 /* SMBclose (and generic) interface */
1440 enum smb_close_level level;
1448 /* SMBsplclose interface - empty! */
1450 enum smb_close_level level;
1459 enum smb_lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1462 union for lpq() backend
1465 /* generic interface */
1467 enum smb_lpq_level level;
1472 /* SMBsplretq interface */
1474 enum smb_lpq_level level;
1482 uint16_t restart_idx;
1494 enum smb_ioctl_level {RAW_IOCTL_IOCTL, RAW_IOCTL_NTIOCTL};
1497 union for ioctl() backend
1500 /* generic interface */
1502 enum smb_ioctl_level level;
1506 /* struct for SMBioctl */
1508 enum smb_ioctl_level level;
1519 /* struct for NT ioctl call */
1521 enum smb_ioctl_level level;
1534 /* struct for SMBflush */
1542 /* struct for SMBcopy */
1557 /* struct for transact/transact2 call */
1565 uint8_t setup_count;
1567 const char *trans_name; /* SMBtrans only */
1573 uint8_t setup_count;
1580 /* struct for nttransact2 call */
1581 struct smb_nttrans {
1586 uint32_t setup_count;
1594 uint8_t setup_count;
1602 /* struct for nttrans change notify call */
1605 uint32_t buffer_size;
1606 uint32_t completion_filter;
1612 uint32_t num_changes;
1621 enum smb_search_level {RAW_SEARCH_GENERIC = 0xF000,
1622 RAW_SEARCH_SEARCH, /* SMBsearch */
1623 RAW_SEARCH_FFIRST, /* SMBffirst */
1624 RAW_SEARCH_FUNIQUE, /* SMBfunique */
1625 RAW_SEARCH_STANDARD = SMB_FIND_STANDARD,
1626 RAW_SEARCH_EA_SIZE = SMB_FIND_EA_SIZE,
1627 RAW_SEARCH_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
1628 RAW_SEARCH_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
1629 RAW_SEARCH_NAME_INFO = SMB_FIND_NAME_INFO,
1630 RAW_SEARCH_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
1631 RAW_SEARCH_ID_FULL_DIRECTORY_INFO = SMB_FIND_ID_FULL_DIRECTORY_INFO,
1632 RAW_SEARCH_ID_BOTH_DIRECTORY_INFO = SMB_FIND_ID_BOTH_DIRECTORY_INFO,
1633 RAW_SEARCH_UNIX_INFO = SMB_FIND_UNIX_INFO};
1636 /* union for file search */
1637 union smb_search_first {
1639 enum smb_search_level level;
1642 /* search (old) findfirst interface.
1643 Also used for ffirst and funique. */
1645 enum smb_search_level level;
1649 uint16_t search_attrib;
1650 const char *pattern;
1657 /* trans2 findfirst interface */
1659 enum smb_search_level level;
1662 uint16_t search_attrib;
1665 uint32_t storage_type;
1666 const char *pattern;
1671 uint16_t end_of_search;
1676 /* union for file search continue */
1677 union smb_search_next {
1679 enum smb_search_level level;
1682 /* search (old) findnext interface. Also used
1683 for ffirst when continuing */
1685 enum smb_search_level level;
1689 uint16_t search_attrib;
1690 struct smb_search_id {
1694 uint32_t server_cookie;
1695 uint32_t client_cookie;
1703 /* trans2 findnext interface */
1705 enum smb_search_level level;
1710 uint32_t resume_key;
1712 const char *last_name;
1716 uint16_t end_of_search;
1721 /* union for search reply file data */
1722 union smb_search_data {
1723 /* search (old) findfirst */
1728 struct smb_search_id id;
1732 /* trans2 findfirst RAW_SEARCH_STANDARD level */
1734 uint32_t resume_key;
1739 uint32_t alloc_size;
1744 /* trans2 findfirst RAW_SEARCH_EA_SIZE level */
1746 uint32_t resume_key;
1751 uint32_t alloc_size;
1757 /* RAW_SEARCH_DIRECTORY_INFO interface */
1759 uint32_t file_index;
1765 uint64_t alloc_size;
1770 /* RAW_SEARCH_FULL_DIRECTORY_INFO interface */
1772 uint32_t file_index;
1778 uint64_t alloc_size;
1782 } full_directory_info;
1784 /* RAW_SEARCH_NAME_INFO interface */
1786 uint32_t file_index;
1790 /* RAW_SEARCH_BOTH_DIRECTORY_INFO interface */
1792 uint32_t file_index;
1798 uint64_t alloc_size;
1801 WIRE_STRING short_name;
1803 } both_directory_info;
1805 /* RAW_SEARCH_ID_FULL_DIRECTORY_INFO interface */
1807 uint32_t file_index;
1813 uint64_t alloc_size;
1818 } id_full_directory_info;
1820 /* RAW_SEARCH_ID_BOTH_DIRECTORY_INFO interface */
1822 uint32_t file_index;
1828 uint64_t alloc_size;
1832 WIRE_STRING short_name;
1834 } id_both_directory_info;
1836 /* RAW_SEARCH_UNIX_INFO interface */
1838 uint32_t file_index;
1840 uint64_t alloc_size;
1841 NTTIME status_change_time;
1850 uint64_t permissions;
1857 enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
1859 /* union for file search close */
1860 union smb_search_close {
1862 enum smb_search_close_level level;
1865 /* SMBfclose (old search) interface */
1867 enum smb_search_close_level level;
1870 /* max_count and search_attrib are not used, but are present */
1872 uint16_t search_attrib;
1873 struct smb_search_id id;
1877 /* SMBfindclose interface */
1879 enum smb_search_close_level level;