diff -dru webalizer-2.01-10/Makefile.in webalizer-2.01-10-fjo/Makefile.in --- webalizer-2.01-10/Makefile.in Tue Oct 17 06:15:53 2000 +++ webalizer-2.01-10-fjo/Makefile.in Sun Feb 15 12:19:09 2004 @@ -40,21 +40,18 @@ webalizer: webalizer.o webalizer.h hashtab.o hashtab.h \ linklist.o linklist.h preserve.o preserve.h \ - dns_resolv.o dns_resolv.h parser.o parser.h \ - output.o output.h graphs.o graphs.h lang.h \ - webalizer_lang.h - $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o ${LIBS} - rm -f webazolver - @LN_S@ webalizer webazolver + parser.o parser.h output.o output.h graphs.o \ + graphs.h lang.h webalizer_lang.h + $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o graphs.o ${LIBS} webalizer.o: webalizer.c webalizer.h parser.h output.h preserve.h \ - graphs.h dns_resolv.h webalizer_lang.h + graphs.h webalizer_lang.h $(CC) ${CFLAGS} ${DEFS} -c webalizer.c parser.o: parser.c parser.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c parser.c -hashtab.o: hashtab.c hashtab.h dns_resolv.h webalizer.h lang.h +hashtab.o: hashtab.c hashtab.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -c hashtab.c linklist.o: linklist.c linklist.h webalizer.h lang.h @@ -68,14 +65,11 @@ hashtab.h graphs.h lang.h $(CC) ${CFLAGS} ${DEFS} -c preserve.c -dns_resolv.o: dns_resolv.c dns_resolv.h lang.h webalizer.h - $(CC) ${CFLAGS} ${DEFS} -c dns_resolv.c - graphs.o: graphs.c graphs.h webalizer.h lang.h $(CC) ${CFLAGS} ${DEFS} -I${GDLIB} -c graphs.c clean: - rm -f webalizer webazolver *.o usage*.png daily*.png hourly*.png + rm -f webalizer *.o usage*.png daily*.png hourly*.png rm -f ctry*.png *.html *.hist *.current core *.gif distclean: clean @@ -87,12 +81,9 @@ $(INSTALL_PROGRAM) webalizer ${BINDIR}/webalizer $(INSTALL_DATA) webalizer.1 ${MANDIR}/webalizer.1 $(INSTALL_DATA) sample.conf ${ETCDIR}/webalizer.conf.sample - rm -f ${BINDIR}/webazolver - @LN_S@ ${BINDIR}/webalizer ${BINDIR}/webazolver uninstall: rm -f ${BINDIR}/webalizer - rm -f ${BINDIR}/webazolver rm -f ${MANDIR}/webalizer.1 rm -f ${ETCDIR}/webalizer.conf.sample rm -f webalizer_lang.h diff -dru webalizer-2.01-10/webalizer.c webalizer-2.01-10-fjo/webalizer.c --- webalizer-2.01-10/webalizer.c Wed Apr 17 00:11:31 2002 +++ webalizer-2.01-10-fjo/webalizer.c Sun Feb 15 12:18:10 2004 @@ -60,17 +60,6 @@ #define CLK_TCK _SC_CLK_TCK #endif -#ifdef USE_DNS -#include -#include - -#ifdef HAVE_DB_185_H -#include -#else -#include -#endif /* HAVE_DB_185_H */ -#endif /* USE_DNS */ - #include "webalizer.h" /* main header */ #include "output.h" #include "parser.h" @@ -79,7 +68,10 @@ #include "linklist.h" #include "webalizer_lang.h" /* lang. support */ #ifdef USE_DNS -#include "dns_resolv.h" +#include +#include +#include +#include #endif /* internal function prototypes */ @@ -136,8 +128,6 @@ char *log_fname = NULL; /* log file pointer */ char *out_dir = NULL; /* output directory */ char *blank_str = ""; /* blank string */ -char *dns_cache = NULL; /* DNS cache file name */ -int dns_children = 0; /* DNS children (0=don't do)*/ int ntop_sites = 30; /* top n sites to display */ int ntop_sitesK = 10; /* top n sites (by kbytes) */ @@ -272,7 +262,7 @@ /* get command line options */ opterr = 0; /* disable parser errors */ - while ((i=getopt(argc,argv,"a:A:c:C:dD:e:E:fF:g:GhHiI:l:Lm:M:n:N:o:pP:qQr:R:s:S:t:Tu:U:vVx:XY"))!=EOF) + while ((i=getopt(argc,argv,"a:A:c:C:de:E:fF:g:GhHiI:l:Lm:M:n:o:pP:qQr:R:s:S:t:Tu:U:vVx:XY"))!=EOF) { switch (i) { @@ -281,7 +271,6 @@ case 'c': get_config(optarg); break; /* Config file */ case 'C': ntop_ctrys=atoi(optarg); break; /* Top countries */ case 'd': debug_mode=1; break; /* Debug */ - case 'D': dns_cache=optarg; break; /* DNS Cache filename */ case 'e': ntop_entry=atoi(optarg); break; /* Top entry pages */ case 'E': ntop_exit=atoi(optarg); break; /* Top exit pages */ case 'f': fold_seq_err=1; break; /* Fold sequence errs */ @@ -299,7 +288,6 @@ case 'm': visit_timeout=atoi(optarg); break; /* Visit Timeout */ case 'M': mangle_agent=atoi(optarg); break; /* mangle user agents */ case 'n': hname=optarg; break; /* Hostname */ - case 'N': dns_children=atoi(optarg); break; /* # of DNS children */ case 'o': out_dir=optarg; break; /* Output directory */ case 'p': incremental=1; break; /* Incremental run */ case 'P': add_nlist(optarg,&page_type); break; /* page view types */ @@ -396,14 +384,6 @@ system_info.release,language); } -#ifndef USE_DNS - if (strstr(argv[0],"webazolver")!=0) - { - printf("DNS support not present, aborting...\n"); - exit(1); - } -#endif /* USE_DNS */ - /* open log file */ if (gz_log) { @@ -454,41 +434,6 @@ } } -#ifdef USE_DNS - if (strstr(argv[0],"webazolver")!=0) - { - if (!dns_children) dns_children=5; /* default dns children if needed */ - if (!dns_cache) - { - /* No cache file specified, aborting... */ - fprintf(stderr,"%s\n",msg_dns_nocf); /* Must have a cache file */ - exit(1); - } - } - - if (dns_cache && dns_children) /* run-time resolution */ - { - if (dns_children > MAXCHILD) dns_children=MAXCHILD; - /* DNS Lookup (#children): */ - if (verbose>1) printf("%s (%d): ",msg_dns_rslv,dns_children); - fflush(stdout); - (gz_log)?dns_resolver(gzlog_fp):dns_resolver(log_fp); - (gz_log)?gzrewind(gzlog_fp):(log_fname)?rewind(log_fp):exit(0); - } - - if (strstr(argv[0],"webazolver")!=0) exit(0); /* webazolver exits here */ - - if (dns_cache) - { - if (!open_cache()) { dns_cache=NULL; dns_db=NULL; } - else - { - /* Using DNS cache file */ - if (verbose>1) printf("%s %s\n",msg_dns_usec,dns_cache); - } - } -#endif /* USE_DNS */ - /* Creating output in ... */ if (verbose>1) printf("%s %s\n",msg_dir_use,out_dir?out_dir:msg_cur_dir); @@ -989,10 +934,11 @@ #ifdef USE_DNS /* Resolve IP address if needed */ - if (dns_db) - { - if (inet_addr(log_rec.hostname) != INADDR_NONE) - resolve_dns(&log_rec); + if (inet_aton(log_rec.hostname, &log_rec.addr)) { + static struct hostent *he; + + he = gethostbyaddr(&log_rec.addr, sizeof(struct in_addr), AF_INET); + if (he) strncpy(log_rec.hostname, he->h_name, MAXHOST); } #endif @@ -1341,10 +1287,6 @@ else printf("\n"); } -#ifdef USE_DNS - if (dns_db) close_cache(); -#endif - /* Whew, all done! Exit with completion status (0) */ exit(0); } @@ -1446,8 +1388,6 @@ "DumpAgents", /* Dump user agents tab file 81 */ "DumpUsers", /* Dump usernames tab file 82 */ "DumpSearchStr", /* Dump search str tab file 83 */ - "DNSCache", /* DNS Cache file name 84 */ - "DNSChildren", /* DNS Children (0=no DNS) 85 */ "DailyGraph", /* Daily Graph (0=no) 86 */ "DailyStats" /* Daily Stats (0=no) 87 */ }; @@ -1584,10 +1524,7 @@ case 81: dump_agents=(value[0]=='y')?1:0; break; /* DumpAgents? */ case 82: dump_users=(value[0]=='y')?1:0; break; /* DumpUsers? */ case 83: dump_search=(value[0]=='y')?1:0; break; /* DumpSrchStrs? */ -#ifdef USE_DNS - case 84: dns_cache=save_opt(value); break; /* DNSCache fname */ - case 85: dns_children=atoi(value); break; /* DNSChildren */ -#else +#ifndef USE_DNS case 84: /* Disable DNSCache and DNSChildren if DNS is not enabled */ case 85: printf("%s '%s' (%s)\n",msg_bad_key,keyword,fname); break; #endif /* USE_DNS */