Now we're getting somewhere... (I'm putting the patch into the cvs to fix up
the new info.html/textinfo.html code - it's compiling (test) on the other
screen)
I *think* what is eating the parameters is the install logic, and ntop is
never seeing them...
Theoretically, /c should pass the rest to ntop itself, so something like
ntop /c <parameters>
should work.
But - we also need to worry about where it gets it's parameters from running
as a service.
The key is this code in ntop_win32.c:
void runService(int argc, char ** argv)
{
DWORD dwArgc;
LPTSTR *lpszArgv;
#ifdef UNICODE
lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
#else
dwArgc = (DWORD) argc;
lpszArgv = argv;
#endif
_tprintf(TEXT("Running %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
// Do it! But since this is a console start, skip the first two
// arguments in the arg list being passed, and reduce its size by
// two also. (The first two command line args should be ignored
// in a console run.)
ServiceStart( dwArgc/*-2*/, lpszArgv/*+2*/);
Which shows it (ntop) being passed the rest of the parameter string. Now if
it's running as a service, where does it get the parameters from? I know
it's NOT from the command line - where is it? Ah ha...
// If we could guarantee that all initialization would occur in less than
one
// second, we would not have to report our status to the service control
manager.
// For good measure, we will assign SERVICE_START_PENDING to the current
service
// state and inform the service control manager through our ReportStatus
function.
if (!ReportStatus(SERVICE_START_PENDING, NO_ERROR, 3000))
goto finally;
// When we installed this service, we probably saved a list of runtime
args
// in the registry as a subkey of the key for this service. We'll try to
get
// it here...
if(0 != getStringValue(szAppParameters,(LPDWORD)&lLen, HKEY_LOCAL_MACHINE,
szParamKey, SZAPPPARAMS)){
dwNewArgc = 0;
lpszNewArgv = NULL;
}
else{
//If we have an argument string, convert it to a list of argc/argv
type...
lpszNewArgv = convertArgStringToArgList(lpszNewArgv, &dwNewArgc,
szAppParameters);
}
and
sprintf(szParamKey,"SYSTEM\\CurrentControlSet\\Services\\%s\\Parameters",SZS
ERVICENAME);
So, if you go into the registry and add your parameter string to
SYSTEM\CurrentControlSet\Services\ntop\Parameters\AppParameters
It should work...
After you confirm this, what we really need is a minimal executable to allow
you to set the right key value....
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Jac Engel
Sent: Sunday, June 09, 2002 2:27 PM
To: Burton M. Strauss III; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [Ntop-dev] RC2 Bug - Win32 build ignores options
Burton,
Command tells:
D:\Utils\ntop-2099rc2>ntop -i1
Unrecognized option: -i1
Available options:
/i [ntop options] - Install ntop as service
/c - Run ntop on a console
/r - Deinstall the service
ntop v.2.0.99rc1 MT [WinNT/2K/XP] (17/05/2002 build)
Copyright 1998-2002 by Luca Deri <[EMAIL PROTECTED]>.
Get the freshest ntop from http://www.ntop.org/
Usage: ntop [OPTION]
[-a <path> path for ntop web server access log]
[-c <sticky hosts: idle hosts are not purged from hash>]
[-e <max # table rows)]
[-f <traffic dump file (see tcpdump)>]
[-i <interface index>]
[-j (set ntop in border gateway sniffing mode)]
[-k <show kernel filter expression in extra frame>]
[-l <path> (dump packets captured on a file: debug only!)]
[-m <local addresses (see man page)>]
[-n (numeric IP addresses)]
[-p <IP protocols to monitor> (see man page)]
[-q <create file ntop-suspicious-pkts.XXX.pcap>]
[-r <refresh time (web = 120 sec)>]
[-t (trace level [0-5])]
[-s Disable promiscuous mode]
[-w <HTTP port>]
[-A <Ask for admin user password and exit]
[-B <filter expression (like tcpdump)>]
[-D <Internet domain name>]
[-F <flow specs (see man page)>]
[-M <don't merge network interfaces (see man page)>]
[-N <don't use nmap if installed>]
[-P <path for db-files>]
[-S <store mode> (store persistently host stats)]
[-U <mapper.pl URL> | "" for not displaying host location]
Jac
-----Original Message-----
From: Burton M. Strauss III [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 09, 2002 5:51 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [Ntop-dev] RC2 Bug - Win32 build ignores options
First off, you should not be using /, but rather unix style - for options.
It's possible that Windows is stripping them off or some such.
Grab the latest cvs version, and send the text version of the new
configuration report - it will show all the settings and how they're being
interpreted.
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Fran Boon
Sent: Sunday, June 09, 2002 5:13 AM
To: [EMAIL PROTECTED]
Subject: [Ntop-dev] RC2 Bug - Win32 build ignores options
I find this same thing.
I am also running Win2k Pro SP2 as the OS & compiled with MinGW
NTop runs fine with either /c or /i
However it ignores all other options passed afterwards.
Best Wishes,
Fran.
----- Original Message -----
From: "Jac Engel" <[EMAIL PROTECTED]>
To: "ntop@Unipi. IT" <[EMAIL PROTECTED]>
Sent: Sunday, June 09, 2002 9:26 AM
Subject: [Ntop] MinGW fixes for ntop-2.0.99-rc2
> Compiled with MINGW with fixes applied.
> Ntop is accepting only parameters /c /r and /i
> All other options are ignored like -i1 ( my second ethernet
> card) -w 4000 etc etc. What happened ?
> Jac
> _______________________________________________
> Ntop mailing list
> [EMAIL PROTECTED]
> http://lists.ntop.org/mailman/listinfo/ntop
>
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev