preparing for release of alpha.0.8
[Samba.git] / source / include / rpc_dce.h
blob50089511555e51744b35925a16bcc4441ac0471f
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-2000
6 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
7 Copyright (C) Paul Ashton 1997-2000
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 2 of the License, or
12 (at your option) any later version.
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.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _DCE_RPC_H /* _DCE_RPC_H */
25 #define _DCE_RPC_H
27 /* DCE/RPC packet types */
29 enum RPC_PKT_TYPE
31 RPC_REQUEST = 0x00,
32 RPC_RESPONSE = 0x02,
33 RPC_FAULT = 0x03,
34 RPC_BIND = 0x0B,
35 RPC_BINDACK = 0x0C,
36 RPC_BINDNACK = 0x0D,
37 RPC_ALTCONT = 0x0E,
38 RPC_ALTCONTRESP = 0x0F,
39 RPC_BINDRESP = 0x10 /* not the real name! this is undocumented! */
42 /* DCE/RPC flags */
43 #define RPC_FLG_FIRST 0x01
44 #define RPC_FLG_LAST 0x02
45 #define RPC_FLG_NOCALL 0x20
49 * Actual structure of a DCE UUID
52 typedef struct rpc_uuid
54 uint32 time_low;
55 uint16 time_mid;
56 uint16 time_hi_and_version;
57 uint8 remaining[8];
58 } RPC_UUID;
61 /* RPC_IFACE */
62 typedef struct rpc_iface_info
64 RPC_UUID uuid; /* 16 bytes of rpc interface identification */
65 uint32 version; /* the interface version number */
67 } RPC_IFACE;
69 struct pipe_id_info
71 /* the names appear not to matter: the syntaxes _do_ matter */
73 char *client_pipe;
74 RPC_IFACE abstr_syntax; /* this one is the abstract syntax id */
76 char *server_pipe; /* this one is the secondary syntax name */
77 RPC_IFACE trans_syntax; /* this one is the primary syntax id */
80 /* RPC_HDR - dce rpc header */
81 typedef struct rpc_hdr_info
83 uint8 major; /* 5 - RPC major version */
84 uint8 minor; /* 0 - RPC minor version */
85 uint8 pkt_type; /* RPC_PKT_TYPE - RPC response packet */
86 uint8 flags; /* DCE/RPC flags */
87 uint8 pack_type[4]; /* 0x10 00 00 00 - packed data representation */
88 uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */
89 uint16 auth_len; /* 0 - authentication length */
90 uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */
92 } RPC_HDR;
94 /* RPC_HDR_REQ - request rpc header */
95 typedef struct rpc_hdr_req_info
97 uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */
98 uint16 context_id; /* 0 - presentation context identifier */
99 uint16 opnum; /* opnum */
101 } RPC_HDR_REQ;
103 /* RPC_HDR_RESP - response rpc header */
104 typedef struct rpc_hdr_resp_info
106 uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */
107 uint16 context_id; /* 0 - presentation context identifier */
108 uint8 cancel_count; /* 0 - cancel count */
109 uint8 reserved; /* 0 - reserved. */
111 } RPC_HDR_RESP;
113 /* RPC_HDR_FAULT - fault rpc header */
114 typedef struct rpc_hdr_fault_info
116 uint32 status;
117 uint32 reserved; /* 0x0000 0000 */
119 } RPC_HDR_FAULT;
121 /* RPC_HDR_NACK - nack rpc header */
122 typedef struct rpc_hdr_nack_info
124 uint16 rej_code;
126 } RPC_HDR_NACK;
128 /* this seems to be the same string name depending on the name of the pipe,
129 * but is more likely to be linked to the interface name
130 * "srvsvc", "\\PIPE\\ntsvcs"
131 * "samr", "\\PIPE\\lsass"
132 * "wkssvc", "\\PIPE\\wksvcs"
133 * "NETLOGON", "\\PIPE\\NETLOGON"
135 /* RPC_ADDR_STR */
136 typedef struct rpc_addr_info
138 uint16 len; /* length of the string including null terminator */
139 fstring str; /* the string above in single byte, null terminated form */
141 } RPC_ADDR_STR;
143 /* RPC_HDR_BBA */
144 typedef struct rpc_hdr_bba_info
146 uint16 max_tsize; /* maximum transmission fragment size (0x1630) */
147 uint16 max_rsize; /* max receive fragment size (0x1630) */
148 uint32 assoc_gid; /* associated group id (0x0) */
150 } RPC_HDR_BBA;
152 /* RPC_HDR_AUTHA */
153 typedef struct rpc_hdr_autha_info
155 uint16 max_tsize; /* maximum transmission fragment size (0x1630) */
156 uint16 max_rsize; /* max receive fragment size (0x1630) */
158 uint8 auth_type; /* 0x0a */
159 uint8 auth_level; /* 0x06 */
160 uint8 stub_type_len; /* don't know */
161 uint8 padding; /* padding */
163 uint32 unknown; /* 0x0014a0c0 */
165 } RPC_HDR_AUTHA;
167 /* RPC_HDR_AUTH */
168 typedef struct rpc_hdr_auth_info
170 uint8 auth_type; /* 0x0a */
171 uint8 auth_level; /* 0x06 */
172 uint8 stub_type_len; /* don't know */
173 uint8 padding; /* padding */
175 uint32 unknown; /* pointer */
177 } RPC_HDR_AUTH;
179 /* RPC_AUTH_VERIFIER */
180 typedef struct rpc_auth_ntlmssp_info
182 fstring signature; /* authentication type */
183 uint32 msg_type; /* message type (1,2,3) */
185 } RPC_AUTH_VERIFIER;
187 /* RPC_BIND_REQ - req bind */
188 typedef struct rpc_bind_req_info
190 RPC_HDR_BBA bba;
192 uint32 num_elements; /* the number of elements (0x1) */
193 uint16 context_id; /* presentation context identifier (0x0) */
194 uint8 num_syntaxes; /* the number of syntaxes (has always been 1?)(0x1) */
196 RPC_IFACE abstract; /* num and vers. of interface client is using */
197 RPC_IFACE transfer; /* num and vers. of interface to use for replies */
199 } RPC_HDR_RB;
201 /* RPC_RESULTS - can only cope with one reason, right now... */
202 typedef struct rpc_results_info
204 /* uint8[] # 4-byte alignment padding, against SMB header */
206 uint8 num_results; /* the number of results (0x01) */
208 /* uint8[] # 4-byte alignment padding, against SMB header */
210 uint16 result; /* result (0x00 = accept) */
211 uint16 reason; /* reason (0x00 = no reason specified) */
213 } RPC_RESULTS;
215 /* RPC_HDR_BA */
216 typedef struct rpc_hdr_ba_info
218 RPC_HDR_BBA bba;
220 RPC_ADDR_STR addr ; /* the secondary address string, as described earlier */
221 RPC_RESULTS res ; /* results and reasons */
222 RPC_IFACE transfer; /* the transfer syntax from the request */
224 } RPC_HDR_BA;
226 #endif /* _DCE_RPC_H */