Ethereal-dev: Re: [Ethereal-dev] Location of data file?

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 14 Mar 2001 14:00:44 -0800 (PST)
> Is there a standard directory(s) for a data file that my dissector uses
> during initialization?

"Uses" in what sense?

You mean some file containing information that the dissector reads
during initialization to, for example, set up tables that it uses when
dissecting protocols (such as names for protocol options, etc.)?

If so, then the file should be handled like the "manuf" file.  If you
have a version that would come with the Ethereal source, it'd go into
the top-level source directory for Ethereal, and you'd add the name of
your file to the "sysconf_DATA" and "EXTRA_DIST" macros in the top-level
"Makefile.am".

This would cause "make install" to install it in the appropriate
directory; if Ethereal is being installed in "/usr/local", it'd be in
"/usr/local/etc".

Your dissector should look for the file in the "DATAFILE_DIR" directory;
"DATAFILE_DIR" is defined by "config.h" to be the pathname of the
directory in which the configuration files appear.  See, for example,
"epan/resolv.c", which is what reads the "manuf" file.

> I will want to have one place where the data file
> can be released/frozen with ethereal and another place outside the
> ethereal tree where I can put an alternate data file (I am currently
> putting this second one at (/usr/local/etc/).

What do you mean by an "alternate" data file?  That'd be the *only* data
file.  If you want alternate data files on a per-user basis, you should
have your dissector first try to read the configuration file from the
".ethereal" directory in the user's home directory and, if that file
doesn't exist, try to read the one in the DATAFILE_DIR directory.