*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Richard Sharpe, 13-Feb-1999, added support for initializing structures
#ifdef _WIN32
#include "capture-wpcap.h"
#include "capture_wpcap_packet.h"
+#include <tchar.h> /* Needed for Unicode */
#if GTK_MAJOR_VERSION >= 2
#include <commctrl.h>
#endif /* GTK_MAJOR_VERSION >= 2 */
/* GTK related */
#include "statusbar.h"
#include "alert_box.h"
+#if 0
#include "dlg_utils.h"
+#endif
+#include "file_dlg.h"
#include "gtkglobals.h"
#include "colors.h"
#include "gui_utils.h"
#include "menu.h"
#include "../main_window.h"
#include "../menu.h"
-#include "file_dlg.h"
+#include "capture_file_dlg.h"
#include <epan/column.h>
#include "proto_draw.h"
#include "keys.h"
/*
* Files under personal and global preferences directories in which
- * GTK settings for Ethereal are stored.
+ * GTK settings for Wireshark are stored.
*/
#define RC_FILE "gtkrc"
}
}
-
static gchar *
get_text_from_packet_list(gpointer data)
{
get_text_from_packet_list(data));
}
+/* This function allows users to right click in the details window and copy the text
+ * information to the operating systems clipboard.
+ *
+ * We first check to see if a string representation is setup in the tree and then
+ * read the string. If not available then we try to grab the value. If all else
+ * fails we display a message to the user to indicate the copy could not be completed.
+ */
+void
+copy_selected_plist_cb(GtkWidget *w _U_, gpointer data _U_)
+{
+ GString *gtk_text_str = g_string_new("");
+ char labelstring[256];
+ char *stringpointer = labelstring;
+
+ if (cfile.finfo_selected->rep->representation != 0) {
+ g_string_sprintfa(gtk_text_str, "%s", cfile.finfo_selected->rep->representation); /* Get the represented data */
+ }
+ if (gtk_text_str->len == 0) { /* If no representation then... */
+ proto_item_fill_label(cfile.finfo_selected, stringpointer); /* Try to read the value */
+ g_string_sprintfa(gtk_text_str, "%s", stringpointer);
+ }
+ if (gtk_text_str->len == 0) { /* Could not get item so display error msg */
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not acquire information to copy, try expanding or choosing another item");
+ }
+ else
+ {
+ copy_to_clipboard(gtk_text_str); /* Copy string to clipboard */
+ }
+ g_string_free(gtk_text_str, TRUE); /* Free the memory */
+}
/* XXX: use a preference for this setting! */
if (print_ver) {
output = stdout;
- fprintf(output, "Ethereal " VERSION "%s\n"
+ fprintf(output, "Wireshark " VERSION "%s\n"
"Interactively dump and analyze network traffic.\n"
"See http://www.ethereal.com for more information.\n"
"\n"
fprintf(output, " -s <snaplen> packet snapshot length (def: 65535)\n");
fprintf(output, " -p don't capture in promiscuous mode\n");
fprintf(output, " -k start capturing immediately (def: do nothing)\n");
- fprintf(output, " -Q quit Ethereal after capturing\n");
+ fprintf(output, " -Q quit Wireshark after capturing\n");
fprintf(output, " -S update packet display when new packets are captured\n");
fprintf(output, " -l turn on automatic scrolling while -S is in use\n");
#ifdef _WIN32
fprintf(output, "\n");
fprintf(output, "Processing:\n");
- fprintf(output, " -R <read filter> packet filter in Ethereal display filter syntax\n");
+ fprintf(output, " -R <read filter> packet filter in Wireshark display filter syntax\n");
fprintf(output, " -n disable all name resolutions (def: all enabled)\n");
fprintf(output, " -N <name resolve flags> enable specific name resolution(s): \"mntC\"\n");
}
#else
-/* if these three functions are copied to gtk1 ethereal, since gtk1 does not
+/* if these three functions are copied to gtk1 Wireshark, since gtk1 does not
use threads all updte_thread_mutex can be dropped and protect/unprotect
would just be empty functions.
g_free(status_msg);
/* window title */
- win_name = g_strdup_printf("%s - Ethereal", name_ptr);
+ win_name = g_strdup_printf("%s - Wireshark", name_ptr);
set_main_window_name(win_name);
g_free(win_name);
}
statusbar_pop_file_msg();
/* Restore the standard title bar message. */
- set_main_window_name("The Ethereal Network Analyzer");
+ set_main_window_name("The Wireshark Network Analyzer");
/* Disable all menu items that make sense only if you have a capture. */
set_menus_for_capture_file(FALSE);
if(capture_opts->iface) {
- title = g_strdup_printf("%s: Capturing - Ethereal",
+ title = g_strdup_printf("%s: Capturing - Wireshark",
get_interface_descriptive_name(capture_opts->iface));
} else {
- title = g_strdup_printf("Capturing - Ethereal");
+ title = g_strdup_printf("Capturing - Wireshark");
}
set_main_window_name(title);
g_free(title);
/* We've done this in "prepared" above, but it will be cleared while
switching to the next multiple file. */
if(capture_opts->iface) {
- title = g_strdup_printf("%s: Capturing - Ethereal",
+ title = g_strdup_printf("%s: Capturing - Wireshark",
get_interface_descriptive_name(capture_opts->iface));
} else {
- title = g_strdup_printf("Capturing - Ethereal");
+ title = g_strdup_printf("Capturing - Wireshark");
}
set_main_window_name(title);
g_free(title);
/* Restore the standard title bar message */
/* (just in case we have trouble opening the capture file). */
- set_main_window_name("The Ethereal Network Analyzer");
+ set_main_window_name("The Wireshark Network Analyzer");
#if GTK_MAJOR_VERSION >= 2
if(icon_list == NULL) {
int
main(int argc, char *argv[])
{
+ char *init_progfile_dir_error;
char *s;
int i;
int opt;
/*
* Attempt to get the pathname of the executable file.
*/
- init_progfile_dir(argv[0]);
+ init_progfile_dir_error = init_progfile_dir(argv[0]);
/*
* Get credential information for later use.
#endif
/* We won't come till here, if we had a "console only" command line parameter. */
- splash_win = splash_new("Loading Ethereal ...");
+ splash_win = splash_new("Loading Wireshark ...");
+ if (init_progfile_dir_error != NULL) {
+ simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
+ "Can't get pathname of Wireshark: %s.\n"
+ "It won't be possible to capture traffic.\n"
+ "Report this to the Wireshark developers.",
+ init_progfile_dir_error);
+ g_free(init_progfile_dir_error);
+ }
splash_update(splash_win, "Init dissectors ...");
if (arg_error) {
#ifndef HAVE_LIBPCAP
if (capture_option_specified) {
- cmdarg_err("This version of Ethereal was not built with support for capturing packets.");
+ cmdarg_err("This version of Wireshark was not built with support for capturing packets.");
}
#endif
print_usage(FALSE);
InitCommonControlsEx(&comm_ctrl);
/* RichEd20.DLL is needed for filter entries. */
- LoadLibrary("riched20.dll");
+ LoadLibrary(_T("riched20.dll"));
#endif /* GTK_MAJOR_VERSION >= 2 */
has_console = FALSE;
the message(s) we put in there). */
atexit(destroy_console);
- SetConsoleTitle("Ethereal Debug Console");
+ SetConsoleTitle(_T("Wireshark Debug Console"));
}
}
gtk_box_pack_start(GTK_BOX(item_hb), icon, FALSE, FALSE, 5);
#if GTK_MAJOR_VERSION < 2
- message = "Welcome to Ethereal!";
+ message = "Welcome to Wireshark!";
#else
- message = "<span weight=\"bold\" size=\"25000\">" "Welcome to Ethereal!" "</span>";
+ message = "<span weight=\"bold\" size=\"25000\">" "Welcome to Wireshark!" "</span>";
#endif
w = gtk_label_new(message);
#if GTK_MAJOR_VERSION >= 2
GList *dfilter_list = NULL;
GtkTooltips *tooltips;
GtkAccelGroup *accel;
- gchar *title;
+ gchar *title;
/* Display filter construct dialog has an Apply button, and "OK" not
only sets our text widget, it activates it (i.e., it causes us to
filter the capture). */
static construct_args_t args = {
- "Ethereal: Display Filter",
+ "Wireshark: Display Filter",
TRUE,
TRUE,
FALSE
};
/* use user-defined title if preference is set */
- title = create_user_window_title("The Ethereal Network Analyzer");
+ title = create_user_window_title("The Wireshark Network Analyzer");
/* Main window */
top_level = window_new(GTK_WINDOW_TOPLEVEL, title);