summaryrefslogtreecommitdiffstats
path: root/source3/rpc_server/rpc_server.h
blob: 73cd78ac6a419891eb2cf1cd35e1cc9aceccb43a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 *  RPC Server helper headers
 *  Almost completely rewritten by (C) Jeremy Allison 2005 - 2010
 *  Copyright (C) Simo Sorce <idra@samba.org> - 2010
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _RPC_SERVER_H_
#define _RPC_SERVER_H_

#include "librpc/rpc/rpc_common.h" /* For enum dcerpc_transport_t */

#include "librpc/rpc/dcesrv_core.h"
#include "rpc_pipes.h"

struct auth_session_info;
struct cli_credentials;

typedef void (*dcerpc_ncacn_termination_fn)(struct dcesrv_connection *,
					    void *);

struct dcerpc_ncacn_conn {
	struct dcerpc_ncacn_conn *prev, *next;
	int sock;

	struct pipes_struct p;
	dcerpc_ncacn_termination_fn termination_fn;
	void *termination_data;

	struct dcesrv_endpoint *endpoint;

	char *remote_client_name;
	char *local_server_name;
};

void set_incoming_fault(struct pipes_struct *p);
void process_complete_pdu(struct pipes_struct *p, struct ncacn_packet *pkt);

NTSTATUS dcesrv_auth_gensec_prepare(
	TALLOC_CTX *mem_ctx,
	struct dcesrv_call_state *call,
	struct gensec_security **out,
	void *private_data);
void dcesrv_log_successful_authz(
	struct dcesrv_call_state *call,
	void *private_data);
NTSTATUS dcesrv_assoc_group_find(
	struct dcesrv_call_state *call,
	void *private_data);

NTSTATUS dcesrv_endpoint_by_ncacn_np_name(struct dcesrv_context *dce_ctx,
					  const char *endpoint,
					  struct dcesrv_endpoint **out);

struct pipes_struct *dcesrv_get_pipes_struct(struct dcesrv_connection *conn);

void dcesrv_transport_terminate_connection(struct dcesrv_connection *dce_conn,
					   const char *reason);

#endif /* _PRC_SERVER_H_ */