2 * Definitions for routines for merging files.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #endif /* __cplusplus */
40 * Structures to manage our input files.
42 typedef struct merge_in_file_s {
46 in_file_state_e state;
47 guint32 packet_num; /* current packet number */
48 gint64 size; /* file size */
51 /** Open a number of input files to merge.
53 * @param in_file_count number of entries in in_file_names and in_files
54 * @param in_file_names filenames of the input files
55 * @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
56 * @param err wiretap error, if failed
57 * @param err_info wiretap error string, if failed
58 * @param err_fileno file on which open failed, if failed
59 * @return TRUE if all files could be opened, FALSE otherwise
62 merge_open_in_files(int in_file_count, char *const *in_file_names,
63 merge_in_file_t **in_files, int *err, gchar **err_info,
66 /** Close the input files again.
68 * @param in_file_count number of entries in in_files
69 * @param in_files input file array to be closed
72 merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
74 /** Try to get the frame type from the input files.
76 * @param in_file_count number of entries in in_files
77 * @param in_files input file array
78 * @return the frame type
81 merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
83 /** Try to get the snapshot length from the input files.
85 * @param in_file_count number of entries in in_files
86 * @param in_files input file array
87 * @return the snapshot length
90 merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
92 /** Read the next packet, in chronological order, from the set of files to
95 * @param in_file_count number of entries in in_files
96 * @param in_files input file array
97 * @param err wiretap error, if failed
98 * @param err_info wiretap error string, if failed
99 * @return pointer to merge_in_file_t for file from which that packet
100 * came, or NULL on error or EOF
102 extern merge_in_file_t *
103 merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
107 /** Read the next packet, in file sequence order, from the set of files
110 * @param in_file_count number of entries in in_files
111 * @param in_files input file array
112 * @param err wiretap error, if failed
113 * @param err_info wiretap error string, if failed
114 * @return pointer to merge_in_file_t for file from which that packet
115 * came, or NULL on error or EOF
117 extern merge_in_file_t *
118 merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
119 int *err, gchar **err_info);
123 #endif /* __cplusplus */
125 #endif /* __MERGE_H__ */