Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
merge.h
Go to the documentation of this file.
1
11#ifndef __MERGE_H__
12#define __MERGE_H__
13
14#include "wiretap/wtap.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20typedef enum {
21 RECORD_PRESENT,
22 RECORD_NOT_PRESENT,
23 AT_EOF,
24 GOT_ERROR
25} in_file_state_e;
26
30typedef struct merge_in_file_s {
31 const char *filename;
32 wtap *wth;
33 wtap_rec rec;
34 Buffer frame_buffer;
35 in_file_state_e state;
36 uint32_t packet_num; /* current packet number */
37 int64_t size; /* file size */
38 GArray *idb_index_map; /* used for mapping the old phdr interface_id values to new during merge */
39 unsigned nrbs_seen; /* number of elements processed so far from wth->nrbs */
40 unsigned dsbs_seen; /* number of elements processed so far from wth->dsbs */
42
44typedef enum {
45 MERGE_EVENT_INPUT_FILES_OPENED,
46 MERGE_EVENT_FRAME_TYPE_SELECTED,
47 MERGE_EVENT_READY_TO_MERGE,
48 MERGE_EVENT_RECORD_WAS_READ,
49 MERGE_EVENT_DONE
51
52
60
61
67WS_DLL_PUBLIC idb_merge_mode
68merge_string_to_idb_merge_mode(const char *name);
69
70
76WS_DLL_PUBLIC const char*
77merge_idb_merge_mode_to_string(const int mode);
78
79
94typedef struct {
95 bool (*callback_func)(merge_event event, int num,
96 const merge_in_file_t in_files[], const unsigned in_file_count,
97 void *data);
98 void *data;
100
101
116WS_DLL_PUBLIC bool
117merge_files(const char* out_filename, const int file_type,
118 const char *const *in_filenames, const unsigned in_file_count,
119 const bool do_append, const idb_merge_mode mode,
120 unsigned snaplen, const char *app_name, merge_progress_callback_t* cb,
121 wtap_compression_type compression_type);
122
139WS_DLL_PUBLIC bool
140merge_files_to_tempfile(const char *tmpdir, char **out_filenamep, const char *pfx,
141 const int file_type, const char *const *in_filenames,
142 const unsigned in_file_count, const bool do_append,
143 const idb_merge_mode mode, unsigned snaplen,
144 const char *app_name, merge_progress_callback_t* cb);
145
158WS_DLL_PUBLIC bool
159merge_files_to_stdout(const int file_type, const char *const *in_filenames,
160 const unsigned in_file_count, const bool do_append,
161 const idb_merge_mode mode, unsigned snaplen,
162 const char *app_name, merge_progress_callback_t* cb,
163 wtap_compression_type compression_type);
164
165#ifdef __cplusplus
166}
167#endif /* __cplusplus */
168
169#endif /* __MERGE_H__ */
170
merge_event
Definition merge.h:44
WS_DLL_PUBLIC idb_merge_mode merge_string_to_idb_merge_mode(const char *name)
Definition merge.c:58
idb_merge_mode
Definition merge.h:54
@ IDB_MERGE_MODE_NONE
Definition merge.h:55
@ IDB_MERGE_MODE_ALL_SAME
Definition merge.h:56
@ IDB_MERGE_MODE_ANY_SAME
Definition merge.h:57
WS_DLL_PUBLIC bool merge_files_to_tempfile(const char *tmpdir, char **out_filenamep, const char *pfx, const int file_type, const char *const *in_filenames, const unsigned in_file_count, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, merge_progress_callback_t *cb)
Definition merge.c:1526
WS_DLL_PUBLIC bool merge_files_to_stdout(const int file_type, const char *const *in_filenames, const unsigned in_file_count, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, merge_progress_callback_t *cb, wtap_compression_type compression_type)
Definition merge.c:1548
WS_DLL_PUBLIC const char * merge_idb_merge_mode_to_string(const int mode)
Definition merge.c:70
WS_DLL_PUBLIC bool merge_files(const char *out_filename, const int file_type, const char *const *in_filenames, const unsigned in_file_count, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, merge_progress_callback_t *cb, wtap_compression_type compression_type)
Definition merge.c:1493
struct merge_in_file_s merge_in_file_t
Definition buffer.h:22
Definition merge.h:30
Callback information for merging.
Definition merge.h:94
void * data
Definition merge.h:98
Definition wtap.h:1432
Definition wtap-int.h:37