1998-09-25 23:24:07 +00:00
|
|
|
/* prefs.h
|
|
|
|
* Definitions for preference handling routines
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-25 23:24:07 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-25 23:24:07 +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
|
|
|
*
|
1998-09-25 23:24:07 +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
|
|
|
*
|
1998-09-25 23:24:07 +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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1998-09-25 23:24:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PREFS_H__
|
|
|
|
#define __PREFS_H__
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2000-11-21 23:54:10 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "color.h"
|
|
|
|
|
2011-06-05 22:39:23 +00:00
|
|
|
#include <epan/params.h>
|
2004-10-14 23:45:09 +00:00
|
|
|
#include <epan/range.h>
|
2013-07-25 23:49:47 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2004-10-14 23:45:09 +00:00
|
|
|
|
1998-10-28 21:38:11 +00:00
|
|
|
#define PR_DEST_CMD 0
|
|
|
|
#define PR_DEST_FILE 1
|
|
|
|
|
2001-12-31 04:41:50 +00:00
|
|
|
#define DEF_WIDTH 750
|
|
|
|
#define DEF_HEIGHT 550
|
|
|
|
|
2003-09-08 21:44:42 +00:00
|
|
|
#define MAX_VAL_LEN 1024
|
|
|
|
|
2008-01-16 07:36:34 +00:00
|
|
|
#define RTP_PLAYER_DEFAULT_VISIBLE 4
|
2008-04-21 10:57:32 +00:00
|
|
|
#define TAP_UPDATE_DEFAULT_INTERVAL 3000
|
2014-08-15 17:54:01 +00:00
|
|
|
#define ST_DEF_BURSTRES 5
|
2013-11-29 22:47:59 +00:00
|
|
|
#define ST_DEF_BURSTLEN 100
|
2014-08-15 17:54:01 +00:00
|
|
|
#define ST_MAX_BURSTRES 600000 /* somewhat arbirary limit of 10 minutes */
|
|
|
|
#define ST_MAX_BURSTBUCKETS 100 /* somewhat arbirary limit - more buckets degrade performance */
|
2008-01-16 07:36:34 +00:00
|
|
|
|
2013-12-03 22:16:49 +00:00
|
|
|
struct epan_uat;
|
2013-12-21 17:24:19 +00:00
|
|
|
struct _e_addr_resolve;
|
2013-12-03 22:16:49 +00:00
|
|
|
|
2001-05-31 08:36:46 +00:00
|
|
|
/*
|
|
|
|
* Convert a string listing name resolution types to a bitmask of
|
|
|
|
* those types.
|
|
|
|
*
|
|
|
|
* Set "*name_resolve" to the bitmask, and return '\0', on success;
|
|
|
|
* return the bad character in the string on error.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-12-21 17:24:19 +00:00
|
|
|
char string_to_name_resolve(const char *string, struct _e_addr_resolve *name_resolve);
|
2001-05-31 08:36:46 +00:00
|
|
|
|
2003-10-14 23:20:17 +00:00
|
|
|
/*
|
|
|
|
* Modes for the starting directory in File Open dialogs.
|
|
|
|
*/
|
2014-08-15 17:54:01 +00:00
|
|
|
#define FO_STYLE_LAST_OPENED 0 /* start in last directory we looked at */
|
|
|
|
#define FO_STYLE_SPECIFIED 1 /* start in specified directory */
|
2003-10-14 23:20:17 +00:00
|
|
|
|
2003-10-16 21:19:12 +00:00
|
|
|
/*
|
|
|
|
* Toolbar styles.
|
|
|
|
*/
|
2014-08-15 17:54:01 +00:00
|
|
|
#define TB_STYLE_ICONS 0
|
|
|
|
#define TB_STYLE_TEXT 1
|
|
|
|
#define TB_STYLE_BOTH 2
|
2003-10-16 21:19:12 +00:00
|
|
|
|
2004-04-30 00:40:45 +00:00
|
|
|
/*
|
|
|
|
* Types of layout of summary/details/hex panes.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
layout_unused, /* entry currently unused */
|
|
|
|
layout_type_5,
|
|
|
|
layout_type_2,
|
|
|
|
layout_type_1,
|
|
|
|
layout_type_4,
|
|
|
|
layout_type_3,
|
2004-05-05 07:31:05 +00:00
|
|
|
layout_type_6,
|
|
|
|
layout_type_max
|
2004-04-30 00:40:45 +00:00
|
|
|
} layout_type_e;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Types of pane.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
layout_pane_content_none,
|
|
|
|
layout_pane_content_plist,
|
|
|
|
layout_pane_content_pdetails,
|
|
|
|
layout_pane_content_pbytes
|
|
|
|
} layout_pane_content_e;
|
|
|
|
|
2004-05-13 15:28:02 +00:00
|
|
|
/*
|
|
|
|
* open console behaviour (win32 only)
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
console_open_never,
|
|
|
|
console_open_auto,
|
2004-05-13 16:34:29 +00:00
|
|
|
console_open_always
|
2004-05-13 15:28:02 +00:00
|
|
|
} console_open_e;
|
|
|
|
|
2012-07-31 07:27:39 +00:00
|
|
|
/*
|
|
|
|
* Places version information will show up
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
version_welcome_only,
|
|
|
|
version_title_only,
|
|
|
|
version_both,
|
|
|
|
version_neither
|
|
|
|
} version_info_e;
|
|
|
|
|
2013-01-18 00:50:14 +00:00
|
|
|
typedef enum {
|
|
|
|
pref_default,
|
|
|
|
pref_stashed,
|
|
|
|
pref_current
|
|
|
|
} pref_source_t;
|
|
|
|
|
2014-02-25 20:42:35 +00:00
|
|
|
/*
|
2013-02-19 22:21:17 +00:00
|
|
|
* Update channel.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
UPDATE_CHANNEL_DEVELOPMENT,
|
|
|
|
UPDATE_CHANNEL_STABLE
|
|
|
|
} software_update_channel_e;
|
2004-04-30 00:40:45 +00:00
|
|
|
|
1998-10-28 21:38:11 +00:00
|
|
|
typedef struct _e_prefs {
|
2012-12-26 05:57:06 +00:00
|
|
|
gint pr_format;
|
|
|
|
gint pr_dest;
|
|
|
|
const gchar *pr_file;
|
|
|
|
const gchar *pr_cmd;
|
|
|
|
GList *col_list;
|
|
|
|
gint num_cols;
|
|
|
|
color_t st_client_fg, st_client_bg, st_server_fg, st_server_bg;
|
2013-06-28 03:03:36 +00:00
|
|
|
color_t gui_text_valid, gui_text_invalid, gui_text_deprecated;
|
2012-12-26 05:57:06 +00:00
|
|
|
gboolean gui_altern_colors;
|
|
|
|
gboolean gui_expert_composite_eyecandy;
|
|
|
|
gboolean filter_toolbar_show_in_statusbar;
|
|
|
|
gint gui_ptree_line_style;
|
|
|
|
gint gui_ptree_expander_style;
|
|
|
|
gboolean gui_hex_dump_highlight_style;
|
|
|
|
gint gui_toolbar_main_style;
|
2014-12-10 00:54:17 +00:00
|
|
|
gint gui_toolbar_filter_style; /* GTK only? */
|
2013-01-24 01:10:12 +00:00
|
|
|
gchar *gui_gtk2_font_name;
|
|
|
|
gchar *gui_qt_font_name;
|
2012-12-26 05:57:06 +00:00
|
|
|
color_t gui_marked_fg;
|
|
|
|
color_t gui_marked_bg;
|
|
|
|
color_t gui_ignored_fg;
|
|
|
|
color_t gui_ignored_bg;
|
|
|
|
const gchar *gui_colorized_fg;
|
|
|
|
const gchar *gui_colorized_bg;
|
|
|
|
gboolean gui_geometry_save_position;
|
|
|
|
gboolean gui_geometry_save_size;
|
|
|
|
gboolean gui_geometry_save_maximized;
|
|
|
|
gboolean gui_macosx_style;
|
2004-05-13 15:28:02 +00:00
|
|
|
console_open_e gui_console_open;
|
2012-12-26 05:57:06 +00:00
|
|
|
guint gui_recent_df_entries_max;
|
|
|
|
guint gui_recent_files_count_max;
|
|
|
|
guint gui_fileopen_style;
|
2013-09-09 16:20:45 +00:00
|
|
|
gchar *gui_fileopen_dir;
|
2012-12-26 05:57:06 +00:00
|
|
|
guint gui_fileopen_preview;
|
|
|
|
gboolean gui_ask_unsaved;
|
|
|
|
gboolean gui_find_wrap;
|
|
|
|
gboolean gui_use_pref_save;
|
|
|
|
gchar *gui_webbrowser;
|
|
|
|
gchar *gui_window_title;
|
|
|
|
const gchar *gui_start_title;
|
2012-07-31 07:27:39 +00:00
|
|
|
version_info_e gui_version_placement;
|
2012-12-26 05:57:06 +00:00
|
|
|
gboolean gui_auto_scroll_on_expand;
|
|
|
|
guint gui_auto_scroll_percentage;
|
2004-04-30 00:40:45 +00:00
|
|
|
layout_type_e gui_layout_type;
|
|
|
|
layout_pane_content_e gui_layout_content_1;
|
|
|
|
layout_pane_content_e gui_layout_content_2;
|
|
|
|
layout_pane_content_e gui_layout_content_3;
|
2012-12-26 05:57:06 +00:00
|
|
|
gint console_log_level;
|
|
|
|
gchar *capture_device;
|
|
|
|
gchar *capture_devices_linktypes;
|
|
|
|
gchar *capture_devices_descr;
|
|
|
|
gchar *capture_devices_hide;
|
|
|
|
gchar *capture_devices_monitor_mode;
|
2013-03-07 09:16:55 +00:00
|
|
|
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
|
|
|
|
gchar *capture_devices_buffersize;
|
|
|
|
#endif
|
|
|
|
gchar *capture_devices_snaplen;
|
2013-03-13 12:38:08 +00:00
|
|
|
gchar *capture_devices_pmode;
|
2014-06-04 09:03:59 +00:00
|
|
|
gchar *capture_devices_filter;
|
2012-12-26 05:57:06 +00:00
|
|
|
gboolean capture_prom_mode;
|
|
|
|
gboolean capture_pcap_ng;
|
|
|
|
gboolean capture_real_time;
|
|
|
|
gboolean capture_auto_scroll;
|
|
|
|
gboolean capture_show_info;
|
|
|
|
GList *capture_columns;
|
|
|
|
guint rtp_player_max_visible;
|
|
|
|
guint tap_update_interval;
|
|
|
|
gboolean display_hidden_proto_items;
|
2015-01-04 16:17:53 +00:00
|
|
|
gboolean display_byte_fields_with_spaces;
|
2014-08-15 17:54:01 +00:00
|
|
|
gpointer filter_expressions;/* Actually points to &head */
|
2013-02-19 22:21:17 +00:00
|
|
|
gboolean gui_update_enabled;
|
|
|
|
software_update_channel_e gui_update_channel;
|
|
|
|
gint gui_update_interval;
|
2013-07-18 04:28:36 +00:00
|
|
|
gchar *saved_at_version;
|
2014-08-15 17:54:01 +00:00
|
|
|
gboolean unknown_prefs; /* unknown or obsolete pref(s) */
|
|
|
|
gboolean unknown_colorfilters; /* unknown or obsolete color filter(s) */
|
|
|
|
guint gui_qt_language; /* Qt Translation language selection */
|
|
|
|
gboolean gui_packet_editor; /* Enable Packet Editor */
|
2013-11-29 22:47:59 +00:00
|
|
|
gboolean st_enable_burstinfo;
|
|
|
|
gboolean st_burst_showcount;
|
|
|
|
gint st_burst_resolution;
|
|
|
|
gint st_burst_windowlen;
|
|
|
|
gboolean st_sort_casesensitve;
|
|
|
|
gboolean st_sort_rng_fixorder;
|
|
|
|
gboolean st_sort_rng_nameonly;
|
|
|
|
gint st_sort_defcolflag;
|
|
|
|
gboolean st_sort_defdescending;
|
|
|
|
gboolean st_sort_showfullname;
|
1998-10-28 21:38:11 +00:00
|
|
|
} e_prefs;
|
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC e_prefs prefs;
|
1999-07-23 08:29:24 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Routines to let modules that have preference settings register
|
|
|
|
* themselves by name, and to let them register preference settings
|
|
|
|
* by name.
|
|
|
|
*/
|
|
|
|
struct pref_module;
|
|
|
|
|
2012-08-08 12:28:26 +00:00
|
|
|
struct pref_custom_cbs;
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
typedef struct pref_module module_t;
|
|
|
|
|
2007-11-30 09:22:01 +00:00
|
|
|
/** Sets up memory used by proto routines. Called at program startup */
|
2013-03-01 23:53:11 +00:00
|
|
|
void prefs_init(void);
|
2007-11-30 09:22:01 +00:00
|
|
|
|
2008-01-14 16:40:23 +00:00
|
|
|
/** Reset preferences to default values. Called at profile change */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_reset(void);
|
2008-01-14 16:40:23 +00:00
|
|
|
|
2007-11-30 09:22:01 +00:00
|
|
|
/** Frees memory used by proto routines. Called at program shutdown */
|
2013-03-01 23:53:11 +00:00
|
|
|
void prefs_cleanup(void);
|
2007-11-30 09:22:01 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register a module that will have preferences.
|
2002-12-20 01:48:57 +00:00
|
|
|
* Specify the module under which to register it or NULL to register it
|
|
|
|
* at the top level, the name used for the module in the preferences file,
|
2012-08-08 12:13:24 +00:00
|
|
|
* the title used in the tab for it in a preferences dialog box, a
|
|
|
|
* routine to call back when we apply the preferences, and if it should
|
|
|
|
* use the GUI controls provided by the preferences or it has its own.
|
2002-12-20 01:48:57 +00:00
|
|
|
*
|
|
|
|
* This should not be used for dissector preferences;
|
|
|
|
* "prefs_register_protocol()" should be used for that, so that the
|
|
|
|
* preferences go under the "Protocols" subtree, and so that the
|
|
|
|
* name is the protocol name specified at the "proto_register_protocol()"
|
|
|
|
* call so that the "Protocol Properties..." menu item works.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
module_t *prefs_register_module(module_t *parent, const char *name,
|
2012-08-08 12:13:24 +00:00
|
|
|
const char *title, const char *description, void (*apply_cb)(void),
|
|
|
|
const gboolean use_gui);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2002-12-20 01:48:57 +00:00
|
|
|
/*
|
|
|
|
* Register a subtree that will have modules under it.
|
|
|
|
* Specify the module under which to register it or NULL to register it
|
|
|
|
* at the top level and the title used in the tab for it in a preferences
|
|
|
|
* dialog box.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
module_t *prefs_register_subtree(module_t *parent, const char *title,
|
2012-08-08 12:13:24 +00:00
|
|
|
const char *description, void (*apply_cb)(void));
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2001-01-03 07:53:48 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol has preferences.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC module_t *prefs_register_protocol(int id, void (*apply_cb)(void));
|
2001-01-03 07:53:48 +00:00
|
|
|
|
2012-07-07 08:15:41 +00:00
|
|
|
/*
|
|
|
|
* Register that a statistical tap has preferences.
|
|
|
|
*
|
|
|
|
* "name" is a name for the tap to use on the command line with "-o"
|
|
|
|
* and in preference files.
|
|
|
|
*
|
|
|
|
* "title" is a short human-readable name for the tap.
|
|
|
|
*
|
|
|
|
* "description" is a longer human-readable description of the tap.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC module_t *prefs_register_stat(const char *name, const char *title,
|
2014-08-15 17:54:01 +00:00
|
|
|
const char *description, void (*apply_cb)(void));
|
2012-07-07 08:15:41 +00:00
|
|
|
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol has preferences and group it under a single
|
2008-10-06 22:49:01 +00:00
|
|
|
* subtree
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
*/
|
|
|
|
#define PREFERENCE_GROUPING
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC module_t *prefs_register_protocol_subtree(const char *subtree, int id,
|
2014-08-15 17:54:01 +00:00
|
|
|
void (*apply_cb)(void));
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
|
2002-05-11 18:58:02 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol used to have preferences but no longer does,
|
|
|
|
* by creating an "obsolete" module for it.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
module_t *prefs_register_protocol_obsolete(int id);
|
2002-05-11 18:58:02 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
2002-12-20 01:48:57 +00:00
|
|
|
* Callback function for module list scanners.
|
|
|
|
*/
|
2004-10-12 03:13:17 +00:00
|
|
|
typedef guint (*module_cb)(module_t *module, gpointer user_data);
|
2002-12-20 01:48:57 +00:00
|
|
|
|
|
|
|
/*
|
2007-11-29 07:52:52 +00:00
|
|
|
* Returns TRUE if module has any submodules
|
2002-12-20 01:48:57 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean prefs_module_has_submodules(module_t *module);
|
2002-12-20 01:48:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each module
|
|
|
|
* in the list of all modules. (This list does not include subtrees.)
|
|
|
|
*
|
2002-05-11 18:58:02 +00:00
|
|
|
* Ignores "obsolete" modules; their sole purpose is to allow old
|
|
|
|
* preferences for dissectors that no longer have preferences to be
|
|
|
|
* silently ignored in preference files.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC guint prefs_modules_foreach(module_cb callback, gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2007-11-29 07:52:52 +00:00
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each submodule
|
|
|
|
* of specified modules. If the module is NULL, goes through the top-level
|
|
|
|
* list in the display tree of modules.
|
|
|
|
*
|
|
|
|
* Ignores "obsolete" modules; their sole purpose is to allow old
|
|
|
|
* preferences for dissectors that no longer have preferences to be
|
|
|
|
* silently ignored in preference files. Does not ignore subtrees,
|
|
|
|
* as this can be used when walking the display tree of modules.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC guint prefs_modules_foreach_submodules(module_t *module, module_cb callback, gpointer user_data);
|
2007-11-29 07:52:52 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
2000-07-09 03:29:42 +00:00
|
|
|
* Call the "apply" callback function for each module if any of its
|
|
|
|
* preferences have changed, and then clear the flag saying its
|
|
|
|
* preferences have changed, as the module has been notified of that
|
|
|
|
* fact.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_apply_all(void);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2006-10-11 00:37:29 +00:00
|
|
|
/*
|
|
|
|
* Call the "apply" callback function for a specific module if any of
|
|
|
|
* its preferences have changed, and then clear the flag saying its
|
|
|
|
* preferences have changed, as the module has been notified of that
|
|
|
|
* fact.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_apply(module_t *module);
|
2006-10-11 00:37:29 +00:00
|
|
|
|
2006-11-17 01:24:03 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
struct preference;
|
|
|
|
|
|
|
|
typedef struct preference pref_t;
|
|
|
|
|
2000-08-15 20:46:17 +00:00
|
|
|
/*
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
* Returns TRUE if the given protocol has registered preferences.
|
2000-08-15 20:46:17 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean prefs_is_registered_protocol(const char *name);
|
2000-08-15 20:46:17 +00:00
|
|
|
|
|
|
|
/*
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
* Returns the module title of a registered protocol (or NULL if unknown).
|
2000-08-15 20:46:17 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const char *prefs_get_title_by_name(const char *name);
|
2000-08-15 20:46:17 +00:00
|
|
|
|
2006-11-17 01:24:03 +00:00
|
|
|
/** Given a module name, return a pointer to its pref_module struct,
|
|
|
|
* or NULL if it's not found.
|
|
|
|
*
|
|
|
|
* @param name The preference module name. Usually the same as the protocol
|
|
|
|
* name, e.g. "tcp".
|
|
|
|
* @return A pointer to the corresponding preference module, or NULL if it
|
|
|
|
* wasn't found.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC module_t *prefs_find_module(const char *name);
|
2006-11-17 01:24:03 +00:00
|
|
|
|
2010-10-29 22:09:31 +00:00
|
|
|
/** Given a module name, and a preference name return a pointer to the given
|
2009-01-06 14:34:18 +00:00
|
|
|
* module's given preference or NULL if it's not found.
|
|
|
|
*
|
|
|
|
* @param module The preference module name. Usually the same as the protocol
|
|
|
|
* name, e.g. "tcp".
|
|
|
|
* @param pref The preference name, e.g. "desegment".
|
|
|
|
* @return A pointer to the corresponding preference, or NULL if it
|
|
|
|
* wasn't found.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC pref_t *prefs_find_preference(module_t * module, const char *pref);
|
2009-01-06 14:34:18 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with an unsigned integral value.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_uint_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, guint base, guint *var);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with an Boolean value.
|
2008-03-05 20:44:02 +00:00
|
|
|
* Note that the name must be in lowercase letters only (underscore allowed).
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_bool_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, gboolean *var);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with an enumerated value.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_enum_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, gint *var,
|
2000-11-18 21:41:40 +00:00
|
|
|
const enum_val_t *enumvals, gboolean radio_buttons);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with a character-string value.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_string_preference(module_t *module, const char *name,
|
2005-07-23 11:41:25 +00:00
|
|
|
const char *title, const char *description, const char **var);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2012-06-13 01:13:12 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with a file name (string) value.
|
|
|
|
* File name preferences are basically like string preferences
|
|
|
|
* except that the GUI gives the user the ability to browse for the
|
|
|
|
* file.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_filename_preference(module_t *module, const char *name,
|
2012-06-13 01:13:12 +00:00
|
|
|
const char *title, const char *description, const char **var);
|
|
|
|
|
2013-02-08 18:07:34 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with a directory name (string) value.
|
|
|
|
* Directory name preferences are basically like string preferences
|
|
|
|
* except that the GUI gives the user the ability to browse for a
|
|
|
|
* directory.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_directory_preference(module_t *module, const char *name,
|
2013-02-08 18:07:34 +00:00
|
|
|
const char *title, const char *description, const char **var);
|
|
|
|
|
2004-10-14 23:45:09 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with a ranged value.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_range_preference(module_t *module, const char *name,
|
2004-10-16 23:32:24 +00:00
|
|
|
const char *title, const char *description, range_t **var,
|
2004-10-14 23:45:09 +00:00
|
|
|
guint32 max_value);
|
|
|
|
|
2006-12-05 00:43:00 +00:00
|
|
|
/*
|
|
|
|
* Register a static text 'preference'. It can be used to add some info/explanation.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_static_text_preference(module_t *module, const char *name,
|
2006-12-05 00:43:00 +00:00
|
|
|
const char *title, const char *description);
|
|
|
|
|
2007-02-03 14:25:02 +00:00
|
|
|
/*
|
|
|
|
* Register a uat 'preference'. It adds a button that opens the uat's window in the
|
|
|
|
* preferences tab of the module.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_uat_preference(module_t *module,
|
2014-08-15 17:54:01 +00:00
|
|
|
const char *name, const char* title, const char *description, struct epan_uat* uat);
|
2007-02-03 14:25:02 +00:00
|
|
|
|
2013-12-09 10:07:33 +00:00
|
|
|
/*
|
|
|
|
* Register a uat 'preference' for QT only. It adds a button that opens the uat's window in the
|
|
|
|
* preferences tab of the module.
|
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC void prefs_register_uat_preference_qt(module_t *module,
|
2014-08-15 17:54:01 +00:00
|
|
|
const char *name, const char* title, const char *description, struct epan_uat* uat);
|
2013-12-09 10:07:33 +00:00
|
|
|
|
|
|
|
|
2012-08-08 12:13:24 +00:00
|
|
|
/*
|
|
|
|
* Register a color preference. Currently does not have any "GUI Dialog" support
|
2014-02-25 20:42:35 +00:00
|
|
|
* so the color data needs to be managed independently. Currently used by the
|
|
|
|
* "GUI preferences" to aid in reading/writing the preferences file, but the
|
2012-08-08 12:13:24 +00:00
|
|
|
* "data" is still managed by the specific "GUI preferences" dialog.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
void prefs_register_color_preference(module_t *module, const char *name,
|
2012-08-08 12:13:24 +00:00
|
|
|
const char *title, const char *description, color_t *color);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a custom preference. Currently does not have any "GUI Dialog" support
|
2014-02-25 20:42:35 +00:00
|
|
|
* so data needs to be managed independently. Currently used by the
|
|
|
|
* "GUI preferences" to aid in reading/writing the preferences file, but the
|
2012-08-08 12:13:24 +00:00
|
|
|
* "data" is still managed by the specific "GUI preferences" dialog.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
void prefs_register_custom_preference(module_t *module, const char *name,
|
2012-08-08 12:13:24 +00:00
|
|
|
const char *title, const char *description, struct pref_custom_cbs* custom_cbs,
|
|
|
|
void** custom_data);
|
|
|
|
|
Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences
file, so that we don't spam the user with error messages caused by them
having saved preferences in an earlier release that contained those
preferences.
Make the Diameter and iSCSI dissectors register obsolete preferences.
Crash if some code tries to register a preferences module with a name
that contains something other than lower-case ASCII letters, numbers, or
underscores, or that has already been registered, or if some code tries
to register a preference with a name that contains something other than
lower-case ASCII letters, numbers, underscores, or periods, or that has
already been registered, so that we don't put code like that in a
release and have to shovel code into "prefs.c" to fix it up later. (The
problem with multiple modules or preferences with the same name should
be obvious; the problem with names with blanks, or upper-case letters,
or punctuation, is that they're a pain to type on the command line.)
svn path=/trunk/; revision=4148
2001-11-04 02:50:21 +00:00
|
|
|
/*
|
|
|
|
* Register a preference that used to be supported but no longer is.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_obsolete_preference(module_t *module,
|
Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences
file, so that we don't spam the user with error messages caused by them
having saved preferences in an earlier release that contained those
preferences.
Make the Diameter and iSCSI dissectors register obsolete preferences.
Crash if some code tries to register a preferences module with a name
that contains something other than lower-case ASCII letters, numbers, or
underscores, or that has already been registered, or if some code tries
to register a preference with a name that contains something other than
lower-case ASCII letters, numbers, underscores, or periods, or that has
already been registered, so that we don't put code like that in a
release and have to shovel code into "prefs.c" to fix it up later. (The
problem with multiple modules or preferences with the same name should
be obvious; the problem with names with blanks, or upper-case letters,
or punctuation, is that they're a pain to type on the command line.)
svn path=/trunk/; revision=4148
2001-11-04 02:50:21 +00:00
|
|
|
const char *name);
|
|
|
|
|
2011-04-26 21:59:11 +00:00
|
|
|
|
2003-10-02 21:06:11 +00:00
|
|
|
typedef guint (*pref_cb)(pref_t *pref, gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each preference
|
|
|
|
* in a given module.
|
2003-10-02 21:06:11 +00:00
|
|
|
*
|
|
|
|
* If any of the callbacks return a non-zero value, stop and return that
|
|
|
|
* value, otherwise return 0.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC guint prefs_pref_foreach(module_t *module, pref_cb callback,
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2008-04-12 19:37:05 +00:00
|
|
|
/* Parse through a list of comma-separated, possibly quoted strings.
|
2008-10-06 22:49:01 +00:00
|
|
|
* Return a list of the string data.
|
2008-04-12 19:37:05 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC GList *prefs_get_string_list(const gchar *str);
|
2008-04-12 19:37:05 +00:00
|
|
|
|
|
|
|
/* Clear the given list of string data. */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_clear_string_list(GList *sl);
|
2008-04-12 19:37:05 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register all non-dissector modules' preferences.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void prefs_register_modules(void);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2013-01-05 02:30:58 +00:00
|
|
|
/** Fetch a short preference type name, e.g. "Integer".
|
|
|
|
*
|
|
|
|
* @param pref A preference.
|
|
|
|
*
|
|
|
|
* @return The preference type name. May be NULL.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-01-05 02:30:58 +00:00
|
|
|
const char *prefs_pref_type_name(pref_t *pref);
|
|
|
|
|
|
|
|
/** Fetch a long description of the preference type
|
|
|
|
*
|
|
|
|
* @param pref A preference.
|
|
|
|
*
|
|
|
|
* @return A description of the preference type including allowed
|
|
|
|
* values for enums. The description may include newlines. Must be
|
|
|
|
* g_free()d.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-01-05 02:30:58 +00:00
|
|
|
char *prefs_pref_type_description(pref_t *pref);
|
|
|
|
|
|
|
|
/** Fetch a string representation of the preference.
|
|
|
|
*
|
|
|
|
* @param pref A preference.
|
2013-04-26 18:28:21 +00:00
|
|
|
* @param source Which value of the preference to return, see pref_source_t.
|
2013-01-05 02:30:58 +00:00
|
|
|
*
|
|
|
|
* @return A string representation of the preference. Must be g_free()d.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2013-01-18 00:50:14 +00:00
|
|
|
char *prefs_pref_to_str(pref_t *pref, pref_source_t source);
|
2013-01-05 02:30:58 +00:00
|
|
|
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
/* Read the preferences file, fill in "prefs", and return a pointer to it.
|
|
|
|
|
|
|
|
If we got an error (other than "it doesn't exist") trying to read
|
|
|
|
the global preferences file, stuff the errno into "*gpf_errno_return"
|
2003-08-07 00:41:28 +00:00
|
|
|
on an open error and into "*gpf_read_errno_return" on a read error,
|
|
|
|
stuff a pointer to the path of the file into "*gpf_path_return", and
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
return NULL.
|
|
|
|
|
|
|
|
If we got an error (other than "it doesn't exist") trying to read
|
|
|
|
the user's preferences file, stuff the errno into "*pf_errno_return"
|
2003-08-07 00:41:28 +00:00
|
|
|
on an open error and into "*pf_read_errno_return" on a read error,
|
|
|
|
stuff a pointer to the path of the file into "*pf_path_return", and
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
return NULL. */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC e_prefs *read_prefs(int *, int *, char **, int *, int *, char **);
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
|
|
|
|
/* Write out "prefs" to the user's preferences file, and return 0.
|
|
|
|
|
|
|
|
If we got an error, stuff a pointer to the path of the preferences file
|
|
|
|
into "*pf_path_return", and return the errno. */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int write_prefs(char **);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Given a string of the form "<pref name>:<pref value>", as might appear
|
|
|
|
* as an argument to a "-o" option, parse it and set the preference in
|
|
|
|
* question. Return an indication of whether it succeeded or failed
|
|
|
|
* in some fashion.
|
2001-07-22 21:25:11 +00:00
|
|
|
*
|
|
|
|
* XXX - should supply, for syntax errors, a detailed explanation of
|
|
|
|
* the syntax error.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2006-11-17 01:24:03 +00:00
|
|
|
typedef enum {
|
2014-08-15 17:54:01 +00:00
|
|
|
PREFS_SET_OK, /* succeeded */
|
|
|
|
PREFS_SET_SYNTAX_ERR, /* syntax error in string */
|
|
|
|
PREFS_SET_NO_SUCH_PREF, /* no such preference */
|
|
|
|
PREFS_SET_OBSOLETE /* preference used to exist but no longer does */
|
2006-11-17 01:24:03 +00:00
|
|
|
} prefs_set_pref_e;
|
2006-10-10 00:28:53 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC prefs_set_pref_e prefs_set_pref(char *prefarg);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2011-04-26 21:59:11 +00:00
|
|
|
/*
|
|
|
|
* Get or set a preference's obsolete status. These can be used to make a
|
|
|
|
* preference obsolete after startup so that we can fetch its value but
|
|
|
|
* keep it from showing up in the prefrences dialog.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
gboolean prefs_get_preference_obsolete(pref_t *pref);
|
|
|
|
prefs_set_pref_e prefs_set_preference_obsolete(pref_t *pref);
|
2011-04-26 21:59:11 +00:00
|
|
|
|
|
|
|
|
2008-01-31 16:47:05 +00:00
|
|
|
/*
|
|
|
|
* Returns TRUE if the given device is hidden
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean prefs_is_capture_device_hidden(const char *name);
|
2008-01-31 16:47:05 +00:00
|
|
|
|
2010-05-15 19:38:13 +00:00
|
|
|
/*
|
|
|
|
* Returns TRUE if the given device should capture in monitor mode by default
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean prefs_capture_device_monitor_mode(const char *name);
|
2010-05-15 19:38:13 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean prefs_capture_options_dialog_column_is_visible(const gchar *column);
|
2012-08-03 11:15:40 +00:00
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
#endif /* prefs.h */
|
2014-08-15 17:54:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|