dnsgetip: filter negative answers, remove -f flag, use dnsgetip logfile
This commit is contained in:
parent
230cee347f
commit
1985bebbdd
1 changed files with 10 additions and 15 deletions
|
@ -8,7 +8,7 @@
|
||||||
Cfg cfg;
|
Cfg cfg;
|
||||||
char *dbfile;
|
char *dbfile;
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
char *logfile = "resolve";
|
char *logfile = "dnsgetip";
|
||||||
int maxage = 60*60;
|
int maxage = 60*60;
|
||||||
char mntpt[Maxpath];
|
char mntpt[Maxpath];
|
||||||
int needrefresh = 0;
|
int needrefresh = 0;
|
||||||
|
@ -32,8 +32,8 @@ resolve(char *name, int type)
|
||||||
req.aborttime = NS2MS(nowns) + Maxreqtm;
|
req.aborttime = NS2MS(nowns) + Maxreqtm;
|
||||||
|
|
||||||
rp = dnresolve(name, Cin, type, &req, 0, 0, Recurse, 0, 0);
|
rp = dnresolve(name, Cin, type, &req, 0, 0, Recurse, 0, 0);
|
||||||
|
rrremneg(&rp);
|
||||||
while(rp != nil){
|
while(rp != nil){
|
||||||
if(rp->ip != nil)
|
|
||||||
print("%s\n", rp->ip->name);
|
print("%s\n", rp->ip->name);
|
||||||
if(!aflag)
|
if(!aflag)
|
||||||
exits(nil);
|
exits(nil);
|
||||||
|
@ -44,7 +44,7 @@ resolve(char *name, int type)
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
fprint(2, "%s: [-adx] [-f ndb-file] domain\n", argv0);
|
fprint(2, "%s: [-adx] domain\n", argv0);
|
||||||
exits("usage");
|
exits("usage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,9 +65,6 @@ main(int argc, char **argv)
|
||||||
case 'x':
|
case 'x':
|
||||||
strcpy(mntpt, "/net.alt");
|
strcpy(mntpt, "/net.alt");
|
||||||
break;
|
break;
|
||||||
case 'f':
|
|
||||||
dbfile = EARGF(usage());
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
}ARGEND
|
}ARGEND
|
||||||
|
@ -75,14 +72,13 @@ main(int argc, char **argv)
|
||||||
if(argc != 1)
|
if(argc != 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if(strcmp(ipattr(argv[0]), "ip") == 0){
|
if(strcmp(ipattr(*argv), "ip") == 0)
|
||||||
print("%s\n", argv[0]);
|
print("%s\n", *argv);
|
||||||
exits(nil);
|
else {
|
||||||
}
|
|
||||||
|
|
||||||
dninit();
|
dninit();
|
||||||
resolve(argv[0], Ta);
|
resolve(*argv, Ta);
|
||||||
resolve(argv[0], Taaaa);
|
resolve(*argv, Taaaa);
|
||||||
|
}
|
||||||
exits(nil);
|
exits(nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,4 +92,3 @@ getdnsservers(int class)
|
||||||
void syslog(int, char*, char*, ...){}
|
void syslog(int, char*, char*, ...){}
|
||||||
void logreply(int, uchar*, DNSmsg*){}
|
void logreply(int, uchar*, DNSmsg*){}
|
||||||
void logsend(int, int, uchar*, char*, char*, int){}
|
void logsend(int, int, uchar*, char*, char*, int){}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue