4 the base dcerpc packet definitions - not traditionally coded as IDL,
5 but given that pidl can handle it nicely it simplifies things a lot
8 see http://www.opengroup.org/onlinepubs/9629399/chap12.htm for packet
17 uint8 num_transfer_syntaxes
;
18 ndr_syntax_id abstract_syntax
;
19 ndr_syntax_id transfer_syntaxes
[num_transfer_syntaxes
];
22 typedef [public] struct {
25 uint32 assoc_group_id
;
27 dcerpc_ctx_list ctx_list
[num_contexts
];
28 [flag
(NDR_REMAINING
)] DATA_BLOB auth_info
;
31 const uint8 DCERPC_REQUEST_LENGTH
= 24;
36 typedef [nodiscriminant
] union {
37 [default] dcerpc_empty empty
;
38 [case(LIBNDR_FLAG_OBJECT_PRESENT
)] GUID
object;
45 [switch_is(ndr
->flags
& LIBNDR_FLAG_OBJECT_PRESENT
)] dcerpc_object
object;
46 [flag
(NDR_ALIGN8
)] DATA_BLOB _pad
;
47 [flag
(NDR_REMAINING
)] DATA_BLOB stub_and_verifier
;
50 const int DCERPC_BIND_REASON_ASYNTAX
= 1;
51 const int DCERPC_BIND_PROVIDER_REJECT
= 2;
52 const int DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED
= 4;
53 const int DCERPC_BIND_REASON_INVALID_AUTH_TYPE
= 8;
64 uint32 assoc_group_id
;
65 [value
(strlen
(secondary_address
)+1)] uint16 secondary_address_size
;
66 [charset
(DOS
)] uint8 secondary_address
[secondary_address_size
];
67 [flag
(NDR_ALIGN4
)] DATA_BLOB _pad1
;
69 dcerpc_ack_ctx ctx_list
[num_results
];
70 [flag
(NDR_REMAINING
)] DATA_BLOB auth_info
;
75 uint32 versions
[num_versions
];
76 } dcerpc_bind_nak_versions
;
78 typedef [nodiscriminant
] union {
79 [case(DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED
)] dcerpc_bind_nak_versions v
;
81 } dcerpc_bind_nak_versions_ctr
;
85 [switch_is(reject_reason
)] dcerpc_bind_nak_versions_ctr versions
;
88 const uint8 DCERPC_RESPONSE_LENGTH
= 24;
94 [flag
(NDR_ALIGN8
)] DATA_BLOB _pad
;
95 [flag
(NDR_REMAINING
)] DATA_BLOB stub_and_verifier
;
98 typedef [v1_enum] enum {
99 DCERPC_NCA_S_COMM_FAILURE
= 0x1C010001,
100 DCERPC_NCA_S_OP_RNG_ERROR
= 0x1C010002,
101 DCERPC_NCA_S_UNKNOWN_IF
= 0x1C010003,
102 DCERPC_NCA_S_WRONG_BOOT_TIME
= 0x1C010006,
103 DCERPC_NCA_S_YOU_CRASHED
= 0x1C010009,
104 DCERPC_NCA_S_PROTO_ERROR
= 0x1C01000B,
105 DCERPC_NCA_S_OUT_ARGS_TOO_BIG
= 0x1C010013,
106 DCERPC_NCA_S_SERVER_TOO_BUSY
= 0x1C010014,
107 DCERPC_NCA_S_FAULT_STRING_TOO_LARGE
= 0x1C010015,
108 DCERPC_NCA_S_UNSUPPORTED_TYPE
= 0x1C010017,
109 DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO
= 0x1C000001,
110 DCERPC_NCA_S_FAULT_ADDR_ERROR
= 0x1C000002,
111 DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO
= 0x1C000003,
112 DCERPC_NCA_S_FAULT_FP_UNDERFLOW
= 0x1C000004,
113 DCERPC_NCA_S_FAULT_FP_OVERRFLOW
= 0x1C000005,
114 DCERPC_NCA_S_FAULT_INVALID_TAG
= 0x1C000006,
115 DCERPC_NCA_S_FAULT_INVALID_BOUND
= 0x1C000007,
116 DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH
= 0x1C000008,
117 DCERPC_NCA_S_FAULT_UNSPEC_REJECT
= 0x1C000009,
118 DCERPC_NCA_S_FAULT_BAD_ACTID
= 0x1C00000A,
119 DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED
= 0x1C00000B,
120 DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED
= 0x1C00000C,
121 DCERPC_NCA_S_FAULT_CANCEL
= 0x1C00000D,
122 DCERPC_NCA_S_FAULT_ILL_INST
= 0x1C00000E,
123 DCERPC_NCA_S_FAULT_FP_ERROR
= 0x1C00000F,
124 DCERPC_NCA_S_FAULT_INT_OVERFLOW
= 0x1C000010,
125 DCERPC_NCA_S_UNUSED_1C000011
= 0x1C000011,
126 DCERPC_NCA_S_FAULT_UNSPEC
= 0x1C000012,
127 DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE
= 0x1C000013,
128 DCERPC_NCA_S_FAULT_PIPE_EMPTY
= 0x1C000014,
129 DCERPC_NCA_S_FAULT_PIPE_CLOSED
= 0x1C000015,
130 DCERPC_NCA_S_FAULT_PIPE_ORDER
= 0x1C000016,
131 DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE
= 0x1C000017,
132 DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR
= 0x1C000018,
133 DCERPC_NCA_S_FAULT_PIPE_MEMORY
= 0x1C000019,
134 DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH
= 0x1C00001A,
135 DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY
= 0x1C00001B,
136 DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID
= 0x1C00001C,
137 DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL
= 0x1C00001D,
138 DCERPC_NCA_S_UNUSED_1C00001E
= 0x1C00001E,
139 DCERPC_NCA_S_INVALID_CHECKSUM
= 0x1C00001F,
140 DCERPC_NCA_S_INVALID_CRC
= 0x1C000020,
141 DCERPC_NCA_S_FAULT_USER_DEFINED
= 0x1C000021,
142 DCERPC_NCA_S_FAULT_TX_OPEN_FAILED
= 0x1C000022,
143 DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR
= 0x1C000023,
144 DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND
= 0x1C000024,
145 DCERPC_NCA_S_FAULT_NO_CLIENT_STUB
= 0x1C000025
148 const int DCERPC_FAULT_OP_RNG_ERROR
= 0x1c010002;
149 const int DCERPC_FAULT_UNK_IF
= 0x1c010003;
150 const int DCERPC_FAULT_NDR
= 0x000006f7;
151 const int DCERPC_FAULT_INVALID_TAG
= 0x1c000006;
152 const int DCERPC_FAULT_CONTEXT_MISMATCH
= 0x1c00001a;
153 const int DCERPC_FAULT_OTHER
= 0x00000001;
154 const int DCERPC_FAULT_ACCESS_DENIED
= 0x00000005;
155 const int DCERPC_FAULT_CANT_PERFORM
= 0x000006d8;
157 /* we return this fault when we haven't yet run the test
158 to see what fault w2k3 returns in this case */
159 const int DCERPC_FAULT_TODO
= 0x00000042;
165 dcerpc_nca_status status
;
166 [flag
(NDR_REMAINING
)] DATA_BLOB _pad
;
169 /* the auth types we know about */
170 typedef [enum8bit
] enum {
171 DCERPC_AUTH_TYPE_NONE
= 0,
172 /* this seems to be not krb5! */
173 DCERPC_AUTH_TYPE_KRB5_1
= 1,
174 DCERPC_AUTH_TYPE_SPNEGO
= 9,
175 DCERPC_AUTH_TYPE_NTLMSSP
= 10,
176 DCERPC_AUTH_TYPE_KRB5
= 16,
177 DCERPC_AUTH_TYPE_DPA
= 17,
178 DCERPC_AUTH_TYPE_MSN
= 18,
179 DCERPC_AUTH_TYPE_DIGEST
= 21,
180 DCERPC_AUTH_TYPE_SCHANNEL
= 68,
181 DCERPC_AUTH_TYPE_MSMQ
= 100
184 typedef [enum8bit
] enum {
185 DCERPC_AUTH_LEVEL_NONE
= 1,
186 DCERPC_AUTH_LEVEL_CONNECT
= 2,
187 DCERPC_AUTH_LEVEL_CALL
= 3,
188 DCERPC_AUTH_LEVEL_PACKET
= 4,
189 DCERPC_AUTH_LEVEL_INTEGRITY
= 5,
190 DCERPC_AUTH_LEVEL_PRIVACY
= 6
193 const uint8 DCERPC_AUTH_LEVEL_DEFAULT
= DCERPC_AUTH_LEVEL_CONNECT
;
195 typedef [public] struct {
196 dcerpc_AuthType auth_type
;
197 dcerpc_AuthLevel auth_level
;
198 uint8 auth_pad_length
;
200 uint32 auth_context_id
;
201 [flag
(NDR_REMAINING
)] DATA_BLOB credentials
;
204 const uint8 DCERPC_AUTH_TRAILER_LENGTH
= 8;
206 typedef [public] struct {
207 [value
(0)] uint32 _pad
;
208 [flag
(NDR_REMAINING
)] DATA_BLOB auth_info
;
211 typedef [public] struct {
212 [value
(0)] uint32 _pad
;
213 [flag
(NDR_REMAINING
)] DATA_BLOB auth_info
;
216 typedef [public] struct {
217 [value
(0)] uint32 _pad
;
218 [flag
(NDR_REMAINING
)] DATA_BLOB auth_info
;
221 typedef [public] struct {
226 typedef [public] struct {
229 boolean32 server_is_accepting
;
232 typedef [public] struct {
237 uint32 max_frag_size
;
240 uint32 selack
[selack_size
];
243 typedef [public] struct {
246 typedef [public] struct {
249 typedef [public] struct {
252 typedef [public] struct {
255 typedef [enum8bit
] enum {
256 DCERPC_PKT_REQUEST
= 0, /* Ordinary request. */
257 DCERPC_PKT_PING
= 1, /* Connectionless is server alive ? */
258 DCERPC_PKT_RESPONSE
= 2, /* Ordinary reply. */
259 DCERPC_PKT_FAULT
= 3, /* Fault in processing of call. */
260 DCERPC_PKT_WORKING
= 4, /* Connectionless reply to a ping when server busy. */
261 DCERPC_PKT_NOCALL
= 5, /* Connectionless reply to a ping when server has lost part of clients call. */
262 DCERPC_PKT_REJECT
= 6, /* Refuse a request with a code. */
263 DCERPC_PKT_ACK
= 7, /* Connectionless client to server code. */
264 DCERPC_PKT_CL_CANCEL
= 8, /* Connectionless cancel. */
265 DCERPC_PKT_FACK
= 9, /* Connectionless fragment ack. Both client and server send. */
266 DCERPC_PKT_CANCEL_ACK
= 10, /* Server ACK to client cancel request. */
267 DCERPC_PKT_BIND
= 11, /* Bind to interface. */
268 DCERPC_PKT_BIND_ACK
= 12, /* Server ack of bind. */
269 DCERPC_PKT_BIND_NAK
= 13, /* Server nack of bind. */
270 DCERPC_PKT_ALTER
= 14, /* Alter auth. */
271 DCERPC_PKT_ALTER_RESP
= 15, /* Reply to alter auth. */
272 DCERPC_PKT_AUTH3
= 16, /* not the real name! this is undocumented! */
273 DCERPC_PKT_SHUTDOWN
= 17, /* Server to client request to shutdown. */
274 DCERPC_PKT_CO_CANCEL
= 18, /* Connection-oriented cancel request. */
275 DCERPC_PKT_ORPHANED
= 19 /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */
278 typedef [nodiscriminant
] union {
279 [case(DCERPC_PKT_REQUEST
)] dcerpc_request request
;
280 [case(DCERPC_PKT_PING
)] dcerpc_ping ping
;
281 [case(DCERPC_PKT_RESPONSE
)] dcerpc_response response
;
282 [case(DCERPC_PKT_FAULT
)] dcerpc_fault fault
;
283 [case(DCERPC_PKT_WORKING
)] dcerpc_working working
;
284 [case(DCERPC_PKT_NOCALL
)] dcerpc_fack nocall
;
285 [case(DCERPC_PKT_REJECT
)] dcerpc_fault reject
;
286 [case(DCERPC_PKT_ACK
)] dcerpc_ack ack
;
287 [case(DCERPC_PKT_CL_CANCEL
)] dcerpc_cl_cancel cl_cancel
;
288 [case(DCERPC_PKT_FACK
)] dcerpc_fack fack
;
289 [case(DCERPC_PKT_CANCEL_ACK
)] dcerpc_cancel_ack cancel_ack
;
290 [case(DCERPC_PKT_BIND
)] dcerpc_bind bind
;
291 [case(DCERPC_PKT_BIND_ACK
)] dcerpc_bind_ack bind_ack
;
292 [case(DCERPC_PKT_BIND_NAK
)] dcerpc_bind_nak bind_nak
;
293 [case(DCERPC_PKT_ALTER
)] dcerpc_bind alter
;
294 [case(DCERPC_PKT_ALTER_RESP
)] dcerpc_bind_ack alter_resp
;
295 [case(DCERPC_PKT_SHUTDOWN
)] dcerpc_shutdown shutdown
;
296 [case(DCERPC_PKT_CO_CANCEL
)] dcerpc_co_cancel co_cancel
;
297 [case(DCERPC_PKT_ORPHANED
)] dcerpc_orphaned orphaned
;
298 [case(DCERPC_PKT_AUTH3
)] dcerpc_auth3 auth3
;
301 /* pfc_flags values */
302 const uint8 DCERPC_PFC_FLAG_FIRST
= 0x01; /* First fragment */
303 const uint8 DCERPC_PFC_FLAG_LAST
= 0x02; /* Last fragment */
304 const uint8 DCERPC_PFC_FLAG_PENDING_CANCEL
= 0x04; /* Cancel was pending at sender */
305 const uint8 DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN
= DCERPC_PFC_FLAG_PENDING_CANCEL
; /* depends on the pdu type */
306 const uint8 DCERPC_PFC_FLAG_CONC_MPX
= 0x10; /* supports concurrent multiplexing of a single connection. */
307 const uint8 DCERPC_PFC_FLAG_DID_NOT_EXECUTE
= 0x20; /* on a fault it means the server hasn't done anything */
308 const uint8 DCERPC_PFC_FLAG_MAYBE
= 0x40; /* `maybe' call semantics requested */
309 const uint8 DCERPC_PFC_FLAG_OBJECT_UUID
= 0x80; /* on valid guid is in the optional object field */
311 /* these offsets are needed by the signing code */
312 const uint8 DCERPC_PFC_OFFSET
= 3;
313 const uint8 DCERPC_DREP_OFFSET
= 4;
314 const uint8 DCERPC_FRAG_LEN_OFFSET
= 8;
315 const uint8 DCERPC_AUTH_LEN_OFFSET
= 10;
317 /* little-endian flag */
318 const uint8 DCERPC_DREP_LE
= 0x10;
320 typedef [public] struct {
321 uint8 rpc_vers
; /* RPC version */
322 uint8 rpc_vers_minor
; /* Minor version */
323 dcerpc_pkt_type ptype
; /* Packet type */
324 uint8 pfc_flags
; /* Fragmentation flags */
325 uint8 drep
[4]; /* NDR data representation */
326 uint16 frag_length
; /* Total length of fragment */
327 uint16 auth_length
; /* authenticator length */
328 uint32 call_id
; /* Call identifier */
329 [switch_is(ptype
)] dcerpc_payload u
;
332 typedef [public] struct {
333 uint8 rpc_vers
; /* RPC version (4) */
342 uint32 server_boot
; /* Server boot time */
343 uint32 iface_version
;
352 [switch_is(ptype
)] dcerpc_payload u
;