Print this page
12513 SMB 3.1.1 support for server
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/smbsrv/smb_ioctl.h
+++ new/usr/src/uts/common/smbsrv/smb_ioctl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
24 24 * Copyright 2017 Joyent, Inc.
25 + * Copyright 2020 RackTop Systems, Inc.
25 26 */
26 27
27 28 #ifndef _SMB_IOCTL_H_
28 29 #define _SMB_IOCTL_H_
29 30
30 31 #ifdef __cplusplus
31 32 extern "C" {
32 33 #endif
33 34
34 35 #include <sys/types.h>
35 36 #include <sys/param.h>
36 37 #include <smbsrv/smbinfo.h>
37 38
38 39 #define SMB_IOC_VERSION 0x534D4201 /* SMB1 */
39 40
40 41 #define SMB_IOC_BASE (('S' << 16) | ('B' << 8))
41 42
42 43 #define SMB_IOC_CONFIG _IOW(SMB_IOC_BASE, 1, int)
43 44 #define SMB_IOC_START _IOW(SMB_IOC_BASE, 2, int)
44 45 #define SMB_IOC_GMTOFF _IOW(SMB_IOC_BASE, 3, int)
45 46 #define SMB_IOC_SHARE _IOW(SMB_IOC_BASE, 4, int)
46 47 #define SMB_IOC_UNSHARE _IOW(SMB_IOC_BASE, 5, int)
47 48 #define SMB_IOC_NUMOPEN _IOW(SMB_IOC_BASE, 6, int)
48 49 #define SMB_IOC_SVCENUM _IOW(SMB_IOC_BASE, 7, int)
49 50 #define SMB_IOC_FILE_CLOSE _IOW(SMB_IOC_BASE, 8, int)
50 51 #define SMB_IOC_SESSION_CLOSE _IOW(SMB_IOC_BASE, 9, int)
51 52 #define SMB_IOC_STOP _IOW(SMB_IOC_BASE, 10, int)
52 53 #define SMB_IOC_EVENT _IOW(SMB_IOC_BASE, 11, int)
53 54 #define SMB_IOC_SHAREINFO _IOW(SMB_IOC_BASE, 12, int)
54 55 #define SMB_IOC_SPOOLDOC _IOW(SMB_IOC_BASE, 13, int)
55 56
56 57 typedef struct smb_ioc_header {
57 58 uint32_t version;
58 59 uint32_t crc;
59 60 uint32_t len;
60 61 int cmd;
61 62 } smb_ioc_header_t;
62 63
63 64 typedef struct smb_ioc_spooldoc {
64 65 smb_ioc_header_t hdr;
65 66 smb_inaddr_t ipaddr;
66 67 uint32_t spool_num;
67 68 char username[MAXNAMELEN];
68 69 char path[MAXPATHLEN];
69 70 } smb_ioc_spooldoc_t;
70 71
71 72 typedef struct {
72 73 smb_ioc_header_t hdr;
73 74 int32_t offset;
74 75 } smb_ioc_gmt_t;
75 76
76 77 typedef struct smb_ioc_share {
77 78 smb_ioc_header_t hdr;
78 79 uint32_t shrlen;
79 80 char shr[1];
80 81 } smb_ioc_share_t;
81 82
82 83 typedef struct smb_ioc_shareinfo {
83 84 smb_ioc_header_t hdr;
84 85 char shrname[MAXNAMELEN];
85 86 uint32_t shortnames;
86 87 } smb_ioc_shareinfo_t;
87 88
88 89 typedef struct smb_ioc_start {
89 90 smb_ioc_header_t hdr;
90 91 int opipe;
91 92 int lmshrd;
92 93 int udoor;
93 94 /* These are used only by libfksmbsrv */
94 95 void *opipe_func;
95 96 void *lmshr_func;
96 97 void *udoor_func;
97 98 } smb_ioc_start_t;
98 99
99 100 typedef struct smb_ioc_event {
100 101 smb_ioc_header_t hdr;
101 102 uint32_t txid;
102 103 } smb_ioc_event_t;
103 104
104 105 typedef struct smb_ioc_opennum {
105 106 smb_ioc_header_t hdr;
106 107 uint32_t open_users;
107 108 uint32_t open_trees;
108 109 uint32_t open_files;
109 110 uint32_t qualtype;
110 111 char qualifier[MAXNAMELEN];
111 112 } smb_ioc_opennum_t;
112 113
113 114 /*
114 115 * For enumeration, user and session are synonymous, as are
115 116 * connection and tree.
116 117 */
117 118 #define SMB_SVCENUM_TYPE_USER 0x55534552 /* 'USER' */
118 119 #define SMB_SVCENUM_TYPE_TREE 0x54524545 /* 'TREE' */
119 120 #define SMB_SVCENUM_TYPE_FILE 0x46494C45 /* 'FILE' */
120 121 #define SMB_SVCENUM_TYPE_SHARE 0x53484152 /* 'SHAR' */
121 122
122 123 /* Maximum size of payload data an smbsrv ioctl may use. */
123 124 #define SMB_IOC_DATA_SIZE (256 * 1024)
124 125
125 126 typedef struct smb_svcenum {
126 127 uint32_t se_type; /* object type to enumerate */
127 128 uint32_t se_level; /* level of detail being requested */
128 129 uint32_t se_prefmaxlen; /* client max size buffer preference */
129 130 /* (ignored by kernel) */
130 131 uint32_t se_resume; /* client resume handle */
131 132 uint32_t se_bavail; /* remaining buffer space in bytes */
132 133 uint32_t se_bused; /* consumed buffer space in bytes */
133 134 uint32_t se_ntotal; /* total number of objects */
134 135 uint32_t se_nlimit; /* max number of objects to return */
135 136 uint32_t se_nitems; /* number of objects in buf */
136 137 uint32_t se_nskip; /* number of objects to skip */
137 138 uint32_t se_status; /* enumeration status */
138 139 uint32_t se_buflen; /* length of the buffer in bytes */
139 140 uint8_t se_buf[1]; /* buffer to hold enumeration data */
140 141 } smb_svcenum_t;
141 142
142 143 typedef struct smb_ioc_svcenum {
143 144 smb_ioc_header_t hdr;
144 145 smb_svcenum_t svcenum;
145 146 } smb_ioc_svcenum_t;
146 147
147 148 typedef struct smb_ioc_session {
148 149 smb_ioc_header_t hdr;
149 150 char client[MAXNAMELEN];
150 151 char username[MAXNAMELEN];
151 152 } smb_ioc_session_t;
152 153
153 154 typedef struct smb_ioc_fileid {
154 155 smb_ioc_header_t hdr;
155 156 uint32_t uniqid;
156 157 } smb_ioc_fileid_t;
157 158
158 159 /* See also: smb_kmod_cfg_t */
159 160 typedef struct smb_ioc_cfg {
160 161 smb_ioc_header_t hdr;
161 162 uint32_t maxworkers;
162 163 uint32_t maxconnections;
163 164 uint32_t keepalive;
164 165 int32_t restrict_anon;
165 166 int32_t signing_enable;
166 167 int32_t signing_required;
167 168 int32_t oplock_enable;
168 169 int32_t sync_enable;
169 170 int32_t secmode;
↓ open down ↓ |
135 lines elided |
↑ open up ↑ |
170 171 int32_t netbios_enable;
171 172 int32_t ipv6_enable;
172 173 int32_t print_enable;
173 174 int32_t traverse_mounts;
174 175 uint32_t max_protocol;
175 176 uint32_t min_protocol;
176 177 uint32_t encrypt;
177 178 uint32_t exec_flags;
178 179 uint32_t negtok_len;
179 180 smb_version_t version;
181 + uint16_t encrypt_cipher;
180 182 uint16_t initial_credits;
181 183 uint16_t maximum_credits;
182 184 /* SMB negotiate protocol response. */
183 185 uuid_t machine_uuid;
184 186 uchar_t negtok[SMB_PI_MAX_NEGTOK];
185 187 char native_os[SMB_PI_MAX_NATIVE_OS];
186 188 char native_lm[SMB_PI_MAX_LANMAN];
187 189 char nbdomain[NETBIOS_NAME_SZ];
188 190 char fqdn[SMB_PI_MAX_DOMAIN];
189 191 char hostname[SMB_PI_MAX_HOST];
190 192 char system_comment[SMB_PI_MAX_COMMENT];
191 193 } smb_ioc_cfg_t;
192 194
193 195 typedef union smb_ioc {
194 196 smb_ioc_header_t ioc_hdr;
195 197 smb_ioc_gmt_t ioc_gmt;
196 198 smb_ioc_cfg_t ioc_cfg;
197 199 smb_ioc_start_t ioc_start;
198 200 smb_ioc_event_t ioc_event;
199 201 smb_ioc_opennum_t ioc_opennum;
200 202 smb_ioc_svcenum_t ioc_svcenum;
201 203 smb_ioc_session_t ioc_session;
202 204 smb_ioc_fileid_t ioc_fileid;
203 205 smb_ioc_share_t ioc_share;
204 206 smb_ioc_shareinfo_t ioc_shareinfo;
205 207 smb_ioc_spooldoc_t ioc_spooldoc;
206 208 } smb_ioc_t;
207 209
208 210 uint32_t smb_crc_gen(uint8_t *, size_t);
209 211
210 212 /* fksmbd (init,open,close,ioctl) calls into libfksmbsrv */
211 213 int fksmbsrv_drv_open(void);
212 214 int fksmbsrv_drv_close(void);
213 215 int fksmbsrv_drv_ioctl(int cmd, void *arg);
214 216 void fksmbsrv_drv_load(void);
215 217
216 218 #ifdef __cplusplus
217 219 }
218 220 #endif
219 221
220 222 #endif /* _SMB_IOCTL_H_ */
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX