Ethereal-dev: Re: [Ethereal-dev] [patch] save & load hostname-cache

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Ronnie Sahlberg" <ronnie_sahlberg@xxxxxxxxxxxxxx>
Date: Wed, 22 Oct 2003 20:36:08 +1000
From: "Matthijs Melchior"
Sent: Tuesday, October 21, 2003 7:56 AM
Subject: [Ethereal-dev] [patch] save & load hostname-cache


> Hi,
>     To make it easy on myself when looking at traces from networks
> without names I have created the following feature.
>
> The "Edit>Preferences>Name Resolution" dialog is extended with 2 lines,
> one to show the file name and one to "Clear", "Load" or "Save" the
> hostname-cache in a file. This allows you to preload the hostname-cache
> with names of your choise and not having to remember the IP numbers.
> And collected IP numbers [with names, if any] can be written to
> a file for adding hostnames and reloading.
>
> There may be a need to connect this to some preferences, but that
> has not yet been done.
>

Very good idea. This would be very useful.

Suggestions,  can you make sure the cache file is called  "hosts" and that
it is stored in the preference directory
as for all the other preference files.
I really think it should be called "hosts" since it is basically a hosts
file.
(I could be wrong (dont use this much myself) but I think that for things
like color filters and friends we have two files, one stored in a global
prefs directory and one local to the users home directory.)
Can you study how the colorfilter settings are stored amd make sure your
addition mimics it?

Something that I think is slightly broken right now (not related to your
patch) is that I berlive this cache is not cleared when
a new capture is loaded, the cached data remains.
Since your patch is related to this cache, could you see if you could also
take care of that so that when a new capture is started or a new
file is opened that the cache is cleared first?


Im not sure if all the controls belong in the prefs section of ethereal.
Sure,  the name resolution part of the preferences should have a button
where one can enable/disable "Use local hosts file for name resolution"
and if enabled, ethereal will preload the cache from the .../hosts file(s)

If this prefs button is enabled, I think it would be better to move the
controls to a menu?
perhaps Edit/NameResolution/Hosts/Import|Export|Save|Clear   ?
Or a better menu   Im not good at menus or usability stuff.

Import   open file load dialog to read a user specified hosts file and merge
it with the current cache content
Export   open file save dialog and write the entire cache to it   so it is
easy to distribute it to others
Save      no dialog  just write the current cache content ontop of any
existing hosts file
Clear     clear cache and clear the hosts file.


comments?