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
13 typedef [public] struct {
20 uint8 num_transfer_syntaxes;
21 dcerpc_syntax_id abstract_syntax;
22 dcerpc_syntax_id transfer_syntaxes[num_transfer_syntaxes];
28 uint32 assoc_group_id;
30 dcerpc_ctx_list ctx_list[num_contexts];
31 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
32 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
36 const uint8 DCERPC_REQUEST_LENGTH = 24;
37 const uint8 DCERPC_MAX_SIGN_SIZE = 32;
43 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
44 [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
47 const int DCERPC_BIND_PROVIDER_REJECT = 2;
48 const int DCERPC_BIND_REASON_ASYNTAX = 1;
53 dcerpc_syntax_id syntax;
59 uint32 assoc_group_id;
60 ascstr3 secondary_address;
61 [flag(NDR_ALIGN4)] DATA_BLOB _pad1;
63 dcerpc_ack_ctx ctx_list[num_results];
64 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
70 uint32 versions[num_versions];
73 const uint8 DCERPC_RESPONSE_LENGTH = 24;
79 [flag(NDR_ALIGN8)] DATA_BLOB _pad;
80 [flag(NDR_REMAINING)] DATA_BLOB stub_and_verifier;
84 const int DCERPC_FAULT_OP_RNG_ERROR = 0x1c010002;
85 const int DCERPC_FAULT_UNK_IF = 0x1c010003;
86 const int DCERPC_FAULT_NDR = 0x000006f7;
87 const int DCERPC_FAULT_INVALID_TAG = 0x1c000006;
88 const int DCERPC_FAULT_CONTEXT_MISMATCH = 0x1c00001a;
89 const int DCERPC_FAULT_OTHER = 0x00000001;
90 const int DCERPC_FAULT_LOGON_FAILURE = 0x00000005;
92 /* we return this fault when we haven't yet run the test
93 to see what fault w2k3 returns in this case */
94 const int DCERPC_FAULT_TODO = 0x00000042;
104 const uint8 DCERPC_AUTH_TYPE_NONE = 0;
105 const uint8 DCERPC_AUTH_TYPE_KRB5 = 1;
106 const uint8 DCERPC_AUTH_TYPE_SPNEGO = 9;
107 const uint8 DCERPC_AUTH_TYPE_NTLMSSP = 10;
108 /* I'm not 100% sure but type 16(0x10)
109 * seems to be raw krb5 --metze
111 const uint8 DCERPC_AUTH_TYPE_KRB5_16 = 16;
112 const uint8 DCERPC_AUTH_TYPE_SCHANNEL = 68;
113 const uint8 DCERPC_AUTH_TYPE_MSMQ = 100;
115 const uint8 DCERPC_AUTH_LEVEL_NONE = 1;
116 const uint8 DCERPC_AUTH_LEVEL_CONNECT = 2;
117 const uint8 DCERPC_AUTH_LEVEL_CALL = 3;
118 const uint8 DCERPC_AUTH_LEVEL_PACKET = 4;
119 const uint8 DCERPC_AUTH_LEVEL_INTEGRITY = 5;
120 const uint8 DCERPC_AUTH_LEVEL_PRIVACY = 6;
122 typedef [public] struct {
125 uint8 auth_pad_length;
127 uint32 auth_context_id;
128 [flag(NDR_REMAINING)] DATA_BLOB credentials;
131 typedef [public] struct {
133 [flag(NDR_REMAINING)] DATA_BLOB auth_info;
137 DCERPC_PKT_REQUEST = 0,
139 DCERPC_PKT_RESPONSE = 2,
140 DCERPC_PKT_FAULT = 3,
141 DCERPC_PKT_WORKING = 4,
142 DCERPC_PKT_NOCALL = 5,
143 DCERPC_PKT_REJECT = 6,
145 DCERPC_PKT_CL_CANCEL = 8,
147 DCERPC_PKT_CANCEL_ACK = 10,
148 DCERPC_PKT_BIND = 11,
149 DCERPC_PKT_BIND_ACK = 12,
150 DCERPC_PKT_BIND_NAK = 13,
151 DCERPC_PKT_ALTER = 14,
152 DCERPC_PKT_ALTER_ACK = 15,
153 DCERPC_PKT_AUTH3 = 16,
154 DCERPC_PKT_SHUTDOWN = 17,
155 DCERPC_PKT_CO_CANCEL = 18,
156 DCERPC_PKT_ORPHANED = 19
159 typedef [nodiscriminant] union {
160 [case(DCERPC_PKT_REQUEST)] dcerpc_request request;
161 [case(DCERPC_PKT_RESPONSE)] dcerpc_response response;
162 [case(DCERPC_PKT_BIND)] dcerpc_bind bind;
163 [case(DCERPC_PKT_BIND_ACK)] dcerpc_bind_ack bind_ack;
164 [case(DCERPC_PKT_ALTER)] dcerpc_bind alter;
165 [case(DCERPC_PKT_ALTER_ACK)] dcerpc_bind_ack alter_ack;
166 [case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
167 [case(DCERPC_PKT_AUTH3)] dcerpc_auth3 auth;
168 [case(DCERPC_PKT_BIND_NAK)] dcerpc_bind_nak bind_nak;
172 /* pfc_flags values */
173 const uint8 DCERPC_PFC_FLAG_FIRST = 0x01;
174 const uint8 DCERPC_PFC_FLAG_LAST = 0x02;
175 const uint8 DCERPC_PFC_FLAG_NOCALL = 0x20;
176 const uint8 DCERPC_PFC_FLAG_ORPC = 0x80;
178 /* these offsets are needed by the signing code */
179 const uint8 DCERPC_DREP_OFFSET = 4;
180 const uint8 DCERPC_FRAG_LEN_OFFSET = 8;
181 const uint8 DCERPC_AUTH_LEN_OFFSET = 10;
183 /* little-endian flag */
184 const uint8 DCERPC_DREP_LE = 0x10;
186 typedef [public] struct {
187 uint8 rpc_vers; /* RPC version */
188 uint8 rpc_vers_minor; /* Minor version */
189 uint8 ptype; /* Packet type */
190 uint8 pfc_flags; /* Fragmentation flags */
191 uint8 drep[4]; /* NDR data representation */
192 uint16 frag_length; /* Total length of fragment */
193 uint16 auth_length; /* authenticator length */
194 uint32 call_id; /* Call identifier */
196 [switch_is(ptype)] dcerpc_payload u;