Rewrite the layout case statement as two separate ones, grouping and using
[metze/wireshark/wip.git] / ui / export_object.h
1 /* export_object.h
2  * Common routines for tracking & saving objects found in streams of data
3  * Copyright 2007, Stephen Fisher (see AUTHORS file)
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
24  * USA.
25  */
26
27 #ifndef __EXPORT_OBJECT_H__
28 #define __EXPORT_OBJECT_H__
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 /* Common between protocols */
35
36 struct _export_object_list_t;
37 typedef struct _export_object_list_t export_object_list_t;
38
39 typedef struct _export_object_entry_t {
40     guint32 pkt_num;
41     gchar *hostname;
42     gchar *content_type;
43     gchar *filename;
44     /* We need to store a 64 bit integer to hold a file length
45       (was guint payload_len;) */
46     gint64 payload_len;
47     guint8 *payload_data;
48 } export_object_entry_t;
49
50 void object_list_add_entry(export_object_list_t *object_list, export_object_entry_t *entry);
51 export_object_entry_t *object_list_get_entry(export_object_list_t *object_list, int row);
52
53 gboolean eo_save_entry(const gchar *save_as_filename, export_object_entry_t *entry, gboolean show_err);
54 GString *eo_massage_str(const gchar *in_str, gsize maxlen, int dup);
55 const char *ct2ext(const char *content_type);
56
57
58 /* Protocol specific */
59 gboolean eo_dicom_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_,
60         const void *data);
61 gboolean eo_http_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_,
62         const void *data);
63 gboolean eo_smb_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_,
64         const void *data);
65
66 void eo_smb_cleanup(void);
67
68
69 #ifdef __cplusplus
70 }
71 #endif /* __cplusplus */
72
73 #endif /* __EXPORT_OBJECT_H__ */
74
75 /*
76  * Editor modelines
77  *
78  * Local Variables:
79  * c-basic-offset: 4
80  * tab-width: 8
81  * indent-tabs-mode: nil
82  * End:
83  *
84  * ex: set shiftwidth=4 tabstop=8 expandtab:
85  * :indentSize=4:tabSize=8:noTabs=true:
86  */