-#include <epan/dissectors/packet-ap1394.h>
-#include <epan/dissectors/packet-atalk.h>
-#include <epan/dissectors/packet-atm.h>
-#include <epan/dissectors/packet-clip.h>
-#include <epan/dissectors/packet-eth.h>
-#include <epan/dissectors/packet-fddi.h>
-#include <epan/dissectors/packet-fr.h>
-#include <epan/dissectors/packet-null.h>
-#include <epan/dissectors/packet-ppi.h>
-#include <epan/dissectors/packet-ppp.h>
-#include <epan/dissectors/packet-raw.h>
-#include <epan/dissectors/packet-sll.h>
-#include <epan/dissectors/packet-tr.h>
-#include <epan/dissectors/packet-ieee80211.h>
-#include <epan/dissectors/packet-radiotap.h>
-#include <epan/dissectors/packet-chdlc.h>
-#include <epan/dissectors/packet-ipfc.h>
-#include <epan/dissectors/packet-arcnet.h>
-#include <epan/dissectors/packet-enc.h>
-
-static void capture_info_packet(
-packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header);
-
-
-
-typedef struct _info_data {
- packet_counts counts; /* several packet type counters */
- struct wtap* wtap; /* current wtap file */
- capture_info ui; /* user interface data */
-} info_data_t;
-
-
-info_data_t info_data;
-
-
-/* open the info */
-void capture_info_open(capture_opts *capture_opts)
-{
- info_data.counts.total = 0;
- info_data.counts.sctp = 0;
- info_data.counts.tcp = 0;
- info_data.counts.udp = 0;
- info_data.counts.icmp = 0;
- info_data.counts.ospf = 0;
- info_data.counts.gre = 0;
- info_data.counts.ipx = 0;
- info_data.counts.netbios = 0;
- info_data.counts.vines = 0;
- info_data.counts.other = 0;
- info_data.counts.arp = 0;
-
- info_data.wtap = NULL;
- info_data.ui.counts = &info_data.counts;
-
- capture_info_ui_create(&info_data.ui, capture_opts);
-}
-
-
-static const char *
-cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
- int file_type)
-{
- const char *errmsg;
- static char errmsg_errno[1024+1];
-
- if (err < 0) {
- /* Wiretap error. */
- switch (err) {
-
- case WTAP_ERR_NOT_REGULAR_FILE:
- errmsg = "The file \"%s\" is a \"special file\" or socket or other non-regular file.";
- break;
-
- case WTAP_ERR_FILE_UNKNOWN_FORMAT:
- /* Seen only when opening a capture file for reading. */
- errmsg = "The file \"%s\" isn't a capture file in a format TShark understands.";
- break;
-
- case WTAP_ERR_UNSUPPORTED:
- /* Seen only when opening a capture file for reading. */
- g_snprintf(errmsg_errno, sizeof(errmsg_errno),
- "The file \"%%s\" isn't a capture file in a format TShark understands.\n"
- "(%s)", err_info);
- g_free(err_info);
- errmsg = errmsg_errno;
- break;
-
- case WTAP_ERR_CANT_WRITE_TO_PIPE:
- /* Seen only when opening a capture file for writing. */
- g_snprintf(errmsg_errno, sizeof(errmsg_errno),
- "The file \"%%s\" is a pipe, and %s capture files can't be "
- "written to a pipe.", wtap_file_type_string(file_type));
- errmsg = errmsg_errno;
- break;
-
- case WTAP_ERR_UNSUPPORTED_FILE_TYPE:
- /* Seen only when opening a capture file for writing. */
- errmsg = "TShark doesn't support writing capture files in that format.";
- break;
-
- case WTAP_ERR_UNSUPPORTED_ENCAP:
- if (for_writing)
- errmsg = "TShark can't save this capture in that format.";
- else {
- g_snprintf(errmsg_errno, sizeof(errmsg_errno),
- "The file \"%%s\" is a capture for a network type that TShark doesn't support.\n"
- "(%s)", err_info);
- g_free(err_info);
- errmsg = errmsg_errno;
- }
- break;
-
- case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED:
- if (for_writing)
- errmsg = "TShark can't save this capture in that format.";
- else
- errmsg = "The file \"%s\" is a capture for a network type that TShark doesn't support.";
- break;
-
- case WTAP_ERR_BAD_RECORD:
- /* Seen only when opening a capture file for reading. */
- g_snprintf(errmsg_errno, sizeof(errmsg_errno),
- "The file \"%%s\" appears to be damaged or corrupt.\n"
- "(%s)", err_info);
- g_free(err_info);
- errmsg = errmsg_errno;
- break;
-
- case WTAP_ERR_CANT_OPEN:
- if (for_writing)
- errmsg = "The file \"%s\" could not be created for some unknown reason.";
- else
- errmsg = "The file \"%s\" could not be opened for some unknown reason.";
- break;