Update of /export/home/ntop/ntop
In directory unknown:/tmp/cvs-serv5285
Modified Files:
config.h.in configure configure.in globals-core.h
globals-structtypes.h http.c main.c Makefile.am Makefile.in
ntop.8 prefs.c util.c webInterface.c
Added Files:
utildl.c
Log Message:
Add --instance option (unix only)
Provide support for running multiple instances of different ntop versions.
You've always been able to run multiple instances of the same ntop by specifying
different -P values.
And you have always been able to run different ntop versions using
LD_LIBRARY_PATH:
# export
LD_LIBRARY_PATH="/devel/lib/ntop/:/devel/lib/ntop/plugins/:/devel/lib/plugins/"
# /devel/bin/ntop ...options...
BUT, you could never tell them apart.
The --instance=name parameter lets you add an "Instance; name" to the top right
of the
ntop web pages and in the configuration report (About | Show Configuration).
As it says in man ntop, if you want to make the tag more obvious, create a
.instance
class in style.css, e.g.:
.instance {
color: #666666;
font-size: 18pt;
}
We also log - if possible to determine - what library the ntop executable is
run from,
in this message:
NOTE: ntop is running from 'xxxxx'
or
NOTE: Unable to establish where ntop is running from
Doing this requires a bit of trickery... so the call to dladdr is controlled by
#ifdef
and isolated in a separate .c file, utildl.c.
Why? Well... dladdr isn't 'standard c'.
According to FreeBSD, "The dladdr() function first appeared in the Solaris
operating
system". And, "This implementation is bug-compatible with the Solaris
implementation." -
not precisely comforting.
Under Linux, it's a gcc extension and requires expanding dlfcn.h with the
#define __USE_GNU
option. BUT: We already expand dlfcn.h for util.c without that option!
While under Linux __USE_GNU globally doesn't seem to cause any problems, other
OSes
might do things differently, so I've isolated it into a separate program w/o
referencing
ntop.h.
If this causes problems for any OS, it's easy to change the #ifndef WIN32 to an
#if !defined(WIN32) && ....
If the dladdr() routine can't be found/expanded, then the HAVE_ flag isn't set
and the
routine returns NULL and is ignored.
-----Burton (ref 549)
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev