-static GOptionEntry general_entries[] =
-{
- /* General */
- { "type", 't', 0, G_OPTION_ARG_NONE, &cap_file_type,
- "display the capture file type", NULL },
- { "Encapsulation", 'E', 0, G_OPTION_ARG_NONE, &cap_file_encap,
- "display the capture file encapsulation", NULL },
-#ifdef HAVE_LIBGCRYPT
- { "Hash", 'H', 0, G_OPTION_ARG_NONE, &cap_file_hashes,
- "display the SHA1, RMD160, and MD5 hashes of the file", NULL },
-#endif /* HAVE_LIBGCRYPT */
- { "capture-comment", 'k', 0, G_OPTION_ARG_NONE, &cap_comment,
- "display the capture comment ", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-static GOptionEntry size_entries[] =
-{
- /* Size */
- { "packets", 'c', 0, G_OPTION_ARG_NONE, &cap_packet_count,
- "display the number of packets", NULL },
- { "size", 's', 0, G_OPTION_ARG_NONE, &cap_file_size,
- "display the size of the file (in bytes)", NULL },
- { "tot-len-of-pkts", 'd', 0, G_OPTION_ARG_NONE, &cap_data_size,
- "display the total length of all packets (in bytes)", NULL },
- { "snap", 'l', 0, G_OPTION_ARG_NONE, &cap_snaplen,
- "display the packet size limit (snapshot length)", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-static GOptionEntry time_entries[] =
-{
- /* Time */
- { "duration", 'u', 0, G_OPTION_ARG_NONE, &cap_duration,
- "display the capture duration (in seconds)", NULL },
- { "start", 'a', 0, G_OPTION_ARG_NONE, &cap_start_time,
- "display the capture start time", NULL },
- { "end", 'e', 0, G_OPTION_ARG_NONE, &cap_end_time,
- "display the capture end time", NULL },
- { "cron", 'o', 0, G_OPTION_ARG_NONE, &cap_order,
- "display the capture file chronological status (True/False)", NULL },
- { "start-end-time-sec", 'S', 0, G_OPTION_ARG_NONE, &time_as_secs,
- "display start and end times as seconds", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-
-static GOptionEntry stats_entries[] =
-{
- /* Statistics */
- { "bytes", 'y', 0, G_OPTION_ARG_NONE, &cap_data_rate_byte,
- "display average data rate (in bytes/s)", NULL },
- { "bits", 'i', 0, G_OPTION_ARG_NONE, &cap_data_rate_bit,
- "display average data rate (in bits/s)", NULL },
- { "packet-bytes", 'z', 0, G_OPTION_ARG_NONE, &cap_packet_size,
- "display average packet size (in bytes)", NULL },
- { "packets", 'x', 0, G_OPTION_ARG_NONE, &cap_packet_rate,
- "display average packet rate (in packets/s)", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-
-static GOptionEntry output_format_entries[] =
-{
- /* Output format */
- { "long", 'L', 0, G_OPTION_ARG_NONE, &long_report,
- "generate long report (default)", NULL },
- { "Table", 'T', 0, G_OPTION_ARG_NONE, &table_report,
- "generate table report", NULL },
- { "machine-readable", 'M', 0, G_OPTION_ARG_NONE, &machine_readable,
- "display machine-readable (unabbreviated) values in long reports", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-
-static GOptionEntry table_report_entries[] =
-{
- /* Table report */
- { "header-rec", 'R', 0, G_OPTION_ARG_NONE, &table_report_header,
- "generate header record (default)", NULL },
- { "no-table", 'r', 0, G_OPTION_ARG_NONE, &table_report_header,
- "do not generate header record", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-
-static GOptionEntry misc_entries[] =
-{
- { "helpcompat", 'h', 0, G_OPTION_ARG_NONE, &cap_help,
- "display help", NULL },
- { NULL,'\0',0,G_OPTION_ARG_NONE,NULL,NULL,NULL }
-};
-
-GOptionContext *ctx;
-GOptionGroup *general_grp, *size_grp, *time_grp, *stats_grp, *output_grp, *table_report_grp;
-GError *parse_err = NULL;
-
-#endif /* USE_GOPTION */
-
-#ifdef HAVE_LIBGCRYPT
-#define HASH_SIZE_SHA1 20