| Wireshark 4.7.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
25 typedef enum {
26 RECORD_PRESENT,
27 RECORD_NOT_PRESENT,
28 AT_EOF,
29 GOT_ERROR
30} in_file_state_e;
31
32
38 typedef struct merge_in_file_s {
39 const char *filename;
40 wtap *wth;
41 wtap_rec rec;
42 in_file_state_e state;
43 uint32_t packet_num;
44 int64_t size;
45 GArray *idb_index_map;
46 unsigned nrbs_seen;
47 unsigned dsbs_seen;
48} merge_in_file_t;
49
55 typedef enum {
56 MERGE_EVENT_INPUT_FILES_OPENED,
57 MERGE_EVENT_FRAME_TYPE_SELECTED,
58 MERGE_EVENT_READY_TO_MERGE,
59 MERGE_EVENT_RECORD_WAS_READ,
60 MERGE_EVENT_DONE
61} merge_event;
62
63
69 typedef enum {
70 IDB_MERGE_MODE_NONE = 0,
71 IDB_MERGE_MODE_ALL_SAME,
72 IDB_MERGE_MODE_ANY_SAME,
73 IDB_MERGE_MODE_MAX
74} idb_merge_mode;
75
76
77
84WS_DLL_PUBLIC idb_merge_mode
85 merge_string_to_idb_merge_mode(const char *name);
86
87
94WS_DLL_PUBLIC const char*
95 merge_idb_merge_mode_to_string(const int mode);
96
97
112 typedef struct {
113 bool (*callback_func)(merge_event event, int num,
114 const merge_in_file_t in_files[], const unsigned in_file_count,
115 void *data);
116 void *data;
117} merge_progress_callback_t;
118
119
137WS_DLL_PUBLIC bool
138 merge_files(const char* out_filename, const int file_type,
139 const char *const *in_filenames, const unsigned in_file_count,
140 const bool add_merging_comment, const bool do_append, const idb_merge_mode mode,
141 unsigned snaplen, const char *app_name, const char* app_env_var_prefix, merge_progress_callback_t* cb,
142 ws_compression_type compression_type);
143
163WS_DLL_PUBLIC bool
164 merge_files_to_tempfile(const char *tmpdir, char **out_filenamep, const char *pfx,
165 const int file_type, const char *const *in_filenames,
166 const unsigned in_file_count, const bool add_merging_comment,
167 const bool do_append, const idb_merge_mode mode, unsigned snaplen,
168 const char *app_name, const char* app_env_var_prefix, merge_progress_callback_t* cb);
169
185WS_DLL_PUBLIC bool
186 merge_files_to_stdout(const int file_type, const char *const *in_filenames,
187 const unsigned in_file_count, const bool add_merging_comment,
188 const bool do_append, const idb_merge_mode mode, unsigned snaplen,
189 const char *app_name, const char* app_env_var_prefix,
190 merge_progress_callback_t* cb, ws_compression_type compression_type);
191
192#ifdef __cplusplus
193}
194#endif /* __cplusplus */
195
196#endif /* __MERGE_H__ */
197
merge_event
merge_event
Merge event types passed to the callback function.
Definition merge.h:55
MERGE_EVENT_RECORD_WAS_READ
@ MERGE_EVENT_RECORD_WAS_READ
Definition merge.h:59
MERGE_EVENT_FRAME_TYPE_SELECTED
@ MERGE_EVENT_FRAME_TYPE_SELECTED
Definition merge.h:57
MERGE_EVENT_READY_TO_MERGE
@ MERGE_EVENT_READY_TO_MERGE
Definition merge.h:58
MERGE_EVENT_DONE
@ MERGE_EVENT_DONE
Definition merge.h:60
MERGE_EVENT_INPUT_FILES_OPENED
@ MERGE_EVENT_INPUT_FILES_OPENED
Definition merge.h:56
merge_files_to_tempfile
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 add_merging_comment, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, const char *app_env_var_prefix, merge_progress_callback_t *cb)
Merge the given input files to a temporary file.
Definition merge.c:1529
merge_string_to_idb_merge_mode
WS_DLL_PUBLIC idb_merge_mode merge_string_to_idb_merge_mode(const char *name)
Returns the idb_merge_mode for the given string name.
Definition merge.c:59
idb_merge_mode
idb_merge_mode
Merge mode for Interface Description Blocks (IDBs).
Definition merge.h:69
IDB_MERGE_MODE_NONE
@ IDB_MERGE_MODE_NONE
Definition merge.h:70
IDB_MERGE_MODE_ALL_SAME
@ IDB_MERGE_MODE_ALL_SAME
Definition merge.h:71
IDB_MERGE_MODE_ANY_SAME
@ IDB_MERGE_MODE_ANY_SAME
Definition merge.h:72
IDB_MERGE_MODE_MAX
@ IDB_MERGE_MODE_MAX
Definition merge.h:73
in_file_state_e
in_file_state_e
State of input file during merge.
Definition merge.h:25
AT_EOF
@ AT_EOF
Definition merge.h:28
RECORD_NOT_PRESENT
@ RECORD_NOT_PRESENT
Definition merge.h:27
RECORD_PRESENT
@ RECORD_PRESENT
Definition merge.h:26
GOT_ERROR
@ GOT_ERROR
Definition merge.h:29
merge_files
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 add_merging_comment, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, const char *app_env_var_prefix, merge_progress_callback_t *cb, ws_compression_type compression_type)
Merge the given input files to a file with the given filename.
Definition merge.c:1495
merge_files_to_stdout
WS_DLL_PUBLIC bool merge_files_to_stdout(const int file_type, const char *const *in_filenames, const unsigned in_file_count, const bool add_merging_comment, const bool do_append, const idb_merge_mode mode, unsigned snaplen, const char *app_name, const char *app_env_var_prefix, merge_progress_callback_t *cb, ws_compression_type compression_type)
Merge the given input files to the standard output.
Definition merge.c:1551
merge_idb_merge_mode_to_string
WS_DLL_PUBLIC const char * merge_idb_merge_mode_to_string(const int mode)
Returns the string name for the given number.
Definition merge.c:71
merge_in_file_t
struct merge_in_file_s merge_in_file_t
Structure to manage input files during merge.
merge_in_file_s
Structure to manage input files during merge.
Definition merge.h:38
merge_in_file_s::filename
const char * filename
Definition merge.h:39
merge_in_file_s::size
int64_t size
Definition merge.h:44
merge_in_file_s::idb_index_map
GArray * idb_index_map
Definition merge.h:45
merge_in_file_s::rec
wtap_rec rec
Definition merge.h:41
merge_in_file_s::dsbs_seen
unsigned dsbs_seen
Definition merge.h:47
merge_in_file_s::state
in_file_state_e state
Definition merge.h:42
merge_in_file_s::nrbs_seen
unsigned nrbs_seen
Definition merge.h:46
merge_in_file_s::packet_num
uint32_t packet_num
Definition merge.h:43
merge_in_file_s::wth
wtap * wth
Definition merge.h:40
merge_progress_callback_t
Callback information for merging.
Definition merge.h:112
merge_progress_callback_t::data
void * data
Definition merge.h:116
wtap_rec
Definition wtap.h:1512
wtap
Definition wtap_module.h:58
wtap.h