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
14 typedef [public] struct {
22 uint8 num_transfer_syntaxes;
23 dcerpc_syntax_id abstract_syntax;
24 dcerpc_syntax_id transfer_syntaxes[num_transfer_syntaxes];
30 uint32 assoc_group_id;
32 dcerpc_ctx_list ctx_list[num_contexts];
33 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
34 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
38 const uint8 DCERPC_REQUEST_LENGTH = 24;
44 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
45 [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
48 const int DCERPC_BIND_PROVIDER_REJECT = 2;
49 const int DCERPC_BIND_REASON_ASYNTAX = 1;
54 dcerpc_syntax_id syntax;
60 uint32 assoc_group_id;
61 ascstr3 secondary_address;
62 [flag(NDR_ALIGN4)] DATA_BLOB _pad1;
64 dcerpc_ack_ctx ctx_list[num_results];
65 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
71 uint32 versions[num_versions];
74 const uint8 DCERPC_RESPONSE_LENGTH = 24;
80 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
81 [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
85 const int DCERPC_FAULT_OP_RNG_ERROR = 0x1c010002;
86 const int DCERPC_FAULT_NDR = 0x000006f7;
87 const int DCERPC_FAULT_CONTEXT_MISMATCH = 0x1c00001a;
88 const int DCERPC_FAULT_OTHER = 0x00000001;
90 /* we return this fault when we haven't yet run the test
91 to see what fault w2k3 returns in this case */
92 const int DCERPC_FAULT_TODO = 0x00000042;
102 const uint8 DCERPC_AUTH_TYPE_NONE = 0;
103 const uint8 DCERPC_AUTH_TYPE_KRB5 = 1;
104 const uint8 DCERPC_AUTH_TYPE_NTLMSSP = 10;
106 const uint8 DCERPC_AUTH_LEVEL_NONE = 1;
107 const uint8 DCERPC_AUTH_LEVEL_CONNECT = 2;
108 const uint8 DCERPC_AUTH_LEVEL_CALL = 3;
109 const uint8 DCERPC_AUTH_LEVEL_PACKET = 4;
110 const uint8 DCERPC_AUTH_LEVEL_INTEGRITY = 5;
111 const uint8 DCERPC_AUTH_LEVEL_PRIVACY = 6;
113 typedef [public] struct {
116 uint8 auth_pad_length;
118 uint32 auth_context_id;
119 [flag(NDR_REMAINING)] DATA_BLOB credentials;
122 typedef [public] struct {
124 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
128 DCERPC_PKT_REQUEST = 0,
130 DCERPC_PKT_RESPONSE = 2,
131 DCERPC_PKT_FAULT = 3,
132 DCERPC_PKT_WORKING = 4,
133 DCERPC_PKT_NOCALL = 5,
134 DCERPC_PKT_REJECT = 6,
136 DCERPC_PKT_CL_CANCEL = 8,
138 DCERPC_PKT_CANCEL_ACK = 10,
139 DCERPC_PKT_BIND = 11,
140 DCERPC_PKT_BIND_ACK = 12,
141 DCERPC_PKT_BIND_NAK = 13,
142 DCERPC_PKT_ALTER = 14,
143 DCERPC_PKT_ALTER_ACK = 15,
144 DCERPC_PKT_AUTH3 = 16,
145 DCERPC_PKT_SHUTDOWN = 17,
146 DCERPC_PKT_CO_CANCEL = 18,
147 DCERPC_PKT_ORPHANED = 19
150 typedef [nodiscriminant] union {
151 [case(DCERPC_PKT_REQUEST)] dcerpc_request request;
152 [case(DCERPC_PKT_RESPONSE)] dcerpc_response response;
153 [case(DCERPC_PKT_BIND)] dcerpc_bind bind;
154 [case(DCERPC_PKT_BIND_ACK)] dcerpc_bind_ack bind_ack;
155 [case(DCERPC_PKT_ALTER)] dcerpc_bind alter;
156 [case(DCERPC_PKT_ALTER_ACK)] dcerpc_bind_ack alter_ack;
157 [case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
158 [case(DCERPC_PKT_AUTH3)] dcerpc_auth3 auth;
159 [case(DCERPC_PKT_BIND_NAK)] dcerpc_bind_nak bind_nak;
163 /* pfc_flags values */
164 const uint8 DCERPC_PFC_FLAG_FIRST = 0x01;
165 const uint8 DCERPC_PFC_FLAG_LAST = 0x02;
166 const uint8 DCERPC_PFC_FLAG_NOCALL = 0x20;
168 /* these offsets are needed by the signing code */
169 const uint8 DCERPC_FRAG_LEN_OFFSET = 8;
170 const uint8 DCERPC_AUTH_LEN_OFFSET = 10;
172 typedef [public] struct {
173 uint8 rpc_vers; /* RPC version */
174 uint8 rpc_vers_minor; /* Minor version */
175 uint8 ptype; /* Packet type */
176 uint8 pfc_flags; /* Fragmentation flags */
177 uint8 drep[4]; /* NDR data representation */
178 uint16 frag_length; /* Total length of fragment */
179 uint16 auth_length; /* authenticator length */
180 uint32 call_id; /* Call identifier */
182 [switch_is(ptype)] dcerpc_payload u;