https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16771
Chuck Craft <bubbas...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bubbas...@gmail.com
--- Comment #1 from Chuck Craft <bubbas...@gmail.com> ---
tl;dr: header fields (and filename) for export are set from tags, if available.
Prior to https://code.wireshark.org/review/#/c/31973/, tags were dissected and
available before export.
Wireshark makes a pass through the file to display fields before File->Export
Objects->DICOM...
epan/dissectors/packet-dcm.c:
If the UIDs are not set, then copy in Wireshark boilerplate values
-------------------------------------------------------------------
dcm_export_create_object()
if (pdv->is_storage &&
pdv_curr->sop_class_uid && strlen(pdv_curr->sop_class_uid)>0 &&
pdv_curr->sop_instance_uid && strlen(pdv_curr->sop_instance_uid)>0)
else {
/* No SOP Instance or SOP Class UID found in PDV. Use wireshark ones
*/
3.0.12 - packet-dcm.c:
"UIDs" populated by dissect_dcm_pdv_body() before dcm_export_create_object()
------------------------------------------------------------------------------------------------
if (tree || have_tap_listener(dicom_eo_tap)) {
/* The performance optimization now starts at tag level.
During, tree can be NULL, but we need a few tags to be
decoded,
i.e Class & Instance UID, so the export dialog has all
information and
that the dicom header is complete
*/
offset += dissect_dcm_pdv_body(next_tvb, pinfo, tree, pdv,
0, next_tvb_length, pdv_description);
}
if (have_tap_listener(dicom_eo_tap)) {
/* Copy pure DICOM data to buffer, no PDV flags */
pdv->data = wmem_alloc(wmem_packet_scope(),
next_tvb_length);
tvb_memcpy(next_tvb, pdv->data, 0, next_tvb_length);
pdv->data_len = next_tvb_length;
/* Copy to export buffer */
dcm_export_create_object(pinfo, assoc, pdv);
}
}
Current - packet-dcm.c:
dcm_export_create_object() called before dissect_dcm_tag()
-----------------------------------------------------------------------------------------------------
if ((pdv_body_len > 0) && (pdv->is_last_fragment)) {
/* At the last segment, merge all related previous PDVs and copy
to export buffer */
dcm_export_create_object(pinfo, assoc, pdv);
}
}
if (pdv->is_command || tree) {
/* Performance optimization starts here. Don't put any COL_INFO
related stuff in here */
if (pdv->syntax == DCM_UNK) {
/* Eventually, we will have a syntax detector. Until then, don't
decode */
proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb,
offset, pdv_body_len, NULL,
"(%04x,%04x) %-8x Unparsed data", 0, 0, pdv_body_len);
}
else {
gboolean is_first_tag = TRUE;
/* Treat the left overs */
offset = dissect_dcm_tag_open(tvb, pinfo, tree, pdv, offset,
endpos, &is_first_tag);
/* Decode all tags, sequences and items in this PDV recursively */
while (offset < endpos) {
offset = dissect_dcm_tag(tvb, pinfo, tree, pdv, offset,
endpos, is_first_tag, &tag_value, &dummy);
is_first_tag = FALSE;
}
}
}
--
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via: Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives: https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe