2 Unix SMB/CIFS implementation.
3 SMB request interface structures
4 Copyright (C) Andrew Tridgell 2003
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 typedef SMB_BIG_UINT large_t;
24 /* Globally Unique ID */
26 typedef struct guid_info
28 uint8 info[GUID_SIZE];
31 /* 64 bit time (100usec) 1601 - cifs6.txt, section 3.5, page 30 */
32 typedef struct nttime_info
39 /* this structure is just a wrapper for a string, the only reason we
40 bother with this is that it allows us to check the length provided
41 on the wire in testsuite test code to ensure that we are
42 terminating names in the same way that win2003 is. The *ONLY* time
43 you should ever look at the 'private_length' field in this
44 structure is inside compliance test code, in all cases just use the
45 null terminated char* as the definitive definition of the
48 also note that this structure is only used in packets where there
49 is an explicit length provided on the wire (hence the name). That
50 length is placed in 'private_length'. For packets where the length
51 is always determined by NULL or packet termination a normal char*
55 uint32 private_length;
61 this header defines the structures and unions used between the SMB
62 parser and the backends.
65 /* struct used for SMBlseek call */
70 int32 offset; /* signed */
78 /* struct used in unlink() call */
87 /* struct used in chkpath() call */
94 enum mkdir_level {RAW_MKDIR_GENERIC, RAW_MKDIR_MKDIR, RAW_MKDIR_T2MKDIR};
96 /* union used in mkdir() call */
100 enum mkdir_level level;
104 enum mkdir_level level;
111 enum mkdir_level level;
115 struct ea_struct *eas;
120 /* struct used in rmdir() call */
127 /* struct used in rename() call */
130 const char *pattern1;
131 const char *pattern2;
136 enum tcon_level {RAW_TCON_TCON, RAW_TCON_TCONX};
138 /* union used in tree connect call */
140 /* generic interface */
142 enum tcon_level level;
145 /* SMBtcon interface */
147 enum tcon_level level;
151 const char *password;
160 /* SMBtconX interface */
162 enum tcon_level level;
180 enum sesssetup_level {RAW_SESSSETUP_GENERIC, RAW_SESSSETUP_OLD, RAW_SESSSETUP_NT1, RAW_SESSSETUP_SPNEGO};
182 /* union used in session_setup call */
183 union smb_sesssetup {
185 /* generic interface - used for auto selecting based on negotiated
188 enum sesssetup_level level;
193 const char *password;
205 /* the pre-NT1 interface */
207 enum sesssetup_level level;
229 /* the NT1 interface */
231 enum sesssetup_level level;
256 /* the SPNEGO interface */
258 enum sesssetup_level level;
282 /* Note that the specified enum values are identical to the actual info-levels used
285 enum fileinfo_level {RAW_FILEINFO_GENERIC = 0xF000,
286 RAW_FILEINFO_GETATTR, /* SMBgetatr */
287 RAW_FILEINFO_GETATTRE, /* SMBgetattrE */
288 RAW_FILEINFO_STANDARD = SMB_QFILEINFO_STANDARD,
289 RAW_FILEINFO_EA_SIZE = SMB_QFILEINFO_EA_SIZE,
290 RAW_FILEINFO_ALL_EAS = SMB_QFILEINFO_ALL_EAS,
291 RAW_FILEINFO_IS_NAME_VALID = SMB_QFILEINFO_IS_NAME_VALID,
292 RAW_FILEINFO_BASIC_INFO = SMB_QFILEINFO_BASIC_INFO,
293 RAW_FILEINFO_STANDARD_INFO = SMB_QFILEINFO_STANDARD_INFO,
294 RAW_FILEINFO_EA_INFO = SMB_QFILEINFO_EA_INFO,
295 RAW_FILEINFO_NAME_INFO = SMB_QFILEINFO_NAME_INFO,
296 RAW_FILEINFO_ALL_INFO = SMB_QFILEINFO_ALL_INFO,
297 RAW_FILEINFO_ALT_NAME_INFO = SMB_QFILEINFO_ALT_NAME_INFO,
298 RAW_FILEINFO_STREAM_INFO = SMB_QFILEINFO_STREAM_INFO,
299 RAW_FILEINFO_COMPRESSION_INFO = SMB_QFILEINFO_COMPRESSION_INFO,
300 RAW_FILEINFO_UNIX_BASIC = SMB_QFILEINFO_UNIX_BASIC,
301 RAW_FILEINFO_UNIX_LINK = SMB_QFILEINFO_UNIX_LINK,
302 RAW_FILEINFO_BASIC_INFORMATION = SMB_QFILEINFO_BASIC_INFORMATION,
303 RAW_FILEINFO_STANDARD_INFORMATION = SMB_QFILEINFO_STANDARD_INFORMATION,
304 RAW_FILEINFO_INTERNAL_INFORMATION = SMB_QFILEINFO_INTERNAL_INFORMATION,
305 RAW_FILEINFO_EA_INFORMATION = SMB_QFILEINFO_EA_INFORMATION,
306 RAW_FILEINFO_ACCESS_INFORMATION = SMB_QFILEINFO_ACCESS_INFORMATION,
307 RAW_FILEINFO_NAME_INFORMATION = SMB_QFILEINFO_NAME_INFORMATION,
308 RAW_FILEINFO_POSITION_INFORMATION = SMB_QFILEINFO_POSITION_INFORMATION,
309 RAW_FILEINFO_MODE_INFORMATION = SMB_QFILEINFO_MODE_INFORMATION,
310 RAW_FILEINFO_ALIGNMENT_INFORMATION = SMB_QFILEINFO_ALIGNMENT_INFORMATION,
311 RAW_FILEINFO_ALL_INFORMATION = SMB_QFILEINFO_ALL_INFORMATION,
312 RAW_FILEINFO_ALT_NAME_INFORMATION = SMB_QFILEINFO_ALT_NAME_INFORMATION,
313 RAW_FILEINFO_STREAM_INFORMATION = SMB_QFILEINFO_STREAM_INFORMATION,
314 RAW_FILEINFO_COMPRESSION_INFORMATION = SMB_QFILEINFO_COMPRESSION_INFORMATION,
315 RAW_FILEINFO_NETWORK_OPEN_INFORMATION = SMB_QFILEINFO_NETWORK_OPEN_INFORMATION,
316 RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION = SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION
320 /* union used in qfileinfo() and qpathinfo() backend calls */
322 /* generic interface:
323 * matches RAW_FILEINFO_GENERIC */
325 enum fileinfo_level level;
327 /* each level can be called on either a pathname or a
328 * filename, in either case the return format is
330 union smb_fileinfo_in {
353 WIRE_STRING alt_fname;
354 uint8 delete_pending;
356 large_t compressed_size;
363 uint32 access_flags; /* seen 0x001f01ff from w2k3 */
366 uint32 alignment_requirement;
369 struct stream_struct {
372 WIRE_STRING stream_name;
378 /* SMBgetatr interface:
379 * matches RAW_FILEINFO_GETATTR */
381 enum fileinfo_level level;
382 union smb_fileinfo_in in;
391 /* SMBgetattrE interface */
393 enum fileinfo_level level;
394 union smb_fileinfo_in in;
406 /* trans2 RAW_FILEINFO_STANDARD interface */
408 enum fileinfo_level level;
409 union smb_fileinfo_in in;
421 /* trans2 RAW_FILEINFO_EA_SIZE interface */
423 enum fileinfo_level level;
424 union smb_fileinfo_in in;
437 /* trans2 RAW_FILEINFO_ALL_EAS interface */
439 enum fileinfo_level level;
440 union smb_fileinfo_in in;
443 /* the ea_size is implied by the list */
445 struct ea_struct *eas;
449 /* trans2 qpathinfo RAW_FILEINFO_IS_NAME_VALID interface
450 only valid for a QPATHNAME call - no returned data */
452 enum fileinfo_level level;
453 union smb_fileinfo_in in;
456 /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
458 enum fileinfo_level level;
459 union smb_fileinfo_in in;
471 /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
473 enum fileinfo_level level;
474 union smb_fileinfo_in in;
485 /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
487 enum fileinfo_level level;
488 union smb_fileinfo_in in;
495 /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
497 enum fileinfo_level level;
498 union smb_fileinfo_in in;
505 /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
507 enum fileinfo_level level;
508 union smb_fileinfo_in in;
519 uint8 delete_pending;
526 /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
528 enum fileinfo_level level;
529 union smb_fileinfo_in in;
536 /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
538 enum fileinfo_level level;
539 union smb_fileinfo_in in;
543 struct stream_struct *streams;
547 /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
549 enum fileinfo_level level;
550 union smb_fileinfo_in in;
553 large_t compressed_size;
561 /* RAW_FILEINFO_UNIX_BASIC interface */
563 enum fileinfo_level level;
564 union smb_fileinfo_in in;
569 NTTIME status_change_time;
583 /* RAW_FILEINFO_UNIX_LINK interface */
585 enum fileinfo_level level;
586 union smb_fileinfo_in in;
589 WIRE_STRING link_dest;
593 /* RAW_FILEINFO_INTERNAL_INFORMATION interface */
595 enum fileinfo_level level;
596 union smb_fileinfo_in in;
599 /* REWRITE: these are very uncertain - we need
600 * to look at this interface */
604 } internal_information;
606 /* RAW_FILEINFO_ACCESS_INFORMATION interface */
608 enum fileinfo_level level;
609 union smb_fileinfo_in in;
612 uint32 access_flags; /* seen 0x001f01ff from w2k3 */
614 } access_information;
616 /* RAW_FILEINFO_POSITION_INFORMATION interface */
618 enum fileinfo_level level;
619 union smb_fileinfo_in in;
624 } position_information;
626 /* RAW_FILEINFO_MODE_INFORMATION interface */
628 enum fileinfo_level level;
629 union smb_fileinfo_in in;
636 /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
638 enum fileinfo_level level;
639 union smb_fileinfo_in in;
642 uint32 alignment_requirement;
644 } alignment_information;
646 /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
648 enum fileinfo_level level;
649 union smb_fileinfo_in in;
660 } network_open_information;
663 /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
665 enum fileinfo_level level;
666 union smb_fileinfo_in in;
672 } attribute_tag_information;
676 enum setfileinfo_level {
677 RAW_SFILEINFO_GENERIC = 0xF000,
678 RAW_SFILEINFO_SETATTR, /* SMBsetatr */
679 RAW_SFILEINFO_SETATTRE, /* SMBsetattrE */
680 RAW_SFILEINFO_STANDARD = SMB_SFILEINFO_STANDARD,
681 RAW_SFILEINFO_EA_SET = SMB_SFILEINFO_EA_SET,
682 RAW_SFILEINFO_BASIC_INFO = SMB_SFILEINFO_BASIC_INFO,
683 RAW_SFILEINFO_DISPOSITION_INFO = SMB_SFILEINFO_DISPOSITION_INFO,
684 RAW_SFILEINFO_ALLOCATION_INFO = SMB_SFILEINFO_ALLOCATION_INFO,
685 RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
686 RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
687 RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
688 RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
689 RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
690 RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
691 RAW_SFILEINFO_DISPOSITION_INFORMATION = SMB_SFILEINFO_DISPOSITION_INFORMATION,
692 RAW_SFILEINFO_POSITION_INFORMATION = SMB_SFILEINFO_POSITION_INFORMATION,
693 RAW_SFILEINFO_MODE_INFORMATION = SMB_SFILEINFO_MODE_INFORMATION,
694 RAW_SFILEINFO_ALLOCATION_INFORMATION = SMB_SFILEINFO_ALLOCATION_INFORMATION,
695 RAW_SFILEINFO_END_OF_FILE_INFORMATION = SMB_SFILEINFO_END_OF_FILE_INFORMATION,
696 RAW_SFILEINFO_1023 = SMB_SFILEINFO_1023,
697 RAW_SFILEINFO_1025 = SMB_SFILEINFO_1025,
698 RAW_SFILEINFO_1029 = SMB_SFILEINFO_1029,
699 RAW_SFILEINFO_1032 = SMB_SFILEINFO_1032,
700 RAW_SFILEINFO_1039 = SMB_SFILEINFO_1039,
701 RAW_SFILEINFO_1040 = SMB_SFILEINFO_1040
704 /* union used in setfileinfo() and setpathinfo() calls */
705 union smb_setfileinfo {
706 /* generic interface */
708 enum setfileinfo_level level;
710 /* we are combining setfileinfo and setpathinfo into one
712 union setfileinfo_file {
718 /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
720 enum setfileinfo_level level;
721 union setfileinfo_file file;
728 /* RAW_SFILEINFO_SETATTRE (SMBsetattrE) interface - only via setfileinfo() */
730 enum setfileinfo_level level;
731 union setfileinfo_file file;
741 /* RAW_SFILEINFO_STANDARD interface */
743 enum setfileinfo_level level;
744 union setfileinfo_file file;
749 /* notice that size, alloc_size and attrib are not settable,
750 unlike the corresponding qfileinfo level */
754 /* RAW_SFILEINFO_EA_SET interface */
756 enum setfileinfo_level level;
757 union setfileinfo_file file;
763 /* RAW_SFILEINFO_BASIC_INFO and
764 RAW_SFILEINFO_BASIC_INFORMATION interfaces */
766 enum setfileinfo_level level;
767 union setfileinfo_file file;
778 /* RAW_SFILEINFO_DISPOSITION_INFO and
779 RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
781 enum setfileinfo_level level;
782 union setfileinfo_file file;
785 BOOL delete_on_close;
789 /* RAW_SFILEINFO_ALLOCATION_INFO and
790 RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
792 enum setfileinfo_level level;
793 union setfileinfo_file file;
796 /* w2k3 rounds this up to nearest 4096 */
801 /* RAW_SFILEINFO_END_OF_FILE_INFO and
802 RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
804 enum setfileinfo_level level;
805 union setfileinfo_file file;
812 /* RAW_SFILEINFO_RENAME_INFORMATION interface */
814 enum setfileinfo_level level;
815 union setfileinfo_file file;
820 const char *new_name;
822 } rename_information;
824 /* RAW_SFILEINFO_POSITION_INFORMATION interface */
826 enum setfileinfo_level level;
827 union setfileinfo_file file;
832 } position_information;
834 /* RAW_SFILEINFO_MODE_INFORMATION interface */
836 enum setfileinfo_level level;
837 union setfileinfo_file file;
840 /* valid values seem to be 0, 2, 4 and 6 */
847 /* RAW_SFILEINFO_UNIX_BASIC interface */
849 enum setfileinfo_level level;
850 union setfileinfo_file file;
852 uint32 mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
855 NTTIME status_change_time;
869 /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
871 enum setfileinfo_level level;
872 union setfileinfo_file file;
874 const char *link_dest;
876 } unix_link, unix_hlink;
880 enum fsinfo_level {RAW_QFS_GENERIC = 0xF000,
881 RAW_QFS_DSKATTR, /* SMBdskattr */
882 RAW_QFS_ALLOCATION = SMB_QFS_ALLOCATION,
883 RAW_QFS_VOLUME = SMB_QFS_VOLUME,
884 RAW_QFS_VOLUME_INFO = SMB_QFS_VOLUME_INFO,
885 RAW_QFS_SIZE_INFO = SMB_QFS_SIZE_INFO,
886 RAW_QFS_DEVICE_INFO = SMB_QFS_DEVICE_INFO,
887 RAW_QFS_ATTRIBUTE_INFO = SMB_QFS_ATTRIBUTE_INFO,
888 RAW_QFS_UNIX_INFO = SMB_QFS_UNIX_INFO,
889 RAW_QFS_VOLUME_INFORMATION = SMB_QFS_VOLUME_INFORMATION,
890 RAW_QFS_SIZE_INFORMATION = SMB_QFS_SIZE_INFORMATION,
891 RAW_QFS_DEVICE_INFORMATION = SMB_QFS_DEVICE_INFORMATION,
892 RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
893 RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
894 RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
895 RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
898 /* union for fsinfo() backend call. Note that there are no in
899 structures, as this call only contains out parameters */
901 /* generic interface */
903 enum fsinfo_level level;
907 large_t blocks_total;
911 uint32 serial_number;
913 uint32 max_file_component_length;
915 uint32 device_characteristics;
925 /* SMBdskattr interface */
927 enum fsinfo_level level;
931 uint16 blocks_per_unit;
937 /* trans2 RAW_QFS_ALLOCATION interface */
939 enum fsinfo_level level;
943 uint32 sectors_per_unit;
944 uint32 total_alloc_units;
945 uint32 avail_alloc_units;
946 uint16 bytes_per_sector;
950 /* TRANS2 RAW_QFS_VOLUME interface */
952 enum fsinfo_level level;
955 uint32 serial_number;
956 WIRE_STRING volume_name;
960 /* TRANS2 RAW_QFS_VOLUME_INFO and RAW_QFS_VOLUME_INFORMATION interfaces */
962 enum fsinfo_level level;
966 uint32 serial_number;
967 WIRE_STRING volume_name;
971 /* trans2 RAW_QFS_SIZE_INFO and RAW_QFS_SIZE_INFORMATION interfaces */
973 enum fsinfo_level level;
976 large_t total_alloc_units;
977 large_t avail_alloc_units; /* maps to call_avail_alloc_units */
978 uint32 sectors_per_unit;
979 uint32 bytes_per_sector;
983 /* TRANS2 RAW_QFS_DEVICE_INFO and RAW_QFS_DEVICE_INFORMATION interfaces */
985 enum fsinfo_level level;
989 uint32 characteristics;
994 /* TRANS2 RAW_QFS_ATTRIBUTE_INFO and RAW_QFS_ATTRIBUTE_INFORMATION interfaces */
996 enum fsinfo_level level;
1000 uint32 max_file_component_length;
1001 WIRE_STRING fs_type;
1006 /* TRANS2 RAW_QFS_UNIX_INFO interface */
1008 enum fsinfo_level level;
1011 uint16 major_version;
1012 uint16 minor_version;
1017 /* trans2 RAW_QFS_QUOTA_INFORMATION interface */
1019 enum fsinfo_level level;
1025 large_t quota_flags;
1027 } quota_information;
1029 /* trans2 RAW_QFS_FULL_SIZE_INFORMATION interface */
1031 enum fsinfo_level level;
1034 large_t total_alloc_units;
1035 large_t call_avail_alloc_units;
1036 large_t actual_avail_alloc_units;
1037 uint32 sectors_per_unit;
1038 uint32 bytes_per_sector;
1040 } full_size_information;
1042 /* trans2 RAW_QFS_OBJECTID_INFORMATION interface */
1044 enum fsinfo_level level;
1050 } objectid_information;
1055 enum open_level {RAW_OPEN_OPEN, RAW_OPEN_OPENX,
1056 RAW_OPEN_MKNEW, RAW_OPEN_CTEMP, RAW_OPEN_SPLOPEN,
1057 RAW_OPEN_NTCREATEX, RAW_OPEN_T2OPEN};
1059 /* the generic interface is defined to be equal to the NTCREATEX interface */
1060 #define RAW_OPEN_GENERIC RAW_OPEN_NTCREATEX
1062 /* union for open() backend call */
1064 /* SMBNTCreateX interface */
1066 enum open_level level;
1074 uint32 share_access;
1075 uint32 open_disposition;
1076 uint32 create_options;
1077 uint32 impersonation;
1078 uint8 security_flags;
1085 uint32 create_action;
1097 } ntcreatex, generic;
1099 /* TRANS2_OPEN interface */
1101 enum open_level level;
1113 struct ea_struct *eas;
1129 /* SMBopen interface */
1131 enum open_level level;
1135 uint16 search_attrs;
1147 /* SMBopenX interface */
1149 enum open_level level;
1154 uint16 search_attrs; /* not honoured by win2003 */
1156 time_t write_time; /* not honoured by win2003 */
1158 uint32 size; /* note that this sets the
1159 initial file size, not
1160 just allocation size */
1161 uint32 timeout; /* not honoured by win2003 */
1179 /* SMBmknew interface */
1181 enum open_level level;
1193 /* SMBctemp interface */
1195 enum open_level level;
1200 const char *directory;
1204 /* temp name, relative to directory */
1209 /* SMBsplopen interface */
1211 enum open_level level;
1214 uint16 setup_length;
1226 enum read_level {RAW_READ_GENERIC, RAW_READ_READBRAW, RAW_READ_LOCKREAD, RAW_READ_READ, RAW_READ_READX};
1228 /* union for read() backend call
1230 note that .infoX.out.data will be allocated before the backend is
1231 called. It will be big enough to hold the maximum size asked for
1234 /* generic interface */
1236 enum read_level level;
1240 SMB_BIG_UINT offset;
1250 /* SMBreadbraw interface */
1252 enum read_level level;
1256 SMB_BIG_UINT offset;
1268 /* SMBlockandread interface */
1270 enum read_level level;
1284 /* SMBread interface */
1286 enum read_level level;
1300 /* SMBreadX interface */
1302 enum read_level level;
1306 SMB_BIG_UINT offset;
1314 uint16 compaction_mode;
1321 enum write_level {RAW_WRITE_GENERIC, RAW_WRITE_WRITEUNLOCK, RAW_WRITE_WRITE,
1322 RAW_WRITE_WRITEX, RAW_WRITE_WRITECLOSE, RAW_WRITE_SPLWRITE};
1324 /* union for write() backend call
1327 /* generic interface */
1329 enum write_level level;
1333 SMB_BIG_UINT offset;
1343 /* SMBwriteunlock interface */
1345 enum write_level level;
1359 /* SMBwrite interface */
1361 enum write_level level;
1375 /* SMBwriteX interface */
1377 enum write_level level;
1381 SMB_BIG_UINT offset;
1393 /* SMBwriteclose interface */
1395 enum write_level level;
1409 /* SMBsplwrite interface */
1411 enum write_level level;
1422 enum lock_level {RAW_LOCK_GENERIC, RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX};
1424 /* union for lock() backend call
1427 /* generic interface */
1429 enum lock_level level;
1436 /* SMBlock interface */
1438 enum lock_level level;
1447 /* SMBunlock interface */
1449 enum lock_level level;
1458 /* SMBlockingX interface */
1460 enum lock_level level;
1468 struct smb_lock_entry {
1470 SMB_BIG_UINT offset;
1472 } *locks; /* unlocks are first in the arrray */
1478 enum close_enum {RAW_CLOSE_GENERIC, RAW_CLOSE_CLOSE, RAW_CLOSE_SPLCLOSE};
1481 union for close() backend call
1484 /* generic interface */
1486 enum close_enum level;
1493 /* SMBclose interface */
1495 enum close_enum level;
1503 /* SMBsplclose interface - empty! */
1505 enum close_enum level;
1514 enum lpq_level {RAW_LPQ_GENERIC, RAW_LPQ_RETQ};
1517 union for lpq() backend
1520 /* generic interface */
1522 enum lpq_level level;
1527 /* SMBsplretq interface */
1529 enum lpq_level level;
1550 /* struct for SMBioctl */
1561 /* struct for SMBflush */
1569 /* struct for SMBcopy */
1584 /* struct for transact2 call */
1606 /* struct for nttransact2 call */
1607 struct smb_nttrans {
1628 /* struct for nttrans change notify call */
1632 uint32 completion_filter;
1646 /* struct for NT ioctl call */
1647 struct smb_ntioctl {
1657 enum search_level {RAW_SEARCH_GENERIC = 0xF000,
1658 RAW_SEARCH_SEARCH, /* SMBsearch */
1659 RAW_SEARCH_STANDARD = SMB_FIND_STANDARD,
1660 RAW_SEARCH_EA_SIZE = SMB_FIND_EA_SIZE,
1661 RAW_SEARCH_DIRECTORY_INFO = SMB_FIND_DIRECTORY_INFO,
1662 RAW_SEARCH_FULL_DIRECTORY_INFO = SMB_FIND_FULL_DIRECTORY_INFO,
1663 RAW_SEARCH_NAME_INFO = SMB_FIND_NAME_INFO,
1664 RAW_SEARCH_BOTH_DIRECTORY_INFO = SMB_FIND_BOTH_DIRECTORY_INFO,
1665 RAW_SEARCH_261 = SMB_FIND_261,
1666 RAW_SEARCH_262 = SMB_FIND_262,
1667 RAW_SEARCH_UNIX_INFO = SMB_FIND_UNIX_INFO};
1670 /* union for file search */
1671 union smb_search_first {
1673 enum search_level level;
1676 /* search (old) findfirst interface */
1678 enum search_level level;
1682 uint16 search_attrib;
1683 const char *pattern;
1690 /* trans2 findfirst interface */
1692 enum search_level level;
1695 uint16 search_attrib;
1698 uint32 storage_type;
1699 const char *pattern;
1704 uint16 end_of_search;
1709 /* union for file search continue */
1710 union smb_search_next {
1712 enum search_level level;
1715 /* search (old) findnext interface */
1717 enum search_level level;
1721 uint16 search_attrib;
1722 DATA_BLOB search_id;
1729 /* trans2 findnext interface */
1731 enum search_level level;
1738 const char *last_name;
1742 uint16 end_of_search;
1747 /* union for search reply file data */
1748 union smb_search_data {
1749 /* search (old) findfirst */
1754 DATA_BLOB search_id; /* used to resume search from this point */
1758 /* trans2 findfirst RAW_SEARCH_STANDARD level */
1770 /* trans2 findfirst RAW_SEARCH_EA_SIZE level */
1783 /* RAW_SEARCH_DIRECTORY_INFO interface */
1796 /* RAW_SEARCH_FULL_DIRECTORY_INFO interface */
1808 } full_directory_info;
1810 /* RAW_SEARCH_NAME_INFO interface */
1816 /* RAW_SEARCH_BOTH_DIRECTORY_INFO interface */
1827 WIRE_STRING short_name;
1829 } both_directory_info;
1831 /* RAW_SEARCH_261 interface */
1846 /* RAW_SEARCH_262 interface */
1858 WIRE_STRING short_name;
1862 /* RAW_SEARCH_UNIX_INFO interface */
1864 large_t end_of_file;
1866 NTTIME status_change_time;
1875 large_t permissions;
1881 enum search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_CLOSE};
1883 /* union for file search close */
1884 union smb_search_close {
1886 enum search_close_level level;
1889 /* SMBfindclose interface */
1891 enum search_level level;