* Copyright 2001, Todd Sabin <tas@webspan.net>
* Copyright 2003, Tim Potter <tpot@samba.org>
*
- * $Id: packet-dcerpc.c,v 1.138 2003/08/04 02:48:59 tpot Exp $
+ * $Id: packet-dcerpc.c,v 1.139 2003/09/11 10:31:01 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
static int dcerpc_tap = -1;
+
static const value_string pckt_vals[] = {
{ PDU_REQ, "Request"},
{ PDU_PING, "Ping"},
"fragments"
};
+
+
+static dcerpc_info *
+get_next_di(void)
+{
+ static dcerpc_info di[20];
+ static int di_counter=0;
+
+ di_counter++;
+ if(di_counter>=20){
+ di_counter=0;
+ }
+ return &di[di_counter];
+}
+
+
typedef struct _dcerpc_auth_info {
guint8 auth_pad_len;
guint8 auth_level;
}
if (value) {
- dcerpc_info di;
+ dcerpc_info *di;
+ di=get_next_di();
/* handoff this call */
- di.conv = conv;
- di.call_id = hdr->call_id;
- di.smb_fid = get_smb_fid(pinfo->private_data);
- di.request = TRUE;
- di.call_data = value;
- di.hf_index = -1;
+ di->conv = conv;
+ di->call_id = hdr->call_id;
+ di->smb_fid = get_smb_fid(pinfo->private_data);
+ di->request = TRUE;
+ di->call_data = value;
+ di->hf_index = -1;
if(value->rep_frame!=0){
proto_tree_add_uint(dcerpc_tree, hf_dcerpc_response_in,
}
/*qqq request, broken*/
dissect_dcerpc_cn_stub (tvb, offset, pinfo, dcerpc_tree, tree,
- hdr, &di, &auth_info, alloc_hint,
+ hdr, di, &auth_info, alloc_hint,
value->req_frame);
} else
show_stub_data (tvb, offset, dcerpc_tree, &auth_info);
}
if (value) {
- dcerpc_info di;
+ dcerpc_info *di;
+ di=get_next_di();
/* handoff this call */
- di.conv = conv;
- di.call_id = hdr->call_id;
- di.smb_fid = get_smb_fid(pinfo->private_data);
- di.request = FALSE;
- di.call_data = value;
+ di->conv = conv;
+ di->call_id = hdr->call_id;
+ di->smb_fid = get_smb_fid(pinfo->private_data);
+ di->request = FALSE;
+ di->call_data = value;
proto_tree_add_uint (dcerpc_tree, hf_dcerpc_opnum, tvb, 0, 0, value->opnum);
if(value->req_frame!=0){
/*qqq response ok*/
dissect_dcerpc_cn_stub (tvb, offset, pinfo, dcerpc_tree, tree,
- hdr, &di, &auth_info, alloc_hint,
+ hdr, di, &auth_info, alloc_hint,
value->rep_frame);
} else
show_stub_data (tvb, offset, dcerpc_tree, &auth_info);
if (value) {
int length, reported_length, stub_length;
- dcerpc_info di;
+ dcerpc_info *di;
+ di=get_next_di();
/* handoff this call */
- di.conv = conv;
- di.call_id = hdr->call_id;
- di.smb_fid = get_smb_fid(pinfo->private_data);
- di.request = FALSE;
- di.call_data = value;
+ di->conv = conv;
+ di->call_id = hdr->call_id;
+ di->smb_fid = get_smb_fid(pinfo->private_data);
+ di->request = FALSE;
+ di->call_data = value;
proto_tree_add_uint (dcerpc_tree, hf_dcerpc_opnum, tvb, 0, 0, value->opnum);
if(value->req_frame!=0){
proto_tree *dcerpc_tree, proto_tree *tree,
e_dce_dg_common_hdr_t *hdr, conversation_t *conv)
{
- dcerpc_info di;
+ dcerpc_info *di;
dcerpc_call_value *value, v;
dcerpc_matched_key matched_key, *new_matched_key;
+ di=get_next_di();
if(!(pinfo->fd->flags.visited)){
dcerpc_call_value *call_value;
dcerpc_call_key *call_key;
value = &v;
}
- di.conv = conv;
- di.call_id = hdr->seqnum;
- di.smb_fid = -1;
- di.request = TRUE;
- di.call_data = value;
+ di->conv = conv;
+ di->call_id = hdr->seqnum;
+ di->smb_fid = -1;
+ di->request = TRUE;
+ di->call_data = value;
if(value->rep_frame!=0){
proto_tree_add_uint(dcerpc_tree, hf_dcerpc_response_in,
tvb, 0, 0, value->rep_frame);
}
- dissect_dcerpc_dg_stub (tvb, offset, pinfo, dcerpc_tree, tree, hdr, &di);
+ dissect_dcerpc_dg_stub (tvb, offset, pinfo, dcerpc_tree, tree, hdr, di);
}
static void
proto_tree *dcerpc_tree, proto_tree *tree,
e_dce_dg_common_hdr_t *hdr, conversation_t *conv)
{
- dcerpc_info di;
+ dcerpc_info *di;
dcerpc_call_value *value, v;
dcerpc_matched_key matched_key, *new_matched_key;
+ di=get_next_di();
if(!(pinfo->fd->flags.visited)){
dcerpc_call_value *call_value;
dcerpc_call_key call_key;
value = &v;
}
- di.conv = conv;
- di.call_id = 0;
- di.smb_fid = -1;
- di.request = FALSE;
- di.call_data = value;
+ di->conv = conv;
+ di->call_id = 0;
+ di->smb_fid = -1;
+ di->request = FALSE;
+ di->call_data = value;
if(value->req_frame!=0){
nstime_t ns;
}
proto_tree_add_time(dcerpc_tree, hf_dcerpc_time, tvb, offset, 0, &ns);
}
- dissect_dcerpc_dg_stub (tvb, offset, pinfo, dcerpc_tree, tree, hdr, &di);
+ dissect_dcerpc_dg_stub (tvb, offset, pinfo, dcerpc_tree, tree, hdr, di);
}
/*