nexmon – Blame information for rev 1

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