1*a90cf9f2SGordon Ross /* 2*a90cf9f2SGordon Ross * This file and its contents are supplied under the terms of the 3*a90cf9f2SGordon Ross * Common Development and Distribution License ("CDDL"), version 1.0. 4*a90cf9f2SGordon Ross * You may only use this file in accordance with the terms of version 5*a90cf9f2SGordon Ross * 1.0 of the CDDL. 6*a90cf9f2SGordon Ross * 7*a90cf9f2SGordon Ross * A full copy of the text of the CDDL should have accompanied this 8*a90cf9f2SGordon Ross * source. A copy of the CDDL is also available via the Internet at 9*a90cf9f2SGordon Ross * http://www.illumos.org/license/CDDL. 10*a90cf9f2SGordon Ross */ 11*a90cf9f2SGordon Ross 12*a90cf9f2SGordon Ross /* 13*a90cf9f2SGordon Ross * Copyright 2014 Nexenta Systems, Inc. All rights reserved. 14*a90cf9f2SGordon Ross */ 15*a90cf9f2SGordon Ross 16*a90cf9f2SGordon Ross #ifndef _SMB2_KPROTO_H_ 17*a90cf9f2SGordon Ross #define _SMB2_KPROTO_H_ 18*a90cf9f2SGordon Ross 19*a90cf9f2SGordon Ross #include <smbsrv/smb_kproto.h> 20*a90cf9f2SGordon Ross #include <smbsrv/smb2.h> 21*a90cf9f2SGordon Ross 22*a90cf9f2SGordon Ross #ifdef __cplusplus 23*a90cf9f2SGordon Ross extern "C" { 24*a90cf9f2SGordon Ross #endif 25*a90cf9f2SGordon Ross 26*a90cf9f2SGordon Ross extern uint32_t smb2_tcp_rcvbuf; 27*a90cf9f2SGordon Ross extern uint32_t smb2_max_rwsize; 28*a90cf9f2SGordon Ross extern uint32_t smb2_max_trans; 29*a90cf9f2SGordon Ross 30*a90cf9f2SGordon Ross void smb2_dispatch_stats_init(smb_server_t *); 31*a90cf9f2SGordon Ross void smb2_dispatch_stats_fini(smb_server_t *); 32*a90cf9f2SGordon Ross void smb2_dispatch_stats_update(smb_server_t *, 33*a90cf9f2SGordon Ross smb_kstat_req_t *, int, int); 34*a90cf9f2SGordon Ross 35*a90cf9f2SGordon Ross int smb2sr_newrq(smb_request_t *); 36*a90cf9f2SGordon Ross int smb2sr_newrq_async(smb_request_t *); 37*a90cf9f2SGordon Ross int smb2sr_newrq_cancel(smb_request_t *); 38*a90cf9f2SGordon Ross void smb2sr_work(smb_request_t *); 39*a90cf9f2SGordon Ross 40*a90cf9f2SGordon Ross int smb2_decode_header(smb_request_t *); 41*a90cf9f2SGordon Ross int smb2_encode_header(smb_request_t *, boolean_t); 42*a90cf9f2SGordon Ross void smb2_send_reply(smb_request_t *); 43*a90cf9f2SGordon Ross void smb2sr_put_error(smb_request_t *, uint32_t); 44*a90cf9f2SGordon Ross void smb2sr_put_error_data(smb_request_t *, uint32_t, mbuf_chain_t *); 45*a90cf9f2SGordon Ross void smb2sr_put_errno(struct smb_request *, int); 46*a90cf9f2SGordon Ross uint32_t smb2sr_lookup_fid(smb_request_t *, smb2fid_t *); 47*a90cf9f2SGordon Ross 48*a90cf9f2SGordon Ross /* SMB2 signing routines - smb2_signing.c */ 49*a90cf9f2SGordon Ross int smb2_sign_check_request(smb_request_t *); 50*a90cf9f2SGordon Ross void smb2_sign_reply(smb_request_t *); 51*a90cf9f2SGordon Ross 52*a90cf9f2SGordon Ross uint32_t smb2_fsctl_vneginfo(smb_request_t *, smb_fsctl_t *); 53*a90cf9f2SGordon Ross 54*a90cf9f2SGordon Ross smb_sdrc_t smb2_negotiate(smb_request_t *); 55*a90cf9f2SGordon Ross smb_sdrc_t smb2_session_setup(smb_request_t *); 56*a90cf9f2SGordon Ross smb_sdrc_t smb2_logoff(smb_request_t *); 57*a90cf9f2SGordon Ross smb_sdrc_t smb2_tree_connect(smb_request_t *); 58*a90cf9f2SGordon Ross smb_sdrc_t smb2_tree_disconn(smb_request_t *); 59*a90cf9f2SGordon Ross smb_sdrc_t smb2_create(smb_request_t *); 60*a90cf9f2SGordon Ross smb_sdrc_t smb2_close(smb_request_t *); 61*a90cf9f2SGordon Ross smb_sdrc_t smb2_flush(smb_request_t *); 62*a90cf9f2SGordon Ross smb_sdrc_t smb2_read(smb_request_t *); 63*a90cf9f2SGordon Ross smb_sdrc_t smb2_write(smb_request_t *); 64*a90cf9f2SGordon Ross smb_sdrc_t smb2_lock(smb_request_t *); 65*a90cf9f2SGordon Ross smb_sdrc_t smb2_ioctl(smb_request_t *); 66*a90cf9f2SGordon Ross /* No smb2_cancel() - see smb2_dispatch.c */ 67*a90cf9f2SGordon Ross smb_sdrc_t smb2_echo(smb_request_t *); 68*a90cf9f2SGordon Ross smb_sdrc_t smb2_query_dir(smb_request_t *); 69*a90cf9f2SGordon Ross smb_sdrc_t smb2_change_notify(smb_request_t *); 70*a90cf9f2SGordon Ross smb_sdrc_t smb2_query_info(smb_request_t *); 71*a90cf9f2SGordon Ross smb_sdrc_t smb2_set_info(smb_request_t *); 72*a90cf9f2SGordon Ross smb_sdrc_t smb2_oplock_break_ack(smb_request_t *); 73*a90cf9f2SGordon Ross 74*a90cf9f2SGordon Ross int smb2_newrq_negotiate(smb_request_t *); 75*a90cf9f2SGordon Ross 76*a90cf9f2SGordon Ross uint32_t smb2_ofile_getattr(smb_request_t *, smb_ofile_t *, smb_attr_t *); 77*a90cf9f2SGordon Ross uint32_t smb2_ofile_getstd(smb_ofile_t *, smb_queryinfo_t *); 78*a90cf9f2SGordon Ross uint32_t smb2_ofile_getname(smb_ofile_t *, smb_queryinfo_t *); 79*a90cf9f2SGordon Ross 80*a90cf9f2SGordon Ross uint32_t smb2_qinfo_file(smb_request_t *, smb_queryinfo_t *); 81*a90cf9f2SGordon Ross uint32_t smb2_qinfo_fs(smb_request_t *, smb_queryinfo_t *); 82*a90cf9f2SGordon Ross uint32_t smb2_qinfo_sec(smb_request_t *, smb_queryinfo_t *); 83*a90cf9f2SGordon Ross uint32_t smb2_qinfo_quota(smb_request_t *, smb_queryinfo_t *); 84*a90cf9f2SGordon Ross uint32_t smb2_qinfo_stream(smb_request_t *, smb_queryinfo_t *); 85*a90cf9f2SGordon Ross 86*a90cf9f2SGordon Ross uint32_t smb2_setinfo_file(smb_request_t *, smb_setinfo_t *, int); 87*a90cf9f2SGordon Ross uint32_t smb2_setinfo_fs(smb_request_t *, smb_setinfo_t *, int); 88*a90cf9f2SGordon Ross uint32_t smb2_setinfo_sec(smb_request_t *, smb_setinfo_t *, uint32_t); 89*a90cf9f2SGordon Ross uint32_t smb2_setinfo_quota(smb_request_t *, smb_setinfo_t *); 90*a90cf9f2SGordon Ross 91*a90cf9f2SGordon Ross #ifdef __cplusplus 92*a90cf9f2SGordon Ross } 93*a90cf9f2SGordon Ross #endif 94*a90cf9f2SGordon Ross 95*a90cf9f2SGordon Ross #endif /* _SMB2_KPROTO_H_ */ 96