2 Unix SMB/CIFS implementation.
6 Copyright (C) Andrew Tridgell 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "libcli/raw/libcliraw.h"
31 #define BIT_NAME(x) { #x, x }
33 const static struct bitmapping fs_attr_bits[] = {
34 BIT_NAME(FS_ATTR_CASE_SENSITIVE_SEARCH),
35 BIT_NAME(FS_ATTR_CASE_PRESERVED_NAMES),
36 BIT_NAME(FS_ATTR_UNICODE_ON_DISK),
37 BIT_NAME(FS_ATTR_PERSISTANT_ACLS),
38 BIT_NAME(FS_ATTR_COMPRESSION),
39 BIT_NAME(FS_ATTR_QUOTAS),
40 BIT_NAME(FS_ATTR_SPARSE_FILES),
41 BIT_NAME(FS_ATTR_REPARSE_POINTS),
42 BIT_NAME(FS_ATTR_REMOTE_STORAGE),
43 BIT_NAME(FS_ATTR_LFN_SUPPORT),
44 BIT_NAME(FS_ATTR_IS_COMPRESSED),
45 BIT_NAME(FS_ATTR_OBJECT_IDS),
46 BIT_NAME(FS_ATTR_ENCRYPTION),
47 BIT_NAME(FS_ATTR_NAMED_STREAMS),
51 const static struct bitmapping capability_bits[] = {
52 BIT_NAME(CAP_RAW_MODE),
53 BIT_NAME(CAP_MPX_MODE),
54 BIT_NAME(CAP_UNICODE),
55 BIT_NAME(CAP_LARGE_FILES),
56 BIT_NAME(CAP_NT_SMBS),
57 BIT_NAME(CAP_RPC_REMOTE_APIS),
58 BIT_NAME(CAP_STATUS32),
59 BIT_NAME(CAP_LEVEL_II_OPLOCKS),
60 BIT_NAME(CAP_LOCK_AND_READ),
61 BIT_NAME(CAP_NT_FIND),
63 BIT_NAME(CAP_W2K_SMBS),
64 BIT_NAME(CAP_LARGE_READX),
65 BIT_NAME(CAP_LARGE_WRITEX),
67 BIT_NAME(CAP_EXTENDED_SECURITY),
71 static void show_bits(const struct bitmapping *bm, uint32_t value)
74 for (i=0;bm[i].name;i++) {
75 if (value & bm[i].value) {
76 d_printf("\t%s\n", bm[i].name);
77 value &= ~bm[i].value;
81 d_printf("\tunknown bits: 0x%08x\n", value);
87 print out server properties
89 BOOL torture_test_properties(void)
91 struct smbcli_state *cli;
96 printf("starting properties test\n");
100 if (!torture_open_connection(&cli)) {
104 d_printf("Capabilities: 0x%08x\n", cli->transport->negotiate.capabilities);
105 show_bits(capability_bits, cli->transport->negotiate.capabilities);
108 fs.attribute_info.level = RAW_QFS_ATTRIBUTE_INFO;
109 status = smb_raw_fsinfo(cli->tree, cli, &fs);
110 if (!NT_STATUS_IS_OK(status)) {
111 d_printf("qfsinfo failed - %s\n", nt_errstr(status));
114 d_printf("Filesystem attributes: 0x%08x\n",
115 fs.attribute_info.out.fs_attr);
116 show_bits(fs_attr_bits, fs.attribute_info.out.fs_attr);
117 d_printf("max_file_component_length: %d\n",
118 fs.attribute_info.out.max_file_component_length);
119 d_printf("fstype: %s\n", fs.attribute_info.out.fs_type.s);
122 if (!torture_close_connection(cli)) {