2 Unix SMB/CIFS implementation.
4 DCERPC client side interface structures
6 Copyright (C) 2008 Jelmer Vernooij
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /* This is a public header file that is installed as part of Samba.
23 * If you remove any functions or change their signature, update
24 * the so version number. */
26 #ifndef _S3_DCERPC_H__
27 #define _S3_DCERPC_H__
29 #include "librpc/gen_ndr/dcerpc.h"
30 #include "../librpc/ndr/libndr.h"
31 #include "../librpc/rpc/rpc_common.h"
33 #define SMB_RPC_INTERFACE_VERSION 1
35 struct NL_AUTH_MESSAGE;
36 struct gensec_security;
38 /* auth state for all bind types. */
40 struct pipe_auth_data {
41 enum dcerpc_AuthType auth_type;
42 enum dcerpc_AuthLevel auth_level;
43 uint32_t auth_context_id;
44 bool client_hdr_signing;
46 bool verified_bitmask1;
48 struct gensec_security *auth_ctx;
50 /* Only the client code uses this for now */
51 DATA_BLOB transport_session_key;
54 /* The following definitions come from librpc/rpc/dcerpc_helpers.c */
55 NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
56 enum dcerpc_pkt_type ptype,
60 union dcerpc_payload *u,
62 NTSTATUS dcerpc_pull_ncacn_packet(TALLOC_CTX *mem_ctx,
63 const DATA_BLOB *blob,
64 struct ncacn_packet *r);
65 NTSTATUS dcerpc_push_dcerpc_auth(TALLOC_CTX *mem_ctx,
66 enum dcerpc_AuthType auth_type,
67 enum dcerpc_AuthLevel auth_level,
68 uint8_t auth_pad_length,
69 uint32_t auth_context_id,
70 const DATA_BLOB *credentials,
72 NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth,
73 size_t header_len, size_t data_left,
75 size_t *data_to_send, size_t *frag_len,
76 size_t *auth_len, size_t *pad_len);
77 NTSTATUS dcerpc_add_auth_footer(struct pipe_auth_data *auth,
78 size_t pad_len, DATA_BLOB *rpc_out);
79 NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
80 struct ncacn_packet *pkt,
81 DATA_BLOB *pkt_trailer,
85 #endif /* __S3_DCERPC_H__ */