1 /* export_object_dicom.c
3 * Routines for tracking & saving objects found in DICOM streams
4 * See also: export_object.c / export_object.h for common code
5 * Copyright 2008, David Aggeler <david_aggeler@hispeed.ch>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
33 #include <epan/dissectors/packet-dcm.h>
35 #include <epan/packet.h>
38 #include "export_object.h"
41 eo_dicom_packet(void *tapdata
, packet_info
*pinfo
, epan_dissect_t
*edt _U_
,
44 export_object_list_t
*object_list
= (export_object_list_t
*)tapdata
;
45 const dicom_eo_t
*eo_info
= (const dicom_eo_t
*)data
;
46 export_object_entry_t
*entry
;
48 if (eo_info
) { /* We have data waiting for us */
50 Don't copy any data. dcm_export_create_object() is already g_malloc() the items
51 Still, the values will be freed when the export Object window is closed.
52 Therefore, strings and buffers must be copied
54 entry
= (export_object_entry_t
*)g_malloc(sizeof(export_object_entry_t
));
56 entry
->pkt_num
= pinfo
->fd
->num
;
57 entry
->hostname
= eo_info
->hostname
;
58 entry
->content_type
= eo_info
->content_type
;
59 entry
->filename
= g_strdup(g_path_get_basename(eo_info
->filename
));
60 entry
->payload_len
= eo_info
->payload_len
;
61 entry
->payload_data
= eo_info
->payload_data
;
63 object_list_add_entry(object_list
, entry
);
65 return TRUE
; /* State changed - window should be redrawn */
67 return FALSE
; /* State unchanged - no window updates needed */
76 * indent-tabs-mode: nil
79 * ex: set shiftwidth=4 tabstop=8 expandtab:
80 * :indentSize=4:tabSize=8:noTabs=true: