aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2003-03-13From Tomas Kukosa - allow a preference name to begin with the stringguy1-2/+3
that's the name of the module, as long as the prefix doesn't end with "." or "_" (so you can register "tc.tcp.port" or "tc.tcp_port", but not "tc.tc.port" or "tc.tc_port"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7351 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-12When fixing up old preferences, check the module for the currentguy1-19/+19
preference by comparing "module->name" against the module, not by checking the first part of the preference name - the preference name might not contain the correct module name, as we've mapped some modules. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7350 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-11When registering a string preference, if the value of the preference isguy1-4/+17
NULL, convert it to a copy of a null string, otherwise replace it with a copy of the string, so that we know that the variable for the preference always points to a string that can be freed. That also obviates the need to worry about a null-pointer value for a preference variable when checking to see whether a preference has changed. When checking for a string preference not being set, check for an empty string, not a null pointer - the above code turns null pointers into pointers to empty strings, *and* the GUI code does (and always did!) the same. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7342 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-29Fix a couple of checks for families with renamed preferences.guy1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7034 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-28Panic if a preference starts with the name of the module to which itguy1-14/+94
belongs, as that's redundant. Fix a bunch of cases where that was done, and map the old name to the new name. Instead of marking "mtp3.mtp3_standard" as obsolete, map it to "mtp3.standard". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7030 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-28Get rid of the extra "pcli." in the "pcli.pcli.udp_port" preference.guy1-1/+5
Map "pcli.pcli.udp_port" to "pcli.udp_port". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7025 f5534014-38df-0310-8fa8-9805f1628bb7
2002-12-20Support putting preferences into arbitrary places in a tree, which isguy1-33/+157
used to construct the "Edit->Preferences" dialog box; this includes the ability to register a "subtree" for preferences. Instead of special-casing protocol preferences, have a subtree "Protocols" for protocol preferences. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6808 f5534014-38df-0310-8fa8-9805f1628bb7
2002-09-28Disable network name resolution by default.gerald1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6350 f5534014-38df-0310-8fa8-9805f1628bb7
2002-09-14- add a new GUI preference in the gtk2 port. It allows to useoabad1-2/+16
alternating colors in all TreeView widgets (see gtk_tree_view_set_rules_hint()). - remove unused preferences in the gtk2 port (tree_expander_style and tree_line_style). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6296 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-20/+20
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-6/+2
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-01Fix a few more memleaks found by valgrind (all derivingjmayer1-5/+7
from the get_persconffile_path mess). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5927 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-16Handle the "bool" members the same way we handled the members forguy1-5/+5
enumerated values - "boolp" for pointers, "boolval" for values. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5678 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-16From Chris Waters: don't use "bool" as a variable name or structureguy1-5/+5
member, as it's a C++ keyword. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5677 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-29From Michal Melerowicz:guy1-1/+7
Fixed TFT decoding and processing PPP payload inside of GTP protocol conf options That change also put all GTP preferences under a "gtp" heading; put in another hack so that your old "gtpv0" and "gtpv1" settings are recognized. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5588 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-25Don't give ordinal numbers to preferences that aren't displayed.guy1-3/+11
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5554 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-11Add a mechanism for registering "obsolete" preference modules, so thatguy1-4/+30
if a dissector had preferences at one point but no longer does, it can register that fact, so that the old preferences in the preference file are silently ignored. Use that mechanism in the NCP dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5446 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31From Joerg Mayer: mark function arguments as unused.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5052 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-5/+5
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-15Include <resolv.h> after "globals.h", as, at least on some platforms,guy1-2/+2
headers included by "globals.h" define MAXNAMELEN, and <resolv.h> defines it if it's not already defined. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4545 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-15Fix some preferences to eliminate the extra copy of the protocol name atguy1-1/+15
the beginning, and to use underscores rather than periods where the preference's name really isn't part of a hierarchical namespace. Use "%u" rather than "%d" to print unsigned quantities. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4543 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-13Add a preferences page for the name resolution flags.guy1-10/+11
Separate the preferences value for those flags and the name resolution code's value into separate variables; this means that the resolution code no longer depends on the preferences code, and may let us eventually have the current setting and the preference setting differ (so that a user can temporarily override the preference setting without causing subsequent saves of the preferences to save the temporary value). Add routines to create various types of widgets for preferences, and to fetch the values for "enumerated" preferences, and use them both in the code to handle hardwired preference pages and table-driven preference pages. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4536 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-10Add a preferences page for capture preferences, so that the user canguy1-5/+19
directly edit the capture preferences, rather than only being able to set them implicitly from the values for the most recent capture. Add a preferences item for the interface on which to capture. Get rid of some unused variables. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4510 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-31Add preferences to save the main window size and position. If enabled,gerald1-10/+66
the geometry is saved at exit. Should we save the main window pane sizes as well? Move the DEF_WIDTH and DEF_HEIGHT #defines from gtk/main.h to prefs.h. Remove the reference to DEF_WIDTH from proto_hier_stats_dlg.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4462 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-08From Darren New: BXXP dissector modified to be a BEEP dissector.guy1-3/+11
Handle "bxxp." preferences as "beep." preferences. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4357 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-19When reading the preferences file, if the "module.preference" stringgram1-18/+35
references an unknown module, check the "preference" part to see if another "." is found; iterate until a known module is found, or until nor more "."'s are found. Needed for the new "x.25.non_q_bit_is_sna" preference. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4225 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-09Fix a couple of comments.guy1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4187 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-08Allow periods in module names.gram1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4177 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-04Allow a dissector to register preferences that it no longer supports asguy1-3/+95
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.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4148 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-03Crash if a dissector tries to create more than one preference with theguy1-3/+17
same name; if that happens, there's no way to tell to which of them a line in a preferences file, or an option supplied with "-o", refers, so it's clearly a bug in the code. This has happened in the past, and fixing that required some preference renaming *and* code in the preferences-file-reading code to try to preserve the user's settings and not spew warnings when starting Ethereal or Tethereal; let's try to catch it *before* the code gets into the code base. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4143 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-24Have a routine that takes a file name for a personal configuration fileguy1-20/+5
and generates the path name; have it, if the file is to be opened for reading on Win32, check whether it exists and, if not, check for it in the old home directory-based configuration directory and, if so, return that path instead, so that files saved with earlier versions of Ethereal will be seen. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4072 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-23Add a new routine to create the ".ethereal" directory for a user.guy1-22/+1
Use that routine rather than duplicating that code in the routines to write out the preference file and filter files. Use it in the code for the color filter dialog, so that the directory in question is created if necessary. As that routine returns an error indication, have the code that calls that routine put up a message box if the attempt fails. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4065 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-22Add a routine to get the directory in which personal configuration filesguy1-28/+38
reside. Use it, rather than concatenating the user's home directory and ".ethereal" in a number of files. Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname separator. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4061 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-21Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in formatguy1-6/+8
strings used to generate pathnames. Move the definition of PF_DIR from <epan/epan.h> to <epan/filesystem.h>, so that files requiring only the definition of PF_DIR don't have to include <epan/epan.h>, and get rid of no-longer-necessary includes of <epan/epan.h>. Add a routine to get the directory for "system files" such as "/etc/ethers" - it's "/etc" on UNIX, and the datafile directory on Windows (as there's no "/etc" on Windows). Use that to construct the pathname of the ethers and ipxnet files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4056 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-21Keep the list of modules with preferences sorted by the module name, inguy1-2/+11
dictionary order (case-insensitive), so that they show up in order in the "Preferences" dialog box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4052 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-16The Quake3 dissector wasn't in the previous release, only users runningguy1-29/+9
CVS versions would've had "quake3.udp.port" in the preferences file; therefore, we can remove the code to map them to "quake3.udp.arena_port" and "quake3.udp.master_port". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4034 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-13The Quake III dissector called both the arena server port preference andguy1-54/+76
the master server port preference "quake3.udp.port"; rename them to "quake3.udp.arena_port" and "quake3.udp.master_port". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4023 f5534014-38df-0310-8fa8-9805f1628bb7
2001-08-21On Windows, use the directory in which the binary resides as theguy1-7/+14
directory in which global data files are stored. If an installed binary is being run, that's the correct directory for them; if a build-tree binary is being run, the "manuf" file will be there, and you can put other data files there as well, if necessary. Do the same with plugins, except that, if there's no "plugins\\{version}" subdirectory of that directory, fall back on the default installation directory, so you at least have a place where you can put plugins for use by build-tree binaries. (Should we, instead, have the Windows build procedure create a subdirectory of the "plugins" source directory, with the plugin version number as its name, and copy the plugins there, so you'd use the build-tree plugin binaries?) Move "test_for_directory()" out of "util.c" and into "epan/filesystem.c", with the other file system access portability wrappers and convenience routines. Fix "util.h" not to declare it - or other routines moved to "epan/filesystem.c" a while ago. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3858 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-23Use an unsigned character when processing string lists, so that you canguy1-2/+3
use "isspace()" on them without getting screwed by negative array subscripts. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3780 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-23Make "put_string_list()" truly take a GList of strings as arguments;guy1-55/+57
generate such a list from the list of column format information and hand the resulting list to "put_string_list()" when writing out the preference. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3779 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22Reformat to be a bit closer to the way it looked before the parserguy1-13/+12
changes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3778 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22Ignore non-quoted white space in string lists.guy1-49/+96
Backslash-escape backslashes and double quotes when writing string lists out. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3777 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22"col_format_to_pref_str()" is used only in "prefs.c", and knows aboutguy1-2/+52
the format of string lists in a preferences file; rename it to "put_string_list()", make it take the list as an argument rather than working only on "prefs.col_list", and put it in "prefs.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3776 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22Check for valid column titles (non-zero-length) and valid column formatsguy1-8/+31
in preference settings. In the process of doing that, fix a memory leak (we were handing a null pointer, rather than a pointer to the list of strings in "column.format", to "clear_string_list()"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3775 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22Don't require the strings in string lists to be quoted, just allow themguy1-50/+77
to be quoted. Correctly handle backslash-quoting in string lists. Return an error if the "get_string_list()" indicates that "column.format" string list is syntactically invalid or if it doesn't contain an even number of entries. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3773 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-18Various signed vs. unsigned fixes, from Joerg Mayer.guy1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3560 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-04Make Ethereal default to promiscuous-mode captures, the way it didguy1-6/+5
before promiscuous-vs-non-promiscuous was made a preference in the preferences file (I suspect at least some of the problems people are seeing with captures on Windows not seeing all the traffic they expect to see might be due to the captures not being done in promiscuous mode - and the default behavior shouldn't have changed in any case). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3511 f5534014-38df-0310-8fa8-9805f1628bb7
2001-05-31Support for "-N" flag enabling selected forms of name resolution, fromguy1-13/+86
Joerg Meyer. Support for saving to the preferences file the settings for all types of name resolution. Do a case-insensitive check for "true" and "false" in Boolean preference settings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3489 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-15There's no "enable name resolution in captures" preference in Ethereal,guy1-10/+20
and never was - there's only an Ethereal-wide "enable name resolution" preference. Name it just "name_resolve". Replace all tests of "g_resolving_actif" with tests of "prefs.name_resolv", and replace all code that sets "g_resolving_actif" with code that sets "prefs.name_resolv", so that the setting of "prefs.name_resolv" actually affects whether names are resolved or not. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3300 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-13Added the ethereal capture preferences to the preference file.jfoster1-1/+50
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3298 f5534014-38df-0310-8fa8-9805f1628bb7