Update to the FreeRADIUS version.
[metze/wireshark/wip.git] / file.h
diff --git a/file.h b/file.h
index 2403e247077734d4ee9c8b371ba9a75b5b20fc76..5ff86b60de7ae1d9eeccb7ce5e6d667148e17dee 100644 (file)
--- a/file.h
+++ b/file.h
@@ -28,7 +28,7 @@
 #include <epan/epan.h>
 
 #include <epan/print.h>
-#include <epan/packet-range.h>
+#include <ui/packet_range.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -73,18 +73,20 @@ typedef enum {
     cf_cb_file_rescan_finished,
     cf_cb_file_retap_started,
     cf_cb_file_retap_finished,
-    cf_cb_file_fast_save_finished,
-    cf_cb_packet_selected,
-    cf_cb_packet_unselected,
-    cf_cb_field_unselected,
+    cf_cb_file_merge_started, /* Qt only */
+    cf_cb_file_merge_finished, /* Qt only */
+    cf_cb_file_fast_save_finished, /* GTK+ only? */
+    cf_cb_packet_selected, /* GTK+ only. */
+    cf_cb_packet_unselected, /* GTK+ only. */
+    cf_cb_field_unselected, /* GTK+ only. */
     cf_cb_file_save_started,
     cf_cb_file_save_finished,
     cf_cb_file_save_failed,
     cf_cb_file_save_stopped,
-    cf_cb_file_export_specified_packets_started,
-    cf_cb_file_export_specified_packets_finished,
-    cf_cb_file_export_specified_packets_failed,
-    cf_cb_file_export_specified_packets_stopped
+    cf_cb_file_export_specified_packets_started, /* GTK+ only. */
+    cf_cb_file_export_specified_packets_finished, /* GTK+ only. */
+    cf_cb_file_export_specified_packets_failed, /* GTK+ only. */
+    cf_cb_file_export_specified_packets_stopped /* GTK+ only. */
 } cf_cbs;
 
 typedef void (*cf_callback_t) (gint event, gpointer data, gpointer user_data);
@@ -415,14 +417,41 @@ cf_read_status_t cf_retap_packets(capture_file *cf);
  */
 void cf_timestamp_auto_precision(capture_file *cf);
 
+/* print_range, enum which frames should be printed */
+typedef enum {
+    print_range_selected_only,    /* selected frame(s) only (currently only one) */
+    print_range_marked_only,      /* marked frames only */
+    print_range_all_displayed,    /* all frames currently displayed */
+    print_range_all_captured      /* all frames in capture */
+} print_range_e;
+
+typedef struct {
+    print_stream_t *stream;       /* the stream to which we're printing */
+    print_format_e format;        /* plain text or PostScript */
+    gboolean to_file;             /* TRUE if we're printing to a file */
+    char *file;                   /* file output pathname */
+    char *cmd;                    /* print command string (not win32) */
+    packet_range_t range;
+
+    gboolean print_summary;       /* TRUE if we should print summary line. */
+    gboolean print_col_headings;  /* TRUE if we should print column headings */
+    print_dissections_e print_dissections;
+    gboolean print_hex;           /* TRUE if we should print hex data;
+                                   * FALSE if we should print only if not dissected. */
+    gboolean print_formfeed;      /* TRUE if a formfeed should be printed before
+                                   * each new packet */
+} print_args_t;
+
 /**
  * Print the capture file.
  *
  * @param cf the capture file
  * @param print_args the arguments what and how to print
+ * @param show_progress_bar TRUE if a progress bar is to be shown
  * @return one of cf_print_status_t
  */
-cf_print_status_t cf_print_packets(capture_file *cf, print_args_t *print_args);
+cf_print_status_t cf_print_packets(capture_file *cf, print_args_t *print_args,
+                                   gboolean show_progress_bar);
 
 /**
  * Print (export) the capture file into PDML format.
@@ -460,6 +489,15 @@ cf_print_status_t cf_write_csv_packets(capture_file *cf, print_args_t *print_arg
  */
 cf_print_status_t cf_write_carrays_packets(capture_file *cf, print_args_t *print_args);
 
+/**
+ * Print (export) the capture file into JSON format.
+ *
+ * @param cf the capture file
+ * @param print_args the arguments what and how to export
+ * @return one of cf_print_status_t
+ */
+cf_print_status_t cf_write_json_packets(capture_file *cf, print_args_t *print_args);
+
 /**
  * Find packet with a protocol tree item that contains a specified text string.
  *
@@ -546,20 +584,6 @@ gboolean cf_find_packet_marked(capture_file *cf, search_direction dir);
  */
 gboolean cf_find_packet_time_reference(capture_file *cf, search_direction dir);
 
-/**
- * GoTo Packet in first row.
- *
- * @return TRUE if the first row exists, FALSE otherwise
- */
-gboolean cf_goto_top_frame(void);
-
-/**
- * GoTo Packet in last row.
- *
- * @return TRUE if last row exists, FALSE otherwise
- */
-gboolean cf_goto_bottom_frame(void);
-
 /**
  * GoTo Packet with the given row.
  *
@@ -634,12 +658,12 @@ void cf_ignore_frame(capture_file *cf, frame_data *frame);
 void cf_unignore_frame(capture_file *cf, frame_data *frame);
 
 /**
- * Merge two (or more) capture files into one.
+ * Merge two or more capture files into a temporary file.
  * @todo is this the right place for this function? It doesn't have to do a lot with capture_file.
  *
- * @param out_filename pointer to output filename; if output filename is
- * NULL, a temporary file name is generated and *out_filename is set
- * to point to the generated file name
+ * @param pd_window Window pointer suitable for use by delayed_create_progress_dlg.
+ * @param out_filenamep Points to a pointer that's set to point to the
+ *        pathname of the temporary file; it's allocated with g_malloc()
  * @param in_file_count the number of input files to merge
  * @param in_filenames array of input filenames
  * @param file_type the output filetype
@@ -647,8 +671,9 @@ void cf_unignore_frame(capture_file *cf, frame_data *frame);
  * @return one of cf_status_t
  */
 cf_status_t
-cf_merge_files(char **out_filename, int in_file_count,
-               char *const *in_filenames, int file_type, gboolean do_append);
+cf_merge_files_to_tempfile(gpointer pd_window, char **out_filenamep,
+                           int in_file_count, char *const *in_filenames,
+                           int file_type, gboolean do_append);
 
 
 /**
@@ -685,6 +710,16 @@ gboolean cf_set_user_packet_comment(capture_file *cf, frame_data *fd, const gcha
  */
 guint32 cf_comment_types(capture_file *cf);
 
+/**
+ * Add a resolved address to this file's list of resolved addresses.
+ *
+ * @param cf the capture file
+ * @param addr a string representing an IPv4 or IPv6 address
+ * @param name a string containing a name corresponding to that address
+ * @return TRUE if it succeeds, FALSE if not
+ */
+gboolean cf_add_ip_name_from_string(capture_file *cf, const char *addr, const char *name);
+
 #ifdef WANT_PACKET_EDITOR
 /**
  * Give a frame new, edited data.