"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/interfaces/gtk/ec_gtk.c" between
ettercap-0.8.3.tar.gz and ettercap-0.8.3.1.tar.gz

About: ettercap is a multipurpose sniffer/interceptor/logger for switched LAN.

ec_gtk.c  (ettercap-0.8.3):ec_gtk.c  (ettercap-0.8.3.1)
skipping to change at line 151 skipping to change at line 151
static gboolean gtkui_fatal_error_shim(gpointer data) { static gboolean gtkui_fatal_error_shim(gpointer data) {
gtkui_fatal_error(data); gtkui_fatal_error(data);
SAFE_FREE(data); SAFE_FREE(data);
return FALSE; return FALSE;
} }
static void gtkui_fatal_error_wrap(const char *msg) { static void gtkui_fatal_error_wrap(const char *msg) {
char *copy = strdup(msg); char *copy = strdup(msg);
if (msg) { if (msg) {
g_idle_add(gtkui_fatal_error_shim, copy); gtkui_fatal_error_shim(copy);
//g_idle_add(gtkui_fatal_error_shim, copy);
} else { } else {
FATAL_ERROR("out of memory"); FATAL_ERROR("out of memory");
} }
} }
struct gtkui_input_data { struct gtkui_input_data {
char *title; char *title;
char *input; char *input;
size_t n; size_t n;
void (*callback)(void); void (*callback)(void);
skipping to change at line 708 skipping to change at line 709
DEBUG_MSG("gtk_start"); DEBUG_MSG("gtk_start");
idle_flush = g_timeout_add(500, gtkui_flush_msg, NULL); idle_flush = g_timeout_add(500, gtkui_flush_msg, NULL);
/* which interface do we have to display ? */ /* which interface do we have to display ? */
if (EC_GBL_OPTIONS->read) if (EC_GBL_OPTIONS->read)
gtkui_sniff_offline(); gtkui_sniff_offline();
else else
gtkui_sniff_live(); gtkui_sniff_live();
/* start plugins defined on CLI */
g_idle_add(gtkui_plugins_autostart, NULL);
/* the main gui loop, once this exits the gui will be destroyed */ /* the main gui loop, once this exits the gui will be destroyed */
gtk_main(); gtk_main();
g_source_remove(idle_flush); g_source_remove(idle_flush);
} }
static void toggle_unoffensive(void) static void toggle_unoffensive(void)
{ {
if (EC_GBL_OPTIONS->unoffensive) { if (EC_GBL_OPTIONS->unoffensive) {
EC_GBL_OPTIONS->unoffensive = 0; EC_GBL_OPTIONS->unoffensive = 0;
skipping to change at line 1253 skipping to change at line 1257
return; return;
} }
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);
} }
/* /*
* start unified sniffing with default interface * start unified sniffing with default interface
*/ */
static void gtkui_unified_sniff_default(void) static void gtkui_unified_sniff_default(void)
{ {
char err[PCAP_ERRBUF_SIZE];
DEBUG_MSG("gtkui_unified_sniff_default"); DEBUG_MSG("gtkui_unified_sniff_default");
/* the ec_capture will find the interface for us */ /* the ec_capture will find the interface for us */
if (EC_GBL_OPTIONS->iface == NULL) { if (EC_GBL_OPTIONS->iface == NULL) {
char *iface; char *iface;
SAFE_CALLOC(EC_GBL_OPTIONS->iface, IFACE_LEN, sizeof(char)); SAFE_CALLOC(EC_GBL_OPTIONS->iface, IFACE_LEN, sizeof(char));
iface = pcap_lookupdev(err); iface = capture_default_if();
ON_ERROR(iface, NULL, "pcap_lookupdev: %s", err); ON_ERROR(iface, NULL, "No suitable interface found....");
strncpy(EC_GBL_OPTIONS->iface, iface, IFACE_LEN - 1); strncpy(EC_GBL_OPTIONS->iface, iface, IFACE_LEN - 1);
} }
/* close setup interface and start sniffing */ /* close setup interface and start sniffing */
gtk_main_quit(); gtk_main_quit();
} }
/* /*
* display the interface selection for bridged sniffing * display the interface selection for bridged sniffing
skipping to change at line 1678 skipping to change at line 1681
void gtkui_page_close_current(void) { void gtkui_page_close_current(void) {
GtkWidget *child; GtkWidget *child;
gint num = 0; gint num = 0;
num = gtk_notebook_get_current_page(GTK_NOTEBOOK (notebook)); num = gtk_notebook_get_current_page(GTK_NOTEBOOK (notebook));
child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), num); child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), num);
gtkui_page_close(NULL, child); gtkui_page_close(NULL, child);
} }
/* show the context menu when the notebook tabs recieve a mouse right-click */ /* show the context menu when the notebook tabs receive a mouse right-click */
gboolean gtkui_context_menu(GtkWidget *widget, GdkEventButton *event, gpointer d ata) { gboolean gtkui_context_menu(GtkWidget *widget, GdkEventButton *event, gpointer d ata) {
/* variable not used */ /* variable not used */
(void) widget; (void) widget;
if(event->button == 3) { if(event->button == 3) {
gtk_menu_popup(GTK_MENU(data), NULL, NULL, NULL, NULL, 3, event->time); gtk_menu_popup(GTK_MENU(data), NULL, NULL, NULL, NULL, 3, event->time);
/* /*
* button press event handle must return TRUE to keep the selection * button press event handle must return TRUE to keep the selection
* active when pressing the mouse button * active when pressing the mouse button
*/ */
skipping to change at line 1772 skipping to change at line 1775
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);
} }
/* make sure data is valid UTF8 */ /* make sure data is valid UTF8 */
char *gtkui_utf8_validate(char *data) { char *gtkui_utf8_validate(char *data) {
const gchar *end; const gchar *end;
char *unicode = NULL; char *unicode = NULL;
unicode = data; unicode = data;
if(!g_utf8_validate (data, -1, &end)) { if(!g_utf8_validate (data, -1, &end)) {
/* if "end" pointer is at begining of string, we have no valid text to pri nt */ /* if "end" pointer is at beginning of string, we have no valid text to pr int */
if(end == unicode) return(NULL); if(end == unicode) return(NULL);
/* cut off the invalid part so we don't lose the whole string */ /* cut off the invalid part so we don't lose the whole string */
/* this shouldn't happen often */ /* this shouldn't happen often */
unicode = (char *)end; unicode = (char *)end;
*unicode = 0; *unicode = 0;
unicode = data; unicode = data;
} }
return(unicode); return(unicode);
 End of changes. 6 change blocks. 
6 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)