ReactOS 0.4.15-dev-7958-gcd0bb1a
rpc_defs.h
Go to the documentation of this file.
1/*
2 * RPC definitions
3 *
4 * Copyright 2001-2002 Ove Kåven, TransGaming Technologies
5 * Copyright 2004 Filip Navara
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#ifndef __WINE_RPC_DEFS_H
23#define __WINE_RPC_DEFS_H
24
25#include "pshpack1.h"
26typedef struct
27{
28 unsigned char rpc_ver; /* RPC major version (5) */
29 unsigned char rpc_ver_minor; /* RPC minor version (0) */
30 unsigned char ptype; /* Packet type (PKT_*) */
31 unsigned char flags;
32 unsigned char drep[4]; /* Data representation */
33 unsigned short frag_len; /* Data size in bytes including header and tail. */
34 unsigned short auth_len; /* Authentication length */
35 unsigned int call_id; /* Call identifier. */
37
38typedef struct
39{
41 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */
42 unsigned short context_id; /* Presentation context identifier */
43 unsigned short opnum;
45
46typedef struct
47{
49 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */
50 unsigned short context_id; /* Presentation context identifier */
51 unsigned char cancel_count;
52 unsigned char reserved;
54
55typedef struct
56{
58 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */
59 unsigned short context_id; /* Presentation context identifier */
60 unsigned char cancel_count; /* Received cancel count */
61 unsigned char reserved; /* Force alignment! */
62 unsigned int status; /* Runtime fault code (RPC_STATUS) */
63 unsigned int reserved2;
65
66typedef struct
67{
68 unsigned short context_id; /* Presentation context identifier */
69 unsigned char num_syntaxes; /* Number of syntaxes */
70 unsigned char reserved; /* For alignment */
72 RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]; /* size_is(num_syntaxes) */
74
75typedef struct
76{
78 unsigned short max_tsize; /* Maximum transmission fragment size */
79 unsigned short max_rsize; /* Maximum receive fragment size */
80 unsigned int assoc_gid; /* Associated group id */
81 unsigned char num_elements; /* Number of elements */
82 unsigned char padding[3]; /* Force alignment! */
83 /*
84 * Following this header are these fields:
85 * RpcContextElement context_elements[num_elements]
86 */
88
89typedef struct
90{
91 unsigned short length; /* Length of the string including null terminator */
92 char string[ANYSIZE_ARRAY]; /* String data in single byte, null terminated form */
94
95typedef struct
96{
97 unsigned short result;
98 unsigned short reason;
100} RpcResult;
101
102typedef struct
103{
104 unsigned char num_results; /* Number of results */
105 unsigned char reserved[3]; /* Force alignment! */
106 RpcResult results[ANYSIZE_ARRAY]; /* size_is(num_results) */
108
109typedef struct
110{
112 unsigned short max_tsize; /* Maximum transmission fragment size */
113 unsigned short max_rsize; /* Maximum receive fragment size */
114 unsigned int assoc_gid; /* Associated group id */
115 /*
116 * Following this header are these fields:
117 * RpcAddressString server_address;
118 * [0 - 3 bytes of padding so that results is 4-byte aligned]
119 * RpcResultList results;
120 */
122
123typedef struct
124{
126 unsigned short reject_reason;
127 unsigned char protocols_count;
128 struct {
129 unsigned char rpc_ver;
130 unsigned char rpc_ver_minor;
133
134/* undocumented packet sent during RPC over HTTP */
135typedef struct
136{
138 unsigned short flags;
139 unsigned short num_data_items;
141
142/* AUTH3 packet */
143typedef struct
144{
146 unsigned int pad; /* ignored */
148
149/* Union representing all possible packet headers */
150typedef union
151{
161} RpcPktHdr;
162
163typedef struct
164{
165 unsigned char auth_type; /* authentication scheme in use */
166 unsigned char auth_level; /* RPC_C_AUTHN_LEVEL* */
167 unsigned char auth_pad_length; /* length of padding to restore n % 4 alignment */
168 unsigned char auth_reserved; /* reserved, must be zero */
169 unsigned int auth_context_id; /* unique value for the authenticated connection */
171#include "poppack.h"
172
173#define RPC_AUTH_VERIFIER_LEN(common_hdr) \
174 ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0)
175
176#define RPC_VER_MAJOR 5
177#define RPC_VER_MINOR 0
178
179#define RPC_FLG_FIRST 1
180#define RPC_FLG_LAST 2
181#define RPC_FLG_OBJECT_UUID 0x80
182
183#define RPC_MIN_PACKET_SIZE 0x1000
184#define RPC_MAX_PACKET_SIZE 0x16D0
185
187{
209};
210
211#define RESULT_ACCEPT 0
212#define RESULT_USER_REJECTION 1
213#define RESULT_PROVIDER_REJECTION 2
214
215#define REASON_NONE 0
216#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED 1
217#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED 2
218#define REASON_LOCAL_LIMIT_EXCEEDED 3
219
220#define REJECT_REASON_NOT_SPECIFIED 0
221#define REJECT_TEMPORARY_CONGESTION 1
222#define REJECT_LOCAL_LIMIT_EXCEEDED 2
223#define REJECT_CALLED_PADDR_UNKNOWN 3 /* not used */
224#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED 4
225#define REJECT_DEFAULT_CONTEXT_NOT_SUPPORTED 5 /* not used */
226#define REJECT_USER_DATA_NOT_READABLE 6 /* not used */
227#define REJECT_NO_PSAP_AVAILABLE 7 /* not used */
228#define REJECT_UNKNOWN_AUTHN_SERVICE 8
229#define REJECT_INVALID_CHECKSUM 9
230
231#define NCADG_IP_UDP 0x08
232#define NCACN_IP_TCP 0x07
233#define NCADG_IPX 0x0E
234#define NCACN_SPX 0x0C
235#define NCACN_NB_NB 0x12
236#define NCACN_NB_IPX 0x0D
237#define NCACN_DNET_NSP 0x04
238#define NCACN_HTTP 0x1F
239
240/* FreeDCE: TWR_C_FLR_PROT_ID_IP */
241#define TWR_IP 0x09
242
243#endif /* __WINE_RPC_DEFS_H */
static struct _test_info results[8]
Definition: SetCursorPos.c:31
struct protocol * protocols
Definition: dispatch.c:56
r reserved
Definition: btrfs.c:3006
static const DWORD padding[]
Definition: mciwnd.c:89
rpc_packet_type
Definition: rpc_defs.h:187
@ PKT_FAULT
Definition: rpc_defs.h:191
@ PKT_NOCALL
Definition: rpc_defs.h:193
@ PKT_WORKING
Definition: rpc_defs.h:192
@ PKT_CANCEL_ACK
Definition: rpc_defs.h:198
@ PKT_REQUEST
Definition: rpc_defs.h:188
@ PKT_RESPONSE
Definition: rpc_defs.h:190
@ PKT_ACK
Definition: rpc_defs.h:195
@ PKT_PING
Definition: rpc_defs.h:189
@ PKT_BIND_NACK
Definition: rpc_defs.h:201
@ PKT_FACK
Definition: rpc_defs.h:197
@ PKT_ALTER_CONTEXT
Definition: rpc_defs.h:202
@ PKT_BIND
Definition: rpc_defs.h:199
@ PKT_CL_CANCEL
Definition: rpc_defs.h:196
@ PKT_ALTER_CONTEXT_RESP
Definition: rpc_defs.h:203
@ PKT_CO_CANCEL
Definition: rpc_defs.h:206
@ PKT_SHUTDOWN
Definition: rpc_defs.h:205
@ PKT_AUTH3
Definition: rpc_defs.h:204
@ PKT_HTTP
Definition: rpc_defs.h:208
@ PKT_ORPHANED
Definition: rpc_defs.h:207
@ PKT_BIND_ACK
Definition: rpc_defs.h:200
@ PKT_REJECT
Definition: rpc_defs.h:194
unsigned short length
Definition: rpc_defs.h:91
unsigned char auth_type
Definition: rpc_defs.h:165
unsigned char auth_pad_length
Definition: rpc_defs.h:167
unsigned char auth_reserved
Definition: rpc_defs.h:168
unsigned char auth_level
Definition: rpc_defs.h:166
unsigned int auth_context_id
Definition: rpc_defs.h:169
unsigned short context_id
Definition: rpc_defs.h:68
unsigned char reserved
Definition: rpc_defs.h:70
RPC_SYNTAX_IDENTIFIER abstract_syntax
Definition: rpc_defs.h:71
unsigned char num_syntaxes
Definition: rpc_defs.h:69
unsigned int pad
Definition: rpc_defs.h:146
RpcPktCommonHdr common
Definition: rpc_defs.h:145
unsigned int assoc_gid
Definition: rpc_defs.h:114
unsigned short max_tsize
Definition: rpc_defs.h:112
unsigned short max_rsize
Definition: rpc_defs.h:113
RpcPktCommonHdr common
Definition: rpc_defs.h:111
RpcPktCommonHdr common
Definition: rpc_defs.h:77
unsigned int assoc_gid
Definition: rpc_defs.h:80
unsigned short max_rsize
Definition: rpc_defs.h:79
unsigned short max_tsize
Definition: rpc_defs.h:78
unsigned char num_elements
Definition: rpc_defs.h:81
unsigned short reject_reason
Definition: rpc_defs.h:126
unsigned char rpc_ver
Definition: rpc_defs.h:129
unsigned char protocols_count
Definition: rpc_defs.h:127
RpcPktCommonHdr common
Definition: rpc_defs.h:125
unsigned char rpc_ver_minor
Definition: rpc_defs.h:130
unsigned char rpc_ver_minor
Definition: rpc_defs.h:29
unsigned char ptype
Definition: rpc_defs.h:30
unsigned char flags
Definition: rpc_defs.h:31
unsigned char rpc_ver
Definition: rpc_defs.h:28
unsigned int call_id
Definition: rpc_defs.h:35
unsigned short auth_len
Definition: rpc_defs.h:34
unsigned short frag_len
Definition: rpc_defs.h:33
unsigned char reserved
Definition: rpc_defs.h:61
unsigned short context_id
Definition: rpc_defs.h:59
unsigned int status
Definition: rpc_defs.h:62
unsigned char cancel_count
Definition: rpc_defs.h:60
unsigned int reserved2
Definition: rpc_defs.h:63
unsigned int alloc_hint
Definition: rpc_defs.h:58
RpcPktCommonHdr common
Definition: rpc_defs.h:57
unsigned short num_data_items
Definition: rpc_defs.h:139
RpcPktCommonHdr common
Definition: rpc_defs.h:137
unsigned short flags
Definition: rpc_defs.h:138
unsigned int alloc_hint
Definition: rpc_defs.h:41
unsigned short context_id
Definition: rpc_defs.h:42
RpcPktCommonHdr common
Definition: rpc_defs.h:40
unsigned short opnum
Definition: rpc_defs.h:43
RpcPktCommonHdr common
Definition: rpc_defs.h:48
unsigned int alloc_hint
Definition: rpc_defs.h:49
unsigned char cancel_count
Definition: rpc_defs.h:51
unsigned short context_id
Definition: rpc_defs.h:50
unsigned char reserved
Definition: rpc_defs.h:52
unsigned char num_results
Definition: rpc_defs.h:104
unsigned short result
Definition: rpc_defs.h:97
RPC_SYNTAX_IDENTIFIER transfer_syntax
Definition: rpc_defs.h:99
unsigned short reason
Definition: rpc_defs.h:98
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
RpcPktFaultHdr fault
Definition: rpc_defs.h:155
RpcPktHttpHdr http
Definition: rpc_defs.h:159
RpcPktCommonHdr common
Definition: rpc_defs.h:152
RpcPktResponseHdr response
Definition: rpc_defs.h:154
RpcPktBindAckHdr bind_ack
Definition: rpc_defs.h:157
RpcPktBindNAckHdr bind_nack
Definition: rpc_defs.h:158
RpcPktAuth3Hdr auth3
Definition: rpc_defs.h:160
RpcPktBindHdr bind
Definition: rpc_defs.h:156
RpcPktRequestHdr request
Definition: rpc_defs.h:153