aboutsummaryrefslogtreecommitdiff
path: root/fs/smb/client/smb1proto.h
blob: 5f522d359952d461bc7c2fa1abfa763d74aafc5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
/* SPDX-License-Identifier: LGPL-2.1 */
/*
 *
 *   Copyright (c) International Business Machines  Corp., 2002,2008
 *   Author(s): Steve French (sfrench@us.ibm.com)
 *
 */
#ifndef _SMB1PROTO_H
#define _SMB1PROTO_H

#include <linux/uidgid_types.h>
#include <linux/unaligned.h>
#include "../common/smb2pdu.h"
#include "cifsglob.h"

struct cifs_unix_set_info_args {
	__u64	ctime;
	__u64	atime;
	__u64	mtime;
	__u64	mode;
	kuid_t	uid;
	kgid_t	gid;
	dev_t	device;
};

#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY

/*
 * cifssmb.c
 */
int small_smb_init_no_tc(const int smb_command, const int wct,
			 struct cifs_ses *ses, void **request_buf);
int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses,
		     struct TCP_Server_Info *server);
int CIFSTCon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
	     struct cifs_tcon *tcon, const struct nls_table *nls_codepage);
int CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon);
int CIFSSMBEcho(struct TCP_Server_Info *server);
int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
		     const char *fileName, __u16 type,
		     const struct nls_table *nls_codepage, int remap);
int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
		   const char *name, struct cifs_sb_info *cifs_sb,
		   struct dentry *dentry);
int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
		 const char *name, struct cifs_sb_info *cifs_sb);
int CIFSSMBMkDir(const unsigned int xid, struct inode *inode, umode_t mode,
		 struct cifs_tcon *tcon, const char *name,
		 struct cifs_sb_info *cifs_sb);
int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
		    __u32 posix_flags, __u64 mode, __u16 *netfid,
		    FILE_UNIX_BASIC_INFO *pRetData, __u32 *pOplock,
		    const char *name, const struct nls_table *nls_codepage,
		    int remap);
int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
		  const char *fileName, const int openDisposition,
		  const int access_flags, const int create_options,
		  __u16 *netfid, int *pOplock, FILE_ALL_INFO *pfile_info,
		  const struct nls_table *nls_codepage, int remap);
int CIFS_open(const unsigned int xid, struct cifs_open_parms *oparms,
	      int *oplock, FILE_ALL_INFO *buf);
int cifs_async_readv(struct cifs_io_subrequest *rdata);
int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
		unsigned int *nbytes, char **buf, int *pbuf_type);
int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
		 unsigned int *nbytes, const char *buf);
void cifs_async_writev(struct cifs_io_subrequest *wdata);
int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
		  unsigned int *nbytes, struct kvec *iov, int n_vec);
int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
	       const __u16 netfid, const __u8 lock_type,
	       const __u32 num_unlock, const __u32 num_lock,
	       LOCKING_ANDX_RANGE *buf);
int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
		const __u16 smb_file_id, const __u32 netpid, const __u64 len,
		const __u64 offset, const __u32 numUnlock, const __u32 numLock,
		const __u8 lockType, const bool waitFlag,
		const __u8 oplock_level);
int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
		     const __u16 smb_file_id, const __u32 netpid,
		     const loff_t start_offset, const __u64 len,
		     struct file_lock *pLockData, const __u16 lock_type,
		     const bool waitFlag);
int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
		 int smb_file_id);
int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
		 int smb_file_id);
int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
		  struct dentry *source_dentry, const char *from_name,
		  const char *to_name, struct cifs_sb_info *cifs_sb);
int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
			  int netfid, const char *target_name,
			  const struct nls_table *nls_codepage, int remap);
int CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
			  const char *fromName, const char *toName,
			  const struct nls_table *nls_codepage, int remap);
int CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
			   const char *fromName, const char *toName,
			   const struct nls_table *nls_codepage, int remap);
int CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
		       struct dentry *source_dentry, const char *from_name,
		       const char *to_name, struct cifs_sb_info *cifs_sb);
int CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
			    const unsigned char *searchName,
			    char **symlinkinfo,
			    const struct nls_table *nls_codepage, int remap);
int cifs_query_reparse_point(const unsigned int xid, struct cifs_tcon *tcon,
			     struct cifs_sb_info *cifs_sb,
			     const char *full_path, u32 *tag, struct kvec *rsp,
			     int *rsp_buftype);
struct inode *cifs_create_reparse_inode(struct cifs_open_info_data *data,
					struct super_block *sb,
					const unsigned int xid,
					struct cifs_tcon *tcon,
					const char *full_path, bool directory,
					struct kvec *reparse_iov,
					struct kvec *xattr_iov);
int CIFSSMB_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
			    __u16 fid);
int cifs_do_get_acl(const unsigned int xid, struct cifs_tcon *tcon,
		    const unsigned char *searchName, struct posix_acl **acl,
		    const int acl_type, const struct nls_table *nls_codepage,
		    int remap);
int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon,
		    const unsigned char *fileName, const struct posix_acl *acl,
		    const int acl_type, const struct nls_table *nls_codepage,
		    int remap);
int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
		   const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
		      __u16 fid, struct smb_ntsd **acl_inf, __u32 *pbuflen,
		      __u32 info);
int CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,