3
3
* Copyright 2001, Todd Sabin <tas@webspan.net>
4
4
* Copyright 2003, Tim Potter <tpot@samba.org>
6
* $Id: packet-dcerpc.c 19640 2006-10-20 19:37:11Z gerald $
6
* $Id: packet-dcerpc.c 19987 2006-11-26 13:24:07Z jake $
8
8
* Wireshark - Network traffic analyzer
9
9
* By Gerald Combs <gerald@wireshark.org>
2127
2127
dcerpc_dissect_fnct_t *volatile sub_dissect;
2128
2128
const char *volatile saved_proto;
2129
2129
void *volatile saved_private_data;
2130
guint length, reported_length;
2130
guint length = 0, reported_length = 0;
2131
2131
tvbuff_t *volatile stub_tvb;
2132
2132
volatile guint auth_pad_len;
2133
2133
volatile int auth_pad_offset;
2183
2183
proc->dissect_rqst : proc->dissect_resp;
2186
sub_item = proto_tree_add_item (tree, sub_proto->proto_id, tvb, 0,
2186
sub_item = proto_tree_add_item (tree, sub_proto->proto_id,
2187
(decrypted_tvb != NULL)?decrypted_tvb:tvb,
2189
2190
if (sub_item) {
2190
2191
sub_tree = proto_item_add_subtree (sub_item, sub_proto->ett);
2231
2232
init_ndr_pointer_list(pinfo);
2234
length = tvb_length(decrypted_tvb);
2235
reported_length = tvb_reported_length(decrypted_tvb);
2234
2238
* Remove the authentication padding from the stub data.
2236
2240
if (auth_info != NULL && auth_info->auth_pad_len != 0) {
2237
length = tvb_length(decrypted_tvb);
2238
reported_length = tvb_reported_length(decrypted_tvb);
2239
2241
if (reported_length >= auth_info->auth_pad_len) {
2241
2243
* OK, the padding length isn't so big that it
2253
2255
if (length > reported_length)
2254
2256
length = reported_length;
2256
stub_tvb = tvb_new_subset(tvb, 0, length, reported_length);
2258
stub_tvb = tvb_new_subset(decrypted_tvb, 0, length, reported_length);
2257
2259
auth_pad_len = auth_info->auth_pad_len;
2258
2260
auth_pad_offset = reported_length;
2287
2295
* dissect; just re-throw that exception.
2290
offset = sub_dissect (decrypted_tvb, 0, pinfo, sub_tree,
2300
offset = sub_dissect (stub_tvb, 0, pinfo, sub_tree,
2293
proto_item_set_len(sub_item, offset);
2296
2303
/* If we have a subdissector and it didn't dissect all
2297
2304
data in the tvb, make a note of it. */
2298
/* XXX - don't do this, as this could be just another RPC Req./Resp. in this PDU */
2299
/*if (tvb_reported_length_remaining(stub_tvb, offset) > 0) {
2305
remaining = tvb_reported_length_remaining(stub_tvb, offset);
2306
if (remaining > 0) {
2307
proto_tree_add_text(sub_tree, stub_tvb, offset,
2309
"[Long frame (%d byte%s)]",
2311
plurality(remaining, "", "s"));
2300
2312
if (check_col(pinfo->cinfo, COL_INFO))
2301
2313
col_append_fstr(pinfo->cinfo, COL_INFO,
2302
"[Long frame (%d bytes)]",
2303
tvb_reported_length_remaining(stub_tvb, offset));
2314
"[Long frame (%d byte%s)]",
2316
plurality(remaining, "", "s"));
2305
2319
} CATCH(BoundsError) {
2308
show_exception(decrypted_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
2322
show_exception(stub_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
4984
dissect_dcerpc_dg_fack (tvb, offset, pinfo, dcerpc_tree, &hdr);
4998
/* Body is optional */
4999
/* XXX - we assume "frag_len" is the length of the body */
5000
if (hdr.frag_len != 0)
5001
dissect_dcerpc_dg_fack (tvb, offset, pinfo, dcerpc_tree, &hdr);
4987
5004
case PDU_REJECT: