s3:librpc/rpc: move prototypes to dcerpc.h
[ira/wip.git] / source3 / librpc / rpc / dcerpc.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    DCERPC client side interface structures
5
6    Copyright (C) 2008 Jelmer Vernooij
7    
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.
12    
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.
17    
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/>.
20 */
21
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. */
25
26 #ifndef __DCERPC_H__
27 #define __DCERPC_H__
28
29 enum dcerpc_transport_t {
30         NCA_UNKNOWN, NCACN_NP, NCACN_IP_TCP, NCACN_IP_UDP, NCACN_VNS_IPC, 
31         NCACN_VNS_SPP, NCACN_AT_DSP, NCADG_AT_DDP, NCALRPC, NCACN_UNIX_STREAM, 
32         NCADG_UNIX_DGRAM, NCACN_HTTP, NCADG_IPX, NCACN_SPX, NCACN_INTERNAL };
33
34 /** this describes a binding to a particular transport/pipe */
35 struct dcerpc_binding {
36         enum dcerpc_transport_t transport;
37         struct ndr_syntax_id object;
38         const char *host;
39         const char *target_hostname;
40         const char *endpoint;
41         const char **options;
42         uint32_t flags;
43         uint32_t assoc_group_id;
44 };
45
46
47 /* dcerpc pipe flags */
48 #define DCERPC_DEBUG_PRINT_IN          (1<<0)
49 #define DCERPC_DEBUG_PRINT_OUT         (1<<1)
50 #define DCERPC_DEBUG_PRINT_BOTH (DCERPC_DEBUG_PRINT_IN | DCERPC_DEBUG_PRINT_OUT)
51
52 #define DCERPC_DEBUG_VALIDATE_IN       (1<<2)
53 #define DCERPC_DEBUG_VALIDATE_OUT      (1<<3)
54 #define DCERPC_DEBUG_VALIDATE_BOTH (DCERPC_DEBUG_VALIDATE_IN | DCERPC_DEBUG_VALIDATE_OUT)
55
56 #define DCERPC_CONNECT                 (1<<4)
57 #define DCERPC_SIGN                    (1<<5)
58 #define DCERPC_SEAL                    (1<<6)
59
60 #define DCERPC_PUSH_BIGENDIAN          (1<<7)
61 #define DCERPC_PULL_BIGENDIAN          (1<<8)
62
63 #define DCERPC_SCHANNEL                (1<<9)
64
65 /* use a 128 bit session key */
66 #define DCERPC_SCHANNEL_128            (1<<12)
67
68 /* check incoming pad bytes */
69 #define DCERPC_DEBUG_PAD_CHECK         (1<<13)
70
71 /* set LIBNDR_FLAG_REF_ALLOC flag when decoding NDR */
72 #define DCERPC_NDR_REF_ALLOC           (1<<14)
73
74 #define DCERPC_AUTH_OPTIONS    (DCERPC_SEAL|DCERPC_SIGN|DCERPC_SCHANNEL|DCERPC_AUTH_SPNEGO|DCERPC_AUTH_KRB5|DCERPC_AUTH_NTLM)
75
76 /* select spnego auth */
77 #define DCERPC_AUTH_SPNEGO             (1<<15)
78
79 /* select krb5 auth */
80 #define DCERPC_AUTH_KRB5               (1<<16)
81
82 #define DCERPC_SMB2                    (1<<17)
83
84 /* select NTLM auth */
85 #define DCERPC_AUTH_NTLM               (1<<18)
86
87 /* this triggers the DCERPC_PFC_FLAG_CONC_MPX flag in the bind request */
88 #define DCERPC_CONCURRENT_MULTIPLEX     (1<<19)
89
90 /* this triggers the DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN flag in the bind request */
91 #define DCERPC_HEADER_SIGNING          (1<<20)
92
93 /* use NDR64 transport */
94 #define DCERPC_NDR64                   (1<<21)
95
96 /* The following definitions come from librpc/rpc/binding.c  */
97
98 const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
99 _PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b);
100 _PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out);
101 _PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
102                                             struct ndr_syntax_id *syntax);
103 const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
104 enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot);
105 _PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower);
106 _PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t);
107 _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
108                                    struct epm_tower *tower,
109                                    struct dcerpc_binding **b_out);
110 _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
111                                              const struct dcerpc_binding *binding,
112                                              struct epm_tower *tower);
113
114 #endif /* __DCERPC_H__ */