xref: /linux/fs/smb/common/smbglob.h (revision f2161d5f1aae21a42b0a64d87e10cb31db423f42)
1 /* SPDX-License-Identifier: LGPL-2.1 */
2 /*
3  *
4  *   Copyright (C) International Business Machines  Corp., 2002,2008
5  *                 2018 Samsung Electronics Co., Ltd.
6  *   Author(s): Steve French (sfrench@us.ibm.com)
7  *              Jeremy Allison (jra@samba.org)
8  *              Namjae Jeon (linkinjeon@kernel.org)
9  *
10  */
11 #ifndef _COMMON_SMB_GLOB_H
12 #define _COMMON_SMB_GLOB_H
13 
14 struct smb_version_values {
15 	char		*version_string;
16 	__u16		protocol_id;
17 	__le16		lock_cmd;
18 	__u32		req_capabilities;
19 	__u32		max_read_size;
20 	__u32		max_write_size;
21 	__u32		max_trans_size;
22 	__u32		max_credits;
23 	__u32		large_lock_type;
24 	__u32		exclusive_lock_type;
25 	__u32		shared_lock_type;
26 	__u32		unlock_lock_type;
27 	size_t		header_size;
28 	size_t		max_header_size;
29 	size_t		read_rsp_size;
30 	unsigned int	cap_unix;
31 	unsigned int	cap_nt_find;
32 	unsigned int	cap_large_files;
33 	unsigned int	cap_unicode;
34 	__u16		signing_enabled;
35 	__u16		signing_required;
36 	size_t		create_lease_size;
37 	size_t		create_durable_size;
38 	size_t		create_durable_v2_size;
39 	size_t		create_mxac_size;
40 	size_t		create_disk_id_size;
41 	size_t		create_posix_size;
42 };
43 
get_rfc1002_len(void * buf)44 static inline unsigned int get_rfc1002_len(void *buf)
45 {
46 	return be32_to_cpu(*((__be32 *)buf)) & 0xffffff;
47 }
48 
inc_rfc1001_len(void * buf,int count)49 static inline void inc_rfc1001_len(void *buf, int count)
50 {
51 	be32_add_cpu((__be32 *)buf, count);
52 }
53 
54 #define SMB1_VERSION_STRING	"1.0"
55 #define SMB20_VERSION_STRING    "2.0"
56 #define SMB21_VERSION_STRING	"2.1"
57 #define SMBDEFAULT_VERSION_STRING "default"
58 #define SMB3ANY_VERSION_STRING "3"
59 #define SMB30_VERSION_STRING	"3.0"
60 #define SMB302_VERSION_STRING	"3.02"
61 #define ALT_SMB302_VERSION_STRING "3.0.2"
62 #define SMB311_VERSION_STRING	"3.1.1"
63 #define ALT_SMB311_VERSION_STRING "3.11"
64 
65 #define CIFS_DEFAULT_IOSIZE (1024 * 1024)
66 
67 #define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */
68 
69 #endif	/* _COMMON_SMB_GLOB_H */
70