Since
I don't know beans about <problem
domain>, I don't understand what it's doing. But if you
understand <problem domain>, C
code isn't THAT hard to read at a crude
level...
So
here's how to find things in the code:
1. unpack the source
2. grep 'meaningfulname' *.[ch]
For example, if it's the
--wwn-map option, grep for wwn-map that will show
you the mapping from long -> short names. If you already know this,
start at step 3...
3. in prefs.c, find the short name, e.g.
'N':
case
'N':
pathSanityCheck(optarg, "-N | --wwn-map");
if (myGlobals.runningPref.fcNSCacheFile != NULL)
free (myGlobals.runningPref.fcNSCacheFile);
myGlobals.runningPref.fcNSCacheFile = strdup (optarg);
break;
pathSanityCheck(optarg, "-N | --wwn-map");
if (myGlobals.runningPref.fcNSCacheFile != NULL)
free (myGlobals.runningPref.fcNSCacheFile);
myGlobals.runningPref.fcNSCacheFile = strdup (optarg);
break;
That tells you the 'magic token' to look for is
myGlobals.runningPref.fcNSCacheFile
grep for that...
$ grep --line-number myGlobals.runningPref.fcNSCacheFile
*.[ch]
main.c:480: if (!myGlobals.runningPref.printIpOnly && (myGlobals.runningPref.fcNSCacheFile != NULL)) {
main.c:481: processFcNSCacheFile (myGlobals.runningPref.fcNSCacheFile);
prefs.c:483: if (myGlobals.runningPref.fcNSCacheFile != NULL)
prefs.c:484: free (myGlobals.runningPref.fcNSCacheFile);
prefs.c:485: myGlobals.runningPref.fcNSCacheFile = strdup (optarg);
main.c:480: if (!myGlobals.runningPref.printIpOnly && (myGlobals.runningPref.fcNSCacheFile != NULL)) {
main.c:481: processFcNSCacheFile (myGlobals.runningPref.fcNSCacheFile);
prefs.c:483: if (myGlobals.runningPref.fcNSCacheFile != NULL)
prefs.c:484: free (myGlobals.runningPref.fcNSCacheFile);
prefs.c:485: myGlobals.runningPref.fcNSCacheFile = strdup (optarg);
The interesting one is usually the function or something
NOT in prefs/main/ntop/admin... so:
$ grep --line-number processFcNSCacheFile
*.[ch]
fcUtils.c:501:void processFcNSCacheFile(char *filename) {
globals-core.h:720:extern void processFcNSCacheFile(char *filename);
main.c:481: processFcNSCacheFile (myGlobals.runningPref.fcNSCacheFile);
15:48:22 tigger [Linux] user=ntop pwd=~/projects/ntop/work/ntop $ vi fcUtils.c -c :501
fcUtils.c:501:void processFcNSCacheFile(char *filename) {
globals-core.h:720:extern void processFcNSCacheFile(char *filename);
main.c:481: processFcNSCacheFile (myGlobals.runningPref.fcNSCacheFile);
15:48:22 tigger [Linux] user=ntop pwd=~/projects/ntop/work/ntop $ vi fcUtils.c -c :501
4. Start reading the code in fcUtils.c beginning at
501...
-----Burton
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rueda, Astolfo (SEA)
Sent: Friday, March 18, 2005 12:54 PM
To: [email protected]
Subject: [Ntop] Format for WWN Mapper File (-N)
Does anyone know what the format for this is. I tried a few different things but none worked.
TIA
Network Administrator
Preston | Gates | Ellis LLP
925 Fourth Avenue,
Suite 2900 Seattle
WA 98104
206-623-7580
206-370-5901
Fax 206-623-7022
“If you obey to rules, you'll miss all the fun”
_______________________________________________ Ntop mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop
