forked from osmocom/wireshark
Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
svn path=/trunk/; revision=50656
This commit is contained in:
parent
d331c33b4f
commit
0a669967fa
|
@ -762,7 +762,6 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
|
||||||
fileset.c
|
fileset.c
|
||||||
filters.c
|
filters.c
|
||||||
iface_monitor.c
|
iface_monitor.c
|
||||||
merge.c
|
|
||||||
proto_hier_stats.c
|
proto_hier_stats.c
|
||||||
summary.c
|
summary.c
|
||||||
ws80211_utils.c
|
ws80211_utils.c
|
||||||
|
@ -927,7 +926,6 @@ if(BUILD_mergecap)
|
||||||
)
|
)
|
||||||
set(mergecap_FILES
|
set(mergecap_FILES
|
||||||
mergecap.c
|
mergecap.c
|
||||||
merge.c
|
|
||||||
svnversion.h
|
svnversion.h
|
||||||
${WTAP_PLUGIN_SOURCES}
|
${WTAP_PLUGIN_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
|
@ -97,7 +97,6 @@ WIRESHARK_COMMON_SRC = \
|
||||||
fileset.c \
|
fileset.c \
|
||||||
filters.c \
|
filters.c \
|
||||||
iface_monitor.c \
|
iface_monitor.c \
|
||||||
merge.c \
|
|
||||||
proto_hier_stats.c \
|
proto_hier_stats.c \
|
||||||
summary.c \
|
summary.c \
|
||||||
ws80211_utils.c
|
ws80211_utils.c
|
||||||
|
@ -114,7 +113,6 @@ WIRESHARK_COMMON_INCLUDES = \
|
||||||
globals.h \
|
globals.h \
|
||||||
iface_monitor.h \
|
iface_monitor.h \
|
||||||
log.h \
|
log.h \
|
||||||
merge.h \
|
|
||||||
proto_hier_stats.h \
|
proto_hier_stats.h \
|
||||||
stat_menu.h \
|
stat_menu.h \
|
||||||
summary.h \
|
summary.h \
|
||||||
|
@ -145,8 +143,7 @@ text2pcap_INCLUDES = \
|
||||||
|
|
||||||
# mergecap specifics
|
# mergecap specifics
|
||||||
mergecap_SOURCES = \
|
mergecap_SOURCES = \
|
||||||
mergecap.c \
|
mergecap.c
|
||||||
merge.c
|
|
||||||
|
|
||||||
# editcap specifics
|
# editcap specifics
|
||||||
editcap_SOURCES = \
|
editcap_SOURCES = \
|
||||||
|
|
27
file.c
27
file.c
|
@ -41,22 +41,17 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <epan/epan.h>
|
#include <wsutil/tempfile.h>
|
||||||
#include <epan/expert.h>
|
#include <wsutil/file_util.h>
|
||||||
#include <epan/filesystem.h>
|
|
||||||
|
|
||||||
#include "color.h"
|
#include <wiretap/merge.h>
|
||||||
#include "color_filters.h"
|
|
||||||
#include "cfile.h"
|
#include <epan/epan.h>
|
||||||
#include <epan/column.h>
|
#include <epan/column.h>
|
||||||
#include <epan/packet.h>
|
#include <epan/packet.h>
|
||||||
#include <epan/column-utils.h>
|
#include <epan/column-utils.h>
|
||||||
#include "file.h"
|
#include <epan/expert.h>
|
||||||
#include "fileset.h"
|
#include <epan/filesystem.h>
|
||||||
#include "frame_tvbuff.h"
|
|
||||||
#include "wsutil/tempfile.h"
|
|
||||||
#include "merge.h"
|
|
||||||
|
|
||||||
#include <epan/prefs.h>
|
#include <epan/prefs.h>
|
||||||
#include <epan/dfilter/dfilter.h>
|
#include <epan/dfilter/dfilter.h>
|
||||||
#include <epan/epan_dissect.h>
|
#include <epan/epan_dissect.h>
|
||||||
|
@ -65,10 +60,16 @@
|
||||||
#include <epan/dissectors/packet-ber.h>
|
#include <epan/dissectors/packet-ber.h>
|
||||||
#include <epan/timestamp.h>
|
#include <epan/timestamp.h>
|
||||||
#include <epan/dfilter/dfilter-macro.h>
|
#include <epan/dfilter/dfilter-macro.h>
|
||||||
#include <wsutil/file_util.h>
|
|
||||||
#include <epan/strutil.h>
|
#include <epan/strutil.h>
|
||||||
#include <epan/addr_resolv.h>
|
#include <epan/addr_resolv.h>
|
||||||
|
|
||||||
|
#include "color.h"
|
||||||
|
#include "color_filters.h"
|
||||||
|
#include "cfile.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "fileset.h"
|
||||||
|
#include "frame_tvbuff.h"
|
||||||
|
|
||||||
#include "ui/alert_box.h"
|
#include "ui/alert_box.h"
|
||||||
#include "ui/simple_dialog.h"
|
#include "ui/simple_dialog.h"
|
||||||
#include "ui/main_statusbar.h"
|
#include "ui/main_statusbar.h"
|
||||||
|
|
12
mergecap.c
12
mergecap.c
|
@ -44,19 +44,15 @@
|
||||||
#include "wtap.h"
|
#include "wtap.h"
|
||||||
|
|
||||||
#ifndef HAVE_GETOPT
|
#ifndef HAVE_GETOPT
|
||||||
#include "wsutil/wsgetopt.h"
|
#include <wsutil/wsgetopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wsutil/strnatcmp.h"
|
#include <wsutil/strnatcmp.h>
|
||||||
|
#include <wsutil/file_util.h>
|
||||||
|
|
||||||
#define WS_BUILD_DLL
|
#include <wiretap/merge.h>
|
||||||
#define RESET_SYMBOL_EXPORT /* wsutil/wsgetopt.h set export behavior above. */
|
|
||||||
#undef WS_BUILD_DLL
|
|
||||||
#define RESET_SYMBOL_EXPORT
|
|
||||||
|
|
||||||
#include "svnversion.h"
|
#include "svnversion.h"
|
||||||
#include "merge.h"
|
|
||||||
#include "wsutil/file_util.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
|
@ -39,11 +39,12 @@
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "color_filters.h"
|
#include "color_filters.h"
|
||||||
#include "merge.h"
|
|
||||||
|
|
||||||
#include "ui/util.h"
|
|
||||||
#include <wsutil/file_util.h>
|
#include <wsutil/file_util.h>
|
||||||
|
|
||||||
|
#include <wiretap/merge.h>
|
||||||
|
|
||||||
|
#include "ui/util.h"
|
||||||
#include "ui/alert_box.h"
|
#include "ui/alert_box.h"
|
||||||
#include "ui/file_dialog.h"
|
#include "ui/file_dialog.h"
|
||||||
#include "ui/recent.h"
|
#include "ui/recent.h"
|
||||||
|
|
|
@ -68,6 +68,8 @@
|
||||||
#include <wsutil/privileges.h>
|
#include <wsutil/privileges.h>
|
||||||
#include <wsutil/file_util.h>
|
#include <wsutil/file_util.h>
|
||||||
|
|
||||||
|
#include <wiretap/merge.h>
|
||||||
|
|
||||||
#include <epan/epan.h>
|
#include <epan/epan.h>
|
||||||
#include <epan/filesystem.h>
|
#include <epan/filesystem.h>
|
||||||
#include <epan/epan_dissect.h>
|
#include <epan/epan_dissect.h>
|
||||||
|
@ -103,7 +105,6 @@
|
||||||
#include "../clopts_common.h"
|
#include "../clopts_common.h"
|
||||||
#include "../cmdarg_err.h"
|
#include "../cmdarg_err.h"
|
||||||
#include "../version_info.h"
|
#include "../version_info.h"
|
||||||
#include "../merge.h"
|
|
||||||
#include "../log.h"
|
#include "../log.h"
|
||||||
|
|
||||||
#include "gtk_iface_monitor.h"
|
#include "gtk_iface_monitor.h"
|
||||||
|
|
|
@ -177,7 +177,6 @@ SOURCES_WS_C = \
|
||||||
../../filters.c \
|
../../filters.c \
|
||||||
../../frame_tvbuff.c \
|
../../frame_tvbuff.c \
|
||||||
../../g711.c \
|
../../g711.c \
|
||||||
../../merge.c \
|
|
||||||
../../proto_hier_stats.c \
|
../../proto_hier_stats.c \
|
||||||
../../summary.c \
|
../../summary.c \
|
||||||
../../sync_pipe_write.c \
|
../../sync_pipe_write.c \
|
||||||
|
|
|
@ -44,6 +44,8 @@
|
||||||
#include <wsutil/u3.h>
|
#include <wsutil/u3.h>
|
||||||
#include <wsutil/file_util.h>
|
#include <wsutil/file_util.h>
|
||||||
|
|
||||||
|
#include <wiretap/merge.h>
|
||||||
|
|
||||||
#include <epan/epan.h>
|
#include <epan/epan.h>
|
||||||
#include <epan/filesystem.h>
|
#include <epan/filesystem.h>
|
||||||
#include <wsutil/privileges.h>
|
#include <wsutil/privileges.h>
|
||||||
|
@ -79,7 +81,6 @@
|
||||||
#include "clopts_common.h"
|
#include "clopts_common.h"
|
||||||
#include "cmdarg_err.h"
|
#include "cmdarg_err.h"
|
||||||
#include "version_info.h"
|
#include "version_info.h"
|
||||||
#include "merge.h"
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "ui/alert_box.h"
|
#include "ui/alert_box.h"
|
||||||
|
|
|
@ -40,16 +40,18 @@
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "wsutil/file_util.h"
|
||||||
|
#include "wsutil/unicode-utils.h"
|
||||||
|
|
||||||
|
#include "wiretap/merge.h"
|
||||||
|
|
||||||
#include "epan/filesystem.h"
|
#include "epan/filesystem.h"
|
||||||
#include "epan/addr_resolv.h"
|
#include "epan/addr_resolv.h"
|
||||||
#include "epan/prefs.h"
|
#include "epan/prefs.h"
|
||||||
#include "epan/print.h"
|
#include "epan/print.h"
|
||||||
#include "wsutil/file_util.h"
|
|
||||||
#include "wsutil/unicode-utils.h"
|
|
||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "color_filters.h"
|
#include "color_filters.h"
|
||||||
#include "merge.h"
|
|
||||||
|
|
||||||
#include "ui/alert_box.h"
|
#include "ui/alert_box.h"
|
||||||
#include "ui/help_url.h"
|
#include "ui/help_url.h"
|
||||||
|
|
|
@ -50,6 +50,7 @@ set(WIRETAP_FILES
|
||||||
k12.c
|
k12.c
|
||||||
lanalyzer.c
|
lanalyzer.c
|
||||||
libpcap.c
|
libpcap.c
|
||||||
|
merge.c
|
||||||
mpeg.c
|
mpeg.c
|
||||||
mime_file.c
|
mime_file.c
|
||||||
mp2t.c
|
mp2t.c
|
||||||
|
|
|
@ -57,6 +57,7 @@ NONGENERATED_C_FILES = \
|
||||||
k12.c \
|
k12.c \
|
||||||
lanalyzer.c \
|
lanalyzer.c \
|
||||||
libpcap.c \
|
libpcap.c \
|
||||||
|
merge.c \
|
||||||
mpeg.c \
|
mpeg.c \
|
||||||
mp2t.c \
|
mp2t.c \
|
||||||
netmon.c \
|
netmon.c \
|
||||||
|
@ -113,6 +114,7 @@ NONGENERATED_HEADER_FILES = \
|
||||||
lanalyzer.h \
|
lanalyzer.h \
|
||||||
libpcap.h \
|
libpcap.h \
|
||||||
mpeg.h \
|
mpeg.h \
|
||||||
|
mpeg.h \
|
||||||
mp2t.h \
|
mp2t.h \
|
||||||
netmon.h \
|
netmon.h \
|
||||||
netscreen.h \
|
netscreen.h \
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "wtap.h"
|
|
||||||
#include "merge.h"
|
#include "merge.h"
|
||||||
|
|
||||||
/*
|
/*
|
|
@ -25,6 +25,8 @@
|
||||||
#ifndef __MERGE_H__
|
#ifndef __MERGE_H__
|
||||||
#define __MERGE_H__
|
#define __MERGE_H__
|
||||||
|
|
||||||
|
#include "wiretap/wtap.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@ -46,12 +48,12 @@ typedef struct merge_in_file_s {
|
||||||
in_file_state_e state;
|
in_file_state_e state;
|
||||||
guint32 packet_num; /* current packet number */
|
guint32 packet_num; /* current packet number */
|
||||||
gint64 size; /* file size */
|
gint64 size; /* file size */
|
||||||
guint32 interface_id; /* identifier of the interface.
|
guint32 interface_id; /* identifier of the interface.
|
||||||
* Used for fake interfaces when writing WTAP_ENCAP_PER_PACKET */
|
* Used for fake interfaces when writing WTAP_ENCAP_PER_PACKET */
|
||||||
} merge_in_file_t;
|
} merge_in_file_t;
|
||||||
|
|
||||||
/** Open a number of input files to merge.
|
/** Open a number of input files to merge.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_file_names and in_files
|
* @param in_file_count number of entries in in_file_names and in_files
|
||||||
* @param in_file_names filenames of the input files
|
* @param in_file_names filenames of the input files
|
||||||
* @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
|
* @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
|
||||||
|
@ -60,40 +62,40 @@ typedef struct merge_in_file_s {
|
||||||
* @param err_fileno file on which open failed, if failed
|
* @param err_fileno file on which open failed, if failed
|
||||||
* @return TRUE if all files could be opened, FALSE otherwise
|
* @return TRUE if all files could be opened, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
extern gboolean
|
WS_DLL_PUBLIC gboolean
|
||||||
merge_open_in_files(int in_file_count, char *const *in_file_names,
|
merge_open_in_files(int in_file_count, char *const *in_file_names,
|
||||||
merge_in_file_t **in_files, int *err, gchar **err_info,
|
merge_in_file_t **in_files, int *err, gchar **err_info,
|
||||||
int *err_fileno);
|
int *err_fileno);
|
||||||
|
|
||||||
/** Close the input files again.
|
/** Close the input files again.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_files
|
* @param in_file_count number of entries in in_files
|
||||||
* @param in_files input file array to be closed
|
* @param in_files input file array to be closed
|
||||||
*/
|
*/
|
||||||
extern void
|
WS_DLL_PUBLIC void
|
||||||
merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
|
merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
|
||||||
|
|
||||||
/** Try to get the frame type from the input files.
|
/** Try to get the frame type from the input files.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_files
|
* @param in_file_count number of entries in in_files
|
||||||
* @param in_files input file array
|
* @param in_files input file array
|
||||||
* @return the frame type
|
* @return the frame type
|
||||||
*/
|
*/
|
||||||
extern int
|
WS_DLL_PUBLIC int
|
||||||
merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
|
merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
|
||||||
|
|
||||||
/** Try to get the snapshot length from the input files.
|
/** Try to get the snapshot length from the input files.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_files
|
* @param in_file_count number of entries in in_files
|
||||||
* @param in_files input file array
|
* @param in_files input file array
|
||||||
* @return the snapshot length
|
* @return the snapshot length
|
||||||
*/
|
*/
|
||||||
extern int
|
WS_DLL_PUBLIC int
|
||||||
merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
|
merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
|
||||||
|
|
||||||
/** Read the next packet, in chronological order, from the set of files to
|
/** Read the next packet, in chronological order, from the set of files to
|
||||||
* be merged.
|
* be merged.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_files
|
* @param in_file_count number of entries in in_files
|
||||||
* @param in_files input file array
|
* @param in_files input file array
|
||||||
* @param err wiretap error, if failed
|
* @param err wiretap error, if failed
|
||||||
|
@ -101,14 +103,14 @@ merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
|
||||||
* @return pointer to merge_in_file_t for file from which that packet
|
* @return pointer to merge_in_file_t for file from which that packet
|
||||||
* came, or NULL on error or EOF
|
* came, or NULL on error or EOF
|
||||||
*/
|
*/
|
||||||
extern merge_in_file_t *
|
WS_DLL_PUBLIC merge_in_file_t *
|
||||||
merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
|
merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
|
||||||
gchar **err_info);
|
gchar **err_info);
|
||||||
|
|
||||||
|
|
||||||
/** Read the next packet, in file sequence order, from the set of files
|
/** Read the next packet, in file sequence order, from the set of files
|
||||||
* to be merged.
|
* to be merged.
|
||||||
*
|
*
|
||||||
* @param in_file_count number of entries in in_files
|
* @param in_file_count number of entries in in_files
|
||||||
* @param in_files input file array
|
* @param in_files input file array
|
||||||
* @param err wiretap error, if failed
|
* @param err wiretap error, if failed
|
||||||
|
@ -116,7 +118,7 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
|
||||||
* @return pointer to merge_in_file_t for file from which that packet
|
* @return pointer to merge_in_file_t for file from which that packet
|
||||||
* came, or NULL on error or EOF
|
* came, or NULL on error or EOF
|
||||||
*/
|
*/
|
||||||
extern merge_in_file_t *
|
WS_DLL_PUBLIC merge_in_file_t *
|
||||||
merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
|
merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
|
||||||
int *err, gchar **err_info);
|
int *err, gchar **err_info);
|
||||||
|
|
Loading…
Reference in New Issue