1 | /*
|
---|
2 | Unix SMB/CIFS implementation.
|
---|
3 |
|
---|
4 | structures specific to stream servers
|
---|
5 |
|
---|
6 | Copyright (C) Stefan (metze) Metzmacher 2004
|
---|
7 | Copyright (C) Andrew Tridgell 2005
|
---|
8 |
|
---|
9 | This program is free software; you can redistribute it and/or modify
|
---|
10 | it under the terms of the GNU General Public License as published by
|
---|
11 | the Free Software Foundation; either version 3 of the License, or
|
---|
12 | (at your option) any later version.
|
---|
13 |
|
---|
14 | This program is distributed in the hope that it will be useful,
|
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
17 | GNU General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU General Public License
|
---|
20 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __SERVICE_STREAM_H__
|
---|
24 | #define __SERVICE_STREAM_H__
|
---|
25 |
|
---|
26 | #include "librpc/gen_ndr/server_id.h"
|
---|
27 |
|
---|
28 | /* modules can use the following to determine if the interface has changed
|
---|
29 | * please increment the version number after each interface change
|
---|
30 | * with a comment and maybe update struct stream_connection_critical_sizes.
|
---|
31 | */
|
---|
32 | /* version 0 - initial version - metze */
|
---|
33 | #define SERVER_SERVICE_VERSION 0
|
---|
34 |
|
---|
35 | /*
|
---|
36 | top level context for an established stream connection
|
---|
37 | */
|
---|
38 | struct stream_connection {
|
---|
39 | const struct stream_server_ops *ops;
|
---|
40 | const struct model_ops *model_ops;
|
---|
41 | struct server_id server_id;
|
---|
42 | void *private_data;
|
---|
43 |
|
---|
44 | struct {
|
---|
45 | struct tevent_context *ctx;
|
---|
46 | struct tevent_fd *fde;
|
---|
47 | } event;
|
---|
48 |
|
---|
49 | struct socket_context *socket;
|
---|
50 | struct imessaging_context *msg_ctx;
|
---|
51 | struct loadparm_context *lp_ctx;
|
---|
52 |
|
---|
53 | struct tstream_context *tstream;
|
---|
54 | struct tsocket_address *local_address;
|
---|
55 | struct tsocket_address *remote_address;
|
---|
56 |
|
---|
57 | /*
|
---|
58 | * this transport layer session info, normally NULL
|
---|
59 | * which means the same as an anonymous session info
|
---|
60 | */
|
---|
61 | struct auth_session_info *session_info;
|
---|
62 |
|
---|
63 | bool processing;
|
---|
64 | const char *terminate;
|
---|
65 | };
|
---|
66 |
|
---|
67 |
|
---|
68 | /* operations passed to the service_stream code */
|
---|
69 | struct stream_server_ops {
|
---|
70 | /* the name of the server_service */
|
---|
71 | const char *name;
|
---|
72 | void (*accept_connection)(struct stream_connection *);
|
---|
73 | void (*recv_handler)(struct stream_connection *, uint16_t);
|
---|
74 | void (*send_handler)(struct stream_connection *, uint16_t);
|
---|
75 | };
|
---|
76 |
|
---|
77 | void stream_terminate_connection(struct stream_connection *srv_conn, const char *reason);
|
---|
78 |
|
---|
79 | #endif /* __SERVICE_STREAM_H__ */
|
---|