1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2016 Syneto S.R.L.  All rights reserved.
25 * Copyright 2019 Nexenta by DDN, Inc. All rights reserved.
26 */
27
28/*
29 * Function prototypes for the SMB module.
30 */
31
32#ifndef _SMB_KPROTO_H_
33#define	_SMB_KPROTO_H_
34
35#ifdef	__cplusplus
36extern "C" {
37#endif
38
39#include <sys/types.h>
40#include <sys/param.h>
41#include <sys/varargs.h>
42#include <sys/systm.h>
43#include <sys/debug.h>
44#include <sys/kmem.h>
45#include <sys/socket.h>
46#include <sys/ksocket.h>
47#include <sys/cred.h>
48#include <sys/nbmlock.h>
49#include <sys/sunddi.h>
50#include <sys/atomic.h>
51#include <smbsrv/smb.h>
52#include <smbsrv/string.h>
53#include <smbsrv/smb_vops.h>
54#include <smbsrv/smb_xdr.h>
55#include <smbsrv/smb_token.h>
56#include <smbsrv/smb_ktypes.h>
57#include <smbsrv/smb_ioctl.h>
58
59/* For timeout(9F). Not in any system header, apparently. */
60typedef void (*tmo_func_t)(void *);
61
62extern	int smb_maxbufsize;
63extern	int smb_flush_required;
64extern	int smb_dirsymlink_enable;
65extern	int smb_shortnames;
66extern	int smb_sign_debug;
67extern	uint_t smb_audit_flags;
68extern	int smb_ssetup_threshold;
69extern	int smb_tcon_threshold;
70extern	int smb_opipe_threshold;
71extern	int smb_ssetup_timeout;
72extern	int smb_tcon_timeout;
73extern	int smb_opipe_timeout;
74extern	int smb_allow_advisory_locks;
75extern	int smb_session_auth_tmo;
76
77extern const uint32_t smb_vop_dosattr_settable;
78
79/* Thread priorities - see smb_init.c */
80extern	int smbsrv_base_pri;
81extern	int smbsrv_listen_pri;
82extern	int smbsrv_receive_pri;
83extern	int smbsrv_worker_pri;
84extern	int smbsrv_notify_pri;
85extern	int smbsrv_timer_pri;
86
87extern	kmem_cache_t		*smb_cache_request;
88extern	kmem_cache_t		*smb_cache_session;
89extern	kmem_cache_t		*smb_cache_user;
90extern	kmem_cache_t		*smb_cache_tree;
91extern	kmem_cache_t		*smb_cache_ofile;
92extern	kmem_cache_t		*smb_cache_odir;
93extern	kmem_cache_t		*smb_cache_opipe;
94extern	kmem_cache_t		*smb_cache_event;
95extern	kmem_cache_t		*smb_cache_lock;
96
97extern	kmem_cache_t		*smb_kshare_cache_vfs;
98
99time_t smb_get_boottime(void);
100int smb_server_lookup(smb_server_t **);
101void smb_server_release(smb_server_t *);
102
103/*
104 * SMB request handers called from the dispatcher.  Each SMB request
105 * is handled in three phases: pre, com (command) and post.
106 *
107 * The pre-handler is primarily to set things up for the DTrace start
108 * probe.  Typically, the SMB request is unmarshalled so that request
109 * specific context can be traced.  This is also a useful place to
110 * allocate memory that will be used throughout the processing of the
111 * command.
112 *
113 * The com-handler performs the requested operation: request validation,
114 * bulk (write) incoming data decode, implementation of the appropriate
115 * algorithm and transmission of a response (as appropriate).
116 *
117 * The post-handler is always called, regardless of success or failure
118 * of the pre or com functions, to trigger the DTrace done probe and
119 * deallocate memory allocated in the pre-handler.
120 */
121#define	SMB_SDT_OPS(NAME)	\
122	smb_pre_##NAME,		\
123	smb_com_##NAME,		\
124	smb_post_##NAME
125
126#define	SMB_COM_DECL(NAME)				\
127	smb_sdrc_t smb_pre_##NAME(smb_request_t *);	\
128	smb_sdrc_t smb_com_##NAME(smb_request_t *);	\
129	void smb_post_##NAME(smb_request_t *)
130
131SMB_COM_DECL(check_directory);
132SMB_COM_DECL(close);
133SMB_COM_DECL(close_and_tree_disconnect);
134SMB_COM_DECL(close_print_file);
135SMB_COM_DECL(create);
136SMB_COM_DECL(create_directory);
137SMB_COM_DECL(create_new);
138SMB_COM_DECL(create_temporary);
139SMB_COM_DECL(delete);
140SMB_COM_DECL(delete_directory);
141SMB_COM_DECL(echo);
142SMB_COM_DECL(find);
143SMB_COM_DECL(find_close);
144SMB_COM_DECL(find_close2);
145SMB_COM_DECL(find_unique);
146SMB_COM_DECL(flush);
147SMB_COM_DECL(get_print_queue);
148SMB_COM_DECL(invalid);
149SMB_COM_DECL(ioctl);
150SMB_COM_DECL(lock_and_read);
151SMB_COM_DECL(lock_byte_range);
152SMB_COM_DECL(locking_andx);
153SMB_COM_DECL(logoff_andx);
154SMB_COM_DECL(negotiate);
155SMB_COM_DECL(nt_cancel);
156SMB_COM_DECL(nt_create_andx);
157SMB_COM_DECL(nt_rename);
158SMB_COM_DECL(nt_transact);
159SMB_COM_DECL(nt_transact_secondary);
160SMB_COM_DECL(open);
161SMB_COM_DECL(open_andx);
162SMB_COM_DECL(open_print_file);
163SMB_COM_DECL(process_exit);
164SMB_COM_DECL(query_information);
165SMB_COM_DECL(query_information2);
166SMB_COM_DECL(query_information_disk);
167SMB_COM_DECL(read);
168SMB_COM_DECL(read_andx);
169SMB_COM_DECL(read_raw);
170SMB_COM_DECL(rename);
171SMB_COM_DECL(search);
172SMB_COM_DECL(seek);
173SMB_COM_DECL(session_setup_andx);
174SMB_COM_DECL(set_information);
175SMB_COM_DECL(set_information2);
176SMB_COM_DECL(transaction);
177SMB_COM_DECL(transaction2);
178SMB_COM_DECL(transaction2_secondary);
179SMB_COM_DECL(transaction_secondary);
180SMB_COM_DECL(tree_connect);
181SMB_COM_DECL(tree_connect_andx);
182SMB_COM_DECL(tree_disconnect);
183SMB_COM_DECL(unlock_byte_range);
184SMB_COM_DECL(write);
185SMB_COM_DECL(write_and_close);
186SMB_COM_DECL(write_and_unlock);
187SMB_COM_DECL(write_andx);
188SMB_COM_DECL(write_print_file);
189SMB_COM_DECL(write_raw);
190
191#define	SMB_NT_TRANSACT_DECL(NAME)				\
192	smb_sdrc_t smb_pre_##NAME(smb_request_t *, smb_xa_t *);	\
193	smb_sdrc_t smb_##NAME(smb_request_t *, smb_xa_t *);	\
194	void smb_post_##NAME(smb_request_t *, smb_xa_t *)
195
196SMB_NT_TRANSACT_DECL(nt_transact_create);
197
198smb_sdrc_t smb_nt_transact_notify_change(smb_request_t *, smb_xa_t *);
199smb_sdrc_t smb_nt_transact_query_security_info(smb_request_t *, smb_xa_t *);
200smb_sdrc_t smb_nt_transact_set_security_info(smb_request_t *, smb_xa_t *);
201smb_sdrc_t smb_nt_transact_ioctl(smb_request_t *, smb_xa_t *);
202smb_sdrc_t smb_nt_transact_rename(smb_request_t *, smb_xa_t *);
203smb_sdrc_t smb_nt_transact_query_quota(smb_request_t *, smb_xa_t *);
204smb_sdrc_t smb_nt_transact_set_quota(smb_request_t *, smb_xa_t *);
205
206smb_sdrc_t smb_com_trans2_open2(smb_request_t *, smb_xa_t *);
207smb_sdrc_t smb_com_trans2_create_directory(smb_request_t *, smb_xa_t *);
208smb_sdrc_t smb_com_trans2_find_first2(smb_request_t *, smb_xa_t *);
209smb_sdrc_t smb_com_trans2_find_next2(smb_request_t *, smb_xa_t *);
210smb_sdrc_t smb_com_trans2_query_fs_information(smb_request_t *, smb_xa_t *);
211smb_sdrc_t smb_com_trans2_set_fs_information(smb_request_t *, smb_xa_t *);
212smb_sdrc_t smb_com_trans2_query_path_information(smb_request_t *, smb_xa_t *);
213smb_sdrc_t smb_com_trans2_query_file_information(smb_request_t *, smb_xa_t *);
214smb_sdrc_t smb_com_trans2_set_path_information(smb_request_t *, smb_xa_t *);
215smb_sdrc_t smb_com_trans2_set_file_information(smb_request_t *, smb_xa_t *);
216smb_sdrc_t smb_com_trans2_get_dfs_referral(smb_request_t *, smb_xa_t *);
217
218uint32_t smb_query_stream_info(smb_request_t *, mbuf_chain_t *,
219    smb_queryinfo_t *);
220int smb_fssize(smb_request_t *, smb_fssize_t *);
221
222/* smb_quota.c */
223uint32_t smb_quota_query_user_quota(smb_request_t *, uid_t, smb_quota_t *);
224int smb_quota_query(smb_server_t *, smb_quota_query_t *,
225    smb_quota_response_t *);
226int smb_quota_set(smb_server_t *, smb_quota_set_t *, uint32_t *);
227uint32_t smb_quota_init_sids(mbuf_chain_t *, smb_quota_query_t *,
228    smb_ofile_t *);
229uint32_t smb_quota_decode_sids(mbuf_chain_t *, list_t *);
230void smb_quota_free_sids(smb_quota_query_t *);
231void smb_quota_max_quota(mbuf_chain_t *, smb_quota_query_t *);
232uint32_t smb_quota_decode_quotas(mbuf_chain_t *, list_t *);
233uint32_t smb_quota_encode_quotas(mbuf_chain_t *, smb_quota_query_t *,
234    smb_quota_response_t *, smb_ofile_t *);
235void smb_quota_free_quotas(list_t *);
236
237void smb_query_shortname(smb_node_t *, smb_queryinfo_t *);
238
239uint32_t smb_dfs_fsctl(smb_request_t *, smb_fsctl_t *);
240uint32_t smb_dfs_get_referrals(smb_request_t *, smb_fsctl_t *);
241
242int smb1_newrq_negotiate(smb_request_t *);
243smb_sdrc_t smb1_negotiate_smb2(smb_request_t *sr);
244
245uint32_t smb_set_basic_info(smb_request_t *, smb_setinfo_t *);
246uint32_t smb_set_eof_info(smb_request_t *, smb_setinfo_t *);
247uint32_t smb_set_alloc_info(smb_request_t *, smb_setinfo_t *);
248uint32_t smb_set_disposition_info(smb_request_t *, smb_setinfo_t *);
249
250uint32_t smb_setinfo_rename(smb_request_t *, smb_node_t *, char *, int);
251uint32_t smb_common_rename(smb_request_t *, smb_fqi_t *, smb_fqi_t *);
252
253uint32_t smb_setinfo_link(smb_request_t *, smb_node_t *, char *, int);
254uint32_t smb_make_link(smb_request_t *, smb_fqi_t *, smb_fqi_t *);
255
256
257/*
258 * Logging functions
259 */
260void smb_log_flush(void);
261void smb_close_all_connections(void);
262
263int smb_net_id(uint32_t);
264
265/*
266 * Common oplock functions
267 */
268uint32_t smb_oplock_request(smb_request_t *, smb_ofile_t *, uint32_t *);
269uint32_t smb_oplock_ack_break(smb_request_t *, smb_ofile_t *, uint32_t *);
270uint32_t smb_oplock_break_PARENT(smb_node_t *, smb_ofile_t *);
271uint32_t smb_oplock_break_OPEN(smb_node_t *, smb_ofile_t *,
272    uint32_t DesiredAccess, uint32_t CreateDisposition);
273uint32_t smb_oplock_break_BATCH(smb_node_t *, smb_ofile_t *,
274    uint32_t DesiredAccess, uint32_t CreateDisposition);
275uint32_t smb_oplock_break_HANDLE(smb_node_t *, smb_ofile_t *);
276void smb_oplock_break_CLOSE(smb_node_t *, smb_ofile_t *);
277uint32_t smb_oplock_break_READ(smb_node_t *, smb_ofile_t *);
278uint32_t smb_oplock_break_WRITE(smb_node_t *, smb_ofile_t *);
279uint32_t smb_oplock_break_SETINFO(smb_node_t *,
280    smb_ofile_t *ofile, uint32_t InfoClass);
281uint32_t smb_oplock_break_DELETE(smb_node_t *, smb_ofile_t *);
282
283void smb_oplock_move(smb_node_t *, smb_ofile_t *, smb_ofile_t *);
284
285/*
286 * Protocol-specific oplock functions
287 * (and "server-level" functions)
288 */
289void smb1_oplock_acquire(smb_request_t *, boolean_t);
290void smb1_oplock_break_notification(smb_request_t *, uint32_t);
291void smb2_oplock_break_notification(smb_request_t *, uint32_t);
292void smb2_lease_break_notification(smb_request_t *, uint32_t, boolean_t);
293void smb_oplock_ind_break(smb_ofile_t *, uint32_t, boolean_t, uint32_t);
294void smb_oplock_ind_break_in_ack(smb_request_t *, smb_ofile_t *,
295    uint32_t, boolean_t);
296void smb_oplock_send_brk(smb_request_t *);
297uint32_t smb_oplock_wait_break(smb_node_t *, int);
298
299/*
300 * range lock functions - node operations
301 */
302uint32_t smb_lock_get_lock_count(smb_node_t *, smb_ofile_t *);
303uint32_t smb_unlock_range(smb_request_t *, uint64_t, uint64_t, uint32_t);
304uint32_t smb_lock_range(smb_request_t *, uint64_t, uint64_t, uint32_t,
305    uint32_t, uint32_t);
306uint32_t smb_lock_range_cancel(smb_request_t *, uint64_t, uint64_t, uint32_t);
307void smb_lock_range_error(smb_request_t *, uint32_t);
308
309int smb_lock_range_access(smb_request_t *, smb_node_t *,
310    uint64_t, uint64_t, boolean_t);
311
312DWORD smb_nbl_conflict(smb_node_t *, uint64_t, uint64_t, nbl_op_t);
313
314void smb_mangle(const char *, ino64_t, char *, size_t);
315int smb_unmangle(smb_node_t *, char *, char *, int, uint32_t);
316boolean_t smb_needs_mangled(const char *);
317boolean_t smb_maybe_mangled(char *);
318boolean_t smb_is_reserved_dos_name(const char *);
319boolean_t smb_is_invalid_filename(const char *);
320
321void smbsr_cleanup(smb_request_t *sr);
322
323int smbsr_connect_tree(smb_request_t *);
324
325int smb_common_create_directory(smb_request_t *);
326
327void	smb_convert_wildcards(char *);
328boolean_t smb_contains_wildcards(const char *);
329int	smb_ascii_or_unicode_strlen(smb_request_t *, char *);
330int	smb_ascii_or_unicode_strlen_null(smb_request_t *, char *);
331int	smb_ascii_or_unicode_null_len(smb_request_t *);
332
333int	smb_search(smb_request_t *);
334
335uint32_t smb_common_create(smb_request_t *);
336uint32_t smb_common_open(smb_request_t *);
337
338int smb_common_write(smb_request_t *, smb_rw_param_t *);
339
340void smb_pathname_init(smb_request_t *, smb_pathname_t *, char *);
341boolean_t smb_pathname_validate(smb_request_t *, smb_pathname_t *);
342boolean_t smb_validate_dirname(smb_request_t *, smb_pathname_t *);
343boolean_t smb_validate_object_name(smb_request_t *, smb_pathname_t *);
344boolean_t smb_validate_stream_name(smb_request_t *, smb_pathname_t *);
345boolean_t smb_is_stream_name(char *);
346boolean_t smb_strname_restricted(char *);
347
348void smb_stream_parse_name(char *, char *, char *);
349
350
351uint32_t smb_omode_to_amask(uint32_t desired_access);
352
353void	sshow_distribution_info(char *);
354
355void	smb_dispatch_stats_init(smb_server_t *);
356void	smb_dispatch_stats_fini(smb_server_t *);
357void	smb_dispatch_stats_update(smb_server_t *,
358		smb_kstat_req_t *, int, int);
359
360int	smb1sr_newrq(smb_request_t *);
361int	smb1sr_newrq_cancel(smb_request_t *);
362void	smb1sr_work(smb_request_t *);
363
364int	smbsr_encode_empty_result(smb_request_t *);
365void	smbsr_lookup_file(smb_request_t *);
366void	smbsr_release_file(smb_request_t *);
367
368int	smbsr_decode_vwv(smb_request_t *sr, const char *, ...);
369int	smbsr_decode_data(smb_request_t *sr, const char *, ...);
370boolean_t smbsr_decode_data_avail(smb_request_t *);
371int	smbsr_encode_result(smb_request_t *, int, int, const char *, ...);
372smb_xa_t *smbsr_lookup_xa(smb_request_t *sr);
373void	smbsr_send_reply(smb_request_t *);
374
375uint32_t smb_errno2status(int);
376uint16_t smb_status2doserr(uint32_t);
377void	smbsr_map_errno(int, smb_error_t *);
378void	smbsr_set_error(smb_request_t *, smb_error_t *);
379void	smbsr_errno(smb_request_t *, int);
380void	smbsr_status(smb_request_t *, DWORD, uint16_t, uint16_t);
381#define	smbsr_error(SR, ST, CL, CO) \
382	smbsr_status(SR, ST, CL, CO)
383#define	smbsr_warn(SR, ST, CL, CO) \
384	smbsr_status(SR, ST, CL, CO)
385void	smbsr_status_smb2(smb_request_t *, DWORD);
386
387int	clock_get_milli_uptime(void);
388
389int	smb_mbc_vencodef(mbuf_chain_t *, const char *, va_list);
390int	smb_mbc_vdecodef(mbuf_chain_t *, const char *, va_list);
391int	smb_mbc_decodef(mbuf_chain_t *, const char *, ...);
392int	smb_mbc_encodef(mbuf_chain_t *, const char *, ...);
393int	smb_mbc_peek(mbuf_chain_t *, int, const char *, ...);
394int	smb_mbc_poke(mbuf_chain_t *, int, const char *, ...);
395int	smb_mbc_put_mem(mbuf_chain_t *, void *, int);
396int	smb_mbc_copy(mbuf_chain_t *, const mbuf_chain_t *, int, int);
397int	smb_mbc_put_align(mbuf_chain_t *, int);
398
399void	smbsr_encode_header(smb_request_t *sr, int wct,
400		    int bcc, const char *fmt, ...);
401
402void smb_encode_sd(mbuf_chain_t *, smb_sd_t *, uint32_t);
403void smb_encode_sid(mbuf_chain_t *, smb_sid_t *);
404smb_sid_t *smb_decode_sid(mbuf_chain_t *, uint32_t);
405uint32_t smb_decode_sd(mbuf_chain_t *, smb_sd_t *);
406
407uint32_t smb_pad_align(uint32_t, uint32_t);
408
409/*
410 * Socket functions
411 */
412ksocket_t smb_socreate(int domain, int type, int protocol);
413void smb_soshutdown(ksocket_t so);
414void smb_sodestroy(ksocket_t so);
415int smb_sorecv(ksocket_t so, void *msg, size_t len);
416void smb_net_txl_constructor(smb_txlst_t *);
417void smb_net_txl_destructor(smb_txlst_t *);
418int smb_net_send_uio(smb_session_t *, struct uio *);
419
420/*
421 * SMB RPC interface
422 */
423void smb_opipe_dealloc(smb_opipe_t *);
424int smb_opipe_open(smb_request_t *, smb_ofile_t *);
425void smb_opipe_close(smb_ofile_t *);
426int smb_opipe_read(smb_request_t *, struct uio *);
427int smb_opipe_write(smb_request_t *, struct uio *);
428int smb_opipe_getattr(smb_ofile_t *, smb_attr_t *);
429int smb_opipe_getname(smb_ofile_t *, char *, size_t);
430uint32_t smb_opipe_fsctl(smb_request_t *, smb_fsctl_t *);
431uint32_t smb_opipe_transceive(smb_request_t *, smb_fsctl_t *);
432
433void smb_kdoor_init(smb_server_t *);
434void smb_kdoor_fini(smb_server_t *);
435int smb_kdoor_open(smb_server_t *, int);
436void smb_kdoor_close(smb_server_t *);
437int smb_kdoor_upcall(smb_server_t *, uint32_t,
438	void *, xdrproc_t, void *, xdrproc_t);
439void fksmb_kdoor_open(smb_server_t *, void *);
440
441/*
442 * SMB server functions (file smb_server.c)
443 */
444int smb_server_get_count(void);
445int smb_server_g_init(void);
446void smb_server_g_fini(void);
447int smb_server_create(void);
448int smb_server_delete(smb_server_t *);
449int smb_server_configure(smb_ioc_cfg_t *);
450int smb_server_start(smb_ioc_start_t *);
451int smb_server_stop(void);
452boolean_t smb_server_is_stopping(smb_server_t *);
453void smb_server_cancel_event(smb_server_t *, uint32_t);
454int smb_server_notify_event(smb_ioc_event_t *);
455uint32_t smb_server_get_session_count(smb_server_t *);
456int smb_server_set_gmtoff(smb_ioc_gmt_t *);
457int smb_server_numopen(smb_ioc_opennum_t *);
458int smb_server_enum(smb_ioc_svcenum_t *);
459int smb_server_session_close(smb_ioc_session_t *);
460int smb_server_file_close(smb_ioc_fileid_t *);
461int smb_server_share_lookup(smb_server_t *, const char *, smb_node_t **);
462int smb_server_unshare(const char *);
463
464void smb_server_logoff_ssnid(smb_request_t *, uint64_t);
465
466void smb_server_get_cfg(smb_server_t *, smb_kmod_cfg_t *);
467
468int smb_server_spooldoc(smb_ioc_spooldoc_t *);
469int smb_spool_add_doc(smb_tree_t *, smb_kspooldoc_t *);
470void smb_spool_add_fid(smb_server_t *, uint16_t);
471
472void smb_server_inc_nbt_sess(smb_server_t *);
473void smb_server_dec_nbt_sess(smb_server_t *);
474void smb_server_inc_tcp_sess(smb_server_t *);
475void smb_server_dec_tcp_sess(smb_server_t *);
476void smb_server_inc_users(smb_server_t *);
477void smb_server_dec_users(smb_server_t *);
478void smb_server_inc_trees(smb_server_t *);
479void smb_server_dec_trees(smb_server_t *);
480void smb_server_inc_files(smb_server_t *);
481void smb_server_dec_files(smb_server_t *);
482void smb_server_inc_pipes(smb_server_t *);
483void smb_server_dec_pipes(smb_server_t *);
484void smb_server_add_rxb(smb_server_t *, int64_t);
485void smb_server_add_txb(smb_server_t *, int64_t);
486void smb_server_inc_req(smb_server_t *);
487
488smb_event_t *smb_event_create(smb_server_t *, int);
489void smb_event_destroy(smb_event_t *);
490uint32_t smb_event_txid(smb_event_t *);
491int smb_event_wait(smb_event_t *);
492void smb_event_notify(smb_server_t *, uint32_t);
493
494/*
495 * SMB node functions (file smb_node.c)
496 */
497void smb_node_init(void);
498void smb_node_fini(void);
499smb_node_t *smb_node_lookup(smb_request_t *, smb_arg_open_t *,
500    cred_t *, vnode_t *, char *, smb_node_t *, smb_node_t *);
501smb_node_t *smb_stream_node_lookup(smb_request_t *, cred_t *,
502    smb_node_t *, vnode_t *, vnode_t *, char *);
503
504void smb_node_ref(smb_node_t *);
505void smb_node_release(smb_node_t *);
506void smb_node_rename(smb_node_t *, smb_node_t *, smb_node_t *, char *);
507int smb_node_root_init(smb_server_t *, smb_node_t **);
508void smb_node_add_lock(smb_node_t *, smb_lock_t *);
509void smb_node_destroy_lock(smb_node_t *, smb_lock_t *);
510void smb_node_destroy_lock_by_ofile(smb_node_t *, smb_ofile_t *);
511void smb_node_start_crit(smb_node_t *, krw_t);
512void smb_node_end_crit(smb_node_t *);
513int smb_node_in_crit(smb_node_t *);
514void smb_node_rdlock(smb_node_t *);
515void smb_node_wrlock(smb_node_t *);
516void smb_node_unlock(smb_node_t *);
517void smb_node_add_ofile(smb_node_t *, smb_ofile_t *);
518void smb_node_rem_ofile(smb_node_t *, smb_ofile_t *);
519void smb_node_inc_open_ofiles(smb_node_t *);
520uint32_t smb_node_dec_open_ofiles(smb_node_t *);
521void smb_node_inc_opening_count(smb_node_t *);
522void smb_node_dec_opening_count(smb_node_t *);
523boolean_t smb_node_is_file(smb_node_t *);
524boolean_t smb_node_is_dir(smb_node_t *);
525boolean_t smb_node_is_symlink(smb_node_t *);
526boolean_t smb_node_is_dfslink(smb_node_t *);
527boolean_t smb_node_is_reparse(smb_node_t *);
528boolean_t smb_node_is_vfsroot(smb_node_t *);
529boolean_t smb_node_is_system(smb_node_t *);
530
531uint32_t smb_node_open_check(smb_node_t *, uint32_t, uint32_t);
532DWORD smb_node_rename_check(smb_node_t *);
533DWORD smb_node_delete_check(smb_node_t *);
534boolean_t smb_node_share_check(smb_node_t *);
535
536void smb_node_fcn_subscribe(smb_node_t *);
537void smb_node_fcn_unsubscribe(smb_node_t *);
538void smb_node_notify_change(smb_node_t *, uint_t, const char *);
539
540int smb_node_getattr(smb_request_t *, smb_node_t *, cred_t *,
541    smb_ofile_t *, smb_attr_t *);
542int smb_node_setattr(smb_request_t *, smb_node_t *, cred_t *,
543    smb_ofile_t *, smb_attr_t *);
544uint32_t smb_node_set_delete_on_close(smb_node_t *, cred_t *, uint32_t);
545void smb_node_reset_delete_on_close(smb_node_t *);
546void smb_node_delete_on_close(smb_node_t *);
547boolean_t smb_node_file_is_readonly(smb_node_t *);
548int smb_node_getpath(smb_node_t *, vnode_t *, char *, uint32_t);
549int smb_node_getmntpath(smb_node_t *, char *, uint32_t);
550int smb_node_getshrpath(smb_node_t *, smb_tree_t *, char *, uint32_t);
551
552/*
553 * Pathname functions
554 */
555
556int smb_pathname_reduce(smb_request_t *, cred_t *,
557    const char *, smb_node_t *, smb_node_t *, smb_node_t **, char *);
558
559int smb_pathname(smb_request_t *, char *, int, smb_node_t *,
560    smb_node_t *, smb_node_t **, smb_node_t **, cred_t *, pathname_t *);
561
562/*
563 * smb_notify.c
564 */
565uint32_t smb_notify_act1(smb_request_t *, uint32_t, uint32_t);
566uint32_t smb_notify_act2(smb_request_t *);
567uint32_t smb_notify_act3(smb_request_t *);
568void smb_notify_ofile(smb_ofile_t *, uint_t, const char *);
569void smb_nt_transact_notify_finish(void *);
570void smb2_change_notify_finish(void *);
571
572int smb_fem_fcn_install(smb_node_t *);
573void smb_fem_fcn_uninstall(smb_node_t *);
574int smb_fem_oplock_install(smb_node_t *);
575void smb_fem_oplock_uninstall(smb_node_t *);
576
577/* FEM */
578
579int smb_fem_init(void);
580void smb_fem_fini(void);
581
582int smb_try_grow(smb_request_t *sr, int64_t new_size);
583
584unsigned short smb_worker_getnum();
585
586/* SMB signing routines smb_signing.c */
587void smb_sign_begin(smb_request_t *, smb_token_t *);
588int smb_sign_check_request(smb_request_t *);
589int smb_sign_check_secondary(smb_request_t *, unsigned int);
590void smb_sign_reply(smb_request_t *, mbuf_chain_t *);
591/* SMB2, but here because it's called from common code. */
592void smb2_sign_begin(smb_request_t *, smb_token_t *);
593void smb3_encrypt_begin(smb_request_t *, smb_token_t *);
594void smb3_encrypt_fini(smb_session_t *);
595
596boolean_t smb_sattr_check(uint16_t, uint16_t);
597
598void smb_request_cancel(smb_request_t *);
599void smb_request_wait(smb_request_t *);
600
601/*
602 * authentication support (smb_authenticate.c)
603 */
604int smb_authenticate_ext(smb_request_t *);
605int smb_authenticate_old(smb_request_t *);
606void smb_authsock_close(smb_user_t *, ksocket_t);
607
608/*
609 * session functions (file smb_session.c)
610 */
611smb_session_t *smb_session_create(ksocket_t, uint16_t, smb_server_t *, int);
612smb_session_t *smb_server_find_session_byptr(smb_server_t *, void *);
613
614void smb_session_receiver(smb_session_t *);
615void smb_session_disconnect(smb_session_t *);
616void smb_session_timers(smb_server_t *);
617void smb_session_delete(smb_session_t *session);
618void smb_session_cancel_requests(smb_session_t *, smb_tree_t *,
619    smb_request_t *);
620void smb_session_config(smb_session_t *session);
621void smb_session_disconnect_from_share(smb_llist_t *, char *);
622smb_user_t *smb_session_dup_user(smb_session_t *, char *, char *);
623smb_user_t *smb_session_lookup_ssnid(smb_session_t *, uint64_t);
624smb_user_t *smb_session_lookup_uid(smb_session_t *, uint16_t);
625smb_user_t *smb_session_lookup_uid_st(smb_session_t *,
626    uint64_t, uint16_t, smb_user_state_t);
627smb_tree_t *smb_session_lookup_tree(smb_session_t *, uint16_t);
628smb_tree_t *smb_session_lookup_share(smb_session_t *, const char *,
629    smb_tree_t *);
630smb_tree_t *smb_session_lookup_volume(smb_session_t *, const char *,
631    smb_tree_t *);
632void smb_session_close_pid(smb_session_t *, uint32_t);
633void smb_session_disconnect_owned_trees(smb_session_t *, smb_user_t *);
634void smb_session_disconnect_share(smb_session_t *, const char *);
635void smb_session_logoff(smb_session_t *);
636void smb_session_getclient(smb_session_t *, char *, size_t);
637boolean_t smb_session_isclient(smb_session_t *, const char *);
638void smb_session_correct_keep_alive_values(smb_llist_t *, uint32_t);
639int smb_session_send(smb_session_t *, uint8_t type, mbuf_chain_t *);
640int smb_session_xprt_gethdr(smb_session_t *, smb_xprt_t *);
641boolean_t smb_session_oplocks_enable(smb_session_t *);
642boolean_t smb_session_levelII_oplocks(smb_session_t *);
643
644#define	SMB_SESSION_GET_ID(s)	((s)->s_kid)
645
646smb_request_t *smb_request_alloc(smb_session_t *, int);
647void smb_request_free(smb_request_t *);
648
649/*
650 * ofile functions (file smb_ofile.c)
651 */
652smb_ofile_t *smb_ofile_lookup_by_fid(smb_request_t *, uint16_t);
653smb_ofile_t *smb_ofile_lookup_by_uniqid(smb_tree_t *, uint32_t);
654smb_ofile_t *smb_ofile_lookup_by_persistid(smb_request_t *, uint64_t);
655boolean_t smb_ofile_disallow_fclose(smb_ofile_t *);
656smb_ofile_t *smb_ofile_alloc(smb_request_t *, smb_arg_open_t *, smb_node_t *,
657    uint16_t, uint16_t);
658void smb_ofile_open(smb_request_t *, smb_arg_open_t *, smb_ofile_t *);
659void smb_ofile_close(smb_ofile_t *, int32_t);
660void smb_ofile_free(smb_ofile_t *);
661uint32_t smb_ofile_access(smb_ofile_t *, cred_t *, uint32_t);
662int smb_ofile_seek(smb_ofile_t *, ushort_t, int32_t, uint32_t *);
663void smb_ofile_flush(smb_request_t *, smb_ofile_t *);
664boolean_t smb_ofile_hold(smb_ofile_t *);
665boolean_t smb_ofile_hold_olbrk(smb_ofile_t *);
666void smb_ofile_release(smb_ofile_t *);
667void smb_ofile_close_all(smb_tree_t *, uint32_t);
668void smb_ofile_set_flags(smb_ofile_t *, uint32_t);
669boolean_t smb_ofile_is_open(smb_ofile_t *);
670int smb_ofile_enum(smb_ofile_t *, smb_svcenum_t *);
671uint32_t smb_ofile_open_check(smb_ofile_t *, uint32_t, uint32_t);
672uint32_t smb_ofile_rename_check(smb_ofile_t *);
673uint32_t smb_ofile_delete_check(smb_ofile_t *);
674boolean_t smb_ofile_share_check(smb_ofile_t *);
675cred_t *smb_ofile_getcred(smb_ofile_t *);
676void smb_ofile_set_delete_on_close(smb_request_t *, smb_ofile_t *);
677void smb_delayed_write_timer(smb_llist_t *);
678void smb_ofile_set_quota_resume(smb_ofile_t *, char *);
679void smb_ofile_get_quota_resume(smb_ofile_t *, char *, int);
680void smb_ofile_del_persistid(smb_ofile_t *);
681void smb_ofile_set_persistid_dh(smb_ofile_t *);
682void smb_ofile_set_persistid_ph(smb_ofile_t *);
683int smb_ofile_insert_persistid(smb_ofile_t *, uint64_t);
684
685#define	SMB_OFILE_GET_SESSION(of)	((of)->f_session)
686#define	SMB_OFILE_GET_TREE(of)		((of)->f_tree)
687#define	SMB_OFILE_GET_FID(of)		((of)->f_fid)
688#define	SMB_OFILE_GET_NODE(of)		((of)->f_node)
689
690#define	smb_ofile_granted_access(_of_)	((_of_)->f_granted_access)
691
692/*
693 * odir functions (file smb_odir.c)
694 */
695uint32_t smb_odir_openpath(smb_request_t *, char *, uint16_t, uint32_t,
696    smb_odir_t **);
697uint32_t smb_odir_openfh(smb_request_t *, const char *, uint16_t,
698    smb_odir_t **);
699uint32_t smb_odir_openat(smb_request_t *, smb_node_t *, smb_odir_t **);
700void smb_odir_reopen(smb_odir_t *, const char *, uint16_t);
701void smb_odir_close(smb_odir_t *);
702boolean_t smb_odir_hold(smb_odir_t *);
703void smb_odir_release(smb_odir_t *);
704
705int smb_odir_read(smb_request_t *, smb_odir_t *,
706    smb_odirent_t *, boolean_t *);
707int smb_odir_read_fileinfo(smb_request_t *, smb_odir_t *,
708    smb_fileinfo_t *, uint16_t *);
709int smb_odir_read_streaminfo(smb_request_t *, smb_odir_t *,
710    smb_streaminfo_t *, boolean_t *);
711
712void smb_odir_save_cookie(smb_odir_t *, int, uint32_t cookie);
713void smb_odir_save_fname(smb_odir_t *, uint32_t, const char *);
714
715void smb_odir_resume_at(smb_odir_t *, smb_odir_resume_t *);
716
717/*
718 * SMB user functions (file smb_user.c)
719 */
720smb_user_t *smb_user_new(smb_session_t *);
721int smb_user_logon(smb_user_t *, cred_t *,
722    char *, char *, uint32_t, uint32_t, uint32_t);
723void smb_user_logoff(smb_user_t *);
724void smb_user_auth_tmo(void *);
725
726boolean_t smb_user_is_admin(smb_user_t *);
727boolean_t smb_user_namecmp(smb_user_t *, const char *);
728int smb_user_enum(smb_user_t *, smb_svcenum_t *);
729boolean_t smb_user_hold(smb_user_t *);
730void smb_user_hold_internal(smb_user_t *);
731void smb_user_release(smb_user_t *);
732cred_t *smb_user_getcred(smb_user_t *);
733cred_t *smb_user_getprivcred(smb_user_t *);
734void smb_user_netinfo_init(smb_user_t *, smb_netuserinfo_t *);
735void smb_user_netinfo_fini(smb_netuserinfo_t *);
736int smb_user_netinfo_encode(smb_user_t *, uint8_t *, size_t, uint32_t *);
737smb_token_t *smb_get_token(smb_session_t *, smb_logon_t *);
738cred_t *smb_cred_create(smb_token_t *);
739cred_t *smb_kcred_create(void);
740void smb_user_setcred(smb_user_t *, cred_t *, uint32_t);
741boolean_t smb_is_same_user(cred_t *, cred_t *);
742
743/*
744 * SMB tree functions (file smb_tree.c)
745 */
746uint32_t smb_tree_connect(smb_request_t *);
747uint32_t smb_tree_connect_disk(smb_request_t *, smb_arg_tcon_t *);
748void smb_tree_disconnect(smb_tree_t *, boolean_t);
749void smb_tree_close_pid(smb_tree_t *, uint32_t);
750boolean_t smb_tree_has_feature(smb_tree_t *, uint_t);
751int smb_tree_enum(smb_tree_t *, smb_svcenum_t *);
752int smb_tree_fclose(smb_tree_t *, uint32_t);
753boolean_t smb_tree_hold(smb_tree_t *);
754void smb_tree_hold_internal(smb_tree_t *);
755void smb_tree_release(smb_tree_t *);
756smb_odir_t *smb_tree_lookup_odir(smb_request_t *, uint16_t);
757boolean_t smb_tree_is_connected(smb_tree_t *);
758smb_tree_t *smb_tree_alloc(smb_request_t *, const smb_kshare_t *,
759    smb_node_t *, uint32_t, uint32_t);
760
761smb_xa_t *smb_xa_create(smb_session_t *session, smb_request_t *sr,
762    uint32_t total_parameter_count, uint32_t total_data_count,
763    uint32_t max_parameter_count, uint32_t max_data_count,
764    uint32_t max_setup_count, uint32_t setup_word_count);
765void smb_xa_delete(smb_xa_t *xa);
766smb_xa_t *smb_xa_hold(smb_xa_t *xa);
767void smb_xa_rele(smb_session_t *session, smb_xa_t *xa);
768int smb_xa_open(smb_xa_t *xa);
769void smb_xa_close(smb_xa_t *xa);
770int smb_xa_complete(smb_xa_t *xa);
771smb_xa_t *smb_xa_find(smb_session_t *session, uint32_t pid, uint16_t mid);
772
773struct mbuf *smb_mbuf_get(uchar_t *buf, int nbytes);
774struct mbuf *smb_mbuf_allocate(struct uio *uio);
775void smb_mbuf_trim(struct mbuf *mhead, int nbytes);
776
777int32_t smb_time_gmt_to_local(smb_request_t *, int32_t);
778int32_t smb_time_local_to_gmt(smb_request_t *, int32_t);
779int32_t	smb_time_dos_to_unix(int16_t, int16_t);
780void smb_time_unix_to_dos(int32_t, int16_t *, int16_t *);
781void smb_time_nt_to_unix(uint64_t nt_time, timestruc_t *unix_time);
782uint64_t smb_time_unix_to_nt(timestruc_t *);
783
784int netbios_name_isvalid(char *in, char *out);
785
786int uioxfer(struct uio *src_uio, struct uio *dst_uio, int n);
787
788/*
789 * Pool ID function prototypes
790 */
791int	smb_idpool_constructor(smb_idpool_t *pool);
792void	smb_idpool_destructor(smb_idpool_t  *pool);
793int	smb_idpool_alloc(smb_idpool_t *pool, uint16_t *id);
794void	smb_idpool_free(smb_idpool_t *pool, uint16_t id);
795
796/*
797 * SMB locked list function prototypes
798 */
799void	smb_llist_init(void);
800void	smb_llist_fini(void);
801void	smb_llist_constructor(smb_llist_t *, size_t, size_t);
802void	smb_llist_destructor(smb_llist_t *);
803void	smb_llist_enter(smb_llist_t *, krw_t);
804void	smb_llist_exit(smb_llist_t *);
805void	smb_llist_post(smb_llist_t *, void *, smb_dtorproc_t);
806void	smb_llist_flush(smb_llist_t *);
807void	smb_llist_insert_head(smb_llist_t *ll, void *obj);
808void	smb_llist_insert_tail(smb_llist_t *ll, void *obj);
809void	smb_llist_remove(smb_llist_t *ll, void *obj);
810int	smb_llist_upgrade(smb_llist_t *ll);
811uint32_t smb_llist_get_count(smb_llist_t *ll);
812#define	smb_llist_head(ll)		list_head(&(ll)->ll_list)
813#define	smb_llist_next(ll, obj)		list_next(&(ll)->ll_list, obj)
814int	smb_account_connected(smb_user_t *user);
815
816/*
817 * SMB Synchronized list function prototypes
818 */
819void	smb_slist_constructor(smb_slist_t *, size_t, size_t);
820void	smb_slist_destructor(smb_slist_t *);
821void	smb_slist_insert_head(smb_slist_t *sl, void *obj);
822void	smb_slist_insert_tail(smb_slist_t *sl, void *obj);
823void	smb_slist_remove(smb_slist_t *sl, void *obj);
824void	smb_slist_wait_for_empty(smb_slist_t *sl);
825void	smb_slist_enter(smb_slist_t *sl);
826void	smb_slist_exit(smb_slist_t *sl);
827uint32_t smb_slist_move_tail(list_t *lst, smb_slist_t *sl);
828void    smb_slist_obj_move(smb_slist_t *dst, smb_slist_t *src, void *obj);
829#define	smb_slist_head(sl)		list_head(&(sl)->sl_list)
830#define	smb_slist_next(sl, obj)		list_next(&(sl)->sl_list, obj)
831
832void    smb_rwx_init(smb_rwx_t *rwx);
833void    smb_rwx_destroy(smb_rwx_t *rwx);
834void	smb_rwx_rwenter(smb_rwx_t *rwx, krw_t);
835void    smb_rwx_rwexit(smb_rwx_t *rwx);
836int	smb_rwx_cvwait(smb_rwx_t *rwx, clock_t timeout);
837void    smb_rwx_cvbcast(smb_rwx_t *rwx);
838
839void	smb_thread_init(smb_thread_t *, char *, smb_thread_ep_t,
840		void *, pri_t);
841void	smb_thread_destroy(smb_thread_t *);
842int	smb_thread_start(smb_thread_t *);
843void	smb_thread_stop(smb_thread_t *);
844void    smb_thread_signal(smb_thread_t *);
845boolean_t smb_thread_continue(smb_thread_t *);
846boolean_t smb_thread_continue_nowait(smb_thread_t *);
847boolean_t smb_thread_continue_timedwait(smb_thread_t *, int /* seconds */);
848
849uint32_t smb_denymode_to_sharemode(uint32_t desired_access, char *fname);
850uint32_t smb_ofun_to_crdisposition(uint16_t ofun);
851
852/* 100's of ns between 1/1/1970 and 1/1/1601 */
853#define	NT_TIME_BIAS	(134774LL * 24LL * 60LL * 60LL * 10000000LL)
854
855uint32_t smb_sd_read(smb_request_t *, smb_sd_t *, uint32_t);
856uint32_t smb_sd_write(smb_request_t *, smb_sd_t *, uint32_t);
857
858acl_t *smb_fsacl_inherit(acl_t *, int, int, cred_t *);
859acl_t *smb_fsacl_merge(acl_t *, acl_t *);
860void smb_fsacl_split(acl_t *, acl_t **, acl_t **, int);
861acl_t *smb_fsacl_from_vsa(vsecattr_t *, acl_type_t);
862int smb_fsacl_to_vsa(acl_t *, vsecattr_t *, int *);
863
864boolean_t smb_ace_is_generic(int);
865boolean_t smb_ace_is_access(int);
866boolean_t smb_ace_is_audit(int);
867
868uint32_t smb_vss_enum_snapshots(smb_request_t *, smb_fsctl_t *);
869int smb_vss_lookup_nodes(smb_request_t *, smb_node_t *, smb_node_t **, char *);
870vnode_t *smb_lookuppathvptovp(smb_request_t *, char *, vnode_t *, vnode_t *);
871int smb_vss_extract_gmttoken(char *, char *);
872
873void smb_panic(char *, const char *, int);
874#pragma	does_not_return(smb_panic)
875#define	SMB_PANIC()	smb_panic(__FILE__, __func__, __LINE__)
876
877void smb_latency_init(smb_latency_t *);
878void smb_latency_destroy(smb_latency_t *);
879void smb_latency_add_sample(smb_latency_t *, hrtime_t);
880void smb_srqueue_init(smb_srqueue_t *);
881void smb_srqueue_destroy(smb_srqueue_t *);
882void smb_srqueue_waitq_enter(smb_srqueue_t *);
883void smb_srqueue_runq_exit(smb_srqueue_t *);
884void smb_srqueue_waitq_to_runq(smb_srqueue_t *);
885void smb_srqueue_update(smb_srqueue_t *, smb_kstat_utilization_t *);
886
887void *smb_mem_alloc(size_t);
888void *smb_mem_zalloc(size_t);
889void *smb_mem_realloc(void *, size_t);
890void *smb_mem_rezalloc(void *, size_t);
891void smb_mem_free(void *);
892void smb_mem_zfree(void *);
893char *smb_mem_strdup(const char *);
894void smb_srm_init(smb_request_t *);
895void smb_srm_fini(smb_request_t *);
896void *smb_srm_alloc(smb_request_t *, size_t);
897void *smb_srm_zalloc(smb_request_t *, size_t);
898void *smb_srm_realloc(smb_request_t *, void *, size_t);
899void *smb_srm_rezalloc(smb_request_t *, void *, size_t);
900char *smb_srm_strdup(smb_request_t *, const char *);
901
902void smb_export_start(smb_server_t *);
903void smb_export_stop(smb_server_t *);
904
905#ifdef	_KERNEL
906struct __door_handle;
907struct __door_handle *smb_kshare_door_init(int);
908void smb_kshare_door_fini(struct __door_handle *);
909int smb_kshare_upcall(struct __door_handle *, void *, boolean_t);
910#endif	/* _KERNEL */
911
912void smb_kshare_g_init(void);
913void smb_kshare_g_fini(void);
914void smb_kshare_init(smb_server_t *);
915void smb_kshare_fini(smb_server_t *);
916int smb_kshare_start(smb_server_t *);
917void smb_kshare_stop(smb_server_t *);
918
919int smb_kshare_export_list(smb_ioc_share_t *);
920int smb_kshare_unexport_list(smb_ioc_share_t *);
921int smb_kshare_info(smb_ioc_shareinfo_t *);
922void smb_kshare_enum(smb_server_t *, smb_enumshare_info_t *);
923smb_kshare_t *smb_kshare_lookup(smb_server_t *, const char *);
924void smb_kshare_release(smb_server_t *, smb_kshare_t *);
925int smb_kshare_exec(smb_server_t *, smb_shr_execinfo_t *);
926uint32_t smb_kshare_hostaccess(smb_kshare_t *, smb_session_t *);
927
928
929void smb_avl_create(smb_avl_t *, size_t, size_t, const smb_avl_nops_t *);
930void smb_avl_destroy(smb_avl_t *);
931int smb_avl_add(smb_avl_t *, void *);
932void smb_avl_remove(smb_avl_t *, void *);
933void *smb_avl_lookup(smb_avl_t *, void *);
934void smb_avl_release(smb_avl_t *, void *);
935void smb_avl_iterinit(smb_avl_t *, smb_avl_cursor_t *);
936void *smb_avl_iterate(smb_avl_t *, smb_avl_cursor_t *);
937
938void smb_threshold_init(smb_cmd_threshold_t *,
939    char *, uint_t, uint_t);
940void smb_threshold_fini(smb_cmd_threshold_t *);
941int smb_threshold_enter(smb_cmd_threshold_t *);
942void smb_threshold_exit(smb_cmd_threshold_t *);
943void smb_threshold_wake_all(smb_cmd_threshold_t *);
944
945/* SMB hash function prototypes */
946smb_hash_t *smb_hash_create(size_t, size_t, uint32_t);
947void smb_hash_destroy(smb_hash_t *);
948uint_t smb_hash_uint64(smb_hash_t *, uint64_t);
949
950#ifdef	__cplusplus
951}
952#endif
953
954#endif /* _SMB_KPROTO_H_ */
955