From Christopher Maynard:

From doc/README.tapping:

IF the tap is going to return private data using the last parameter to
tap_queue_packet() and IF the protocol can appear multiple times inside the
same packet, you will have to make sure that each instance of
tap_queue_packet() is using its own instance of private struct variable
so they don't overwrite each other.

This was the case here, so I changed the static allocation of tap_rec to be
ep_alloc'd.  I also tried to clean up the Info column a bit.  With this patch
applied, the graph now shows the APM and ANM correctly instead of 2 ANM's.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5966

svn path=/trunk/; revision=37893
This commit is contained in:
Anders Broman 2011-07-04 20:43:29 +00:00
parent 42dcd2af62
commit 49b4ec10b6
1 changed files with 16 additions and 13 deletions

View File

@ -6946,7 +6946,8 @@ dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
static void
dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup_tree)
{
static isup_tap_rec_t tap_rec;
isup_tap_rec_t *tap_rec;
tvbuff_t *parameter_tvb;
tvbuff_t *optional_parameter_tvb;
proto_item* pass_along_item;
@ -6975,9 +6976,10 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
}
offset += MESSAGE_TYPE_LENGTH;
tap_rec.message_type = message_type;
tap_rec.calling_number = NULL;
tap_rec.called_number = NULL;
tap_rec = (isup_tap_rec_t *)ep_alloc(sizeof(isup_tap_rec_t));
tap_rec->message_type = message_type;
tap_rec->calling_number = NULL;
tap_rec->called_number = NULL;
parameter_tvb = tvb_new_subset_remaining(message_tvb, offset);
@ -7422,10 +7424,10 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
proto_tree_add_text(isup_tree, message_tvb, 0, 0, "No optional parameters are possible with this message type");
/* if there are calling/called number, we'll get them for the tap */
tap_rec.calling_number=tap_calling_number?tap_calling_number:ep_strdup("");
tap_rec.called_number=tap_called_number;
tap_rec.cause_value=tap_cause_value;
tap_queue_packet(isup_tap, pinfo, &tap_rec);
tap_rec->calling_number=tap_calling_number?tap_calling_number:ep_strdup("");
tap_rec->called_number=tap_called_number;
tap_rec->cause_value=tap_cause_value;
tap_queue_packet(isup_tap, pinfo, tap_rec);
}
/* ------------------------------------------------------------------ */
@ -7536,15 +7538,15 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->ctype = CT_BICC;
pinfo->circuit_id = bicc_cic;
col_clear(pinfo->cinfo, COL_INFO);
if (isup_show_cic_in_info) {
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s (CIC %u) ",
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ",
"%s (CIC %u)",
val_to_str_ext_const(message_type, &isup_message_type_value_acro_ext, "reserved"),
bicc_cic);
} else {
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s ",
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ",
"%s",
val_to_str_ext_const(message_type, &isup_message_type_value_acro_ext, "reserved"));
}
/* dissect CIC in main dissector since pass-along message type carrying complete BICC/ISUP message w/o CIC needs
@ -7563,6 +7565,7 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
message_tvb = tvb_new_subset_remaining(tvb, BICC_CIC_LENGTH);
dissect_isup_message(message_tvb, pinfo, bicc_tree);
col_set_fence(pinfo->cinfo, COL_INFO);
}
static void