2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Stefan Metzmacher 2011-2012
5 * Copyright (C) Michael Adam 2012
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __SMBXSRV_SESSION_H__
22 #define __SMBXSRV_SESSION_H__
26 #include "libcli/util/ntstatus.h"
27 #include "lib/util/time.h"
29 struct messaging_context
;
30 struct smbXsrv_client
;
31 struct smbXsrv_connection
;
32 struct smbXsrv_session
;
33 struct smbXsrv_session_global0
;
34 struct smbXsrv_channel_global0
;
35 struct smbXsrv_session_auth0
;
37 NTSTATUS
smbXsrv_session_global_init(struct messaging_context
*msg_ctx
);
38 NTSTATUS
smbXsrv_session_create(struct smbXsrv_connection
*conn
,
40 struct smbXsrv_session
**_session
);
41 NTSTATUS
smbXsrv_session_add_channel(struct smbXsrv_session
*session
,
42 struct smbXsrv_connection
*conn
,
44 struct smbXsrv_channel_global0
**_c
);
45 NTSTATUS
smbXsrv_session_remove_channel(struct smbXsrv_session
*session
,
46 struct smbXsrv_connection
*xconn
);
47 NTSTATUS
smbXsrv_session_disconnect_xconn(struct smbXsrv_connection
*xconn
);
48 NTSTATUS
smbXsrv_session_update(struct smbXsrv_session
*session
);
49 NTSTATUS
smbXsrv_session_find_channel(const struct smbXsrv_session
*session
,
50 const struct smbXsrv_connection
*conn
,
51 struct smbXsrv_channel_global0
**_c
);
52 NTSTATUS
smbXsrv_session_find_auth(const struct smbXsrv_session
*session
,
53 const struct smbXsrv_connection
*conn
,
55 struct smbXsrv_session_auth0
**_a
);
56 NTSTATUS
smbXsrv_session_create_auth(struct smbXsrv_session
*session
,
57 struct smbXsrv_connection
*conn
,
60 uint8_t in_security_mode
,
61 struct smbXsrv_session_auth0
**_a
);
62 struct tevent_req
*smb2srv_session_shutdown_send(
64 struct tevent_context
*ev
,
65 struct smbXsrv_session
*session
,
66 struct smbd_smb2_request
*current_req
);
67 NTSTATUS
smb2srv_session_shutdown_recv(struct tevent_req
*req
);
68 NTSTATUS
smbXsrv_session_logoff(struct smbXsrv_session
*session
);
69 NTSTATUS
smbXsrv_session_logoff_all(struct smbXsrv_client
*client
);
70 NTSTATUS
smb1srv_session_table_init(struct smbXsrv_connection
*conn
);
71 NTSTATUS
smb1srv_session_lookup(struct smbXsrv_connection
*conn
,
74 struct smbXsrv_session
**session
);
75 NTSTATUS
smbXsrv_session_info_lookup(struct smbXsrv_client
*client
,
76 uint64_t session_wire_id
,
77 struct auth_session_info
**si
);
78 NTSTATUS
smb2srv_session_table_init(struct smbXsrv_connection
*conn
);
79 NTSTATUS
smb2srv_session_lookup_conn(struct smbXsrv_connection
*conn
,
82 struct smbXsrv_session
**session
);
83 NTSTATUS
smb2srv_session_lookup_client(struct smbXsrv_client
*client
,
86 struct smbXsrv_session
**session
);
87 NTSTATUS
smb2srv_session_lookup_global(struct smbXsrv_client
*client
,
88 uint64_t session_wire_id
,
90 struct smbXsrv_session
**session
);
91 NTSTATUS
get_valid_smbXsrv_session(struct smbXsrv_client
*client
,
92 uint64_t session_wire_id
,
93 struct smbXsrv_session
**session
);
94 NTSTATUS
smbXsrv_session_local_traverse(
95 struct smbXsrv_client
*client
,
96 int (*caller_cb
)(struct smbXsrv_session
*session
, void *caller_data
),
98 NTSTATUS
smbXsrv_session_global_traverse(
99 int (*fn
)(struct smbXsrv_session_global0
*, void *),
101 struct tevent_req
*smb2srv_session_close_previous_send(
103 struct tevent_context
*ev
,
104 struct smbXsrv_connection
*conn
,
105 struct auth_session_info
*session_info
,
106 uint64_t previous_session_id
,
107 uint64_t current_session_id
);
108 NTSTATUS
smb2srv_session_close_previous_recv(struct tevent_req
*req
);