Ethereal-dev: Re: [Ethereal-dev] show hostname in window title - feature/patch submission

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

From: Nathan Jennings <njen@xxxxxxxxxxxx>
Date: Wed, 24 Nov 2004 10:02:52 -0500
Guy Harris wrote:
Nathan Jennings wrote:

The attached patch allows you to easily see which copy of Ethereal you're manipulating (by looking at the window title) if you have multiple Ethereal instances open on your desktop that are running on multiple machines.


If the two instances have different files open, so that the title (which shows the file name) is different in the windows, is that necessary?

Yes, I think so. :o)


I.e., should it just add the host name if it's running a capture or if it has a capture that hasn't been saved (i.e., if there's no file name)?

IMO, no. I think having the hostname in the main window title consistently, regardless of current state, is preferred. This is really a convenience option to reduce confusion and save time; so, if I can't look at the window title and quickly see which instance I'm working with, it's of limited value.

I'd rather not have to think of, or remember, which file is on which host in order to differentiate. (OK, I admit it; I'm lazy ;o) Also, as an example, I may have closed the files on all the instances on my desktop and then when I come back later... I don't know which is which again.


It doesn't handle differentiating multiple instances running on the same machine.


The file name should handle that if it has a saved file - and, otherwise, the name of the interface on which it's capturing or on which it captured, and possibly also the filter expression, might help there.

Yes, I agree here. On Unix, some window managers let you control window title numbering for multiple instances. For example:
Ethereal (1)
Ethereal (2)
Ethereal (3)

So that may help some people if they really need it. I don't know how to handle this on Windows (window handle/class name matches?), so I intentionally left this part/aspect of the feature out; thinking that someone else may improve upon it later.


The patch also adds a user preference to show the local machine's host name in full or short format.


should the choice be "fully-qualified domain name" vs. something else, e.g. "unqualified domain name"?

IMO, no. I took the lead from other apps/tools I've used that use the same terminology ("full", "short") for providing a choice. It's shorter too and fits nicely in the limited space on the line in the preferences dialog.


I tested it on FreeBSD 4.9-RELEASE only.


I suspect most, if not all, of the UN*Xes we support have "gethostname()". Winsock 2 has it, also, and we might require Winsock 2 (or WinPcap might require it), which I think causes a problem for Windows 95, but we *might* be able to bundle Microsoft's add-on Winsock 2 for W95, assuming that our installer can be made to install it only if necessary *and* Microsoft's license for the add-on doesn't get in the way (I think it predates their anti-GPL licenses).

Are you saying I should add some #if conditionals for compilation only on Unix or post Win95 Windows versions? How should we handle detecting whether or not the Win32 system is post Win95? (Sorry, I've limited Win32 experience.) Add some _WIN32 version detection code?

I was hoping the patch could at least make it in for the Unix users, i.e. I could surround the patch with "_WIN32" macros, for the next release. :o)

-Nathan