diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-07-16 02:35:33 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-07-16 02:35:33 +0000 |
commit | 0a669967fa719111db64437f7dd3b2869091f9e8 (patch) | |
tree | 35aa1a3589fe2927087c1482683afaccb0183c89 | |
parent | d331c33b4ff4f5ce6c001a040db5ba1a0ded1c60 (diff) |
Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
svn path=/trunk/; revision=50656
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Makefile.common | 5 | ||||
-rw-r--r-- | file.c | 27 | ||||
-rw-r--r-- | mergecap.c | 12 | ||||
-rw-r--r-- | ui/gtk/capture_file_dlg.c | 5 | ||||
-rw-r--r-- | ui/gtk/main.c | 3 | ||||
-rw-r--r-- | ui/qt/QtShark.pro | 1 | ||||
-rw-r--r-- | ui/qt/main.cpp | 3 | ||||
-rw-r--r-- | ui/win32/file_dlg_win32.c | 8 | ||||
-rw-r--r-- | wiretap/CMakeLists.txt | 1 | ||||
-rw-r--r-- | wiretap/Makefile.common | 2 | ||||
-rw-r--r-- | wiretap/merge.c (renamed from merge.c) | 1 | ||||
-rw-r--r-- | wiretap/merge.h (renamed from merge.h) | 28 |
13 files changed, 49 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 06d5bb6290..29f65b6e2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -762,7 +762,6 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) ) fileset.c filters.c iface_monitor.c - merge.c proto_hier_stats.c summary.c ws80211_utils.c @@ -927,7 +926,6 @@ if(BUILD_mergecap) ) set(mergecap_FILES mergecap.c - merge.c svnversion.h ${WTAP_PLUGIN_SOURCES} ) diff --git a/Makefile.common b/Makefile.common index dcd139d34a..b4dab9ae88 100644 --- a/Makefile.common +++ b/Makefile.common @@ -97,7 +97,6 @@ WIRESHARK_COMMON_SRC = \ fileset.c \ filters.c \ iface_monitor.c \ - merge.c \ proto_hier_stats.c \ summary.c \ ws80211_utils.c @@ -114,7 +113,6 @@ WIRESHARK_COMMON_INCLUDES = \ globals.h \ iface_monitor.h \ log.h \ - merge.h \ proto_hier_stats.h \ stat_menu.h \ summary.h \ @@ -145,8 +143,7 @@ text2pcap_INCLUDES = \ # mergecap specifics mergecap_SOURCES = \ - mergecap.c \ - merge.c + mergecap.c # editcap specifics editcap_SOURCES = \ @@ -41,22 +41,17 @@ #include <fcntl.h> #endif -#include <epan/epan.h> -#include <epan/expert.h> -#include <epan/filesystem.h> +#include <wsutil/tempfile.h> +#include <wsutil/file_util.h> -#include "color.h" -#include "color_filters.h" -#include "cfile.h" +#include <wiretap/merge.h> + +#include <epan/epan.h> #include <epan/column.h> #include <epan/packet.h> #include <epan/column-utils.h> -#include "file.h" -#include "fileset.h" -#include "frame_tvbuff.h" -#include "wsutil/tempfile.h" -#include "merge.h" - +#include <epan/expert.h> +#include <epan/filesystem.h> #include <epan/prefs.h> #include <epan/dfilter/dfilter.h> #include <epan/epan_dissect.h> @@ -65,10 +60,16 @@ #include <epan/dissectors/packet-ber.h> #include <epan/timestamp.h> #include <epan/dfilter/dfilter-macro.h> -#include <wsutil/file_util.h> #include <epan/strutil.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/simple_dialog.h" #include "ui/main_statusbar.h" diff --git a/mergecap.c b/mergecap.c index 35609ee074..e8cae5d43f 100644 --- a/mergecap.c +++ b/mergecap.c @@ -44,19 +44,15 @@ #include "wtap.h" #ifndef HAVE_GETOPT -#include "wsutil/wsgetopt.h" +#include <wsutil/wsgetopt.h> #endif -#include "wsutil/strnatcmp.h" +#include <wsutil/strnatcmp.h> +#include <wsutil/file_util.h> -#define WS_BUILD_DLL -#define RESET_SYMBOL_EXPORT /* wsutil/wsgetopt.h set export behavior above. */ -#undef WS_BUILD_DLL -#define RESET_SYMBOL_EXPORT +#include <wiretap/merge.h> #include "svnversion.h" -#include "merge.h" -#include "wsutil/file_util.h" #ifdef HAVE_FCNTL_H #include <fcntl.h> diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c index 6d24dff82c..0c97311512 100644 --- a/ui/gtk/capture_file_dlg.c +++ b/ui/gtk/capture_file_dlg.c @@ -39,11 +39,12 @@ #include "globals.h" #include "color.h" #include "color_filters.h" -#include "merge.h" -#include "ui/util.h" #include <wsutil/file_util.h> +#include <wiretap/merge.h> + +#include "ui/util.h" #include "ui/alert_box.h" #include "ui/file_dialog.h" #include "ui/recent.h" diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 8aa1c6792b..ab137a2d97 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -68,6 +68,8 @@ #include <wsutil/privileges.h> #include <wsutil/file_util.h> +#include <wiretap/merge.h> + #include <epan/epan.h> #include <epan/filesystem.h> #include <epan/epan_dissect.h> @@ -103,7 +105,6 @@ #include "../clopts_common.h" #include "../cmdarg_err.h" #include "../version_info.h" -#include "../merge.h" #include "../log.h" #include "gtk_iface_monitor.h" diff --git a/ui/qt/QtShark.pro b/ui/qt/QtShark.pro index c590d0643f..dad81c2af3 100644 --- a/ui/qt/QtShark.pro +++ b/ui/qt/QtShark.pro @@ -177,7 +177,6 @@ SOURCES_WS_C = \ ../../filters.c \ ../../frame_tvbuff.c \ ../../g711.c \ - ../../merge.c \ ../../proto_hier_stats.c \ ../../summary.c \ ../../sync_pipe_write.c \ diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index ba271236a4..9f497e9803 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -44,6 +44,8 @@ #include <wsutil/u3.h> #include <wsutil/file_util.h> +#include <wiretap/merge.h> + #include <epan/epan.h> #include <epan/filesystem.h> #include <wsutil/privileges.h> @@ -79,7 +81,6 @@ #include "clopts_common.h" #include "cmdarg_err.h" #include "version_info.h" -#include "merge.h" #include "log.h" #include "ui/alert_box.h" diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c index c9fa01b997..955767f156 100644 --- a/ui/win32/file_dlg_win32.c +++ b/ui/win32/file_dlg_win32.c @@ -40,16 +40,18 @@ #include <gtk/gtk.h> +#include "wsutil/file_util.h" +#include "wsutil/unicode-utils.h" + +#include "wiretap/merge.h" + #include "epan/filesystem.h" #include "epan/addr_resolv.h" #include "epan/prefs.h" #include "epan/print.h" -#include "wsutil/file_util.h" -#include "wsutil/unicode-utils.h" #include "color.h" #include "color_filters.h" -#include "merge.h" #include "ui/alert_box.h" #include "ui/help_url.h" diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt index 1ddbcfdbf1..4dcacdbd46 100644 --- a/wiretap/CMakeLists.txt +++ b/wiretap/CMakeLists.txt @@ -50,6 +50,7 @@ set(WIRETAP_FILES k12.c lanalyzer.c libpcap.c + merge.c mpeg.c mime_file.c mp2t.c diff --git a/wiretap/Makefile.common b/wiretap/Makefile.common index 8726adbb2e..eb54501c61 100644 --- a/wiretap/Makefile.common +++ b/wiretap/Makefile.common @@ -57,6 +57,7 @@ NONGENERATED_C_FILES = \ k12.c \ lanalyzer.c \ libpcap.c \ + merge.c \ mpeg.c \ mp2t.c \ netmon.c \ @@ -113,6 +114,7 @@ NONGENERATED_HEADER_FILES = \ lanalyzer.h \ libpcap.h \ mpeg.h \ + mpeg.h \ mp2t.h \ netmon.h \ netscreen.h \ diff --git a/merge.c b/wiretap/merge.c index f68c4758c8..264f66c3ed 100644 --- a/merge.c +++ b/wiretap/merge.c @@ -42,7 +42,6 @@ #endif #include <string.h> -#include "wtap.h" #include "merge.h" /* diff --git a/merge.h b/wiretap/merge.h index a9a36f2c93..12be91bc12 100644 --- a/merge.h +++ b/wiretap/merge.h @@ -25,6 +25,8 @@ #ifndef __MERGE_H__ #define __MERGE_H__ +#include "wiretap/wtap.h" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -46,12 +48,12 @@ typedef struct merge_in_file_s { in_file_state_e state; guint32 packet_num; /* current packet number */ 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 */ } merge_in_file_t; /** 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_names filenames of the input files * @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 * @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_in_file_t **in_files, int *err, gchar **err_info, int *err_fileno); /** Close the input files again. - * + * * @param in_file_count number of entries in in_files * @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[]); /** Try to get the frame type from the input files. - * + * * @param in_file_count number of entries in in_files * @param in_files input file array * @return the frame type */ -extern int +WS_DLL_PUBLIC int merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]); /** Try to get the snapshot length from the input files. - * + * * @param in_file_count number of entries in in_files * @param in_files input file array * @return the snapshot length */ -extern int +WS_DLL_PUBLIC int 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 * be merged. - * + * * @param in_file_count number of entries in in_files * @param in_files input file array * @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 * 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, gchar **err_info); /** Read the next packet, in file sequence order, from the set of files * to be merged. - * + * * @param in_file_count number of entries in in_files * @param in_files input file array * @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 * 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[], int *err, gchar **err_info); |