version 1.1, 2009/11/25 11:59:33
|
version 1.2, 2011/06/08 12:45:41
|
Line 0
|
Line 1
|
|
#include "global.h" |
|
#include "dumpz.h" |
|
|
|
|
|
int Verbose; |
|
|
|
|
|
int main(int argc, char **argv) |
|
{ |
|
char ch; |
|
int idxmask = 0; |
|
register int i, idx; |
|
sl_config cfg[2]; |
|
|
|
while ((ch = getopt(argc, argv, "hvid")) != -1) |
|
switch (ch) { |
|
case 'v': |
|
Verbose++; |
|
break; |
|
case 'i': // interfaces |
|
idxmask |= 1 << 0; |
|
break; |
|
case 'd': // disks |
|
idxmask |= 1 << 1; |
|
break; |
|
case 'h': |
|
default: |
|
return 1; |
|
} |
|
argc -= optind; |
|
argv += optind; |
|
|
|
for (idx = 0; 2 > idx; idx++) |
|
InitConfig(&cfg[idx]); |
|
|
|
for (i = 0x2, idx = 0; i; i >>= 1, idx++) |
|
switch (i & idxmask) { |
|
case 1: |
|
Interfaces(&cfg[0]); |
|
break; |
|
case 2: |
|
Disks(&cfg[1]); |
|
break; |
|
} |
|
|
|
for (idx = 0; 2 > idx; idx++) |
|
UnloadConfig(&cfg[idx]); |
|
return 0; |
|
} |