2012-09-20 10:28:05 +00:00
|
|
|
/* Reorder the frames from an input dump file, and write to output dump file.
|
2012-10-04 18:24:21 +00:00
|
|
|
* Martin Mathieson and Jakub Jawadzki
|
2012-09-20 10:28:05 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-08-22 21:13:05 +00:00
|
|
|
#include <config.h>
|
2012-10-03 18:03:01 +00:00
|
|
|
|
2012-09-20 10:28:05 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2012-10-03 18:03:01 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-07-03 04:50:54 +00:00
|
|
|
#ifdef HAVE_GETOPT_H
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
|
|
|
|
2014-07-03 08:45:32 +00:00
|
|
|
#ifdef HAVE_LIBZ
|
2014-08-05 20:10:44 +00:00
|
|
|
#include <zlib.h> /* to get the libz version number */
|
2014-07-03 08:45:32 +00:00
|
|
|
#endif
|
|
|
|
|
2012-09-20 10:28:05 +00:00
|
|
|
#include "wtap.h"
|
|
|
|
|
2014-12-25 01:10:40 +00:00
|
|
|
#ifndef HAVE_GETOPT_LONG
|
2012-10-03 18:03:01 +00:00
|
|
|
#include "wsutil/wsgetopt.h"
|
|
|
|
#endif
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-07-03 08:45:32 +00:00
|
|
|
#include <wsutil/crash_info.h>
|
2015-02-20 00:05:49 +00:00
|
|
|
#include <wsutil/file_util.h>
|
|
|
|
#include <wsutil/ws_diag_control.h>
|
2014-07-03 08:45:32 +00:00
|
|
|
#include <wsutil/ws_version_info.h>
|
|
|
|
|
2012-09-20 10:28:05 +00:00
|
|
|
/* Show command-line usage */
|
2014-06-20 18:48:27 +00:00
|
|
|
static void
|
2014-07-03 08:45:32 +00:00
|
|
|
print_usage(FILE *output)
|
2012-09-20 10:28:05 +00:00
|
|
|
{
|
2013-12-31 16:23:00 +00:00
|
|
|
fprintf(output, "\n");
|
|
|
|
fprintf(output, "Usage: reordercap [options] <infile> <outfile>\n");
|
|
|
|
fprintf(output, "\n");
|
|
|
|
fprintf(output, "Options:\n");
|
|
|
|
fprintf(output, " -n don't write to output file if the input file is ordered.\n");
|
|
|
|
fprintf(output, " -h display this help and exit.\n");
|
2012-09-20 10:28:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Remember where this frame was in the file */
|
|
|
|
typedef struct FrameRecord_t {
|
2013-11-09 10:38:02 +00:00
|
|
|
gint64 offset;
|
|
|
|
guint num;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2013-11-09 10:38:02 +00:00
|
|
|
nstime_t time;
|
2012-09-20 10:28:05 +00:00
|
|
|
} FrameRecord_t;
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************/
|
|
|
|
/* Debugging only */
|
|
|
|
|
|
|
|
/* Enable this symbol to see debug output */
|
2012-09-20 10:36:28 +00:00
|
|
|
/* #define REORDER_DEBUG */
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
#ifdef REORDER_DEBUG
|
|
|
|
#define DEBUG_PRINT printf
|
|
|
|
#else
|
|
|
|
#define DEBUG_PRINT(...)
|
|
|
|
#endif
|
|
|
|
/**************************************************/
|
|
|
|
|
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
static void
|
2014-12-01 00:30:19 +00:00
|
|
|
frame_write(FrameRecord_t *frame, wtap *wth, wtap_dumper *pdh,
|
|
|
|
struct wtap_pkthdr *phdr, Buffer *buf, const char *infile)
|
2012-09-20 10:28:05 +00:00
|
|
|
{
|
|
|
|
int err;
|
2013-07-26 21:49:42 +00:00
|
|
|
gchar *err_info;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-02-07 19:14:52 +00:00
|
|
|
DEBUG_PRINT("\nDumping frame (offset=%" G_GINT64_MODIFIER "u)\n",
|
2014-01-02 20:47:21 +00:00
|
|
|
frame->offset);
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-02-07 19:14:52 +00:00
|
|
|
|
2014-12-01 00:30:19 +00:00
|
|
|
/* Re-read the frame from the stored location */
|
|
|
|
if (!wtap_seek_read(wth, frame->offset, phdr, buf, &err, &err_info)) {
|
2013-07-26 21:49:42 +00:00
|
|
|
if (err != 0) {
|
|
|
|
/* Print a message noting that the read failed somewhere along the line. */
|
|
|
|
fprintf(stderr,
|
|
|
|
"reordercap: An error occurred while re-reading \"%s\": %s.\n",
|
|
|
|
infile, wtap_strerror(err));
|
2014-12-18 04:03:47 +00:00
|
|
|
if (err_info != NULL) {
|
2013-07-26 21:49:42 +00:00
|
|
|
fprintf(stderr, "(%s)\n", err_info);
|
|
|
|
g_free(err_info);
|
|
|
|
}
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
/* Copy, and set length and timestamp from item. */
|
2014-12-01 00:30:19 +00:00
|
|
|
/* TODO: remove when wtap_seek_read() fills in phdr,
|
|
|
|
including time stamps, for all file types */
|
|
|
|
phdr->ts = frame->time;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
/* Dump frame to outfile */
|
2014-12-18 00:02:50 +00:00
|
|
|
if (!wtap_dump(pdh, phdr, ws_buffer_start_ptr(buf), &err, &err_info)) {
|
2014-12-18 04:03:47 +00:00
|
|
|
fprintf(stderr, "reordercap: Error (%s) writing frame to outfile\n",
|
|
|
|
wtap_strerror(err));
|
|
|
|
if (err_info != NULL) {
|
|
|
|
fprintf(stderr, "(%s)\n", err_info);
|
2014-12-18 00:02:50 +00:00
|
|
|
g_free(err_info);
|
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2012-10-04 18:24:21 +00:00
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
/* Comparing timestamps between 2 frames.
|
2014-05-23 23:40:56 +00:00
|
|
|
negative if (t1 < t2)
|
|
|
|
zero if (t1 == t2)
|
|
|
|
positive if (t1 > t2)
|
2012-10-04 18:24:21 +00:00
|
|
|
*/
|
|
|
|
static int
|
|
|
|
frames_compare(gconstpointer a, gconstpointer b)
|
|
|
|
{
|
2014-01-15 08:36:09 +00:00
|
|
|
const FrameRecord_t *frame1 = *(const FrameRecord_t *const *) a;
|
|
|
|
const FrameRecord_t *frame2 = *(const FrameRecord_t *const *) b;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2013-11-09 10:38:02 +00:00
|
|
|
const nstime_t *time1 = &frame1->time;
|
|
|
|
const nstime_t *time2 = &frame2->time;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-05-23 23:40:56 +00:00
|
|
|
return nstime_cmp(time1, time2);
|
2012-10-04 18:24:21 +00:00
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-07-03 08:45:32 +00:00
|
|
|
static void
|
|
|
|
get_reordercap_compiled_info(GString *str)
|
|
|
|
{
|
|
|
|
/* LIBZ */
|
|
|
|
g_string_append(str, ", ");
|
|
|
|
#ifdef HAVE_LIBZ
|
|
|
|
g_string_append(str, "with libz ");
|
|
|
|
#ifdef ZLIB_VERSION
|
|
|
|
g_string_append(str, ZLIB_VERSION);
|
|
|
|
#else /* ZLIB_VERSION */
|
|
|
|
g_string_append(str, "(version unknown)");
|
|
|
|
#endif /* ZLIB_VERSION */
|
|
|
|
#else /* HAVE_LIBZ */
|
|
|
|
g_string_append(str, "without libz");
|
|
|
|
#endif /* HAVE_LIBZ */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
get_reordercap_runtime_info(GString *str)
|
|
|
|
{
|
|
|
|
/* zlib */
|
|
|
|
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
|
|
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
|
|
#endif
|
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
/********************************************************************/
|
|
|
|
/* Main function. */
|
|
|
|
/********************************************************************/
|
2014-06-20 18:48:27 +00:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
2012-09-20 10:28:05 +00:00
|
|
|
{
|
2014-07-03 08:45:32 +00:00
|
|
|
GString *comp_info_str;
|
|
|
|
GString *runtime_info_str;
|
2014-05-09 05:18:49 +00:00
|
|
|
wtap *wth = NULL;
|
|
|
|
wtap_dumper *pdh = NULL;
|
2014-12-01 00:30:19 +00:00
|
|
|
struct wtap_pkthdr dump_phdr;
|
2013-06-16 00:20:00 +00:00
|
|
|
Buffer buf;
|
2012-09-20 10:28:05 +00:00
|
|
|
int err;
|
|
|
|
gchar *err_info;
|
|
|
|
gint64 data_offset;
|
|
|
|
const struct wtap_pkthdr *phdr;
|
2012-10-04 18:24:21 +00:00
|
|
|
guint wrong_order_count = 0;
|
|
|
|
gboolean write_output_regardless = TRUE;
|
|
|
|
guint i;
|
2013-06-19 19:31:06 +00:00
|
|
|
wtapng_section_t *shb_hdr;
|
|
|
|
wtapng_iface_descriptions_t *idb_inf;
|
2012-10-04 18:24:21 +00:00
|
|
|
|
|
|
|
GPtrArray *frames;
|
|
|
|
FrameRecord_t *prevFrame = NULL;
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2012-10-03 18:03:01 +00:00
|
|
|
int opt;
|
2015-02-20 00:05:49 +00:00
|
|
|
DIAG_OFF(cast-qual)
|
2014-07-03 04:50:54 +00:00
|
|
|
static const struct option long_options[] = {
|
|
|
|
{(char *)"help", no_argument, NULL, 'h'},
|
|
|
|
{(char *)"version", no_argument, NULL, 'v'},
|
|
|
|
{0, 0, 0, 0 }
|
|
|
|
};
|
2015-02-20 00:05:49 +00:00
|
|
|
DIAG_ON(cast-qual)
|
2012-10-03 18:03:01 +00:00
|
|
|
int file_count;
|
2012-09-20 10:28:05 +00:00
|
|
|
char *infile;
|
|
|
|
char *outfile;
|
2012-10-03 18:03:01 +00:00
|
|
|
|
2014-12-31 06:28:25 +00:00
|
|
|
/* Get the compile-time version information string */
|
|
|
|
comp_info_str = get_compiled_version_info(NULL, get_reordercap_compiled_info);
|
2014-07-03 08:45:32 +00:00
|
|
|
|
2014-12-31 06:28:25 +00:00
|
|
|
/* Get the run-time version information string */
|
|
|
|
runtime_info_str = get_runtime_version_info(get_reordercap_runtime_info);
|
2014-07-03 08:45:32 +00:00
|
|
|
|
|
|
|
/* Add it to the information to be reported on a crash. */
|
|
|
|
ws_add_crash_info("Reordercap (Wireshark) %s\n"
|
|
|
|
"\n"
|
|
|
|
"%s"
|
|
|
|
"\n"
|
|
|
|
"%s",
|
|
|
|
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
|
|
|
|
|
2012-10-03 18:03:01 +00:00
|
|
|
/* Process the options first */
|
2014-07-03 04:50:54 +00:00
|
|
|
while ((opt = getopt_long(argc, argv, "hnv", long_options, NULL)) != -1) {
|
2012-10-03 18:03:01 +00:00
|
|
|
switch (opt) {
|
2012-10-04 18:24:21 +00:00
|
|
|
case 'n':
|
|
|
|
write_output_regardless = FALSE;
|
2012-10-03 18:03:01 +00:00
|
|
|
break;
|
2013-12-31 16:23:00 +00:00
|
|
|
case 'h':
|
2014-07-03 08:45:32 +00:00
|
|
|
printf("Reordercap (Wireshark) %s\n"
|
|
|
|
"Reorder timestamps of input file frames into output file.\n"
|
|
|
|
"See http://www.wireshark.org for more information.\n",
|
|
|
|
get_ws_vcs_version_info());
|
|
|
|
print_usage(stdout);
|
2013-12-31 16:23:00 +00:00
|
|
|
exit(0);
|
2014-06-20 18:48:27 +00:00
|
|
|
case 'v':
|
2014-12-23 21:58:38 +00:00
|
|
|
show_version("Reordercap (Wireshark)", comp_info_str, runtime_info_str);
|
2014-07-03 08:45:32 +00:00
|
|
|
g_string_free(comp_info_str, TRUE);
|
|
|
|
g_string_free(runtime_info_str, TRUE);
|
2014-06-20 18:48:27 +00:00
|
|
|
exit(0);
|
2012-10-03 18:03:01 +00:00
|
|
|
case '?':
|
2014-07-03 08:45:32 +00:00
|
|
|
print_usage(stderr);
|
2012-10-03 18:03:01 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
/* Remaining args are file names */
|
2012-10-03 18:03:01 +00:00
|
|
|
file_count = argc - optind;
|
|
|
|
if (file_count == 2) {
|
2013-12-31 16:23:00 +00:00
|
|
|
infile = argv[optind];
|
2012-10-03 18:03:01 +00:00
|
|
|
outfile = argv[optind+1];
|
2012-09-20 10:28:05 +00:00
|
|
|
}
|
|
|
|
else {
|
2014-07-03 08:45:32 +00:00
|
|
|
print_usage(stderr);
|
2012-09-20 10:28:05 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Open infile */
|
2014-03-20 16:57:29 +00:00
|
|
|
/* TODO: if reordercap is ever changed to give the user a choice of which
|
|
|
|
open_routine reader to use, then the following needs to change. */
|
2014-01-18 14:20:02 +00:00
|
|
|
wth = wtap_open_offline(infile, WTAP_TYPE_AUTO, &err, &err_info, TRUE);
|
2012-09-20 10:28:05 +00:00
|
|
|
if (wth == NULL) {
|
2013-07-26 21:25:33 +00:00
|
|
|
fprintf(stderr, "reordercap: Can't open %s: %s\n", infile,
|
|
|
|
wtap_strerror(err));
|
2014-12-18 04:03:47 +00:00
|
|
|
if (err_info != NULL) {
|
2013-07-26 21:49:42 +00:00
|
|
|
fprintf(stderr, "(%s)\n", err_info);
|
|
|
|
g_free(err_info);
|
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2014-05-09 05:18:49 +00:00
|
|
|
DEBUG_PRINT("file_type_subtype is %u\n", wtap_file_type_subtype(wth));
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2013-06-19 19:31:06 +00:00
|
|
|
shb_hdr = wtap_file_get_shb_info(wth);
|
|
|
|
idb_inf = wtap_file_get_idb_info(wth);
|
|
|
|
|
2012-09-20 10:28:05 +00:00
|
|
|
/* Open outfile (same filetype/encap as input file) */
|
2014-05-09 05:18:49 +00:00
|
|
|
pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth),
|
2013-06-19 19:31:06 +00:00
|
|
|
65535, FALSE, shb_hdr, idb_inf, &err);
|
|
|
|
g_free(idb_inf);
|
2012-09-20 10:28:05 +00:00
|
|
|
if (pdh == NULL) {
|
2013-07-26 21:25:33 +00:00
|
|
|
fprintf(stderr, "reordercap: Failed to open output file: (%s) - error %s\n",
|
|
|
|
outfile, wtap_strerror(err));
|
2013-06-19 19:31:06 +00:00
|
|
|
g_free(shb_hdr);
|
2012-09-20 10:28:05 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
/* Allocate the array of frame pointers. */
|
|
|
|
frames = g_ptr_array_new();
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
/* Read each frame from infile */
|
2014-05-23 10:50:02 +00:00
|
|
|
while (wtap_read(wth, &err, &err_info, &data_offset)) {
|
|
|
|
FrameRecord_t *newFrameRecord;
|
2012-10-04 18:24:21 +00:00
|
|
|
|
2014-05-23 10:50:02 +00:00
|
|
|
phdr = wtap_phdr(wth);
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-05-23 10:50:02 +00:00
|
|
|
newFrameRecord = g_slice_new(FrameRecord_t);
|
|
|
|
newFrameRecord->num = frames->len + 1;
|
|
|
|
newFrameRecord->offset = data_offset;
|
2014-05-23 23:40:56 +00:00
|
|
|
if (phdr->presence_flags & WTAP_HAS_TS) {
|
|
|
|
newFrameRecord->time = phdr->ts;
|
|
|
|
} else {
|
|
|
|
nstime_set_unset(&newFrameRecord->time);
|
|
|
|
}
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2014-05-23 10:50:02 +00:00
|
|
|
if (prevFrame && frames_compare(&newFrameRecord, &prevFrame) < 0) {
|
|
|
|
wrong_order_count++;
|
2014-05-23 03:01:31 +00:00
|
|
|
}
|
2014-05-23 10:50:02 +00:00
|
|
|
|
|
|
|
g_ptr_array_add(frames, newFrameRecord);
|
|
|
|
prevFrame = newFrameRecord;
|
2012-10-04 18:24:21 +00:00
|
|
|
}
|
2013-07-26 21:49:42 +00:00
|
|
|
if (err != 0) {
|
|
|
|
/* Print a message noting that the read failed somewhere along the line. */
|
|
|
|
fprintf(stderr,
|
|
|
|
"reordercap: An error occurred while reading \"%s\": %s.\n",
|
|
|
|
infile, wtap_strerror(err));
|
2014-12-18 04:03:47 +00:00
|
|
|
if (err_info != NULL) {
|
2013-07-26 21:49:42 +00:00
|
|
|
fprintf(stderr, "(%s)\n", err_info);
|
|
|
|
g_free(err_info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
printf("%u frames, %u out of order\n", frames->len, wrong_order_count);
|
|
|
|
|
|
|
|
/* Sort the frames */
|
|
|
|
if (wrong_order_count > 0) {
|
|
|
|
g_ptr_array_sort(frames, frames_compare);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Write out each sorted frame in turn */
|
2014-12-01 00:30:19 +00:00
|
|
|
wtap_phdr_init(&dump_phdr);
|
2014-08-02 11:00:48 +00:00
|
|
|
ws_buffer_init(&buf, 1500);
|
2012-10-04 18:24:21 +00:00
|
|
|
for (i = 0; i < frames->len; i++) {
|
2013-03-20 01:18:10 +00:00
|
|
|
FrameRecord_t *frame = (FrameRecord_t *)frames->pdata[i];
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
/* Avoid writing if already sorted and configured to */
|
|
|
|
if (write_output_regardless || (wrong_order_count > 0)) {
|
2014-12-01 00:30:19 +00:00
|
|
|
frame_write(frame, wth, pdh, &dump_phdr, &buf, infile);
|
2012-09-20 10:28:05 +00:00
|
|
|
}
|
2012-10-04 18:24:21 +00:00
|
|
|
g_slice_free(FrameRecord_t, frame);
|
2012-09-20 10:28:05 +00:00
|
|
|
}
|
2014-12-01 00:30:19 +00:00
|
|
|
wtap_phdr_cleanup(&dump_phdr);
|
2014-08-02 11:00:48 +00:00
|
|
|
ws_buffer_free(&buf);
|
2012-09-20 10:28:05 +00:00
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
if (!write_output_regardless && (wrong_order_count == 0)) {
|
|
|
|
printf("Not writing output file because input file is already in order!\n");
|
2012-09-20 10:28:05 +00:00
|
|
|
}
|
|
|
|
|
2012-10-04 18:24:21 +00:00
|
|
|
/* Free the whole array */
|
|
|
|
g_ptr_array_free(frames, TRUE);
|
|
|
|
|
2012-09-20 10:28:05 +00:00
|
|
|
/* Close outfile */
|
2014-05-09 05:18:49 +00:00
|
|
|
if (!wtap_dump_close(pdh, &err)) {
|
2013-07-26 21:25:33 +00:00
|
|
|
fprintf(stderr, "reordercap: Error closing %s: %s\n", outfile,
|
|
|
|
wtap_strerror(err));
|
2013-06-19 19:31:06 +00:00
|
|
|
g_free(shb_hdr);
|
2012-09-20 10:28:05 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2013-06-19 19:31:06 +00:00
|
|
|
g_free(shb_hdr);
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
/* Finally, close infile */
|
2014-05-09 05:18:49 +00:00
|
|
|
wtap_fdclose(wth);
|
2012-09-20 10:28:05 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:23:00 +00:00
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|