Added name resolution in GUI part:
- Capture->Start->"Active name resolution" Allows the user to turn on/off name resolution during a live capture. - Display->Options->"Name resolution" Turn on/off name resolution for the displayed data (or during the -S mode). E.g. clicking on a packet captured with resolution disabled will resolve names in the detailed list if this option is set. And applying or resetting a display filter allows the update of the packet list as well. svn path=/trunk/; revision=726
This commit is contained in:
parent
4536f01901
commit
a673e8bb2c
18
display.c
18
display.c
|
@ -1,7 +1,7 @@
|
|||
/* display.c
|
||||
* Routines for packet display windows
|
||||
*
|
||||
* $Id: display.c,v 1.10 1999/09/19 15:54:54 deniel Exp $
|
||||
* $Id: display.c,v 1.11 1999/09/26 14:39:11 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -90,6 +90,7 @@ extern GtkWidget *packet_list;
|
|||
#define E_DISPLAY_TIME_REL_KEY "display_time_rel"
|
||||
#define E_DISPLAY_TIME_DELTA_KEY "display_time_delta"
|
||||
#define E_DISPLAY_AUTO_SCROLL_KEY "display_auto_scroll"
|
||||
#define E_DISPLAY_NAME_RESOLUTION_KEY "display_name_resolution"
|
||||
|
||||
static void display_opt_ok_cb(GtkWidget *, gpointer);
|
||||
static void display_opt_apply_cb(GtkWidget *, gpointer);
|
||||
|
@ -162,6 +163,13 @@ display_opt_cb(GtkWidget *w, gpointer d) {
|
|||
button);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show(button);
|
||||
|
||||
button = gtk_check_button_new_with_label("Name resolution");
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), g_resolving_actif);
|
||||
gtk_object_set_data(GTK_OBJECT(display_opt_w), E_DISPLAY_NAME_RESOLUTION_KEY,
|
||||
button);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show(button);
|
||||
|
||||
/* Button row: OK, Apply, and Cancel buttons */
|
||||
bbox = gtk_hbutton_box_new();
|
||||
|
@ -219,6 +227,10 @@ display_opt_ok_cb(GtkWidget *ok_bt, gpointer parent_w) {
|
|||
E_DISPLAY_AUTO_SCROLL_KEY);
|
||||
auto_scroll_live = (GTK_TOGGLE_BUTTON (button)->active);
|
||||
|
||||
button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
|
||||
E_DISPLAY_NAME_RESOLUTION_KEY);
|
||||
g_resolving_actif = (GTK_TOGGLE_BUTTON (button)->active);
|
||||
|
||||
gtk_widget_destroy(GTK_WIDGET(parent_w));
|
||||
display_opt_window_active = FALSE;
|
||||
|
||||
|
@ -248,6 +260,10 @@ display_opt_apply_cb(GtkWidget *ok_bt, gpointer parent_w) {
|
|||
E_DISPLAY_AUTO_SCROLL_KEY);
|
||||
auto_scroll_live = (GTK_TOGGLE_BUTTON (button)->active);
|
||||
|
||||
button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
|
||||
E_DISPLAY_NAME_RESOLUTION_KEY);
|
||||
g_resolving_actif = (GTK_TOGGLE_BUTTON (button)->active);
|
||||
|
||||
change_time_formats(&cf);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* globals.h
|
||||
* Global defines, etc.
|
||||
*
|
||||
* $Id: globals.h,v 1.6 1999/09/23 06:27:19 guy Exp $
|
||||
* $Id: globals.h,v 1.7 1999/09/26 14:39:12 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -92,6 +92,7 @@ extern gchar *medium_font;
|
|||
extern gchar *bold_font;
|
||||
extern gchar *last_open_dir;
|
||||
extern gboolean auto_scroll_live;
|
||||
extern int g_resolving_actif;
|
||||
|
||||
extern ts_type timestamp_type;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* capture_dlg.c
|
||||
* Routines for packet capture windows
|
||||
*
|
||||
* $Id: capture_dlg.c,v 1.4 1999/09/23 07:20:19 guy Exp $
|
||||
* $Id: capture_dlg.c,v 1.5 1999/09/26 14:40:01 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -82,6 +82,7 @@
|
|||
#define E_CAP_OPEN_KEY "cap_open"
|
||||
#define E_CAP_SNAP_KEY "cap_snap"
|
||||
#define E_CAP_SYNC_KEY "cap_sync"
|
||||
#define E_CAP_RESOLVE_KEY "cap_resolve"
|
||||
|
||||
/* Capture filter key */
|
||||
#define E_CAP_FILT_TE_KEY "cap_filt_te"
|
||||
|
@ -107,7 +108,7 @@ capture_prep_cb(GtkWidget *w, gpointer d) {
|
|||
*count_lb, *count_cb, *main_vb, *if_hb, *count_hb,
|
||||
*filter_hb, *filter_bt, *filter_te, *caplen_hb,
|
||||
*bbox, *ok_bt, *cancel_bt, *snap_lb,
|
||||
*snap_sb, *sync_cb;
|
||||
*snap_sb, *sync_cb, *resolv_cb;
|
||||
GtkAdjustment *adj;
|
||||
GList *if_list, *count_list = NULL;
|
||||
gchar *count_item1 = "0 (Infinite)", count_item2[16];
|
||||
|
@ -210,6 +211,11 @@ capture_prep_cb(GtkWidget *w, gpointer d) {
|
|||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sync_cb), sync_mode);
|
||||
gtk_container_add(GTK_CONTAINER(main_vb), sync_cb);
|
||||
gtk_widget_show(sync_cb);
|
||||
|
||||
resolv_cb = gtk_check_button_new_with_label("Enable name resolution");
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(resolv_cb), g_resolving_actif);
|
||||
gtk_container_add(GTK_CONTAINER(main_vb), resolv_cb);
|
||||
gtk_widget_show(resolv_cb);
|
||||
|
||||
/* Button row: OK and cancel buttons */
|
||||
bbox = gtk_hbutton_box_new();
|
||||
|
@ -239,13 +245,14 @@ capture_prep_cb(GtkWidget *w, gpointer d) {
|
|||
gtk_object_set_data(GTK_OBJECT(cap_open_w), E_CAP_COUNT_KEY, count_cb);
|
||||
gtk_object_set_data(GTK_OBJECT(cap_open_w), E_CAP_SNAP_KEY, snap_sb);
|
||||
gtk_object_set_data(GTK_OBJECT(cap_open_w), E_CAP_SYNC_KEY, sync_cb);
|
||||
gtk_object_set_data(GTK_OBJECT(cap_open_w), E_CAP_RESOLVE_KEY, resolv_cb);
|
||||
|
||||
gtk_widget_show(cap_open_w);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_prep_ok_cb(GtkWidget *ok_bt, gpointer parent_w) {
|
||||
GtkWidget *if_cb, *filter_te, *count_cb, *snap_sb, *sync_cb;
|
||||
GtkWidget *if_cb, *filter_te, *count_cb, *snap_sb, *sync_cb, *resolv_cb;
|
||||
gchar *filter_text;
|
||||
|
||||
if_cb = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_CAP_IFACE_KEY);
|
||||
|
@ -253,6 +260,7 @@ capture_prep_ok_cb(GtkWidget *ok_bt, gpointer parent_w) {
|
|||
count_cb = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_CAP_COUNT_KEY);
|
||||
snap_sb = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_CAP_SNAP_KEY);
|
||||
sync_cb = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_CAP_SYNC_KEY);
|
||||
resolv_cb = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_CAP_RESOLVE_KEY);
|
||||
|
||||
if (cf.iface)
|
||||
g_free(cf.iface);
|
||||
|
@ -281,6 +289,7 @@ capture_prep_ok_cb(GtkWidget *ok_bt, gpointer parent_w) {
|
|||
captured. */
|
||||
sync_mode = FALSE;
|
||||
}
|
||||
g_resolving_actif = GTK_TOGGLE_BUTTON (resolv_cb)->active;
|
||||
|
||||
gtk_widget_destroy(GTK_WIDGET(parent_w));
|
||||
|
||||
|
|
3
resolv.c
3
resolv.c
|
@ -1,7 +1,7 @@
|
|||
/* resolv.c
|
||||
* Routines for network object lookup
|
||||
*
|
||||
* $Id: resolv.c,v 1.11 1999/09/18 16:01:52 deniel Exp $
|
||||
* $Id: resolv.c,v 1.12 1999/09/26 14:39:12 deniel Exp $
|
||||
*
|
||||
* Laurent Deniel <deniel@worldnet.fr>
|
||||
*
|
||||
|
@ -68,6 +68,7 @@
|
|||
|
||||
#include "packet.h"
|
||||
#include "packet-ipv6.h"
|
||||
#include "globals.h"
|
||||
#include "resolv.h"
|
||||
|
||||
#ifndef MAXNAMELEN
|
||||
|
|
3
resolv.h
3
resolv.h
|
@ -1,7 +1,7 @@
|
|||
/* resolv.h
|
||||
* Definitions for network object lookup
|
||||
*
|
||||
* $Id: resolv.h,v 1.5 1999/07/07 22:51:59 gram Exp $
|
||||
* $Id: resolv.h,v 1.6 1999/09/26 14:39:12 deniel Exp $
|
||||
*
|
||||
* Laurent Deniel <deniel@worldnet.fr>
|
||||
*
|
||||
|
@ -41,7 +41,6 @@
|
|||
extern gchar *g_ethers_path;
|
||||
extern gchar *g_manuf_path;
|
||||
extern gchar *g_pethers_path;
|
||||
extern int g_resolving_actif;
|
||||
|
||||
/* Functions in resolv.c */
|
||||
|
||||
|
|
Loading…
Reference in New Issue