Well, I don't *think* much changed between those versions.
I'm not one of the developers, just (a PITA) another user with some
programming skills. I came to the party late, found a bunch of things that
I didn't like or don't work and started sending Luca patches. But honestly,
I've mostly looked at the display logic.
If you want to look, I've put it through RedHat's source navigator... (all
line#s are approximate, as I don't know exactly which version is on my
Windows machine)
the -S option is set in main.c:
case 'S':
/*
Persitent storage only for 'local' machines
Courtesy of Joel Crisp <[EMAIL PROTECTED]>
0 = no storage
1 = store all hosts
2 = store only local hosts
*/
usePersistentStorage = atoi(optarg);
if((usePersistentStorage > 2)
|| (usePersistentStorage < 0)){
printf("FATAL ERROR: -S flag accepts value in the 0-2 range.\n");
exit(-1);
}
break;
The only references to it are in hash.c and pbuf.c:
hash.c ~ 935 (in freeHostSessions(hostIdx, theDevice);)
if(usePersistentStorage != 0) {
if((!broadcastHost(host))
&& ((usePersistentStorage == 1)
|| subnetPseudoLocalHost(host)
/*
Courtesy of
Joel Crisp <[EMAIL PROTECTED]>
*/
))
storeHostTrafficInstance(host);
}
Where storeHostTrafficInstance() is in util.c at 1846.
pbuf.c ~ 238
if(firstEmptySlot != NO_PEER) {
/* New table entry */
int len;
if(usePersistentStorage) {
if((hostIpAddress == NULL) || (isLocalAddress(hostIpAddress)))
el = resurrectHostTrafficInstance(etheraddr_string(ether_addr));
else
el = resurrectHostTrafficInstance(_intoa(*hostIpAddress, buf,
sizeof(buf)));
} else
el = NULL;
if(el == NULL) {
el = (HostTraffic*)malloc(sizeof(HostTraffic));
memset(el, 0, sizeof(HostTraffic));
el->firstSeen=actTime;
}
resurrectHostTrafficInstance is in util.c at 1938 and is the inverse of the
store routine.
I *think* that your problem is because the reload is in getHostInfo(), where
it's checking the hash for the host. If I'm reading it right, that would
only be run if ANOTHER packet to/from that host was seen. So instead of
getting all the data reloaded, you only get back information for hosts you
continue to see. Looking at invokation of freeHostSessions, I *think*
that's semi deliberate. The info is saved off when the information about
that host would otherwise be aged off.
*****What I don't see is an invoke during shutdown******
In initialize.c, it's done during resetStats:
void resetStats(void) {
...
/* Do not reset the first entry (broadcastEntry) */
for(i=0; i<interfacesToCreate; i++) {
u_int j;
for(j=1; j<device[i].actualHashSize; j++)
if(device[i].hash_hostTraffic[j] != NULL) {
freeHostInfo(i, j, 1);
device[i].hash_hostTraffic[j] = NULL;
}
...
pbuf.c invokes it when the hash table is full
If I'm right, you won't see any saved data unless you overflow the hash
table and it can't grow further. The fix? Basicaly you would need to copy
the code from resetStats into cleanup in main.c (starts at 833).
You could test my theory by resetting statistics just before you shut down
and seeing if *that* preserves them across startups...
-----Burton
-----Original Message-----
From: Darryl [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 30, 2001 3:02 PM
To: [EMAIL PROTECTED]
Subject: RE: [Ntop] Problems option -S
Thanks for the prompt reply. I am using Ver. 2.0 complied download on the
20dec2001.
I will download the latest and try it as well
Thanks
Darryl
-----Original Message-----
From: Burton M. Strauss III [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 30 December 2001 11:45
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [Ntop] Problems option -S
Which version of NTop?
v2 has just (27Dec2001) been released and there has been very limited
support for the old (v1.3) release for a while now. If you are running 1.3,
please try it with 2.0
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Darryl
Sent: Sunday, December 30, 2001 4:52 AM
To: [EMAIL PROTECTED]
Subject: [Ntop] Problems option -S
Hi
Firstly I would thank the developers for a wonderful product and I am sure
it will only get better.
I am a relative newbies to this sort of thing.
My question is with the -S 2 option will the data be stored and reloaded
after ntop crashes? For some reason when I use this option and ntop stops
when I reload ntop it does not display the previous data even though the
hostsInfo.db file has a current time and data stamp. Am I doing something
wrong? How often does the -S option save the data and can the time frame be
set?
I am running redhat 7.1 on a Pentium III 450, 128meg ram, the network
consists of 12 pc's of various operating systems.
Any help/comments is greatly appreciated
Thanks
Darryl
>From a very smoky Sydney Australia.
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listmanager.unipi.it/mailman/listinfo/ntop
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listmanager.unipi.it/mailman/listinfo/ntop