Print this page
1575 untangle libmlrpc ... (libmlrpc)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/smbsrv/ndl/rpcpdu.ndl
+++ new/usr/src/lib/libmlrpc/common/rpcpdu.ndl
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
23 24 */
24 25
25 26 #ifndef _RPCPDU_NDL_
26 27 #define _RPCPDU_NDL_
27 28
28 29 #include "ndrtypes.ndl"
29 30
30 31 /*
31 32 * Normally, constructs are (un)marshalled atoms first, then
32 33 * constructs, then pointers. This can be confusing sometimes
33 34 * when debugging. We know that everything in here can be
34 35 * safely (un)marshalled in member order, so we say so.
35 36 */
36 37 #ifdef NDRGEN
37 38 #define _NO_REORDER_ [_no_reorder]
38 39 #else
39 40 #define _NO_REORDER_
40 41 #endif
41 42
42 43 #define NDR_TRANSFER_SYNTAX_UUID "8a885d04-1ceb-11c9-9fe8-08002b104860"
43 44
44 45 /*
45 46 * UUID (Universal Unique IDentifier)
46 47 */
47 48 /* (X/Open CAE Spec Appendix A) */
48 49 struct ndr_dce_uuid {
49 50 DWORD time_low;
50 51 WORD time_mid;
51 52 WORD time_hi_and_version;
52 53 BYTE clock_seq_hi_and_reserved;
53 54 BYTE clock_seq_low;
54 55 BYTE node[6];
55 56 };
56 57
57 58 struct ndr_uuid {
58 59 DWORD data1;
59 60 WORD data2;
60 61 WORD data3;
61 62 BYTE data4[8];
62 63 };
63 64 typedef struct ndr_uuid ndr_uuid_t;
64 65
65 66 /*
66 67 * Representation label -- needed for RPC header
67 68 * (X/Open CAE Spec Chapter 14.1)
68 69 *
69 70 * Bits Data Type Description
70 71 * ---- --------- -----------
71 72 * 0-3 charset 0=ASCII
72 73 * 1=EBCDIC
73 74 * 4-7 byte-order 0=big-endian
74 75 * 1=little-endian
75 76 * 8-15 float 0=IEEE
76 77 * 1=VAX
77 78 * 2=Cray
78 79 * 3=IBM
79 80 * 16-31 reserved
80 81 */
81 82 #define NDR_REPLAB_CHAR_MASK 0x0F /* low nibble of intg_char */
82 83 #define NDR_REPLAB_CHAR_ASCII 0x00 /* ASCII */
83 84 #define NDR_REPLAB_CHAR_EBCDIC 0x01 /* EBCDIC (never happen) */
84 85 #define NDR_REPLAB_INTG_MASK 0xF0 /* hi nibble of intg_char */
85 86 #define NDR_REPLAB_INTG_BIG_ENDIAN 0x00 /* big endian */
86 87 #define NDR_REPLAB_INTG_LITTLE_ENDIAN 0x10 /* little endian (x86) */
87 88 #define NDR_REPLAB_FLOAT_IEEE 0x00
88 89 #define NDR_REPLAB_FLOAT_VAX 0x01
89 90 #define NDR_REPLAB_FLOAT_CRAY 0x02
90 91 #define NDR_REPLAB_FLOAT_IBM 0x03
91 92
92 93 struct ndr_representation_label {
93 94 BYTE intg_char_rep; /* integer and charset */
94 95 BYTE float_rep;
95 96 BYTE _spare[2];
96 97 };
97 98 typedef struct ndr_representation_label ndr_replab_t;
98 99
99 100
100 101
101 102 /*
102 103 * RPC PDU (Protocol Data Unit) types
103 104 ****************************************************************
104 105 * (X/Open CAE Spec 12.1)
105 106 */
106 107
107 108 #define NDR_PTYPE_REQUEST 0x00 /* CO/CL */
108 109 #define NDR_PTYPE_PING 0x01 /* CL */
109 110 #define NDR_PTYPE_RESPONSE 0x02 /* CO/CL */
110 111 #define NDR_PTYPE_FAULT 0x03 /* CL/CL */
111 112 #define NDR_PTYPE_WORKING 0x04 /* CL */
112 113 #define NDR_PTYPE_NOCALL 0x05 /* CL */
113 114 #define NDR_PTYPE_REJECT 0x06 /* CL */
114 115 #define NDR_PTYPE_ACK 0x07 /* CL */
115 116 #define NDR_PTYPE_CL_CANCEL 0x08 /* CL */
116 117 #define NDR_PTYPE_FACK 0x09 /* CL */
117 118 #define NDR_PTYPE_CANCEL_ACK 0x0A /* CL */
118 119 #define NDR_PTYPE_BIND 0x0B /* CO */
119 120 #define NDR_PTYPE_BIND_ACK 0x0C /* CO */
120 121 #define NDR_PTYPE_BIND_NAK 0x0D /* CO */
121 122 #define NDR_PTYPE_ALTER_CONTEXT 0x0E /* CO */
122 123 #define NDR_PTYPE_ALTER_CONTEXT_RESP 0x0F /* CO */
123 124 /* 0x10 missing from DCE/RPC */
124 125 #define NDR_PTYPE_SHUTDOWN 0x11 /* CO */
125 126 #define NDR_PTYPE_CO_CANCEL 0x12 /* CO */
126 127 #define NDR_PTYPE_ORPHANED 0x13 /* CO */
127 128
128 129 /*
129 130 * Flags in the RPC header for Connection-oriented PDU data types
130 131 * (X/Open CAE Spec 12.6.3.1)
131 132 *
132 133 * MS-RPCE 2.2.2.3 PFC_SUPPORT_HEADER_SIGN
133 134 * For PDU types bind, bind_ack, alter_context and alter_context_resp,
134 135 * 0x04 means PFC_SUPPORT_HEADER_SIGN.
135 136 * For other PDU types 0x04 means PFC_PENDING_CANCEL.
136 137 */
137 138 #define NDR_PFC_FIRST_FRAG 0x01 /* First fragment */
138 139 #define NDR_PFC_LAST_FRAG 0x02 /* Last framgent */
139 140 #define NDR_PFC_PENDING_CANCEL 0x04 /* Cancel was pending@sender*/
140 141 #define NDR_PFC_SUPPORT_HEADER_SIGN NDR_PFC_PENDING_CANCEL
141 142 #define NDR_PFC_RESERVED_1 0x08 /* */
142 143 #define NDR_PFC_CONC_MPX 0x10 /* supports concurrent muxing
143 144 * of single connection */
144 145 #define NDR_PFC_DID_NOT_EXECUTE 0x20 /* for PTYPE_FAULT, guarantee
145 146 * call did not execute */
146 147 #define NDR_PFC_MAYBE 0x40 /* "maybe" semantics req'ed*/
147 148 #define NDR_PFC_OBJECT_UUID 0x80 /* */
148 149
149 150 /*
150 151 * Security Providers
151 152 * MS-RPCE 2.2.1.1.6
152 153 */
153 154 #define NDR_C_AUTHN_NONE 0x00 /* No authentication */
154 155 #define NDR_C_AUTHN_GSS_NEGOTIATE 0x09 /* SPNEGO */
155 156 #define NDR_C_AUTHN_WINNT 0x0A /* NTLM */
156 157 #define NDR_C_AUTHN_GSS_KERBEROS 0x10 /* Kerberos */
157 158 #define NDR_C_AUTHN_GSS_NETLOGON 0x44 /* Netlogon */
158 159 #define NDR_C_AUTHN_GSS_DEFAULT 0xFF /* Default is NTLM */
159 160
160 161 /*
161 162 * Encoding protection levels
162 163 * X/Open CAE Spec 13.1.2.1
163 164 * MS-RPCE 2.2.1.1.7
164 165 */
165 166 #define NDR_C_AUTHN_LEVEL_DEFAULT 0x00 /* Same as Connect */
166 167 #define NDR_C_AUTHN_LEVEL_NONE 0x01
167 168 #define NDR_C_AUTHN_LEVEL_CONNECT 0x02
168 169 #define NDR_C_AUTHN_LEVEL_CALL 0x03
169 170 #define NDR_C_AUTHN_LEVEL_PKT 0x04
170 171 #define NDR_C_AUTHN_LEVEL_PKT_INTEGRITY 0x05
171 172 #define NDR_C_AUTHN_LEVEL_PKT_PRIVACY 0x06
172 173
173 174 /*
174 175 * Header common to all Connection-oriented RPC PDUs
175 176 * (X/Open CAE Spec 12.6.3.1)
176 177 */
177 178 _NO_REORDER_
178 179 struct ndr_p_syntax_id {
179 180 ndr_uuid_t if_uuid;
180 181 DWORD if_version;
181 182 };
182 183 typedef struct ndr_p_syntax_id ndr_p_syntax_id_t;
183 184
184 185 _NO_REORDER_
185 186 struct ndr_common_header {
186 187 BYTE rpc_vers; /* 00:01 5 */
187 188 BYTE rpc_vers_minor; /* 01:01 0 */
188 189 BYTE ptype; /* 02:01 NDR_PTYPE_... */
189 190 BYTE pfc_flags; /* 03:01 NDR_PFC_... */
190 191 struct ndr_representation_label
191 192 packed_drep; /* 04:04 NDR representation label */
192 193 WORD frag_length; /* 08:02 total length of frag */
193 194 WORD auth_length; /* 10:02 length of auth_value */
194 195 DWORD call_id; /* 12:04 call identifier */
195 196 /* 16: */
196 197 };
197 198 typedef struct ndr_common_header ndr_common_header_t;
198 199 EXTERNTYPEINFO(ndr_common_header)
199 200
200 201 /*
201 202 * MS-RPCE 2.2.6 Type Serialization Version 1 extensions to IDL/+ pickle
202 203 * One header per serialization stream: the header must be little endian.
203 204 * The filler must be set to 0xcccccccc during marshaling and ignored
204 205 * during unmarshaling.
205 206 */
206 207 _NO_REORDER_
207 208 struct ndr_serialtype1_hdr {
208 209 BYTE version; /* 00:01 1 */
209 210 BYTE endianness; /* 01:01 0=big, 1=little */
210 211 WORD hdrlen; /* 02:02 8 */
211 212 DWORD filler; /* 04:04 0xcccccccc */
212 213 /* 8: */
213 214 };
214 215 typedef struct ndr_serialtype1_hdr ndr_serialtype1_hdr_t;
215 216 EXTERNTYPEINFO(ndr_serialtype1_hdr)
216 217
217 218 /*
218 219 * Type Serialization Version 1 Private Header.
219 220 * A private header must precede a top-level NDR constructed type.
220 221 */
221 222 _NO_REORDER_
222 223 struct ndr_serialtype1_priv_hdr {
223 224 DWORD buflen; /* 00:04 */
224 225 DWORD filler; /* 04:04 must be zero */
225 226 /* 8: */
226 227 };
227 228 typedef struct ndr_serialtype1_priv_hdr ndr_serialtype1_priv_hdr_t;
228 229 EXTERNTYPEINFO(ndr_serialtype1_priv_hdr)
229 230
230 231 /*
231 232 * MS-RPCE 2.2.7 Type Serialization Version 2 extensions Version 1 (2.2.6).
232 233 * The header must be little endian.
233 234 * The endianinfo and reserved fields must be set to 0xcccccccc during
234 235 * marshaling and ignored during unmarshaling.
235 236 */
236 237 _NO_REORDER_
237 238 struct ndr_serialtype2_hdr {
238 239 BYTE version; /* 00:01 1 */
239 240 BYTE endianness; /* 01:01 0=big, 1=little */
240 241 WORD hdrlen; /* 02:02 8 */
241 242 DWORD endianinfo; /* 04:04 0xcccccccc */
242 243 DWORD reserved[4]; /* 08:16 0xcccccccc */
243 244 ndr_p_syntax_id_t transfer_syntax; /* 24:20 */
244 245 ndr_p_syntax_id_t interface_id; /* 44:20 */
245 246 /* 64: */
246 247 };
247 248 typedef struct ndr_serialtype2_hdr ndr_serialtype2_hdr_t;
248 249 EXTERNTYPEINFO(ndr_serialtype2_hdr)
249 250
250 251 /*
251 252 * Type Serialization Version 2 Private Header.
252 253 * A private header must precede a top-level NDR constructed type.
253 254 */
254 255 _NO_REORDER_
255 256 struct ndr_serialtype2_priv_hdr {
256 257 DWORD buflen; /* 00:04 */
257 258 DWORD filler[3]; /* 04:12 must be zero */
258 259 /* 16: */
259 260 };
260 261 typedef struct ndr_serialtype2_priv_hdr ndr_serialtype2_priv_hdr_t;
261 262 EXTERNTYPEINFO(ndr_serialtype2_priv_hdr)
262 263
263 264 /*
264 265 * This header comes before the NDR-encoded KERB_VALIDATION_INFO structure,
265 266 * which can be found in one of the info buffers of the PAC.
266 267 */
267 268 _NO_REORDER_
268 269 struct ndr_pac_hdr {
269 270 ndr_serialtype1_hdr_t common_hdr;
270 271 ndr_serialtype1_priv_hdr_t priv_hdr;
271 272 DWORD ref_pointer;
272 273 };
273 274 typedef struct ndr_pac_hdr ndr_pac_hdr_t;
274 275 EXTERNTYPEINFO(ndr_pac_hdr)
275 276
276 277 /*
277 278 * Supporting types (X/Open CAE Spec 12.6.3.1)
278 279 */
279 280 typedef WORD ndr_p_context_id_t;
280 281
281 282 _NO_REORDER_
282 283 struct ndr_p_cont_elem {
283 284 ndr_p_context_id_t p_cont_id;
284 285 BYTE n_transfer_syn;
285 286 BYTE _reserved;
286 287 ndr_p_syntax_id_t abstract_syntax;
287 288 /*SIZE_IS(n_transfer_syn)*/
288 289 ndr_p_syntax_id_t transfer_syntaxes[1];
289 290 };
290 291 typedef struct ndr_p_cont_elem ndr_p_cont_elem_t;
291 292 EXTERNTYPEINFO(ndr_p_cont_elem)
292 293
293 294 _NO_REORDER_
294 295 struct ndr_p_cont_list {
295 296 BYTE n_context_elem;
296 297 BYTE _reserved;
297 298 WORD _reserved2;
298 299 /*SIZE_IS(n_context_elem)*/
299 300 ndr_p_cont_elem_t p_cont_elem[1];
300 301 };
301 302 typedef struct ndr_p_cont_list ndr_p_cont_list_t;
302 303 EXTERNTYPEINFO(ndr_p_cont_list)
303 304
304 305 typedef WORD ndr_p_cont_def_result_t;
305 306 #define NDR_PCDR_ACCEPTANCE 0
306 307 #define NDR_PCDR_USER_REJECTION 1
307 308 #define NDR_PCDR_PROVIDER_REJECTION 2
308 309
309 310 /*
310 311 * Reasons for provider rejection.
311 312 * X/Open CAE Spec 12.6.3.1
312 313 */
313 314 typedef WORD ndr_p_provider_reason_t;
314 315 #define NDR_PPR_REASON_NOT_SPECIFIED 0
315 316 #define NDR_PPR_ABSTRACT_SYNTAX_NOT_SUPPORTED 1
316 317 #define NDR_PPR_PROPOSED_TRANSFER_SYNTAXES_NOT_SUPPORTED 2
317 318 #define NDR_PPR_LOCAL_LIMIT_EXCEEDED 3
318 319
319 320 _NO_REORDER_
320 321 struct ndr_p_result {
321 322 ndr_p_cont_def_result_t result; /* NDR_PCDR_... */
322 323 ndr_p_provider_reason_t reason; /* NDR_PPR_... */
323 324 ndr_p_syntax_id_t transfer_syntax; /* 0-fill if result!=ACCEPT */
324 325 };
325 326 typedef struct ndr_p_result ndr_p_result_t;
326 327 EXTERNTYPEINFO(ndr_p_result)
327 328
328 329 _NO_REORDER_
329 330 struct ndr_p_result_list {
330 331 BYTE n_results;
331 332 BYTE reserved;
332 333 WORD reserved2;
333 334 /*SIZE_IS(n_results)*/
334 335 ndr_p_result_t p_results[1];
335 336 };
336 337 typedef struct ndr_p_result_list ndr_p_result_list_t;
337 338 EXTERNTYPEINFO(ndr_p_result_list)
338 339
339 340 #define NDR_PORT_ANY_MAX_PORT_SPEC 30
340 341 _NO_REORDER_
341 342 struct ndr_port_any {
342 343 WORD length; /* always 18 */
343 344 /*SIZE_IS(length)*/
344 345 BYTE port_spec[NDR_PORT_ANY_MAX_PORT_SPEC];
345 346 /* \PIPE\ntsvcs */
346 347 /* We cheat by using 18, and pad on the right with zeroes */
347 348 };
348 349 typedef struct ndr_port_any ndr_port_any_t;
349 350 EXTERNTYPEINFO(ndr_port_any)
350 351
351 352 /*
352 353 * Reasons for rejecting an association in the bind_nak PDU.
353 354 * X/Open CAE Spec 12.6.3.1
354 355 * MS-RPCE 2.2.2.5
355 356 */
356 357 #define NDR_REASON_NOT_SPECIFIED 0
357 358 #define NDR_TEMPORARY_CONGESTION 1
358 359 #define NDR_LOCAL_LIMIT_EXCEEDED 2
359 360 #define NDR_CALLED_PADDR_UNKNOWN 3
360 361 #define NDR_PROTOCOL_VERSION_NOT_SUPPORTED 4
361 362 #define NDR_DEFAULT_CONTEXT_NOT_SUPPORTED 5
362 363 #define NDR_USER_DATA_NOT_READABLE 6
363 364 #define NDR_NO_PSAP_AVAILABLE 7
364 365 #define NDR_AUTH_TYPE_NOT_RECOGNIZED 8
365 366 #define NDR_INAVLID_CHECKSUM 9
366 367
367 368 /*
368 369 * Alter Context PDU (0x0E)
369 370 * (X/Open CAE Spec 12.6.4.1)
370 371 */
371 372 _NO_REORDER_
372 373 struct ndr_alter_context_hdr {
373 374 ndr_common_header_t common_hdr; /* 00:16 (see above) */
374 375
375 376 WORD max_xmit_frag; /* 16:02 ignored */
376 377 WORD max_recv_frag; /* 18:02 ignored */
377 378 DWORD assoc_group_id; /* 20:04 ignored */
378 379
379 380 /*
380 381 * Presentation context list (see bind hdr comments).
381 382 */
382 383 ndr_p_cont_list_t p_context_elem; /* 24: */
383 384
384 385 /* optional authentication verifier if auth_length != 0 */
385 386 /* auth_verifier_co_t auth_verifier; */
386 387 };
387 388 typedef struct ndr_alter_context_hdr ndr_alter_context_hdr_t;
388 389
389 390
390 391 /*
391 392 * Alter Context Response PDU (0x0F)
392 393 * (X/Open CAE Spec 12.6.4.2)
393 394 *
394 395 * We can't automatically generate an alter context response header because
395 396 * the sec_addr is an interior conformant (variable length) array, which is
396 397 * inconsistent with IDL/NDR rules. We mark this import-extern and provide
397 398 * a hand-coded marshalling function.
398 399 */
399 400 IMPORT_EXTERN
400 401 _NO_REORDER_
401 402 struct ndr_alter_context_rsp_hdr {
402 403 ndr_common_header_t common_hdr; /* 00:16 (see above) */
403 404
404 405 WORD max_xmit_frag; /* 16:02 ignored */
405 406 WORD max_recv_frag; /* 18:02 ignored */
406 407 DWORD assoc_group_id; /* 20:04 ignored */
407 408 ndr_port_any_t sec_addr; /* 24:20 ignored */
408 409
409 410 /*
410 411 * Presentation context list (see bind hdr comments).
411 412 */
412 413 ndr_p_result_list_t p_result_list; /* 44:nn */
413 414
414 415 /* optional authentication verifier if auth_length != 0 */
415 416 /* auth_verifier_co_t auth_verifier; */
416 417 };
417 418 typedef struct ndr_alter_context_rsp_hdr ndr_alter_context_rsp_hdr_t;
418 419
419 420
420 421 /*
421 422 * Bind PDU (0x0B)
422 423 * (X/Open CAE Spec 12.6.4.3)
423 424 */
424 425 _NO_REORDER_
425 426 struct ndr_bind_hdr {
426 427 ndr_common_header_t common_hdr; /* 00:16 (see above) */
427 428
428 429 WORD max_xmit_frag; /* 16:02 max xmit frag size, bytes */
429 430 WORD max_recv_frag; /* 18:02 max recv frag size, bytes */
430 431 DWORD assoc_group_id; /* 20:04 association group */
431 432 /* 24: */
432 433
433 434 /* presentation, a variable**2 list, of presentation contexts */
434 435 ndr_p_cont_list_t p_context_elem;
435 436
436 437 /*
437 438 * This could be followed by more transfer_syntaxes[] for the
438 439 * p_cont_elem[0], and subsequently followed by more p_cont_elem[],
439 440 * each with one or more transfer_syntaxes[]. A single
440 441 * p_cont_elem[] with a single transfer_syntaxes[] is so common,
441 442 * though, we embed it in the bind_hdr but the bind processor must
442 443 * walk through this tail if there is one.
443 444 */
444 445
445 446 /* optional authentication verifier iff auth_length != 0 */
446 447 /* auth_verifier_co_t auth_verifier; */
447 448 };
448 449 typedef struct ndr_bind_hdr ndr_bind_hdr_t;
449 450
450 451
451 452 /*
452 453 * Bind_Ack PDU (0x0C)
453 454 * (X/Open CAE Spec 12.6.4.4)
454 455 *
455 456 * We can't automatically generate a bind ack header because the sec_addr
456 457 * is an interior conformant (variable length) array, which is inconsistent
457 458 * with IDL/NDR rules. We mark this import-extern and provide a hand-coded
458 459 * marshalling function.
459 460 */
460 461 IMPORT_EXTERN
461 462 _NO_REORDER_
462 463 struct ndr_bind_ack_hdr {
463 464 ndr_common_header_t common_hdr; /* 00:16 (see above) */
464 465
465 466 WORD max_xmit_frag; /* 16:02 max xmit frag size, bytes */
466 467 WORD max_recv_frag; /* 18:02 max recv frag size, bytes */
467 468 DWORD assoc_group_id; /* 20:04 association group */
468 469 ndr_port_any_t sec_addr; /* 24:20 */
469 470
470 471 ndr_p_result_list_t p_result_list; /* 44:nn */
471 472 /* This could be followed by more. See bind_hdr above */
472 473
473 474 /* optional authentication verifier iff auth_length != 0 */
474 475 /* auth_verifier_co_t auth_verifier; */
475 476 };
476 477 typedef struct ndr_bind_ack_hdr ndr_bind_ack_hdr_t;
477 478
478 479
479 480 /*
480 481 * Request PDU (0x00)
481 482 ****************************************************************
482 483 * Two flavors, selected based on PFC_OBJECT_UUID in hdr.pfc_flags
483 484 * one without the "object" (flag clear)
484 485 * one with the "object" (flag set)
485 486 * (X/Open CAE Spec 12.6.4.9)
486 487 */
487 488
488 489 _NO_REORDER_
489 490 struct ndr_request_hdr {
490 491 ndr_common_header_t common_hdr; /* 00:16 (see above) */
491 492
492 493 /* needed for request, response, or fault */
493 494 DWORD alloc_hint; /* 16:04 allocation hint */
494 495 ndr_p_context_id_t p_cont_id; /* 20:02 pres context, i.e. data rep */
495 496 WORD opnum; /* 22:02 op number w/i interface */
496 497
497 498 /* optional field if PFC_OBJECT_UUID, not present */
498 499 /* ndr_uuid_t object; */
499 500
500 501 /* stub-data, 8-octet aligned */ /* 24:nn */
501 502 /* nn = frag_len - sizeof(common_header) - auth_len */
502 503
503 504 /* optional authentication verifier iff auth_length != 0 */
504 505 /* auth_verifier_co_t auth_verifier; */
505 506 };
506 507 typedef struct ndr_request_hdr ndr_request_hdr_t;
507 508
508 509 _NO_REORDER_
509 510 struct ndr_request_hdr_with_object {
510 511 ndr_common_header_t common_hdr; /* 00:16 (see above) */
511 512
512 513 /* needed for request, response, or fault */
513 514 DWORD alloc_hint; /* 16:04 allocation hint */
514 515 ndr_p_context_id_t p_cont_id; /* 20:02 pres context, i.e. data rep */
515 516 WORD opnum; /* 22:02 op number w/i interface */
516 517
517 518 /* optional field if PFC_OBJECT_UUID, is present */
518 519 ndr_uuid_t object; /* 24:16 object UUID, unknown purpose*/
519 520
520 521 /* stub-data, 8-octet aligned */ /* 28:nn */
521 522 /* nn = frag_len - sizeof(common_header) - auth_len */
522 523 /* nn -= sizeof(ndr_uuid_t); */
523 524
524 525 /* optional authentication verifier iff auth_length != 0 */
525 526 /* auth_verifier_co_t auth_verifier; */
526 527 };
527 528
528 529
529 530 /*
530 531 * Convenient for response header sizing and multi-fragment responses.
531 532 * We know the header is going to be 24 bytes.
532 533 */
533 534 #define NDR_RSP_HDR_SIZE 24
534 535
535 536
536 537 /*
537 538 * Response PDU (0x02)
538 539 * (X/Open CAE Spec 12.6.4.10)
539 540 */
540 541
541 542 _NO_REORDER_
542 543 struct ndr_response_hdr {
543 544 ndr_common_header_t common_hdr; /* 00:16 (see above) */
544 545
545 546 /* needed for request, response, or fault */
546 547 DWORD alloc_hint; /* 16:04 allocation hint */
547 548 ndr_p_context_id_t p_cont_id; /* 20:02 pres context, i.e. data rep */
548 549
549 550 /* needed for response or fault */
550 551 BYTE cancel_count; /* 22:01 cancel count */
551 552 BYTE reserved; /* 23:01 mbz */
552 553
553 554 /* stub-data, 8-octet aligned */ /* 24:nn */
554 555 /* nn = frag_len - sizeof(common_header) - auth_len */
555 556
556 557 /* optional authentication verifier iff auth_length != 0 */
557 558 /* auth_verifier_co_t auth_verifier; */
558 559 };
559 560 typedef struct ndr_response_hdr ndr_response_hdr_t;
560 561
561 562
562 563 /*
563 564 * Fault PDU (0x03)
564 565 * (X/Open CAE Spec 12.6.4.7)
565 566 */
566 567
567 568 _NO_REORDER_
568 569 struct ndr_fault_hdr {
569 570 ndr_common_header_t common_hdr; /* 00:16 (see above) */
570 571
571 572 DWORD alloc_hint; /* 16:04 allocation hint */
572 573 ndr_p_context_id_t p_cont_id; /* 20:02 pres context, i.e. data rep */
573 574
574 575 /* needed for response or fault */
575 576 BYTE cancel_count; /* 22:01 cancel count */
576 577 BYTE reserved; /* 23:01 mbz */
577 578
578 579 /* fault code */
579 580 DWORD status; /* 24:04 run-time fault code or 0 */
580 581
581 582 /* pad to 8-byte alignment */
582 583 BYTE reserved2[4]; /* 28:04 must-be-zero */
583 584
584 585 /* stub-data here if status==0. We do not use this mode. */
585 586
586 587 /* optional authentication verifier iff auth_length != 0 */
587 588 /* auth_verifier_co_t auth_verifier; */
588 589 };
589 590 typedef struct ndr_fault_hdr ndr_fault_hdr_t;
590 591
591 592
592 593 /* Fault status code (X/Open CAE Spec Appendix E) */
593 594 #define NDR_FAULT_NCA_RPC_VERSION_MISMATCH 0x1c000008 /* CO/CL */
594 595 #define NDR_FAULT_NCA_UNSPEC_REJECT 0x1c000009 /* CO/CL */
595 596 #define NDR_FAULT_NCA_S_BAD_ACTID 0x1c00000A /* CL */
596 597 #define NDR_FAULT_NCA_WHO_ARE_YOU_FAILED 0x1c00000B /* CL */
597 598 #define NDR_FAULT_NCA_MANAGER_NOT_ENTERED 0x1c00000C /* CO/CL */
598 599 #define NDR_FAULT_NCA_OP_RNG_ERROR 0x1c010002 /* CO/CL */
599 600 #define NDR_FAULT_NCA_UNK_IF 0x1c010003 /* CO/CL */
600 601 #define NDR_FAULT_NCA_WRONG_BOOT_TIME 0x1c010006 /* CL */
601 602 #define NDR_FAULT_NCA_S_YOU_CRASHED 0x1c010009 /* CL */
602 603 #define NDR_FAULT_NCA_PROTO_ERROR 0x1c01000B /* CO/CL */
603 604 #define NDR_FAULT_NCA_OUT_ARGS_TOO_BIG 0x1c010013 /* CO/CL */
604 605 #define NDR_FAULT_NCA_SERVER_TOO_BUSY 0x1c010014 /* CO/CL */
605 606 #define NDR_FAULT_NCA_UNSUPPORTED_TYPE 0x1c010017 /* CO/CL */
606 607 #define NDR_FAULT_NCA_INVALID_PRES_CONTEXT_ID 0x1c00001c /* CO */
607 608 #define NDR_FAULT_NCA_UNSUPPORTED_AUTHN_LEVEL 0x1c00001d /* CO/CL */
608 609 #define NDR_FAULT_NCA_INVALID_CHECKSUM 0x1c00001f /* CO/CL */
609 610 #define NDR_FAULT_NCA_INVALID_CRC 0x1c000020 /* CO/CL */
610 611
611 612
612 613 /*
613 614 * The Header Union/Switch
614 615 ****************************************************************
615 616 */
616 617
617 618 #define NDR_PTYPE_COMMON 999
618 619 #define NDR_PTYPE_REQUEST_WITH 998
619 620 #define NDR_PTYPE_SERIALTYPE_V1 997
620 621 #define NDR_PTYPE_SERIALTYPE_V2 996
621 622 #define NDR_PTYPE_PAC 995
622 623
623 624 INTERFACE(0)
624 625 union ndr_hdr {
625 626 CASE(NDR_PTYPE_COMMON) /* exceeds BYTE range, obtains common hdr */
626 627 struct ndr_common_header common_hdr;
627 628
628 629 CASE(NDR_PTYPE_BIND)
629 630 struct ndr_bind_hdr bind_hdr;
630 631
631 632 CASE(NDR_PTYPE_BIND_ACK)
632 633 struct ndr_bind_ack_hdr bind_ack_hdr;
633 634
634 635 CASE(NDR_PTYPE_REQUEST)
635 636 struct ndr_request_hdr request_hdr;
636 637
637 638 CASE(NDR_PTYPE_REQUEST_WITH) /* exceeds BYTE range, ... */
638 639 struct ndr_request_hdr_with_object request_hdr_with;
639 640
640 641 CASE(NDR_PTYPE_RESPONSE)
641 642 struct ndr_response_hdr response_hdr;
642 643
643 644 CASE(NDR_PTYPE_ALTER_CONTEXT)
644 645 struct ndr_alter_context_hdr alter_context_hdr;
645 646
646 647 CASE(NDR_PTYPE_ALTER_CONTEXT_RESP)
647 648 struct ndr_alter_context_rsp_hdr alter_context_rsp_hdr;
648 649
649 650 CASE(NDR_PTYPE_SERIALTYPE_V1)
650 651 struct ndr_serialtype1_hdr serialtype1_hdr;
651 652
652 653 CASE(NDR_PTYPE_SERIALTYPE_V2)
653 654 struct ndr_serialtype2_hdr serialtype2_hdr;
654 655
655 656 CASE(NDR_PTYPE_PAC)
656 657 struct ndr_pac_hdr pac_hdr;
657 658
658 659 CASE(NDR_PTYPE_FAULT)
659 660 struct ndr_fault_hdr fault_hdr;
660 661 };
661 662 typedef union ndr_hdr ndr_hdr_t;
662 663 EXTERNTYPEINFO(ndr_hdr)
663 664
664 665 #endif /* _RPCPDU_NDL_ */
665 666
↓ open down ↓ |
633 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX