s3:registry: Initialize struct security_ace ace[]
[samba4-gss.git] / source3 / smbd / smbXsrv_session.h
blobe2a28e0d13685a20159085015735a72712bcc9ec
1 /*
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__
24 #include "replace.h"
25 #include <tevent.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,
39 NTTIME now,
40 struct smbXsrv_session **_session);
41 NTSTATUS smbXsrv_session_add_channel(struct smbXsrv_session *session,
42 struct smbXsrv_connection *conn,
43 NTTIME now,
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,
54 NTTIME now,
55 struct smbXsrv_session_auth0 **_a);
56 NTSTATUS smbXsrv_session_create_auth(struct smbXsrv_session *session,
57 struct smbXsrv_connection *conn,
58 NTTIME now,
59 uint8_t in_flags,
60 uint8_t in_security_mode,
61 struct smbXsrv_session_auth0 **_a);
62 struct tevent_req *smb2srv_session_shutdown_send(
63 TALLOC_CTX *mem_ctx,
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,
72 uint16_t vuid,
73 NTTIME now,
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,
80 uint64_t session_id,
81 NTTIME now,
82 struct smbXsrv_session **session);
83 NTSTATUS smb2srv_session_lookup_client(struct smbXsrv_client *client,
84 uint64_t session_id,
85 NTTIME now,
86 struct smbXsrv_session **session);
87 NTSTATUS smb2srv_session_lookup_global(struct smbXsrv_client *client,
88 uint64_t session_wire_id,
89 TALLOC_CTX *mem_ctx,
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),
97 void *caller_data);
98 NTSTATUS smbXsrv_session_global_traverse(
99 int (*fn)(struct smbXsrv_session_global0 *, void *),
100 void *private_data);
101 struct tevent_req *smb2srv_session_close_previous_send(
102 TALLOC_CTX *mem_ctx,
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);
110 #endif