1999-09-09 03:32:03 +00:00
|
|
|
/* capture_dlg.c
|
|
|
|
* Routines for packet capture windows
|
|
|
|
*
|
2003-09-24 08:43:34 +00:00
|
|
|
* $Id: capture_dlg.c,v 1.84 2003/09/24 08:43:34 guy Exp $
|
1999-09-09 03:32:03 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-09-26 20:02:36 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-09-09 03:32:03 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-09-09 03:32:03 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-09-09 03:32:03 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-09-09 03:32:03 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
1999-10-02 19:33:14 +00:00
|
|
|
#ifdef HAVE_LIBPCAP
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-28 23:56:29 +00:00
|
|
|
#include <pcap.h>
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
#include "capture.h"
|
|
|
|
#include "globals.h"
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/resolv.h>
|
1999-09-09 03:32:03 +00:00
|
|
|
#include "main.h"
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
#include "ui_util.h"
|
1999-09-09 03:32:03 +00:00
|
|
|
#include "capture_dlg.h"
|
2000-02-12 06:46:54 +00:00
|
|
|
#include "filter_prefs.h"
|
2000-01-03 06:59:25 +00:00
|
|
|
#include "simple_dialog.h"
|
2000-05-03 07:09:40 +00:00
|
|
|
#include "dlg_utils.h"
|
2001-11-09 07:44:51 +00:00
|
|
|
#include "pcap-util.h"
|
2003-09-10 05:35:26 +00:00
|
|
|
#include "capture_combo_utils.h"
|
2001-04-13 14:59:30 +00:00
|
|
|
#include "prefs.h"
|
2001-12-04 08:26:00 +00:00
|
|
|
#include "ringbuffer.h"
|
2002-09-09 20:39:01 +00:00
|
|
|
#include <epan/filesystem.h>
|
2002-11-09 20:00:35 +00:00
|
|
|
#include "compat_macros.h"
|
1999-09-09 03:32:03 +00:00
|
|
|
|
2001-04-03 05:26:27 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include "capture-wpcap.h"
|
|
|
|
#endif
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
/* Capture callback data keys */
|
2000-01-18 09:25:04 +00:00
|
|
|
#define E_CAP_IFACE_KEY "cap_iface"
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
#define E_CAP_SNAP_CB_KEY "cap_snap_cb"
|
|
|
|
#define E_CAP_SNAP_SB_KEY "cap_snap_sb"
|
|
|
|
#define E_CAP_PROMISC_KEY "cap_promisc"
|
2000-01-18 09:25:04 +00:00
|
|
|
#define E_CAP_FILT_KEY "cap_filter_te"
|
|
|
|
#define E_CAP_FILE_TE_KEY "cap_file_te"
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
#define E_CAP_RING_ON_TB_KEY "cap_ringbuffer_on_tb"
|
|
|
|
#define E_CAP_RING_NBF_LB_KEY "cap_ringbuffer_nbf_lb"
|
|
|
|
#define E_CAP_RING_NBF_SB_KEY "cap_ringbuffer_nbf_sb"
|
2003-05-15 13:40:20 +00:00
|
|
|
#define E_CAP_RING_DURATION_CB_KEY "cap_ringbuffer_duration_cb"
|
|
|
|
#define E_CAP_RING_DURATION_SB_KEY "cap_ringbuffer_duration_sb"
|
2000-01-18 09:25:04 +00:00
|
|
|
#define E_CAP_SYNC_KEY "cap_sync"
|
|
|
|
#define E_CAP_AUTO_SCROLL_KEY "cap_auto_scroll"
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
#define E_CAP_COUNT_CB_KEY "cap_count_cb"
|
|
|
|
#define E_CAP_COUNT_SB_KEY "cap_count_sb"
|
|
|
|
#define E_CAP_FILESIZE_CB_KEY "cap_filesize_cb"
|
|
|
|
#define E_CAP_FILESIZE_SB_KEY "cap_filesize_sb"
|
|
|
|
#define E_CAP_FILESIZE_LB_KEY "cap_filesize_lb"
|
|
|
|
#define E_CAP_DURATION_CB_KEY "cap_duration_cb"
|
|
|
|
#define E_CAP_DURATION_SB_KEY "cap_duration_sb"
|
2001-05-31 08:36:46 +00:00
|
|
|
#define E_CAP_M_RESOLVE_KEY "cap_m_resolve"
|
|
|
|
#define E_CAP_N_RESOLVE_KEY "cap_n_resolve"
|
|
|
|
#define E_CAP_T_RESOLVE_KEY "cap_t_resolve"
|
1999-09-09 03:32:03 +00:00
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
#define E_FS_CALLER_PTR_KEY "fs_caller_ptr"
|
|
|
|
#define E_FILE_SEL_DIALOG_PTR_KEY "file_sel_dialog_ptr"
|
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
static void
|
|
|
|
capture_prep_file_cb(GtkWidget *w, gpointer te);
|
|
|
|
|
|
|
|
static void
|
|
|
|
cap_prep_fs_ok_cb(GtkWidget *w, gpointer data);
|
|
|
|
|
|
|
|
static void
|
|
|
|
cap_prep_fs_cancel_cb(GtkWidget *w, gpointer data);
|
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
static void
|
2002-09-09 20:39:01 +00:00
|
|
|
cap_prep_fs_destroy_cb(GtkWidget *win, GtkWidget* file_te);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
2001-12-04 08:26:00 +00:00
|
|
|
static void
|
2001-12-04 09:46:01 +00:00
|
|
|
capture_prep_adjust_sensitivity(GtkWidget *tb, gpointer parent_w);
|
2001-12-04 08:26:00 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
static void
|
|
|
|
capture_prep_ok_cb(GtkWidget *ok_bt, gpointer parent_w);
|
|
|
|
|
|
|
|
static void
|
|
|
|
capture_prep_close_cb(GtkWidget *close_bt, gpointer parent_w);
|
|
|
|
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
static void
|
|
|
|
capture_prep_destroy_cb(GtkWidget *win, gpointer user_data);
|
|
|
|
|
2000-10-11 06:01:16 +00:00
|
|
|
void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_stop_cb(GtkWidget *w _U_, gpointer d _U_)
|
2000-10-11 06:01:16 +00:00
|
|
|
{
|
|
|
|
capture_stop();
|
|
|
|
}
|
|
|
|
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
/*
|
2002-01-11 08:55:02 +00:00
|
|
|
* Keep a static pointer to the current "Capture Options" window, if
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
* any, so that if somebody tries to do "Capture:Start" while there's
|
2002-01-11 08:55:02 +00:00
|
|
|
* already a "Capture Options" window up, we just pop up the existing
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
* one, rather than creating a new one.
|
|
|
|
*/
|
|
|
|
static GtkWidget *cap_open_w;
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
|
1999-10-02 07:13:20 +00:00
|
|
|
{
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
GtkWidget *main_vb,
|
|
|
|
*capture_fr, *capture_vb,
|
|
|
|
*if_hb, *if_cb, *if_lb,
|
|
|
|
*snap_hb, *snap_cb, *snap_sb, *snap_lb,
|
|
|
|
*promisc_cb,
|
|
|
|
*filter_hb, *filter_bt, *filter_te,
|
|
|
|
*file_fr, *file_vb,
|
|
|
|
*file_hb, *file_bt, *file_te,
|
|
|
|
*ringbuffer_hb, *ringbuffer_on_tb, *ringbuffer_nbf_lb, *ringbuffer_nbf_sb,
|
|
|
|
*display_fr, *display_vb,
|
|
|
|
*sync_cb, *auto_scroll_cb,
|
|
|
|
*limit_fr, *limit_vb,
|
|
|
|
*count_hb, *count_cb, *count_sb, *count_lb,
|
|
|
|
*filesize_hb, *filesize_cb, *filesize_sb, *filesize_lb,
|
|
|
|
*duration_hb, *duration_cb, *duration_sb, *duration_lb,
|
2003-05-15 13:40:20 +00:00
|
|
|
*ring_duration_hb, *ring_duration_cb, *ring_duration_sb,
|
|
|
|
*ring_duration_lb,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
*resolv_fr, *resolv_vb,
|
2001-12-04 08:26:00 +00:00
|
|
|
*m_resolv_cb, *n_resolv_cb, *t_resolv_cb,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
*bbox, *ok_bt, *cancel_bt;
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2000-05-08 05:51:37 +00:00
|
|
|
GtkAccelGroup *accel_group;
|
2002-11-03 17:38:45 +00:00
|
|
|
#endif
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
GtkAdjustment *snap_adj, *ringbuffer_nbf_adj,
|
2003-05-15 13:40:20 +00:00
|
|
|
*count_adj, *filesize_adj, *duration_adj, *ring_duration_adj;
|
2003-09-10 05:35:26 +00:00
|
|
|
GList *if_list, *combo_list;
|
2000-01-16 02:48:12 +00:00
|
|
|
int err;
|
|
|
|
char err_str[PCAP_ERRBUF_SIZE];
|
1999-09-09 03:32:03 +00:00
|
|
|
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
if (cap_open_w != NULL) {
|
2002-01-11 08:55:02 +00:00
|
|
|
/* There's already a "Capture Options" dialog box; reactivate it. */
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
reactivate_window(cap_open_w);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-04-03 05:26:27 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
/* Is WPcap loaded? */
|
|
|
|
if (!has_wpcap) {
|
|
|
|
simple_dialog(ESD_TYPE_CRIT, NULL,
|
2001-09-26 20:02:36 +00:00
|
|
|
"Unable to load WinPcap (wpcap.dll); Ethereal will not be able\n"
|
|
|
|
"to capture packets.\n\n"
|
|
|
|
"In order to capture packets, WinPcap must be installed; see\n"
|
2001-09-28 07:50:48 +00:00
|
|
|
"\n"
|
2002-06-24 20:56:15 +00:00
|
|
|
" http://winpcap.polito.it/\n"
|
2001-09-29 19:56:08 +00:00
|
|
|
"\n"
|
|
|
|
"or the mirror at\n"
|
|
|
|
"\n"
|
2002-04-14 19:24:26 +00:00
|
|
|
" http://winpcap.mirror.ethereal.com/\n"
|
2001-10-31 07:11:08 +00:00
|
|
|
"\n"
|
|
|
|
"or the mirror at\n"
|
|
|
|
"\n"
|
2002-04-14 20:06:04 +00:00
|
|
|
" http://www.mirrors.wiretapped.net/security/packet-capture/winpcap/\n"
|
2001-09-28 07:50:48 +00:00
|
|
|
"\n"
|
2001-09-26 20:02:36 +00:00
|
|
|
"for a downloadable version of WinPcap and for instructions\n"
|
|
|
|
"on how to install WinPcap.");
|
2001-04-03 05:26:27 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-01-16 02:48:12 +00:00
|
|
|
if_list = get_interface_list(&err, err_str);
|
|
|
|
if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) {
|
|
|
|
simple_dialog(ESD_TYPE_WARN, NULL, "Can't get list of interfaces: %s",
|
|
|
|
err_str);
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-01-11 08:55:02 +00:00
|
|
|
cap_open_w = dlg_window_new("Ethereal: Capture Options");
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(cap_open_w, "destroy", capture_prep_destroy_cb, NULL);
|
2000-05-08 05:51:37 +00:00
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2000-05-08 05:51:37 +00:00
|
|
|
/* Accelerator group for the accelerators (or, as they're called in
|
|
|
|
Windows and, I think, in Motif, "mnemonics"; Alt+<key> is a mnemonic,
|
|
|
|
Ctrl+<key> is an accelerator). */
|
|
|
|
accel_group = gtk_accel_group_new();
|
|
|
|
gtk_window_add_accel_group(GTK_WINDOW(cap_open_w), accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#endif
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
main_vb = gtk_vbox_new(FALSE, 0);
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
|
|
|
|
gtk_container_add(GTK_CONTAINER(cap_open_w), main_vb);
|
|
|
|
gtk_widget_show(main_vb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Capture-related options frame */
|
|
|
|
capture_fr = gtk_frame_new("Capture");
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), capture_fr);
|
|
|
|
gtk_widget_show(capture_fr);
|
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
capture_vb = gtk_vbox_new(FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(capture_fr), capture_vb);
|
|
|
|
gtk_widget_show(capture_vb);
|
2000-08-23 20:55:44 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
/* Interface row */
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
if_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(capture_vb), if_hb);
|
|
|
|
gtk_widget_show(if_hb);
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
if_lb = gtk_label_new("Interface:");
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(if_hb), if_lb, FALSE, FALSE, 6);
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_show(if_lb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
if_cb = gtk_combo_new();
|
2003-09-10 05:35:26 +00:00
|
|
|
combo_list = build_capture_combo_list(if_list, TRUE);
|
2003-09-10 07:02:25 +00:00
|
|
|
if (combo_list != NULL)
|
2003-09-10 06:55:28 +00:00
|
|
|
gtk_combo_set_popdown_strings(GTK_COMBO(if_cb), combo_list);
|
2002-01-10 07:43:39 +00:00
|
|
|
if (cfile.iface == NULL && prefs.capture_device != NULL) {
|
|
|
|
/* No interface was specified on the command line or in a previous
|
|
|
|
capture, but there is one specified in the preferences file;
|
|
|
|
make the one from the preferences file the default */
|
|
|
|
cfile.iface = g_strdup(prefs.capture_device);
|
|
|
|
}
|
|
|
|
if (cfile.iface != NULL)
|
2000-06-27 04:36:03 +00:00
|
|
|
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(if_cb)->entry), cfile.iface);
|
2003-09-10 07:02:25 +00:00
|
|
|
else if (combo_list != NULL) {
|
2003-09-10 05:35:26 +00:00
|
|
|
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(if_cb)->entry),
|
2003-09-10 07:02:25 +00:00
|
|
|
(char *)combo_list->data);
|
2003-09-10 05:35:26 +00:00
|
|
|
}
|
2003-09-10 07:02:25 +00:00
|
|
|
free_capture_combo_list(combo_list);
|
2003-09-10 05:35:26 +00:00
|
|
|
free_interface_list(if_list);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(if_hb), if_cb, TRUE, TRUE, 6);
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_show(if_cb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Capture length row */
|
|
|
|
snap_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(capture_vb), snap_hb);
|
|
|
|
gtk_widget_show(snap_hb);
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
snap_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"_Limit each packet to", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
snap_cb = gtk_check_button_new_with_mnemonic("_Limit each packet to");
|
|
|
|
#endif
|
2002-02-24 09:25:36 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(snap_cb),
|
|
|
|
capture_opts.has_snaplen);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(snap_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(snap_hb), snap_cb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(snap_cb);
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
snap_adj = (GtkAdjustment *) gtk_adjustment_new((float) capture_opts.snaplen,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
MIN_PACKET_SIZE, WTAP_MAX_PACKET_SIZE, 1.0, 10.0, 0.0);
|
|
|
|
snap_sb = gtk_spin_button_new (snap_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (snap_sb), TRUE);
|
2002-11-09 20:00:35 +00:00
|
|
|
WIDGET_SET_SIZE(snap_sb, 80, -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX(snap_hb), snap_sb, FALSE, FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_widget_show(snap_sb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
snap_lb = gtk_label_new("bytes");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(snap_lb), 0, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(snap_hb), snap_lb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(snap_lb);
|
2001-12-04 07:32:05 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Promiscuous mode row */
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
promisc_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"Capture packets in _promiscuous mode", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
promisc_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"Capture packets in _promiscuous mode");
|
|
|
|
#endif
|
2002-02-24 09:25:36 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(promisc_cb),
|
|
|
|
capture_opts.promisc_mode);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(capture_vb), promisc_cb);
|
|
|
|
gtk_widget_show(promisc_cb);
|
2001-12-04 07:32:05 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
/* Filter row */
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
filter_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(capture_vb), filter_hb);
|
|
|
|
gtk_widget_show(filter_hb);
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
filter_bt = gtk_button_new_with_label("Filter:");
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(filter_bt, "clicked", capture_filter_construct_cb, NULL);
|
2003-01-15 05:20:19 +00:00
|
|
|
SIGNAL_CONNECT(filter_bt, "destroy", filter_button_destroy_cb, NULL);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(filter_hb), filter_bt, FALSE, FALSE, 3);
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_show(filter_bt);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
filter_te = gtk_entry_new();
|
2000-06-27 04:36:03 +00:00
|
|
|
if (cfile.cfilter) gtk_entry_set_text(GTK_ENTRY(filter_te), cfile.cfilter);
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(filter_bt, E_FILT_TE_PTR_KEY, filter_te);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(filter_hb), filter_te, TRUE, TRUE, 3);
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_show(filter_te);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
/* Capture file-related options frame */
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
file_fr = gtk_frame_new("Capture file(s)");
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), file_fr);
|
|
|
|
gtk_widget_show(file_fr);
|
|
|
|
|
|
|
|
file_vb = gtk_vbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(file_fr), file_vb);
|
|
|
|
gtk_widget_show(file_vb);
|
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
/* File row */
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
file_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(file_vb), file_hb);
|
|
|
|
gtk_widget_show(file_hb);
|
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
file_bt = gtk_button_new_with_label("File:");
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(file_hb), file_bt, FALSE, FALSE, 3);
|
1999-10-02 07:13:20 +00:00
|
|
|
gtk_widget_show(file_bt);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
file_te = gtk_entry_new();
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(file_hb), file_te, TRUE, TRUE, 3);
|
1999-10-02 07:13:20 +00:00
|
|
|
gtk_widget_show(file_te);
|
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(file_bt, "clicked", capture_prep_file_cb, file_te);
|
1999-09-09 03:32:03 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Ring buffer row */
|
2001-12-04 08:26:00 +00:00
|
|
|
ringbuffer_hb = gtk_hbox_new(FALSE, 3);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(file_vb), ringbuffer_hb);
|
2001-12-04 08:26:00 +00:00
|
|
|
gtk_widget_show(ringbuffer_hb);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2001-12-04 08:26:00 +00:00
|
|
|
ringbuffer_on_tb = dlg_check_button_new_with_label_with_mnemonic(
|
2001-12-04 09:46:01 +00:00
|
|
|
"Use _ring buffer", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
ringbuffer_on_tb = gtk_check_button_new_with_mnemonic("Use _ring buffer");
|
|
|
|
#endif
|
2001-12-04 09:46:01 +00:00
|
|
|
/* Ring buffer mode is allowed only if we're not doing an "Update list of
|
|
|
|
packets in real time" capture, so force it off if we're doing such
|
|
|
|
a capture. */
|
2002-02-24 09:25:36 +00:00
|
|
|
if (capture_opts.sync_mode)
|
|
|
|
capture_opts.ringbuffer_on = FALSE;
|
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(ringbuffer_on_tb),
|
|
|
|
capture_opts.ringbuffer_on);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(ringbuffer_on_tb, "toggled", capture_prep_adjust_sensitivity,
|
|
|
|
cap_open_w);
|
2001-12-04 08:26:00 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(ringbuffer_hb), ringbuffer_on_tb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(ringbuffer_on_tb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-04 08:26:00 +00:00
|
|
|
ringbuffer_nbf_lb = gtk_label_new("Number of files");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(ringbuffer_nbf_lb), 1, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(ringbuffer_hb), ringbuffer_nbf_lb, FALSE, FALSE, 6);
|
|
|
|
gtk_widget_show(ringbuffer_nbf_lb);
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
ringbuffer_nbf_adj = (GtkAdjustment *) gtk_adjustment_new((float) capture_opts.ringbuffer_num_files,
|
2001-12-04 08:26:00 +00:00
|
|
|
RINGBUFFER_MIN_NUM_FILES, RINGBUFFER_MAX_NUM_FILES, 1.0, 10.0, 0.0);
|
|
|
|
ringbuffer_nbf_sb = gtk_spin_button_new (ringbuffer_nbf_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (ringbuffer_nbf_sb), TRUE);
|
2002-11-09 20:00:35 +00:00
|
|
|
WIDGET_SET_SIZE(ringbuffer_nbf_sb, 40, -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX(ringbuffer_hb), ringbuffer_nbf_sb, TRUE, TRUE, 0);
|
2001-12-04 08:26:00 +00:00
|
|
|
gtk_widget_show(ringbuffer_nbf_sb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-05-15 13:40:20 +00:00
|
|
|
/* Ring buffer duration row */
|
|
|
|
ring_duration_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(file_vb), ring_duration_hb);
|
|
|
|
gtk_widget_show(ring_duration_hb);
|
|
|
|
|
|
|
|
ring_duration_cb = gtk_check_button_new_with_label("Rotate capture file every");
|
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(ring_duration_cb),
|
|
|
|
capture_opts.has_ring_duration);
|
|
|
|
SIGNAL_CONNECT(ring_duration_cb, "toggled",
|
|
|
|
capture_prep_adjust_sensitivity, cap_open_w);
|
|
|
|
gtk_box_pack_start(GTK_BOX(ring_duration_hb), ring_duration_cb,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(ring_duration_cb);
|
|
|
|
|
|
|
|
ring_duration_adj = (GtkAdjustment *)gtk_adjustment_new(capture_opts.ringbuffer_duration,
|
|
|
|
1, INT_MAX, 1.0, 10.0, 0.0);
|
|
|
|
ring_duration_sb = gtk_spin_button_new (ring_duration_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (ring_duration_sb), TRUE);
|
|
|
|
WIDGET_SET_SIZE(ring_duration_sb, 80, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX(ring_duration_hb), ring_duration_sb,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(ring_duration_sb);
|
|
|
|
|
|
|
|
ring_duration_lb = gtk_label_new("second(s)");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(ring_duration_lb), 0, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(ring_duration_hb), ring_duration_lb,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(ring_duration_lb);
|
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Display-related options frame */
|
|
|
|
display_fr = gtk_frame_new("Display options");
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), display_fr);
|
|
|
|
gtk_widget_show(display_fr);
|
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
display_vb = gtk_vbox_new(FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(display_fr), display_vb);
|
|
|
|
gtk_widget_show(display_vb);
|
|
|
|
|
|
|
|
/* "Update display in real time" row */
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2000-05-08 05:51:37 +00:00
|
|
|
sync_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"_Update list of packets in real time", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
sync_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"_Update list of packets in real time");
|
|
|
|
#endif
|
2002-02-24 09:25:36 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sync_cb),
|
|
|
|
capture_opts.sync_mode);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(sync_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(display_vb), sync_cb);
|
Move the toolkit-independent code to create a temporary capture file,
and to fork off and run a separate copy of "ethereal" for "-S" and "-F"
captures or just call "capture()" otherwise, out of "gtk/capture_dlg.c"
and into a routine in "capture.c".
If the attempt to create said temporary capture file fails, pop up a
dialog box and don't do the capture.
Have the child capture process send a message upstream after it either
successfully starts the capture and syncs out the header of the capture
file, or fails to start the capture; the message indicates whether it
succeeded or failed, and, if it failed, includes a failure message.
This:
avoids the use of a signal, and thus means we don't have to
worry about whether to capture the signal, or whether to start
or stop capturing depending on whether this particular capture
is in sync mode or not;
lets us pop up the message box for the error in the parent
process if we're in sync mode, rather than doing it in the
child, which didn't work well.
Add a check button to the Capture/Start dialog box, so that we can
control, for each capture, whether it's to be done in sync mode or not.
svn path=/trunk/; revision=708
1999-09-23 06:27:27 +00:00
|
|
|
gtk_widget_show(sync_cb);
|
1999-09-26 14:40:01 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* "Auto-scroll live update" row */
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2000-05-08 05:51:37 +00:00
|
|
|
auto_scroll_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"_Automatic scrolling in live capture", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
auto_scroll_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"_Automatic scrolling in live capture");
|
|
|
|
#endif
|
2002-01-10 11:05:50 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(auto_scroll_cb), auto_scroll_live);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(display_vb), auto_scroll_cb);
|
2000-01-18 09:25:04 +00:00
|
|
|
gtk_widget_show(auto_scroll_cb);
|
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Capture limits frame */
|
|
|
|
limit_fr = gtk_frame_new("Capture limits");
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), limit_fr);
|
|
|
|
gtk_widget_show(limit_fr);
|
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
limit_vb = gtk_vbox_new(FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(limit_fr), limit_vb);
|
|
|
|
gtk_widget_show(limit_vb);
|
|
|
|
|
|
|
|
/* Count row */
|
|
|
|
count_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(limit_vb), count_hb);
|
|
|
|
gtk_widget_show(count_hb);
|
|
|
|
|
|
|
|
count_cb = gtk_check_button_new_with_label("Stop capture after");
|
2002-02-24 09:25:36 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(count_cb),
|
|
|
|
capture_opts.has_autostop_count);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(count_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(count_hb), count_cb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(count_cb);
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
count_adj = (GtkAdjustment *) gtk_adjustment_new(capture_opts.autostop_count,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
1, INT_MAX, 1.0, 10.0, 0.0);
|
|
|
|
count_sb = gtk_spin_button_new (count_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (count_sb), TRUE);
|
2002-11-09 20:00:35 +00:00
|
|
|
WIDGET_SET_SIZE(count_sb, 80, -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX(count_hb), count_sb, FALSE, FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_widget_show(count_sb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
count_lb = gtk_label_new("packet(s) captured");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(count_lb), 0, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(count_hb), count_lb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(count_lb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Filesize row */
|
|
|
|
filesize_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(limit_vb), filesize_hb);
|
|
|
|
gtk_widget_show(filesize_hb);
|
|
|
|
|
|
|
|
filesize_cb = gtk_check_button_new_with_label("");
|
"autostop_filesize" and "autostop_duration" don't need to be in the
"capture_file" structure - they're a property of an in-progress capture,
not a property of an open capture file. Make them just variables.
The maximum number of packets to be captured should be a variable
separate from the "count" field in the "capture_file" structure - the
latter is a count of the packets in the capture file in question.
Have Boolean variables indicating whether a maximum packet count,
maximum capture file size, and maximum capture duration were specified.
If an option isn't set, and we're doing an "update list of packets in
real time" capture, don't pass the option to the child process with a
command-line argument.
Don't create "stop when the capture file reaches this size" or "stop
when the capture's run for this long" conditions if a maximum capture
file size or a maximum capture duration, respectively, haven't been
specified. Don't test or free a condition if it wasn't created.
Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag
is the way you specify "no limit on the number of packets".
Initialize the check boxes and spin buttons for the "maximum packets to
capture", "maximum capture size", and "maximum capture duration" options
to the values they had in the last capture. If an option wasn't
specified, don't read its value from the dialog box and set the
variable.
svn path=/trunk/; revision=4795
2002-02-24 03:33:05 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(filesize_cb),
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_autostop_filesize);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(filesize_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(filesize_hb), filesize_cb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(filesize_cb);
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
filesize_adj = (GtkAdjustment *) gtk_adjustment_new(capture_opts.autostop_filesize,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
1, INT_MAX, 1.0, 10.0, 0.0);
|
|
|
|
filesize_sb = gtk_spin_button_new (filesize_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (filesize_sb), TRUE);
|
2002-11-09 20:00:35 +00:00
|
|
|
WIDGET_SET_SIZE(filesize_sb, 80, -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX(filesize_hb), filesize_sb, FALSE, FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_widget_show(filesize_sb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
filesize_lb = gtk_label_new("");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(filesize_lb), 0, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(filesize_hb), filesize_lb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(filesize_lb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Duration row */
|
|
|
|
duration_hb = gtk_hbox_new(FALSE, 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(limit_vb), duration_hb);
|
|
|
|
gtk_widget_show(duration_hb);
|
|
|
|
|
|
|
|
duration_cb = gtk_check_button_new_with_label("Stop capture after");
|
"autostop_filesize" and "autostop_duration" don't need to be in the
"capture_file" structure - they're a property of an in-progress capture,
not a property of an open capture file. Make them just variables.
The maximum number of packets to be captured should be a variable
separate from the "count" field in the "capture_file" structure - the
latter is a count of the packets in the capture file in question.
Have Boolean variables indicating whether a maximum packet count,
maximum capture file size, and maximum capture duration were specified.
If an option isn't set, and we're doing an "update list of packets in
real time" capture, don't pass the option to the child process with a
command-line argument.
Don't create "stop when the capture file reaches this size" or "stop
when the capture's run for this long" conditions if a maximum capture
file size or a maximum capture duration, respectively, haven't been
specified. Don't test or free a condition if it wasn't created.
Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag
is the way you specify "no limit on the number of packets".
Initialize the check boxes and spin buttons for the "maximum packets to
capture", "maximum capture size", and "maximum capture duration" options
to the values they had in the last capture. If an option wasn't
specified, don't read its value from the dialog box and set the
variable.
svn path=/trunk/; revision=4795
2002-02-24 03:33:05 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(duration_cb),
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_autostop_duration);
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(duration_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(duration_hb), duration_cb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(duration_cb);
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
duration_adj = (GtkAdjustment *) gtk_adjustment_new(capture_opts.autostop_duration,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
1, INT_MAX, 1.0, 10.0, 0.0);
|
|
|
|
duration_sb = gtk_spin_button_new (duration_adj, 0, 0);
|
|
|
|
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (duration_sb), TRUE);
|
2002-11-09 20:00:35 +00:00
|
|
|
WIDGET_SET_SIZE(duration_sb, 80, -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX(duration_hb), duration_sb, FALSE, FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_widget_show(duration_sb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
duration_lb = gtk_label_new("second(s)");
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(duration_lb), 0, 0.5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(duration_hb), duration_lb, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(duration_lb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
/* Resolution options frame */
|
|
|
|
resolv_fr = gtk_frame_new("Name resolution");
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), resolv_fr);
|
|
|
|
gtk_widget_show(resolv_fr);
|
|
|
|
|
2002-03-05 02:25:09 +00:00
|
|
|
resolv_vb = gtk_vbox_new(FALSE, 0);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(resolv_fr), resolv_vb);
|
|
|
|
gtk_widget_show(resolv_vb);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2001-05-31 08:36:46 +00:00
|
|
|
m_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"Enable _MAC name resolution", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
m_resolv_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"Enable _MAC name resolution");
|
|
|
|
#endif
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(m_resolv_cb),
|
2002-01-13 20:35:12 +00:00
|
|
|
g_resolv_flags & RESOLV_MAC);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(resolv_vb), m_resolv_cb);
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_widget_show(m_resolv_cb);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2001-05-31 08:36:46 +00:00
|
|
|
n_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"Enable _network name resolution", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
n_resolv_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"Enable _network name resolution");
|
|
|
|
#endif
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(n_resolv_cb),
|
2002-01-13 20:35:12 +00:00
|
|
|
g_resolv_flags & RESOLV_NETWORK);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(resolv_vb), n_resolv_cb);
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_widget_show(n_resolv_cb);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
2001-05-31 08:36:46 +00:00
|
|
|
t_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
|
|
|
|
"Enable _transport name resolution", accel_group);
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
t_resolv_cb = gtk_check_button_new_with_mnemonic(
|
|
|
|
"Enable _transport name resolution");
|
|
|
|
#endif
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(t_resolv_cb),
|
2002-01-13 20:35:12 +00:00
|
|
|
g_resolv_flags & RESOLV_TRANSPORT);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(resolv_vb), t_resolv_cb);
|
2001-05-31 08:36:46 +00:00
|
|
|
gtk_widget_show(t_resolv_cb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
/* Button row: OK and cancel buttons */
|
|
|
|
bbox = gtk_hbutton_box_new();
|
|
|
|
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
|
|
|
|
gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), bbox);
|
|
|
|
gtk_widget_show(bbox);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
1999-09-09 03:32:03 +00:00
|
|
|
ok_bt = gtk_button_new_with_label ("OK");
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
ok_bt = gtk_button_new_from_stock(GTK_STOCK_OK);
|
|
|
|
#endif
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(ok_bt, "clicked", capture_prep_ok_cb, cap_open_w);
|
1999-09-09 03:32:03 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_grab_default(ok_bt);
|
|
|
|
gtk_widget_show(ok_bt);
|
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
#if GTK_MAJOR_VERSION < 2
|
1999-09-09 03:32:03 +00:00
|
|
|
cancel_bt = gtk_button_new_with_label ("Cancel");
|
2002-11-03 17:38:45 +00:00
|
|
|
#else
|
|
|
|
cancel_bt = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
|
|
|
|
#endif
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(cancel_bt, "clicked", capture_prep_close_cb, cap_open_w);
|
1999-09-09 03:32:03 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (bbox), cancel_bt, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show(cancel_bt);
|
|
|
|
|
|
|
|
/* Attach pointers to needed widgets to the capture prefs window/object */
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_IFACE_KEY, if_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_SNAP_CB_KEY, snap_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_SNAP_SB_KEY, snap_sb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_PROMISC_KEY, promisc_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_FILT_KEY, filter_te);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_FILE_TE_KEY, file_te);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_RING_ON_TB_KEY, ringbuffer_on_tb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_RING_NBF_LB_KEY, ringbuffer_nbf_lb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_RING_NBF_SB_KEY, ringbuffer_nbf_sb);
|
2003-05-15 13:40:20 +00:00
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_RING_DURATION_CB_KEY, ring_duration_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_RING_DURATION_SB_KEY, ring_duration_sb);
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_SYNC_KEY, sync_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_AUTO_SCROLL_KEY, auto_scroll_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_COUNT_CB_KEY, count_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_COUNT_SB_KEY, count_sb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_FILESIZE_CB_KEY, filesize_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_FILESIZE_SB_KEY, filesize_sb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_FILESIZE_LB_KEY, filesize_lb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_DURATION_CB_KEY, duration_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_DURATION_SB_KEY, duration_sb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_M_RESOLVE_KEY, m_resolv_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_N_RESOLVE_KEY, n_resolv_cb);
|
|
|
|
OBJECT_SET_DATA(cap_open_w, E_CAP_T_RESOLVE_KEY, t_resolv_cb);
|
2001-12-04 09:46:01 +00:00
|
|
|
|
|
|
|
/* Set the sensitivity of various widgets as per the settings of other
|
|
|
|
widgets. */
|
|
|
|
capture_prep_adjust_sensitivity(NULL, cap_open_w);
|
1999-09-09 03:32:03 +00:00
|
|
|
|
2002-09-09 20:39:01 +00:00
|
|
|
/* Catch the "activate" signal on the filter and file name text
|
2000-05-03 07:09:40 +00:00
|
|
|
entries, so that if the user types Return there, we act as if the
|
|
|
|
"OK" button had been selected, as happens if Return is typed if some
|
|
|
|
widget that *doesn't* handle the Return key has the input focus. */
|
|
|
|
dlg_set_activate(filter_te, ok_bt);
|
|
|
|
dlg_set_activate(file_te, ok_bt);
|
|
|
|
|
|
|
|
/* Catch the "key_press_event" signal in the window, so that we can catch
|
|
|
|
the ESC key being pressed and act as if the "Cancel" button had
|
|
|
|
been selected. */
|
|
|
|
dlg_set_cancel(cap_open_w, cancel_bt);
|
|
|
|
|
|
|
|
/* XXX - why does not
|
|
|
|
|
|
|
|
gtk_widget_grab_focus(if_cb);
|
|
|
|
|
|
|
|
give the initial focus to the "Interface" combo box?
|
|
|
|
|
|
|
|
Or should I phrase that as "why does GTK+ continually frustrate
|
|
|
|
attempts to make GUIs driveable from the keyboard?" We have to
|
|
|
|
go catch the activate signal on every single GtkEntry widget
|
|
|
|
(rather than having widgets whose activate signal is *not*
|
|
|
|
caught not catch the Return keystroke, so that it passes on,
|
|
|
|
ultimately, to the window, which can activate the default
|
|
|
|
widget, i.e. the "OK" button); we have to catch the "key_press_event"
|
|
|
|
signal and have the handler check for ESC, so that we can have ESC
|
|
|
|
activate the "Cancel" button; in order to support Alt+<key> mnemonics
|
|
|
|
for buttons and the like, we may have to construct an accelerator
|
|
|
|
group by hand and set up the accelerators by hand (if that even
|
|
|
|
works - I've not tried it yet); we have to do a "gtk_widget_grab_focus()"
|
|
|
|
to keep some container widget from getting the initial focus, so that
|
|
|
|
you don't have to tab into the first widget in order to start typing
|
|
|
|
in it; and it now appears that you simply *can't* make a combo box
|
|
|
|
get the initial focus, at least not in the obvious fashion. Sigh.... */
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_show(cap_open_w);
|
|
|
|
}
|
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
static void
|
|
|
|
capture_prep_file_cb(GtkWidget *w, gpointer file_te)
|
|
|
|
{
|
2000-05-08 05:42:54 +00:00
|
|
|
GtkWidget *caller = gtk_widget_get_toplevel(w);
|
1999-10-02 07:13:20 +00:00
|
|
|
GtkWidget *fs;
|
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
/* Has a file selection dialog box already been opened for that top-level
|
|
|
|
widget? */
|
2002-11-09 20:00:35 +00:00
|
|
|
fs = OBJECT_GET_DATA(caller, E_FILE_SEL_DIALOG_PTR_KEY);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
|
|
|
if (fs != NULL) {
|
|
|
|
/* Yes. Just re-activate that dialog box. */
|
|
|
|
reactivate_window(fs);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-09-24 08:43:34 +00:00
|
|
|
fs = file_selection_new ("Ethereal: Capture File");
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2002-09-09 20:39:01 +00:00
|
|
|
/* If we've opened a file, start out by showing the files in the directory
|
|
|
|
in which that file resided. */
|
|
|
|
if (last_open_dir)
|
|
|
|
gtk_file_selection_set_filename(GTK_FILE_SELECTION(fs), last_open_dir);
|
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(fs, E_CAP_FILE_TE_KEY, file_te);
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
/* Set the E_FS_CALLER_PTR_KEY for the new dialog to point to our caller. */
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(fs, E_FS_CALLER_PTR_KEY, caller);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
|
|
|
/* Set the E_FILE_SEL_DIALOG_PTR_KEY for the caller to point to us */
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(caller, E_FILE_SEL_DIALOG_PTR_KEY, fs);
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
/* Call a handler when the file selection box is destroyed, so we can inform
|
|
|
|
our caller, if any, that it's been destroyed. */
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(fs, "destroy", cap_prep_fs_destroy_cb, file_te);
|
2002-11-03 17:38:45 +00:00
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(GTK_FILE_SELECTION(fs)->ok_button, "clicked", cap_prep_fs_ok_cb, fs);
|
2002-11-03 17:38:45 +00:00
|
|
|
|
|
|
|
/* Connect the cancel_button to destroy the widget */
|
2002-11-09 20:00:35 +00:00
|
|
|
SIGNAL_CONNECT(GTK_FILE_SELECTION(fs)->cancel_button, "clicked", cap_prep_fs_cancel_cb,
|
|
|
|
fs);
|
2000-05-08 07:13:40 +00:00
|
|
|
|
|
|
|
/* Catch the "key_press_event" signal in the window, so that we can catch
|
|
|
|
the ESC key being pressed and act as if the "Cancel" button had
|
|
|
|
been selected. */
|
|
|
|
dlg_set_cancel(fs, GTK_FILE_SELECTION(fs)->cancel_button);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
gtk_widget_show(fs);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
cap_prep_fs_ok_cb(GtkWidget *w _U_, gpointer data)
|
1999-10-02 07:13:20 +00:00
|
|
|
{
|
2002-09-09 20:39:01 +00:00
|
|
|
gchar *cf_name;
|
|
|
|
|
|
|
|
cf_name = g_strdup(gtk_file_selection_get_filename(
|
|
|
|
GTK_FILE_SELECTION (data)));
|
|
|
|
|
|
|
|
/* Perhaps the user specified a directory instead of a file.
|
|
|
|
Check whether they did. */
|
|
|
|
if (test_for_directory(cf_name) == EISDIR) {
|
|
|
|
/* It's a directory - set the file selection box to display it. */
|
|
|
|
set_last_open_dir(cf_name);
|
|
|
|
g_free(cf_name);
|
|
|
|
gtk_file_selection_set_filename(GTK_FILE_SELECTION(data),
|
|
|
|
last_open_dir);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
gtk_entry_set_text(GTK_ENTRY(OBJECT_GET_DATA(data, E_CAP_FILE_TE_KEY)), cf_name);
|
2002-09-09 20:39:01 +00:00
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
gtk_widget_destroy(GTK_WIDGET(data));
|
2002-09-09 20:39:01 +00:00
|
|
|
g_free(cf_name);
|
1999-10-02 07:13:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
cap_prep_fs_cancel_cb(GtkWidget *w _U_, gpointer data)
|
1999-10-02 07:13:20 +00:00
|
|
|
{
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(data));
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
static void
|
2002-09-09 20:39:01 +00:00
|
|
|
cap_prep_fs_destroy_cb(GtkWidget *win, GtkWidget* file_te)
|
2000-05-08 05:42:54 +00:00
|
|
|
{
|
|
|
|
GtkWidget *caller;
|
|
|
|
|
|
|
|
/* Get the widget that requested that we be popped up.
|
|
|
|
(It should arrange to destroy us if it's destroyed, so
|
|
|
|
that we don't get a pointer to a non-existent window here.) */
|
2002-11-09 20:00:35 +00:00
|
|
|
caller = OBJECT_GET_DATA(win, E_FS_CALLER_PTR_KEY);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
|
|
|
/* Tell it we no longer exist. */
|
2002-11-09 20:00:35 +00:00
|
|
|
OBJECT_SET_DATA(caller, E_FILE_SEL_DIALOG_PTR_KEY, NULL);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
|
|
|
/* Now nuke this window. */
|
|
|
|
gtk_grab_remove(GTK_WIDGET(win));
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(win));
|
2002-09-09 20:39:01 +00:00
|
|
|
|
|
|
|
/* Give the focus to the file text entry widget so the user can just press
|
|
|
|
Return to start the capture. */
|
|
|
|
gtk_widget_grab_focus(file_te);
|
2000-05-08 05:42:54 +00:00
|
|
|
}
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_prep_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) {
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
GtkWidget *if_cb, *snap_cb, *snap_sb, *promisc_cb, *filter_te,
|
|
|
|
*file_te, *ringbuffer_on_tb, *ringbuffer_nbf_sb,
|
|
|
|
*sync_cb, *auto_scroll_cb,
|
|
|
|
*count_cb, *count_sb,
|
|
|
|
*filesize_cb, *filesize_sb,
|
|
|
|
*duration_cb, *duration_sb,
|
2003-05-15 13:40:20 +00:00
|
|
|
*ring_duration_cb, *ring_duration_sb,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
*m_resolv_cb, *n_resolv_cb, *t_resolv_cb;
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
gchar *if_text;
|
|
|
|
gchar *if_name;
|
1999-09-09 03:32:03 +00:00
|
|
|
gchar *filter_text;
|
2002-11-03 17:38:45 +00:00
|
|
|
gchar *save_file, *g_save_file;
|
2002-09-22 17:52:38 +00:00
|
|
|
gchar *cf_name;
|
|
|
|
gchar *dirname;
|
1999-09-09 03:32:03 +00:00
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
if_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_IFACE_KEY);
|
|
|
|
snap_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SNAP_CB_KEY);
|
|
|
|
snap_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SNAP_SB_KEY);
|
|
|
|
promisc_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_PROMISC_KEY);
|
|
|
|
filter_te = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILT_KEY);
|
|
|
|
file_te = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILE_TE_KEY);
|
|
|
|
ringbuffer_on_tb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_ON_TB_KEY);
|
|
|
|
ringbuffer_nbf_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_NBF_SB_KEY);
|
2003-05-15 13:40:20 +00:00
|
|
|
ring_duration_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_DURATION_CB_KEY);
|
|
|
|
ring_duration_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_DURATION_SB_KEY);
|
2002-11-09 20:00:35 +00:00
|
|
|
sync_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SYNC_KEY);
|
|
|
|
auto_scroll_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_AUTO_SCROLL_KEY);
|
|
|
|
count_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_COUNT_CB_KEY);
|
|
|
|
count_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_COUNT_SB_KEY);
|
|
|
|
filesize_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILESIZE_CB_KEY);
|
|
|
|
filesize_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILESIZE_SB_KEY);
|
|
|
|
duration_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_DURATION_CB_KEY);
|
|
|
|
duration_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_DURATION_SB_KEY);
|
|
|
|
m_resolv_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_M_RESOLVE_KEY);
|
|
|
|
n_resolv_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_N_RESOLVE_KEY);
|
|
|
|
t_resolv_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_T_RESOLVE_KEY);
|
1999-09-09 03:32:03 +00:00
|
|
|
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
if_text =
|
|
|
|
g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(if_cb)->entry)));
|
2003-09-08 21:44:42 +00:00
|
|
|
/* Remove interface description. Also, Windows combo entries have a
|
|
|
|
description followed by the interface name. These two cases are
|
2003-09-10 05:35:26 +00:00
|
|
|
OK as long as they're in front. */
|
2002-05-18 02:41:46 +00:00
|
|
|
if_name = strrchr(if_text, ' ');
|
|
|
|
if (if_name == NULL) {
|
|
|
|
if_name = if_text;
|
|
|
|
} else {
|
|
|
|
if_name++;
|
|
|
|
}
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
if (if_name == NULL) {
|
2000-07-20 05:10:02 +00:00
|
|
|
simple_dialog(ESD_TYPE_CRIT, NULL,
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
"You didn't specify an interface on which to capture packets.");
|
2001-05-31 05:33:15 +00:00
|
|
|
g_free(if_text);
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
return;
|
|
|
|
}
|
2000-06-27 04:36:03 +00:00
|
|
|
if (cfile.iface)
|
|
|
|
g_free(cfile.iface);
|
|
|
|
cfile.iface = g_strdup(if_name);
|
I thought I'd seen a problem with the combo box in the "Capture:Start"
dialog box if we hadn't found any interfaces on which we could capture,
but perhaps the problem was that "gtk_combo_set_popdown_strings()"
doesn't like it if you set the list of items to a NULL list - if you
don't set it at all, you get a combo box with only one blank entry in
the list, but you don't seem to get complaints from GTK+ 1.2.6, at
least.
Pop up the "Capture:Start" dialog box even if we don't find any
interfaces on which we could capture; at least this way, they won't just
get confronted with a
There are no network interfaces that can be opened.
Please check to make sure you have sufficient permission
to capture packets.
message box and no way to give us any more information other than "it
said 'There are no network interfaces that can be opened...'" - they can
at least try the interfaces that *should* work, and report the error
messages they get, giving us a better chance at figuring out what the
problem is.
Trim white space from the entry in that combo box, and, if there isn't
anything other than possibly white space, pop up a
You didn't specify an interface on which to capture packets.
message box and leave the dialog box up so that the user can supply an
interface name.
svn path=/trunk/; revision=1373
1999-12-23 09:31:09 +00:00
|
|
|
g_free(if_text);
|
1999-09-09 03:32:03 +00:00
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_snaplen =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(snap_cb));
|
|
|
|
if (capture_opts.has_snaplen) {
|
|
|
|
capture_opts.snaplen =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(snap_sb));
|
|
|
|
if (capture_opts.snaplen < 1)
|
|
|
|
capture_opts.snaplen = WTAP_MAX_PACKET_SIZE;
|
|
|
|
else if (capture_opts.snaplen < MIN_PACKET_SIZE)
|
|
|
|
capture_opts.snaplen = MIN_PACKET_SIZE;
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
}
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.promisc_mode =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(promisc_cb));
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
2000-06-27 04:36:03 +00:00
|
|
|
/* XXX - don't try to get clever and set "cfile.filter" to NULL if the
|
2000-01-06 05:09:01 +00:00
|
|
|
filter string is empty, as an indication that we don't have a filter
|
|
|
|
and thus don't have to set a filter when capturing - the version of
|
|
|
|
libpcap in Red Hat Linux 6.1, and versions based on later patches
|
|
|
|
in that series, don't bind the AF_PACKET socket to an interface
|
|
|
|
until a filter is set, which means they aren't bound at all if
|
|
|
|
no filter is set, which means no packets arrive as input on that
|
|
|
|
socket, which means Ethereal never sees any packets. */
|
1999-09-09 03:32:03 +00:00
|
|
|
filter_text = gtk_entry_get_text(GTK_ENTRY(filter_te));
|
2000-06-27 04:36:03 +00:00
|
|
|
if (cfile.cfilter)
|
|
|
|
g_free(cfile.cfilter);
|
2000-01-06 05:09:01 +00:00
|
|
|
g_assert(filter_text != NULL);
|
2002-08-28 21:04:11 +00:00
|
|
|
cfile.cfilter = g_strdup(filter_text);
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2002-11-03 17:38:45 +00:00
|
|
|
g_save_file = gtk_entry_get_text(GTK_ENTRY(file_te));
|
|
|
|
if (g_save_file && g_save_file[0]) {
|
1999-10-02 07:13:20 +00:00
|
|
|
/* User specified a file to which the capture should be written. */
|
2002-11-03 17:38:45 +00:00
|
|
|
save_file = g_strdup(g_save_file);
|
2002-09-22 17:52:38 +00:00
|
|
|
/* Save the directory name for future file dialogs. */
|
2002-11-03 17:38:45 +00:00
|
|
|
cf_name = g_strdup(g_save_file);
|
2002-09-22 17:52:38 +00:00
|
|
|
dirname = get_dirname(cf_name); /* Overwrites cf_name */
|
|
|
|
set_last_open_dir(dirname);
|
|
|
|
g_free(cf_name);
|
1999-10-02 07:13:20 +00:00
|
|
|
} else {
|
|
|
|
/* User didn't specify a file; save to a temporary file. */
|
|
|
|
save_file = NULL;
|
|
|
|
}
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_autostop_count =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(count_cb));
|
|
|
|
if (capture_opts.has_autostop_count)
|
|
|
|
capture_opts.autostop_count =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(count_sb));
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_autostop_filesize =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filesize_cb));
|
|
|
|
if (capture_opts.has_autostop_filesize)
|
|
|
|
capture_opts.autostop_filesize =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(filesize_sb));
|
1999-10-02 07:13:20 +00:00
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.has_autostop_duration =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(duration_cb));
|
|
|
|
if (capture_opts.has_autostop_duration)
|
|
|
|
capture_opts.autostop_duration =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(duration_sb));
|
2000-09-15 05:32:49 +00:00
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.sync_mode =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sync_cb));
|
1999-10-02 07:13:20 +00:00
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
auto_scroll_live =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_scroll_cb));
|
2000-01-18 09:25:04 +00:00
|
|
|
|
2002-01-13 20:35:12 +00:00
|
|
|
g_resolv_flags = RESOLV_NONE;
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_resolv_cb)))
|
|
|
|
g_resolv_flags |= RESOLV_MAC;
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(n_resolv_cb)))
|
|
|
|
g_resolv_flags |= RESOLV_NETWORK;
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(t_resolv_cb)))
|
|
|
|
g_resolv_flags |= RESOLV_TRANSPORT;
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.ringbuffer_on =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ringbuffer_on_tb)) &&
|
|
|
|
!(capture_opts.sync_mode);
|
|
|
|
if (capture_opts.ringbuffer_on) {
|
2001-12-04 08:26:00 +00:00
|
|
|
if (save_file == NULL) {
|
|
|
|
simple_dialog(ESD_TYPE_CRIT, NULL,
|
2001-12-04 09:46:01 +00:00
|
|
|
"You must specify a save file if you want to use the ring buffer.");
|
2001-12-04 08:26:00 +00:00
|
|
|
return;
|
2002-02-24 09:25:36 +00:00
|
|
|
} else if (!capture_opts.has_autostop_filesize) {
|
2001-12-04 08:26:00 +00:00
|
|
|
simple_dialog(ESD_TYPE_CRIT, NULL,
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
"You must specify a file size at which to rotate the capture files\n"
|
|
|
|
"if you want to use the ring buffer.");
|
2002-09-09 20:39:01 +00:00
|
|
|
g_free(save_file);
|
2001-12-04 08:26:00 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.ringbuffer_num_files =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ringbuffer_nbf_sb));
|
2003-07-25 04:11:51 +00:00
|
|
|
if (capture_opts.ringbuffer_num_files > RINGBUFFER_MAX_NUM_FILES)
|
2002-02-24 09:25:36 +00:00
|
|
|
capture_opts.ringbuffer_num_files = RINGBUFFER_MAX_NUM_FILES;
|
2003-07-25 04:11:51 +00:00
|
|
|
#if RINGBUFFER_MIN_NUM_FILES > 0
|
|
|
|
else if (capture_opts.ringbuffer_num_files < RINGBUFFER_MIN_NUM_FILES)
|
|
|
|
capture_opts.ringbuffer_num_files = RINGBUFFER_MIN_NUM_FILES;
|
|
|
|
#endif
|
2001-12-04 08:26:00 +00:00
|
|
|
|
2003-05-15 13:40:20 +00:00
|
|
|
capture_opts.has_ring_duration =
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ring_duration_cb));
|
|
|
|
if (capture_opts.has_ring_duration)
|
|
|
|
capture_opts.ringbuffer_duration =
|
|
|
|
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ring_duration_sb));
|
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
gtk_widget_destroy(GTK_WIDGET(parent_w));
|
|
|
|
|
1999-10-02 07:13:20 +00:00
|
|
|
do_capture(save_file);
|
2002-09-09 20:39:01 +00:00
|
|
|
if (save_file != NULL)
|
|
|
|
g_free(save_file);
|
1999-09-09 03:32:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_prep_close_cb(GtkWidget *close_bt _U_, gpointer parent_w)
|
1999-09-09 03:32:03 +00:00
|
|
|
{
|
|
|
|
gtk_grab_remove(GTK_WIDGET(parent_w));
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(parent_w));
|
|
|
|
}
|
|
|
|
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_prep_destroy_cb(GtkWidget *win, gpointer user_data _U_)
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
{
|
2000-05-08 05:42:54 +00:00
|
|
|
GtkWidget *fs;
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
|
2000-05-08 05:42:54 +00:00
|
|
|
/* Is there a file selection dialog associated with this
|
2003-01-15 05:20:19 +00:00
|
|
|
Capture Options dialog? */
|
2002-11-09 20:00:35 +00:00
|
|
|
fs = OBJECT_GET_DATA(win, E_FILE_SEL_DIALOG_PTR_KEY);
|
2000-05-08 05:42:54 +00:00
|
|
|
|
|
|
|
if (fs != NULL) {
|
|
|
|
/* Yes. Destroy it. */
|
|
|
|
gtk_widget_destroy(fs);
|
|
|
|
}
|
|
|
|
|
2002-01-11 08:55:02 +00:00
|
|
|
/* Note that we no longer have a "Capture Options" dialog box. */
|
Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).
Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:
if the window in which the "Filter:" button lives goes away, so
does the filter dialog box (as it no longer has a text widget
into which it can stuff the selected filter);
if the "Filter:" button is clicked when there's already a filter
dialog box open, we just reactivate that existing dialog box
rather than popping up a new one.
Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).
Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).
Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.
svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
|
|
|
cap_open_w = NULL;
|
|
|
|
}
|
|
|
|
|
2001-12-04 09:46:01 +00:00
|
|
|
/*
|
|
|
|
* Adjust the sensitivity of various widgets as per the current setting
|
|
|
|
* of other widgets.
|
|
|
|
*/
|
2001-12-04 08:26:00 +00:00
|
|
|
static void
|
2002-03-05 11:56:00 +00:00
|
|
|
capture_prep_adjust_sensitivity(GtkWidget *tb _U_, gpointer parent_w)
|
2001-12-04 08:26:00 +00:00
|
|
|
{
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
GtkWidget *snap_cb, *snap_sb,
|
|
|
|
*ringbuffer_on_tb, *ringbuffer_nbf_lb, *ringbuffer_nbf_sb,
|
|
|
|
*sync_cb, *auto_scroll_cb,
|
|
|
|
*count_cb, *count_sb,
|
|
|
|
*filesize_cb, *filesize_sb, *filesize_lb,
|
2003-05-15 13:40:20 +00:00
|
|
|
*duration_cb, *duration_sb,
|
|
|
|
*ring_duration_cb, *ring_duration_sb;
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
2002-11-09 20:00:35 +00:00
|
|
|
snap_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SNAP_CB_KEY);
|
|
|
|
snap_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SNAP_SB_KEY);
|
|
|
|
ringbuffer_on_tb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_ON_TB_KEY);
|
|
|
|
ringbuffer_nbf_lb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_NBF_LB_KEY);
|
|
|
|
ringbuffer_nbf_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_NBF_SB_KEY);
|
2003-05-15 13:40:20 +00:00
|
|
|
ring_duration_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_DURATION_CB_KEY);
|
|
|
|
ring_duration_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_RING_DURATION_SB_KEY);
|
2002-11-09 20:00:35 +00:00
|
|
|
sync_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_SYNC_KEY);
|
|
|
|
auto_scroll_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_AUTO_SCROLL_KEY);
|
|
|
|
count_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_COUNT_CB_KEY);
|
|
|
|
count_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_COUNT_SB_KEY);
|
|
|
|
filesize_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILESIZE_CB_KEY);
|
|
|
|
filesize_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILESIZE_SB_KEY);
|
|
|
|
filesize_lb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_FILESIZE_LB_KEY);
|
|
|
|
duration_cb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_DURATION_CB_KEY);
|
|
|
|
duration_sb = (GtkWidget *) OBJECT_GET_DATA(parent_w, E_CAP_DURATION_SB_KEY);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
|
|
|
/* The snapshot length spinbox is sensitive iff the "Limit each packet
|
|
|
|
to" checkbox is on. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(snap_sb),
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(snap_cb)));
|
2001-12-04 09:46:01 +00:00
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sync_cb))) {
|
|
|
|
/* "Update list of packets in real time" captures enabled; we don't
|
|
|
|
support ring buffer mode for those captures, so turn ring buffer
|
|
|
|
mode off if it's on, and make its toggle button, and the spin
|
|
|
|
button for the number of ring buffer files (and the spin button's
|
|
|
|
label), insensitive. */
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ringbuffer_on_tb))) {
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ringbuffer_on_tb), FALSE);
|
|
|
|
}
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_on_tb), FALSE);
|
2001-12-04 08:26:00 +00:00
|
|
|
|
2001-12-04 09:46:01 +00:00
|
|
|
/* Auto-scroll mode is meaningful only in "Update list of packets
|
|
|
|
in real time" captures, so make its toggle button sensitive. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(auto_scroll_cb), TRUE);
|
|
|
|
} else {
|
|
|
|
/* "Update list of packets in real time" captures disabled; that
|
|
|
|
means ring buffer mode is OK, so make its toggle button
|
|
|
|
sensitive. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_on_tb), TRUE);
|
|
|
|
|
|
|
|
/* Auto-scroll mode is meaningful only in "Update list of packets
|
|
|
|
in real time" captures, so make its toggle button insensitive. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(auto_scroll_cb), FALSE);
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-04 09:46:01 +00:00
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ringbuffer_on_tb))) {
|
|
|
|
/* Ring buffer mode enabled. Make the spin button for the number
|
|
|
|
of ring buffer files, and its label, sensitive. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_nbf_lb), TRUE);
|
2001-12-04 08:26:00 +00:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_nbf_sb), TRUE);
|
2003-05-15 13:40:20 +00:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ring_duration_cb), TRUE);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
|
|
|
/* Also, indicate that the file size is a size at which to switch
|
|
|
|
ring buffer files, not a size at which to stop the capture,
|
|
|
|
turn its button on. */
|
|
|
|
gtk_label_set_text(GTK_LABEL(GTK_BIN(filesize_cb)->child),
|
|
|
|
"Rotate capture file every");
|
|
|
|
gtk_label_set_text(GTK_LABEL(filesize_lb), "kilobyte(s)");
|
|
|
|
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(filesize_cb), TRUE);
|
2001-12-04 08:26:00 +00:00
|
|
|
} else {
|
2001-12-04 09:46:01 +00:00
|
|
|
/* Ring buffer mode disabled. Make the spin button for the number
|
|
|
|
of ring buffer files, and its label insensitive. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_nbf_lb), FALSE);
|
2001-12-04 08:26:00 +00:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ringbuffer_nbf_sb), FALSE);
|
2003-05-15 13:40:20 +00:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ring_duration_cb), FALSE);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
|
|
|
/* Also, indicate that the file size is a size at which to stop the
|
|
|
|
capture, not a size at which to switch ring buffer files. */
|
|
|
|
gtk_label_set_text(GTK_LABEL(GTK_BIN(filesize_cb)->child),
|
|
|
|
"Stop capture after");
|
|
|
|
gtk_label_set_text(GTK_LABEL(filesize_lb), "kilobyte(s) captured");
|
2001-12-04 08:26:00 +00:00
|
|
|
}
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
|
|
|
|
/* The maximum packet count spinbox is sensitive iff the "Stop capture
|
|
|
|
after N packets captured" checkbox is on. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(count_sb),
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(count_cb)));
|
|
|
|
|
|
|
|
/* The maximum file size spinbox is sensitive iff the "Stop capture
|
|
|
|
after N kilobytes captured" checkbox is on. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(filesize_sb),
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filesize_cb)));
|
|
|
|
|
|
|
|
/* The capture duration spinbox is sensitive iff the "Stop capture
|
|
|
|
after N seconds" checkbox is on. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(duration_sb),
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(duration_cb)));
|
2003-05-15 13:40:20 +00:00
|
|
|
|
|
|
|
/* The ring duration spinbox is sensitive if the "Rotate capture file
|
|
|
|
after N seconds" checkbox is on. */
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(ring_duration_sb),
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ring_duration_cb)));
|
|
|
|
|
2001-12-04 08:26:00 +00:00
|
|
|
}
|
|
|
|
|
1999-10-02 19:33:14 +00:00
|
|
|
#endif /* HAVE_LIBPCAP */
|